Routing – how IPv4 routing is done for TCP? as TCP is connection oriented but IP is not

iproutingtcp

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?

Best Answer

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.

Related Topic