Xiaobai's learning journey

Computer basics

IP address planning
is now commonly used IPV4, the public network has been exhausted. There are 277 million public Internet addresses in China. IPV6 is still in the laboratory stage and has not yet landed.
Larger IP address plans are divided into business addresses, physical addresses, and management addresses.

  1. Business address It is
    necessary to know how many wireless (WiFi) and wired (network card) equipment terminals are connected. There are two types of addresses for internal and guest use.
    Requires server access, which is divided into network management equipment, business system network segment and monitoring system network segment.
    Structure:
    Intranet network with server and terminal.
    The external network has fewer servers and more terminals. There are wireless and wired terminals, as well as internal and visitor types.
    To monitor the network, the server side has a database, application side, and streaming media; the terminal is divided into cameras, punch card alarms and the like.
    Network management network, authentication server has portal, dotlx; network management system has proxy server, WSUS, bastion host, ad domain control.

  2. Physical address
    back-to-back, VRRP HA HSRP, network equipment distributed in various regions

  3. Management address
    There are equipment remote, router protocol router-id, network management to equipment.

The overall regional structure has various outlets in various places.

Smaller IP address planning such as schools
can be divided into dormitory area, office area, and teaching area, all including user IP, device management IP, and device interconnection IP. Then the core equipment has equipment management IP and equipment interconnection IP.

TCP/IP protocol
Insert picture description here

IP or ICMP (Internet Control Message Protocol, Internet Control Message Protocol), TCP or UDP, TELNET or FTP, and HTTP are all TCP/IP protocols, also known as the Internet Protocol Family.
The Internet protocol is TCP/IP, and TCP/IP is the Internet protocol.
TCP/IP is the current mainstream Internet protocol, and a hierarchical, multi-protocol communication system.
The IP address is the physical address of the machine. The
protocol is divided into application layer (user space), transport layer, network layer (kernel space), and data link layer.

Data link layer
The network driver of the network card interface, which handles the transmission of data on the physical transmission medium.
There are ARP protocol (Address Resolve Protocol, address resolution protocol), RARP protocol (Reverse Address Resolve Protocol, reverse address resolution protocol)
network layer through IP Address link host, first broadcast the IP address from ARP, the data link layer connects the host through the physical address
WAN (Wide Area Network, wide area network) through the router to connect the host.
IP protocol (Internet Protocol): Determine how to deliver information according to the destination IP address of the data packet, and use the hop by hop method to determine the communication path.

ICMP protocol :
detect network connection. Distinguish message types: message errors, respond to network errors; query messages, query network information. The message performs a redundancy check (CRC) to check whether the message is damaged during transmission.

The transport layer
provides end-to-end communication for applications on two hosts.
TCP protocol (Transmission Control Protocol): Provides reliable, connection-oriented, stream-based services for the application layer.
UDP protocol (User Control Transmission Protocol, User Datagram Protocol): Provides unreliable, connectionless, datagram-based services for the application layer. Although the size of the sent message can be guaranteed, there is no guarantee that the message will arrive.
SCTP protocol (Stream Control Transmission Protocol, Stream Control Transmission Protocol): a service designed to transmit telephone signals on the Internet.

Application layer
The protocol used for communication between the browser and the server is HTTP (HuperText Transfer Protocol). The main format of the transmitted data is HTML (HyperText Markup Language). HTTP in the WWW (World Wide Web) belongs to the OSI application layer protocol, and HTTP belongs to the presentation layer protocol.

Application layer protocol
Ping application program, using ICMP message to detect network connection.
Telnet remote login protocol to complete remote tasks locally.
OSPF (Open Shortest Path Fist, open shortest path first) dynamic routing update protocol, used for communication between routers.
DNS (Domain Name Service, domain name service) protocol provides the conversion function from machine domain name to IP address.
Package.
Each layer of the protocol adds its own header information (tail information) on the basis of the upper layer data. The realization of this layer function
is a distributed domain name service system. Each DNS server has a large number of mappings between machine domain names and IP addresses and is dynamically updated.
Domain name service, convert machine domain name to Chen IP address.

Insert picture description here

The TCP protocol
maintains a connection for both communicating parties and stores related data in the kernel. The TCP header information in this part of the data and the TCP kernel buffered data form a TCP message segment.
Frame : Data encapsulated by the data link layer.
Demultiplexing: After the frame reaches the destination host, the layer is responsible for processing the header data in the frame from the bottom to the top, obtaining the required information, and finally handing the processed frame to the target application.

ARP protocol
realizes the conversion from any network layer address to any physical layer address.
The host broadcasts an ARP request to the network where it is located. The request contains the network address of the target machine. This network is received by other machines, but only the requested target machine will respond to an ARP request, which contains its own physical address.

IP Services The
IP protocol is the driving force of the TCP/IP protocol suite, which provides stateless, connectionless, and unreliable services for the upper-layer protocols.
Stateless (stateless): Can not handle out-of-order, repeated IP datagrams, but simple and efficient.
Connectionless: Both parties of IP communication do not maintain any information about each other for a long time, and each time they send data, they must specify the other party's IP address.
Unreliable: There is no guarantee that the IP datagram arrives at the receiving end accurately, just as far as possible.
The upper layer protocol of the IP service needs to implement mechanisms such as data confirmation and timeout retransmission to achieve reliable transmission.

IP header structure
IP header information appears in each IP datagram and is used to specify the source IP address and destination IP address of IP communication, guide IP fragmentation and reorganization, and specify some communication behaviors.

IPv4 header structure

Insert picture description here

IPv6 header structure

Insert picture description here

IPv6 makes every grain of sand on the earth have an IP address.

IP Fragmentation
When the length of an IP datagram exceeds the MTU of the frame, it will be fragmented for transmission and reassembled on the final target machine.

Insert picture description here

IP routing
determines the way to send datagrams to the target machine.

IP module workflow

Insert picture description here

Routing mechanism
Find the host IP address that exactly matches the destination IP address of the datagram in the routing table. If found, use the routing item, if not, go to 2.
Look up the network IP address in the routing table that has the same network ID as the destination IP address of the datagram. If found, use the routing item, if not, go to 3.
Choosing the default routing item usually means that the next hop of the datagram is the gateway.

IP forwarding
The IP data not sent to this machine is forwarded by the datagram forwarding sub-module.
For a file system (host/router) that allows IP datagram forwarding, the datagram forwarding sub-module will perform the following operations on the datagram that it expects to forward:

  1. Check the TTL value in the header of the datagram. If the TTL is 0, the datagram is discarded.
  2. Look at the strict source router selection options in the datagram header. If this option is set, check whether the destination IP address of the datagram is a certain IP address of the machine. If not, it returns an ICMP source station routing failure message.
  3. Send an ICMP reset message to the source to tell it a more appropriate next-hop router.
  4. Decrease the TTL value by 1.
  5. Process IP header options.
  6. Perform IP fragmentation operations

Common status codes on web pages
begin with 1 -information prompt
These status codes indicate temporary responses. The client should be prepared to receive one or more 1xx responses before receiving regular responses.
100-Continue The initial request has been accepted and the customer should continue to send the rest of the request. (HTTP 1.1 new)
101-Switching Protocols server will comply with the client's request to switch to another protocol (HTTP 1.1 new)

The status code starting with 2 (request successful) indicates that the request was successfully processed.
200 (Success) The server has successfully processed the request. Usually, this means that the server provided the requested page.
201 (Created) The request was successful and the server created a new resource.
202 (Accepted) The server has accepted the request, but has not yet processed it.
203 (Non-authorized information) The server has successfully processed the request, but the returned information may come from another source.
204 (No content) The server successfully processed the request, but did not return any content.
205 (Reset content) The server successfully processed the request, but did not return any content.
206 (Partial content) The server successfully processed part of the GET request.

The beginning of 3 (the request is redirected) indicates that further operations are required to complete the request. Usually, these status codes are used for redirection.
300 (multiple choices) In response to requests, the server can perform multiple operations. The server can select an operation based on the requester (user agent), or provide a list of operations for the requester to choose.
301 (Moved Permanently) The requested page has been permanently moved to a new location. When the server returns this response (response to a GET or HEAD request), it will automatically redirect the requester to the new location.
302 (Temporary move) The server currently responds to requests from web pages in different locations, but the requester should continue to use the original location for future requests.
303 (View other locations) When the requester should use separate GET requests for different locations to retrieve the response, the server returns this code.
304 (Unmodified) The requested webpage has not been modified since the last request. When the server returns this response, the content of the web page will not be returned.
305 (Use proxy) The requester can only use the proxy to access the requested web page. If the server returns this response, it also indicates that the requester should use a proxy.
307 (Temporary redirect) The server currently responds to requests from web pages in different locations, but the requester should continue to use the original location for future requests.

At the beginning of 4 (request error), these status codes indicate that the request may be wrong, which prevents the server from processing.
400 (Bad request) The server does not understand the syntax of the request.
401 (Unauthorized) The request requires authentication. For web pages that require login, the server may return this response.
403 (Forbidden) The server rejected the request.
404 (Not Found) The server could not find the requested page.
405 (Method disabled) The method specified in the request is disabled.
406 (Not Accepted) Unable to respond to the requested page with the requested content characteristics.
407 (Proxy authorization required) This status code is similar to 401 (Unauthorized), but specifies that the requester should be authorized to use the proxy.
408 (Request timeout) The server timed out while waiting for the request.
409 (Conflict) The server encountered a conflict while fulfilling the request. The server must include information about the conflict in the response.
410 (Deleted) If the requested resource has been permanently deleted, the server will return this response.
411 (Valid length required) The server does not accept requests without a valid content length header field.
412 (Precondition not met) The server did not meet one of the preconditions set by the requester in the request.
413 (The request entity is too large) The server cannot process the request because the request entity is too large and exceeds the server's processing capacity.
414 (The requested URI is too long) The requested URI (usually a URL) is too long for the server to process.
415 (Unsupported media type) The requested format is not supported by the requested page.
416 (The requested range does not meet the requirements) If the page cannot provide the requested range, the server will return this status code.
417 (Expected value not met) The server did not meet the requirements of the "expected" request header field.

The status codes beginning with 5 (server error) indicate that an internal error occurred when the server was trying to process the request. These errors may be errors in the server itself, rather than request errors.
500 (Internal server error) The server encountered an error and could not complete the request.
501 (Not yet implemented) The server does not have the function to complete the request. For example, the server may return this code when the request method is not recognized.
502 (Bad gateway) The server was acting as a gateway or proxy and received an invalid response from the upstream server.
503 (Service unavailable) The server is currently unavailable (due to overload or maintenance shutdown). Usually, this is only a temporary state.
504 (Gateway timeout) The server is acting as a gateway or proxy, but did not receive a request from the upstream server in time.
505 (HTTP version is not supported) The server does not support the HTTP protocol version used in the request.

The two basic request methods of Get/Post,
GET and POST, are essentially TCP links, and there is no difference. However, due to HTTP regulations and browser/server restrictions, they show some differences in the application process.
GET generates one TCP data packet; POST generates two TCP data packets (not all browsers will send the packet twice in POST, but Firefox will only send it once). The difference between the time of sending one package and the time of sending two packages can basically be ignored. However, in the case of poor network environment, two-packet TCP has a great advantage in verifying the integrity of the data packet.
For a GET request, the browser will send the http header and data together, and the server will respond with 200 (return data);
for POST, the browser will first send the header, the server will respond with 100 continue, the browser will then send data, and the server will respond. 200 ok (return data).
In the World Wide Web, TCP is used to transport data, and HTTP has set several service categories, including GET, POST, PUT, DELETE, etc. HTTP stipulates that when a GET request is executed, a GET label will be affixed (set method to GET), and the transmitted data is required to be placed in the url to facilitate recording. If it is a POST request, it must be labeled POST. HTTP is just a code of conduct, and TCP is the basis of how GET and POST are implemented.
GET is harmless when the browser rolls back, while POST will submit the request again.
The URL address generated by GET can be Bookmarked, but not POST.
GET requests will be actively cached by the browser, while POST will not, unless manually set.
GET requests can only be url-encoded, while POST supports multiple encoding methods.
GET request parameters will be completely retained in the browser history, while POST parameters will not be retained.
The parameters sent in the URL for GET requests are limited in length, but not for POST.
For the data type of the parameter, GET only accepts ASCII characters, while POST has no restrictions.
GET is less secure than POST, because the parameters are directly exposed on the URL, so it cannot be used to transmit sensitive information.
GET parameters are passed through the URL, and POST is placed in the Request body.

HTML basic syntax
HTML (Hypertext Markup Language, Hypertext Markup Language). Documents written in HTML are called web pages, and HTML is the basic language of web design. The latest version is HTML5, and the most widely used is HTML4.1.
HTML is the main language of web documents. HTML tags can identify web objects such as text, graphics, animation, sound, tables, and hyperlinks.

Basic structure of
HTML documents HTML documents generally contain header=header area and body area, consisting of three tags, each tag exists in pairs.
Insert picture description here

Static webpage: The file extension is generally .html or .htm, which can be browsed directly in the browser.
Dynamic webpage: The file extension is .asp, .aspx, .php or .jsp, etc., and the browser can browse it after the server resolves it.
Elements :
We call the matched tag pairs and the content enclosed by them as elements. That is (element = start tag + content + end tag), such as: <a href="http://hanzhaoxin.cnblogs.com/">My Blog</a>.
Attributes :
those content in the form of name/value pairs in the opening tag, we call them attributes. As in the above example: href="http://hanzhaoxin.cnblogs.com/".
(Href is the attribute name, "http://hanzhaoxin.cnblogs.com/" is the attribute value).

Guess you like

Origin blog.csdn.net/Goodric/article/details/109527196