Search code examples
httpnetworkingethernetmss

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.

How HTTP message could be encapsulated into the Ethernet Frame if the Ethernet Frame is just 1500 Bytes max?[enter image description here][1]

Illustration of the question: [1]: https://i.sstatic.net/IOf92.jpg


Solution

  • HTTP is an application layer protocol. 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.

    With IP (v4), you have fragmentation with the fragment offset and the more fragments flag in the IP header. Each fragment but the last is sent with the more fragments flag, and the fragment offset is their order.