1

Looking on my network, I can tell...

...the start of a packet, by seeing what responds to a certain packet of mine, because the messages acknowledgement number matches the sequence number of that initiating packet.

...the end of a packet, by seeing what packet includes the PSH bit.

I know TCP is considered a protocol that sends continuous streams of data, and it is the application protocol's task to figure out where the data starts and ends.

However I don't quite understand, why it not might also be done on the transport layer, it seems to, all the necessary information is right there.

0

1 Answer 1

2

I know TCP is considered a protocol that sends continuous streams of data, and it is the application protocol's task to figure out where the data starts and ends.

However I don't quite understand, why it not might also be done on the transport layer, it seems to, all the necessary information is right there.

Simply because the TCP (the transport layer) doesn't indicate where data used by the application starts/stops itself. It only keeps track of the transport layer session and the payload the segment(s) contains. Just because you know where a segment starts and how big a segment is, doesn't mean that matches the size of the data being transferred.

The transport layer payload can contain part, all or multiple pieces of data needed by the application. Stated another way, the data used by the application may fit neatly into the payload of a single TCP segment, may be larger than the limits of the TCP segment and need multiple segments to deliver, or may be small enough that multiple pieces of data can be contained in one TCP segment.

Further, a TCP session can be used to transfer one "piece of data", multiple pieces of data or even be used bidirectionally/interactively. Or one "piece of data" from an application can be sent over multiple different TCP sessions.

If the transport layer were to indicate when data starts/ends, it would need to know how to figure out where data starts and ends for every possibly type of data it could be used to transport. This simply isn't necessary or even practical. It just needs to transport data to the other side and hand it off to the correct application.

Your Answer

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

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