IP datagram Fragmentation, assembly process, and routing table establishment process

Source: Internet
Author: User

1)3-bit flag in IP packet

Three-bit flag bit

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

DF (do not Fragment)

A DF value of 1 means that it cannot be fragmented if the packet length exceeds the MTU and cannot be fragmented then this packet is discarded and reported to the host with an ICMP error message

0 means you can shard

MF (more Fragment)

A MF value of 1 indicates that the received is not the last Shard

0 indicates that the last shard was received

2) Description of the Shard and assembly process

In the IP packet header, the fields associated with grouping and assembly are: identification (16-bit), flag (3-bit), slice offset (13-bit).

Maximum Transmission unit: The maximum length of the data field for the frame specified in each LAN.

Shard Process:

When the IP packet length is greater than the Data Link layer MTU, the IP packet must be fragmented. The IP packet first needs to determine the slice length, and then divides the original IP group 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 keeps dividing until the last piece of data is less than the MTU.

Identity bits: 16-bit, up to ID65535 the number of tags that are grouped

Each packet consists of multiple shards, the identity bit of each shard, so that the destination host, the destination host can be identified by the different groups of shards to find out.

Slice offset: The slice offset is calculated in 8 byte bit units. The slice offset allows you to sort the shards of the same grouping that were found by the identity bit, and one simply sorts them based on the slice offset and finds

A grouping.

Flag bit: Know which Shard is the last of the current grouping.

Assembly Process:

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, 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.

3) How the routing table is built

The general router only needs to record the subnet mask, destination network address, next hop router address and router forwarding port, and it is not necessary or impossible to log the full path.

The routing table is a table that records the information above.

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.


Routing table generation is mainly through routing algorithm.

The routing table is updated primarily through routing protocols. such as routing Information Protocol RIP, open Shortest Path-first OSPF protocol. Protocols are algorithm-based. RIP is based on the vector-distance (v-d) route selection algorithm.

v-d Algorithm Design idea:

The router periodically notifies neighboring routers: the network to which it can reach itself, and the distance (hop count) to reach the network.

After receiving the router's (V,D) message, the other routers refresh their routing table according to the shortest path principle.

Note: At the beginning of the router routing table there is no information, to be initialized, the initialized routing table contains all the routes that are directly connected to the route. Then there is the constant update.



This article is from the "City Hunter" blog, please be sure to keep this source http://alick.blog.51cto.com/10786574/1833860

IP datagram Fragmentation, assembly process, and routing table establishment process

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.