5

In connection oriented networks, the source first establish connection with destination before sending packets. When a connection is established sequence of packets are sent on that connection which is some virtual tube or pipe. Also it is written that in connection oriented protocol, decision about route for sequence of packets can be made only once when the connection is established. (Ref: Data communication and networking, by Behrouz Forouzan)

My doubt is: TCP is connection-oriented protocol and IP use connection-less packet switched routing. So while implementing TCP with IP as network layer protocol, how routing is done. If IP decides one route when establishing connection and use it for entire communication, how it is done. Or IP is free to choose any possible route during the communication? I mean, is it possible that network layer can choose different path for different packets for same connection?

2
  • Neither TCP does care which route is chosen, nor IP cares about upper layer protocols. As long as IP addresses are the same and it is the same session (Sequence numbers). Sometimes with equal-cost multipath the packets are going thru 2 links even and the packets arrive out-of-order, and it's still not a problem
    – Alex
    Dec 19, 2014 at 7:05
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can post and accept your own answer.
    – Ron Maupin
    Jan 5, 2021 at 17:24

3 Answers 3

4

A connection oriented network is one where the network layer (roughly equivalent to the IP layer) where the routing done is connection based (like X.25 or a telephone call).

So this is absolutely true:

In connection oriented networks, the source first establish connection with destination before sending packets.

but this misses the important word network:

in connection oriented [network] protocol, decision about route for sequence of packets can be made only once when the connection is established

So, a protocol like TCP has to add sequence numbers, acknowledgments and retries to ensure that it delivers data in the same order it was supplied. It works with the connectionless service the lower layer provides though.

2

In connection oriented networks, the source first establish connection with destination before sending packets.

The process of establishing that connection is sending packets. I think you're referring to how TCP establishes a connection before sending data. So in that case, you would need a successful 3-way handshake before you can transfer data.

Or IP is free to choose any possible route during the communication? I mean, is it possible that network layer can choose different path for different packets for same connection?

Not only is it possible, but it happens. The underpinnings of packet switching is that it really doesn't matter how it gets there, just that it does. This sometimes comes with issues in delivering packets out of order because of that asynchronous routing.

3
  • RE: "in some cases, it's encouraged for load balancing." In most cases, it's strongly discouraged because TCP doesn't like out-of-order packet delivery Dec 19, 2014 at 8:58
  • @MikePennington Routing asymmetry can occasionally cause issues across a WAN (and most of the time can't even be mitigated). Inside a LAN, however, it doesn't make much of a difference. So what if packets round-robin across a couple 10G links? That's making efficient use of infrastructure that might otherwise be idle backup.
    – Ryan Foley
    Dec 19, 2014 at 9:18
  • So many people use this rationalization because they think they "know better", when in reality even modest variations in delay will deliver packets out of order; and yes this even happens in a LAN. The most frequent reason for it happening in a LAN is queue congestion. All it takes is the difference of one extra packet in a queue to deliver out of order Dec 19, 2014 at 9:21
1

IP makes path selection decisions with no knowledge or care about the upper layer protocols. TCP is connection-oriented in the sense that it emulates connections by enforcing in-order delivery and knowledge of delivery success.

IP traffic can (and sometimes does) change paths in the middle of a session. When this happens, either the upper layer protocols (like TCP) simply back-up to the last acknowledge in-order message and continue from there, or the upper layer protocols (like UDP and RTSP) just assume the connectivity was lost and reestablished , and keep going.

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.