0

TCP is connection-oriented protocol whereas IP isn't connection-oriented protocol. Any packets before sending into transport layer sorted operation must have been done in network layer. That's why we get in-order packets in transport layer by TCP. Whenever in TCP flow control is some packets could be loss and there is a chance of out of order delivery. But always we get the in-order acknowledgement. My question is that packets lost is the only reason of connectionless of TCP? I'm struggling to understand this concept.

2
  • if would be appreciated if you could proof read your question. you have sentences like transport layer and transport layer and they do not make sense.
    – Effie
    Sep 8 at 11:19
  • It's hard to understand your question. But basically TCP provides a guarantee that the data get delivered in order to the application. It is impossible to provide this guarantee if packets are permanently lost. It though possible that packets arrive in different order or duplicates since TCP can resolve these problems by eliminating duplicates and by reordering. Sep 8 at 11:29
2

I still do not understand the question fully and thus point out where misconception comes from. But, does this clarify things?

enter image description here

Note, that TCP is stream based, i.e., on the sender side (left) upper layer passes the stream of bytes which TCP divides into packets. on the receiver TCP reassembles the stream from packets and passes bytes to the upper layer.

I will try to consider the question one line at a time.:

TCP is connection-oriented protocol whereas IP isn't connection-oriented protocol.

connection oriented and reliable

Any packets before sending into transport layer sorted operation must have been done in network layer.

no, sorted operation is done in transport layer, by TCP.

That's why we get in order packets in transport layer by TCP.

again, packets do not get in order when entering transport layer, transport layer puts them in order. they get in order when leaving transport layer and entering upper layer.

Whenever in TCP flow control

flow control or congestion control?

is some packets could be loss and there is a chance of out order delivery. But always we get the in order acknowledgement.

TCP always acknowledge the last packet received in order. If a packet is received out of order, TCP sends an acknowledgement where acknowledgement number is the number corresponds to the last in-order received packet.

In other words this does not refer to what happens, that refers to what TCP writes in the acknowledgement number field.

My question is that packets lost is the only reason of connectionless of TCP?

connectionless? please correct?

No, packets can be reordered in the network. A classical example: in a packet switched network packets can follow different paths (which take differently long). They will arrive in different order.

TCP congestion control will act, in this case erroneously. Because it is impossible to distinguish between these cases before all packets arrive, and TCP congestion control will go on the side of caution and assume the loss.

I'm struggling to understand this concept.

9
  • TCP connection-oriented means not accept any out of order delivery... But reassembles against connection-oriented.
    – Alok Maity
    Sep 8 at 11:55
  • TCP does accept out of order delivery. TCP is reliable means that the layer above TCP does not accept out of order delivery. IP is unreliable means that the layer above it must accept out of order delivery.
    – Effie
    Sep 8 at 12:03
  • Different website, different people saying different answer... Some are saying that your answer.. And some are saying that my question.. That's why I posted this.. Don't know what is right..
    – Alok Maity
    Sep 8 at 12:06
  • if you have sources - add them to your question. But generally there is a difference between what layer does (functionality) and how it appears to upper layers (interface). And this question is exactly about the difference between these two.
    – Effie
    Sep 8 at 12:11
  • Connection-oriented means we directly got in order packets no need reorder..
    – Alok Maity
    Sep 8 at 12:12
1

TCP is connection-oriented protocol whereas IP isn't connection-oriented protocol.

Correct.

Any packets before sending into transport layer sorted operation must have been done in network layer.

The transport layer can't get its datagrams/segments anywhere by itself. It requires the routing service done in the network layer.

The re-sorting of out-of-order segments for those transport-layer protocols like TCP that provide in-order delivery for the upper application layer is up to the transport-layer protocol itself.

That's why we get in order packets in transport layer by TCP. Whenever in TCP flow control is some packets could be loss and there is a chance of out order delivery. But always we get the in order acknowledgement.

Selective acknowledgement in TCP can also provide out-of-order acknowledgement. The various algorithms treat this differently though in order to avoid performance problems.

My question is that packets lost is the only reason of connectionless of TCP?

TCP is always connection-oriented and stateful. It provides reliable, in-order, arbitrary-length transport, necessitating the tracking of connection states - it'd be very hard to impossible to achieve TCP's functionality in a stateless model.

For a common connection-less and stateless transport protocol, take a look at UDP. IP itself in the network layer is also connectionless and stateless.

10
  • TCP is Connection-oriented means we directly got in order packets no need of reordering?
    – Alok Maity
    Sep 8 at 13:02
  • TCP provides in-order transport for the application above, but since the underlying network layer does not provide in-order transport it needs to buffer and re-sort data segments where required. The requirement for socket states comes from that buffering (together with transport reliability).
    – Zac67
    Sep 8 at 13:04
  • In the sense if I sorting all the packets in network layer, it seems to be connection-oriented... My question basis on reordering connection-oriented or less depends?
    – Alok Maity
    Sep 8 at 13:05
  • A connection-less transport protocol can only do so much. Just try to create a concept for in-order, reliable and arbitrary-length transport without using connection states and you'll see the benefit.
    – Zac67
    Sep 8 at 13:09
  • You one thing clarify me.. In L3 it's not doing sorting it's connectionless and in L4 it's doing sorting means Connection-oriented?
    – Alok Maity
    Sep 8 at 13:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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