IP datagram format, routing table

Source: Internet
Author: User

IP datagram Format

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/85/50/wKiom1ef-3_z6H_0AAD2l4O4lTE605.png "title=" 1.PNG " alt= "Wkiom1ef-3_z6h_0aad2l4o4lte605.png"/>


MTU Maximum Transmission unit: The maximum length of the payload in the data frame, excluding the length of the header, if it is greater than the MTU, the Shard is required, and the Shard is done by the IP layer. The assembly is also done by the IP layer itself.


In the IP packet header, the fields associated with the group leader are: 16-bit ID, 3-bit flag, 13-bit offset

16-bit ID:

The grouping may reach the destination host through a different transmission path. Different slices that belong to the same group appear in a disorderly order, or are blended with other groupings. If all slices belonging to a group are assigned an identity value ID, the destination host can pick up the slices belonging to the same group according to the identity values and reassemble them. The identity ID is a token of the slice recognition.

3-bit flag:

Flags are divided into three fields: 0 DF MF

The highest bit is 0, and the value must be copied into all groupings.

DF: The non-Shard value must be duplicated. Df=1, indicates that the receiving host cannot group shards, and if the packet length exceeds the MTU and cannot be fragmented, it is discarded. Df=0, which means you can Shard

MF: The Shard value indicates whether the Shard is the last shard. Mf=1 indicates that the received Shard is not the last Shard, Mf=0, which indicates that the last shard was received

13-bit Displacement:

The Slice offset field value represents the relative position of the Shard in the entire grouping.


Basic methods of sharding:

When the IP packet length is greater than the Data Link layer MTU, the IP packet must be fragmented. IP packet shards first need to determine the slice length, and then divide the original IP grouping including the packet header into the first slice. If the remaining data still exceeds the slice length, a second shard is required, and the second Shard data, together with the original packet header, forms the second slice. This is divided until the remaining data is less than the Data Link layer MTU value.


Basic methods of assembly:

The grouping may reach the destination host through a different transmission path. When different slices belonging to the same group arrive, they appear in a disorderly order, or are blended with other groupings. First of all, according to the identification field will belong to the same group of all the slices out, the host allocates a storage buffer when the first shard arrives, when the datagram after the next Shard arrives, the data according to the slice displacement is copied to the buffer memory at the specified location, when all the shards arrive, the original datagram is restored.


Routing table:

The routing table consists of a number of routing entries, each of which indicates which interface the packets to a network should be sent through, and the last is the default route entry.

the routing table specifies only the next step from the router to the destination path, without knowing the full path to the destination .

Route entry:

A row in the routing table, each entry is mainly composed of the network address of the route, the subnet mask, the next hop address, and the sending interface 4 parts, if the destination network address of the packet to be sent matches a row in the routing table, it is sent to the next hop address according to the specified interface.

Default route entry:

The last row in the routing table consists mainly of the next hop address and the Send interface, and when the destination address does not match the other rows in the routing table, the interface specified by the default route entry is sent to the next hop address.


The goal of the routing algorithm is to generate the routing table and find the appropriate next hop route for the router forwarding IP packet.

The goal of Design routing protocol is to implement dynamic update of routing table information.


A widely adopted routing protocol:

Routing Information Protocol rip: using vector-distance algorithm

Basic idea:

The router broadcasts its own known routing information periodically to its neighboring routers, notifying the network to which the neighboring router is reachable and the distance to the network. Neighboring routers can modify and refresh their routing tables based on the routing information received.

This article from "Together to see the Stars" blog, reproduced please contact the author!

IP datagram format, routing table

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.