大网数据广告活动
服务器运维问答

Can data link layer do IP fragmentation in some special cases?

· 52CE 我爱测

I'm reading book TCP/IP Illustrated, Vol.1 and there it says that IP fragmentation is done by network layer. This is how I understood the concept so far: Network layer (L3) creates "IP datagram" (IP header + data) and sends that …

问题原文

原帖链接 · David · CC BY-SA 3.0

I'm reading book TCP/IP Illustrated, Vol.1 and there it says that IP fragmentation is done by network layer.

This is how I understood the concept so far: Network layer (L3) creates "IP datagram" (IP header + data) and sends that byte array to data link layer (L2). If L2 doesn't know about IP datagram structure, and received byte array is greater than maximal size, it wouldn't know how to split that byte array and append IP header to each chunk, as its L3's responsibility. So L2 and L3 have to cooperate somehow.

What confuses me is that few pages later, when discussing about IP header, total length and max size of IP datagram, it says: "Although it's possible to send a 65535-byte IP datagram, most link layers will fragment this".

Is my "concept" wrong? Does L2 actually know about IP datagram structure so it could fragment IP datagram? If that's true, why doesn't L2 always do the fragmentation since it knows its MTU?

已采纳解答

原帖链接 · John Mahowald · CC BY-SA 3.0

IP fragmentation is a thing, chopping up datagrams at the IP layer. Reassembly work, and possible re-transmit if one of the fragments is lost, means fragmentation is to be avoided.

The underlying layer 2 is separate and wraps each packet (fragment) in a frame. In fact that's all it can do as generally L2, and certainly not Ethernet, does not do "fragmentation".

Determining an optimum size is much less coordination and more like guesswork, and is called Path MTU Discovery. The network stack is very unlikely to try the maximum of 65535 bytes. Maybe an ICMP message will come back that the size is too big. Although the path is probably an Ethernet interface from the beginning, so trying anything over 1400 or so is probably not going to work.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-01-01)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。