Knowledge about various network protocols

Source: Internet
Author: User

Network Protocol review
The levels of different protocols are as follows:

IP
The IP address is a category addressing address at the beginning, and is changed to a category-free addressing address by 1990s. There are a total of five abcde ip addresses for category addressing. For ABC-type addresses, IP addresses can be divided into network IDs and Host IDS. To extract a network address from an IP address, use the network mask and IP address for calculation. The IP address is originally two-level addressing, but this will cause a huge waste of addresses and is not conducive to management. In subnet division, a network is divided into several smaller subnetworks, each of which has its own subnet mask.
Each network has two special addresses: the host ID 0 indicates the network address and does not point to a host; The host ID 1 indicates the direct broadcast address, all Hosts accept this type of Destination Address group.

IP is an unreliable connectionless datagram protocol, which may be lost in four scenarios: 1) Verification Failed; 2) TTL timeout; 3) the router cannot be split; 4) packet Loss Caused by overflow of the router buffer during the process.
The fields related to the shard are: ID, flag, and shard offset. The part offset indicates the relative position of the part in the entire datagram. This is the offset of the data in the original datagram, measured in 8 bytes.
The Checksum in the IP Group only overwrites the header, regardless of the data. The Checksum is calculated to divide the group header into n-bit segments (n is usually 16 ). Add the reverse codes of these segments, and the length of the obtained sum is also n bits. Then, get the sum and the inverse code to get the checksum. During receiving end parsing, you only need to add the first anti-code and then obtain the anti-code to determine whether it is 0.
ARP
An IP group can find the IP address of the next hop by consulting the route table. However, since the IP address uses the data link layer service, it needs to know the physical address of the next hop. This can be done through ARP.
The IP address is a logical address, and the MAC address is a physical address. ARP maps logical addresses to physical addresses, and RARP maps physical addresses to logical addresses.
At any time, when the host or router needs to find the physical address of another host or router on the network, it can send an ARP query group. This group includes the physical address and IP address of the sender and the IP address of the receiver. Because the sender does not know the physical address of the receiver, the query group is broadcast on the network. Each host or router on the network accepts and processes the ARP query group. However, only the expected receiver can recognize the IP address and return an ARP response group. This response group contains the IP address and physical address of the receiver. This group uses the physical address in the received query group to send it directly to the queryer in Unicast mode.
ICMP
The IP protocol has no error reporting or error correction mechanism. The IP protocol also lacks the mechanisms required for host management and query. ICMP is designed to make up for the preceding defects.

ICMP itself is a network layer protocol. However, its packets are not directly transmitted to the data link layer. In fact, ICMP packets must be encapsulated into IP datagram before being transmitted to the next layer.
ICMP packets are classified into two types: Error Report messages and Query Packets. ICMP uses the source IP address to send the error message to the source point of the datagram.
Unicast routing protocol
Today, the Internet is so large that only one routing protocol can be used to update the route tables of all routers. Therefore, the Internet must be divided into multiple Autonomous Systems. An autonomous system is a group of networks and routers under the jurisdiction of a management organization. Intra-Domain Routing is called intra-domain routing. The routing between AS is called the Inter-Domain Routing. You can select one or more routing protocols in AS, but only one Inter-Domain Routing Protocol can be used between.
There are two routing protocols in the domain: distance vector and link status. There is a routing protocol between domains: path vector. The routing information protocol (RIP) is the implementation of the distance vector protocol. The Open Shortest Path (OSPF) protocol is used to implement the link status. Border Gateway Protocol (BGP) is the implementation of the path vector protocol.
Transport Layer
The first task of the transport layer protocol is to provide process-to-process communication.
The Transport Layer needs to implement traffic control at two levels: from the transport layer of the sender to the application layer of the sender and from the transport layer of the receiver to the transport layer of the sender. It can be seen that the traffic control communication can be achieved by sending signals from the consumer to the producer. When the transport layer cache is full, it notifies the application layer to stop transmitting the message block. When it has another empty location, it notifies the application layer to continue to transmit the message block. When the transport layer of the receiver is full, it notifies the transport layer of the sender to stop sending the group. When the receiver is empty, it notifies the transport layer of the sender to continue sending the group.
Error Control should solve the following problems: 1) Detect and discard corrupt groups; 2) identify duplicate groups and discard them; 3) track lost and discarded groups and re-Send them; 4) Save the unordered groups until all the missing groups arrive.
TCP

Serial number: defines the number assigned to the First Data byte in this section.
HLEN (header length): This 4-bit segment specifies the total number of 4 bytes in the TCP header.
Window Size: the size of the receiving window allowed by the sender, indicating how much data the sender can receive now.
Checksum: Same as UDP, But UDP checksum is optional, and TCP is mandatory. The verification part includes the pseudo header, TCP header, and application layer data.
TCP establish a connection using three-step handshake: the customer first sends a SYN packet segment, then the server replies a SYN + ACK packet segment, and finally the client sends an ACK packet segment. The SYN packet segment does not carry any data, but it consumes a serial number, that is, when sending data, the serial number should be 1.
TCP also uses a three-step handshake to terminate the connection. After receiving the closing command from the client process, the client sends a FIN packet, and then the server sends a FIN + ACK packet segment, the client sends an ACK packet segment over TCP. The FIN message segment does not carry data, but consumes a sequence number.
DHCP
After a host is started, DHCP is the first client/server application to run. That is, when a host is started, if it thinks that it should connect to the Internet but does not know its IP address, DHCP will play a role as a boot program.
The current computer needs four types of information to connect to the network: 1) the IP address of the computer; 2) the subnet mask of the computer; 3) the IP address of a router; 4) the IP address of the DNS server.
Before DHCP, RARP was also used to map a physical address to an IP address. But now it has been eliminated for two reasons: 1) RARP uses the broadcast service at the data link layer, which means that each network must have an RARP server; 2) RARP can only provide IP addresses of computers, but today's computers need the above four types of information.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.