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.

masonCherry
  • 113
  • 4
  • Does this answer your question? [Why do transport layer do data chunking. If there is fragmentation in Network Layer](https://networkengineering.stackexchange.com/questions/60653/why-do-transport-layer-do-data-chunking-if-there-is-fragmentation-in-network-la) – Zac67 May 10 '21 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 '21 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 '21 at 15:47
  • Also, there are no layers 5 and 6 in the real world. – Ron Maupin May 10 '21 at 15:48
  • 1
    [This](https://networkengineering.stackexchange.com/questions/6380/osi-model-and-networking-protocols-relationship) should also be a good read for you. – Zac67 May 10 '21 at 15:49
  • @Zac67 by "mixing up various things" do you mean me referring to TCP data as packets instead of segments or is there something else you're talking about because your explanation seems like what I already understand. thanks for linking more information. – masonCherry May 10 '21 at 16:40
  • There really are no OSI layers because OSes have not implemented the OSI model. – Ron Maupin May 10 '21 at 16:55
  • My question is really about OSI layers it is about how after receiving a number of TCP packets a machine knows that it has all the intended packets for all the intended data. but I think I get it. that is abstracted to the layer above it. all that each layer knows is that its sent it data. – masonCherry May 10 '21 at 17:25
  • @RonMaupin Even if you don't stick to the OSI model you need to define the same functionality. The Internet protocol suite is very similar with only slight differences other than bunching several OSI layers together. – Zac67 May 10 '21 at 20:06
  • Did any answer help you? if so, you should accept the answer so that the question does not keep popping up forever, looking for an answer. Alternatively, you could post and accept your own answer. – Ron Maupin Dec 23 '21 at 19:32

2 Answers2

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).

Ron Maupin
  • 98,218
  • 26
  • 115
  • 191
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.

Ron Trunk
  • 66,852
  • 5
  • 65
  • 126