Virtual Circuit and Datagram Networks
Virtual circuit and datagram networks are computer networks that provide connection oriented and connectionless services respectively. Let’s try to understand what they mean.
A transport layer can offer applications connectionless service or connection-oriented service between two processes. For example, the internet’s transport layer provides each application a choice between two services : UDP, a connectionless service; or TCP, a connection-oriented service between two hosts. Network-layer connection and connectionless service in many ways parallel transport layer connection-oriented and connectionless services.
For example, a network layer connection service begins with handshaking between the source and destination host; and a network layer connectionless service does not have any handshaking preliminaries.
Although the network layer connection and connectionless services have some parallel with transport-layer connection-oriented and connectionless services, there are crucial differences:
- In the network layer, these services are host-to-host services provided by the network layer for the transport layer. In the transport layer these services are process-to-process services provided by the transport layer for the application layer.
- In all major computer network architectures to date (Internet, ATM, frame relay and so on), the network layer provides either host-to-host connectionless service or host-to-host connection service, but not both. Computer networks that provide only a connection service at the network layer are called virtual circuit (VC) networks ; computer networks that provide only a connectionless service at the network layer are called datagram networks .
- The implementations of connection oriented service in the transport layer and the connection service in the network layer are fundamentally different. We already know that the transport-layer connection-oriented service is implemented at the edge of the network in the end systems; we’ll see shortly that the network-layer connection service is implemented in the routers in the network core as well as in the end systems.
Virtual circuit and datagram networks are two fundamental classes of computer networks. They use very different information in making their forwarding decision. Let’s now take a closer look at their implementations.
Virtual Circuit Networks
While the internet is a datagram network, many alternative network architectures – including those of ATM (Asynchronous Transfer Mode) and frame relay – are virtual circuit networks and, therefore, use connections at the network layer. These network layer connections are called virtual circuits (VCs). Let’s now consider how a VC service can be implemented in a computer network.
A VC consists of :
- a path (that is , a series of links and routers) between the source and destination hosts,
- VC numbers, one number for each link along the path, and
- entries in the forwarding table n each router along the path.
A packet belonging to a virtual circuit will carry a VC number in its header. Because a virtual circuit may have a different VC number on each link, each intervening router must replace the VC number of each traversing packet with a new VC number. The new VC number is obtained from the forwarding table.
To illustrate the concept, consider the network shown in the figure below:
The numbers next to links of R1 in the above figure are the link interface numbers. Suppose now that Host A requests that the network establish a VC between itself and Host B. Suppose also that the network chooses the path A-R1-R2-B and assigns VC numbers 12, 22, and 32 to the three links in this path for this virtual circuit. In this case, when a packet in this VC leaves Host A, the value in the VC number filed in the packet header is 12; when it leaves R1, the value is 22; and when it leaves R2, the value is 32.
How does the router determine the replacement VC number for a packet traversing the router? For a VC network, each router’s forwarding table includes VC number translation; for example the forwarding table in R1 might look something like the table below:
Whenever a new VC is established across a router, an entry is added to the forwarding table. Similarly, whenever a VC terminates, the appropriate entries in each table along its path are removed.
You might be wondering why a packet doesn’t just keep the same VC number on each of the links along its route. The answer is twofold. First, replacing the number from the link reduces the length of the VC field in the packet header. Second, and more importantly, VC setup is considerably simplified by permitting a different VC number at each link along the path of the VC. Specifically, with multiple VC numbers, each link in the path can choose a VC number independently of the VC numbers chosen at other links along the path. If a common VC number were required for all links along the path, the routers would have to exchange and process a substantial number of messages to agree on a common VC number (e.g. one that is not being used by any other existing VC at these routers) to be used for a connection.
In a VC network, the network’s routers must maintain connection state information for the ongoing connections. Specifically, each time a new connection is established across a router, a new connection entry must be added to the router’s forwarding table; and each time a connection is released an entry must be removed from the table. Note that even if there is no VC number translation, it is still necessary to maintain connection state information that associates VC numbers with output interface numbers. The issue of whether or not a router maintains connection state information for each ongoing connection is a crucial one.
There are three identifiable phases in a virtual circuit:
- VC Setup : During this setup phase, the sending transport layer contacts the network layer, specifies the receiver’s address, and waits for the network to set up the VC. The network layer determines the path between sender and receiver, that is, the series of links and routers through which all packets of the VC will travel. The network layer also determines the VC number for each link along the path. Finally, the network layer adds an entry in the forwarding table in each router along the path. During VC setup, the network layer may also reserve resources (for example, bandwidth) along the path of the VC.
- Data Transfer : As shown in the figure below, once the VC has been established, packets can begin to flow along the VC.
- VC Teardown : This is initiated when the sender (or receiver) informs the network layer of its desire to terminate the VC. The network layer will then typically inform the end system on the other side of the network of the call termination and update the forwarding table sin each of the packet routers on the path to indicate that the VC no longer exists.
There is subtle but important distinction between VC setup at the network layer and connection setup at the transport layer (for example, the TCP three-way handshake). Connection setup at the transport layer involves only the two end systems. During transport-layer connection setup, the two end systems alone determine the parameters (for example, initial sequence number and flow-control window size) of their transport-layer connection. Although the two end systems are aware of the transport-layer connection, the routers within the network are completely oblivious to it. On the other hand, with a VC network layer, routers along the path between the two end systems are involved in VC setup, and each router is fully aware of all the VCs passing through it.
The message that the end systems send into the network to initiate or terminate a VC, and the message passed between the routers to set up the VC (that is, to modify connection state in router tables ) are known as signalling messages, and the protocols used to exchange these message are often referred to as signalling protocols. VC setup is shown in the figure above.
In a datagram network, each time an end system wants to send a packet, it stamps the packet with the address of the destination end system and then pops the packet into the network. As shown in the figure below , there is no VC setup and routers do not maintain any VC state information (because there are no VCs).
As a packet is transmitted from source to destination, it passes through a series of routers. Each of these routers uses the packet’s destination address to forward the packet. Specifically, each router has a forwarding table that maps destination address to link interfaces; when a packet arrives at the router, the router uses the packet’s destination address to look up the appropriate output link interface in the forwarding table. The router then intentionally forwards the packet to that output link interface.
To get some further insight into the lookup operation, let’s look at a specific example. Suppose that all destination addresses are 32 bits (which just happens to be the length of the destination address in an IP datagram). A brute-force implementation of the forwarding table would have one entry for every possible destination address. Since there are more than 4 billion possible addresses, this option is totally out of the question.
Now, let’s further suppose that our router has four links, numbered 0 through 3, and the packets are to be forwarded to the link interfaces as follows :
With this style of forwarding table, the router matches a prefix of the packet’s destination address with the entries in the table; if there’s a match, the router forwards the packet to a link associated with the match.
For example , suppose the packet’s destination address is 11001000 00010110 10100001; because the 21-bit prefix of this address matches the first entry in the table, the router forwards the packet to link interface 0. If a prefix doesn’t match any of the first three entries, then the router forwards the packet to interface 3.
Although this sounds simple enough, there’s an important subtlety here. You may have noticed that it is possible for a destination address to match more than one entry. For example, the first 24 bits of the address 11001000 00010111 00011000 10101010 match the second entry in the table, and the first 21 bits of the address match the third entry in the table. When there are multiple matches, the router uses the longest prefix matching rule; that is, it finds the longest matching entry in the table and forwards the packet to the link interface associated with the longest prefix match.
Although routers in datagram networks maintain no connection state information, they nevertheless maintain forwarding state information in their forwarding tables. However, the time scale at which this forwarding information changes is relatively slow. Indeed, in a datagram network the forwarding tables are modified by routing algorithms, which typically update a forwarding table every one-to-five minutes or so. In a VC network, a forwarding table in a router is modified whenever a new connection is set up through the router or whenever an existing connection through the router is torn down. This could easily happen at microsecond timescale in a backbone, tier-1 router.
Because forwarding tables in datagram networks can be modified at any time, a series of packets sent from one end system to another may follow different paths through the network and may arrive out of order.