简体   繁体   English

如果以太网帧最大只有 1500 字节,如何将 HTTP 消息封装到以太网帧中?

[英]How HTTP message could be encapsulated into the Ethernet Frame, if the Ethernet Frame is just 1500 Bytes max?

Ethernet Frame is 1500 bytes max HTTP Message can be way bigger than that.以太网帧最大为 1500 字节 HTTP 消息可能比这大得多。

How HTTP message could be encapsulated into the Ethernet Frame if the Ethernet Frame is just 1500 Bytes max?[enter image description here][1]如果以太网帧最大仅为 1500 字节,如何将 HTTP 消息封装到以太网帧中?[在此处输入图像描述][1]

Illustration of the question: [1]: https://i.stack.imgur.com/IOf92.jpg问题说明:[1]: https://i.stack.imgur.com/IOf92.jpg

HTTP is an application layer protocol. HTTP是一个应用层协议。 In the layers under it segmentation/fragmentation can occur.在它下面的层中,可能会发生分割/碎片化。 The basic idea is that if the layer below can't handle the packet size it should be split to smaller packets, with some way to reassemble the packets together in the correct order.基本思想是,如果下面的层无法处理数据包大小,则应将其拆分为较小的数据包,并通过某种方式以正确的顺序将数据包重新组合在一起。

With TCP (which http uses), if you try to send a really long message it will be split into segments, and the reassembly is done with according to a sequence number that marks how far in the data stream the content of the segment belongs.使用 TCP(http 使用),如果您尝试发送非常长的消息,它将被分成多个段,并且根据标记数据 ZF7B44CFAFD5C52223D5498E196 的内容在数据 ZF7B44CFAFD5C52223D5498E196 中属于多远的序列号完成重组。

With IP (v4), you have fragmentation with the fragment offset and the more fragments flag in the IP header.使用 IP (v4),您可以在 IP header 中使用片段偏移量和更多片段标志进行分片。 Each fragment but the last is sent with the more fragments flag, and the fragment offset is their order.除了最后一个片段之外的每个片段都带有更多片段标志,片段偏移量是它们的顺序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM