数据报分片的偏移量问题
基本概念
- 不是所有的链路层协议都能承载相同长度的网络层分组,这时候我们需要将IP数据报中的数据分片成更小的IP数据报,每个单独最小的数据报都称为 fragment
- 一个链路层frame能承载的最大数据量叫做 Maximum Transmission Unit (MTU).
offset的计算
- 一个x字节的数据报包括:20字节的IP首部和(x-20)字节的有效载荷,假设该数据报到达一个router,并被转发到一个MTU为y字节的链路上当x-20 > y时,意味着需要分片
- offset用来记录每个分片所在的位置,offset = 相对分片报文长度 / 8;
eg.An IP datagram of 2312 bytes arrives at a router and must be forwarded to a link with an MTU of 1500 bytes. Thus, the router has to fragment the datagram. To the last fragment, the value of offset should be?
- 4310 bytes inc