1

I understand the general sense of the ISO model but it's my understanding that the Data from the Application layer which is usually large would get split into many TCP packets. The same thing would happen on the Data Link Layer which would split the IP packets from Layer 3 into Frames. Look at this image.

My question is how do the Layer 3 Network and Layer 5 Data (TCP/IP) know when they have all the data from the lower layer.

If that's not clear what I mean is if I have an HTTP request; that would get split up into many TCP (layer 4) packets. somewhere some computer will receive these TCP packets but how do I know if these are enough packets for me to view the entire HTTP request. does Layer 4 just append packets continuously and it's up to Layer 5 to look at the data it has and determine if that is a complete HTTP request. does the HTTP request have information inside it that says that this is the end of the HTTP request.

This also applies the Layer 3. since the IP packets are split into frames; does the Network layer (3) have a way to determine after receiving some ethernet frames that it has a full TCP packet.

I'm trying to understand whether the layer 3's (lower layer) frames themselves have a way of saying this is the end of a full IP packet or if the ethernet frames just keep appending and It's up to Layer 3 (higher layer) to say that this is a complete IP packet, same for layer 4 & 5.

10
  • Does this answer your question? Why do transport layer do data chunking. If there is fragmentation in Network Layer
    – Zac67
    May 10, 2021 at 15:42
  • You're mixing up various things. TCP uses segments to chunk data. Too large IP packets are fragmented into smaller IP packets (which are then encapsulated in L2 frames). TCP is OSI layer 4, transport layer. TCP uses sequence numbers to recreate the original data stream. HTTP has no knowledge of segmentation, it just uses TCP. Likewise, IP doesn't care about segmentation, it just hauls packets (and possibly fragments and reassembles oversized ones). Frames are in the data link layer (OSI L2).
    – Zac67
    May 10, 2021 at 15:47
  • The network layer does not know or care about frames, and the application layer does not know or care about segments. The data-link layer uses frames, and the transport layer (TCP) uses segments.
    – Ron Maupin
    May 10, 2021 at 15:47
  • Also, there are no layers 5 and 6 in the real world.
    – Ron Maupin
    May 10, 2021 at 15:48
  • 1
    This should also be a good read for you.
    – Zac67
    May 10, 2021 at 15:49

2 Answers 2

2

In the real world, each data-link protocol has its own method to determine if it has received a full frame. For example, ethernet has the inter-packet gap and the FCS. If a frame fails the FCS (damaged frame, too small, too large, etc.), it drops the frame. If everything passes, it sends the frame payload to the process indicated by the Ether Type field, e.g. IPv4.

IP, both IPv4 and IPv6, have a length field in the IP header. IPv4 has a Total Length field from which the payload length can be derived, and IPv6 has a Payload Length field. IP will pass the packet payload to the process (UDP, TCP, etc.) indicated by the Protocol field (IPv4) or Next Header field (IPv6).

Some transport protocols use port numbers for the process that is to receive the payload of the datagram. Both TCP and UDP have a Length field in their headers from which the payload length can be derived. Both will send the payload to the process registered for the port number in the header.

UDP, being a messaged-based protocol simply sends the payload upon receipt. TCP is a streaming protocol, and it will normally buffer data and send it to the application when it gets a full buffer, or if it gets a flag to send right away. What it really does is OS implementation-specific (off-topic here).

1

One of the characteristics of layers (in any model) is abstraction. Layering abstracts the information as data "moves" up the layers.

In your case of HTTP, the layers abstract all the networking, fragmentation, validation, etc. into a data stream. To your application, all it knows is it's getting a stream of data. How that data arrives is abstracted (hidden) from the browser.

It's up to the application (your browser) to make sense of it and decide that it has received a valid HTTP message.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.