Deep understanding of Linux Network Technology insider--ipv4 concept

Source: Internet
Author: User

1. Big Blueprint

The big blueprint shows the interaction between the IPV4 protocol and other subsystems, Paul's device drivers, NetFilter, L4 layer protocols, and so on. Messages in the IPV4 protocolWe can roughly see the flow of data in the IPV4 protocol, Receiving MessagesAfter the device driver finishes processing the data introduced by the hardware, the IP_RCV function (NET_RECEIVE_SKB call) of the IPV4 protocol obtains the message belonging to the IPV4, then calls Ip_rcv_finish to analyze the message. Determine whether to forward or deliver the local upper layer protocol.If it is a local message, it is passed to ip_local_deliver processing, and if it is forwarded, it is delivered to Ip_forward for forwarding processing. Send a delivery paperMessages received belonging to the forwarded message (from the Ip_forward_finish) and the L4 layer need to be analyzed and transmitted to the device driver and sent to other systems. The process is mainly carried out through ip_finish_ouput. Finally, call Hard_start_xmit to the NIC device driver.
Tasks of the IPV4 protocol Health Check:Slightly Firewall:The netfilter is called several times during the lifetime of the message in order to process the message. Processing options:Some of the options set by the application. segment/reorganization:The Len option of the IP header can express the length of the 64k data segment, but the actual network cannot transmit that large data, the network transmission generally has an MTU, when the datagram data to be transmitted beyond the MTU, it must be segmented, reorganized. receive, transmit, and forward:Slightly
IP header
Service Type:(Type of Service:tos) serves QoS and is now used for differentiated services for differential treatment of messages. Logo:Important Field DF: Non-segmented MF: segment Segment Offset:For staging/reassembly Survival Time:The message will be abandoned after a few seconds. protocol:L4 Layer Protocol Flag Options:It provides an extension to the application of whether the IP message is segmented, how to transmit, and how to choose the route.
Fragmentation and reassemblyAs mentioned earlier, the Len field of the IP header can express the length of the packet in the 64k data segment, but the actual network cannot transmit such large data, and the MTU, when the message length exceeds the MTU, is divided into several packet lengths of the MTU (the last segment may be small), and then the transmission is carried out separately.IP segmentation is usually reorganized on the destination host (intermediate devices need to be reorganized if the entire IP packet needs to be viewed).Fragmentation and reassembly work consumes CPU and memory, and may consume excess network bandwidth, resulting in large overhead. Sometimes we need to avoid fragmentation and reassembly.In theory, upper-level protocols do not know when the IP layer is segmented and reorganized, but the application can transmit data by using a smaller size than the MTU it can use to avoid packet fragmentation. (It can be seen that fragmentation is handled at the application layer, but in fact it does improve response time).
Discovery of Path MTURelated to User configuration, egress device, default value 576, ICMP detection, and so on. Inspection andVerify that the message is wrong, or even fix the error.

























Deep understanding of Linux Network Technology insider--ipv4 concept

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.