Tcp – Does TCP use Virtual Circuit Model

layer4tcptransport-protocoludp

First some information:

In virtual circuit model ( which is in the Network Layer ) there are three phases:

1) Connection establishment => In this step a path is chosen. Let's simply say, use routers with id 4,9,12 to get to the destination.

2) Data transfer => In this step the packets ( IP packets ) are forwarded.

3) Connection tear down => Circuit information is removed from the routers.

So in this model, the packets only need to know what circuit they are on. So they do not need full addresses. If a packet only carries the information that it is on circuit 9454, the routers will be able to know where to forward the packets to, because a connection was established, and routers hold the necessary information…

Now lets move up one level, to the Transport Layer.. TCP ( Transmission Control Protocol ) uses connections! Does that mean TCP uses Virtual Circuit Model in the Network Layer?
Or is still Datagram Model used in Network Layer, and TCP makes its own connection in the Transport Layer?

My question is also valid for UDP in Transport Layer and Datagram Model in Network Layer. Can we say that a UDP connection will always use Datagram Model in the Network Layer?

Best Answer

I would give an answer of "no, but it is remarkably similar."

Here's some history and a largely complete explanation.

Circuits 101

Information networks can route traffic, basically, in terms of circuit switching or in terms of packet switching. Circuit switching offers many more guarantees than packet switching, but this comes at a cost, and so circuit switched networks can't degrade gracefully. The classic circuit-switched network is the PSTN, and a virtual circuit would be something like a DS0 on the PSTN.

A DS0 basically works as part of a bundle of connections, usually in a DS1. In a DS1, you will have a bundle of DS0's which are transmitted together, frame-by frame in time-division manner, so each DS0 is guaranteed a specific bandwidth, timeliness, etc. by the underlying network transport.

Another way to look at this is that a physical circuit would be something like a cat6 cable running between two terminals. You can send data back and forth over the wires at guaranteed speeds, and no other communications are going to interfere with that. Indeed the early telephone networks worked by connecting physical circuits (that is copper wires) using manual or electromechanical switches. As this was computerized, the circuits were virtualized and digital (as opposed to analog) information was sent down wires on a time division basis again with a circuit reserving a slot in the time division schedule.

What this means is that circuit switching is more about bandwidth reservation than it is about routing. The former leads to the latter. I.e. a circuit reserves bandwidth for the entire connection.

Why TCP Connections are not Virtual Circuits

TCP/IP is fully packet-switched. It makes no provisions for virtual circuits. This is why things like QoS are often necessary when trunking VOIP (a virtual circuit has built-in QoS guarantees). You have no guarantee that all packets will be routed alike. They may not come through in the same order. They may not come through in a timely manner (from a connection-oriented perspective). So you can't really build virtual circuits per se on top of a packet switched protocol like IP.

TCP comes somewhat close and in fact can work as a somewhat imperfect substitute. It offers as many of the guarantees as it can. This is why, when implemented on TCP/IP, H.323 uses TCP connections instead of the virtual circuits the protocol prefers.

But TCP connections still aren't circuits, because they don't reserve bandwidth during connection on every switch between the two nodes.

Of course TCP connections are more than just datagrams. They include routing information (as does UDP) but they also include the accounting information necessary to reconstruct the stream on the other side in order.

The Answer

Both TCP and UDP are datagram protocols. They send a packet of data with routing information to routers with none of the guarantees of that a circuit offers. TCP offers a subset of guarantees on the end points of what a circuit would offer by adding accounting information to allow the end points to handle errors and a series of data in order, but it is only a subset. Of datagram protocols, TCP is the closest thing one will find to a virtual circuit but it is still conceptually and operationally very different.