MSc-IT Study Material
June 2010 Edition

Computer Science Department, University of Cape Town

Circuit and packet switching

Computers communicate with each other by, first and foremost, being in some way connected to one another. This connection is either permanent or for the duration of the communication. The simplest arrangement requires the existence of an electrical circuit between two computers, while the more general situation connects a number of computers in a network. The network in the figure below shows both simple and complicated possibilities for computer communication. The computer A can communicate directly with B and E, but for A to communicate with F or C requires passing data via E or B, respectively. For A to pass data to I or G, C must be involved; obviously, if for some reason C could not communicate A's data, G and I would be isolated from A.

To summarise: for a computer to pass data to another in a network requires a path between the data source and destination. This path can be constructed in a variety of ways, with each possibility having its own advantages and disadvantages.

As well as requiring a path between the source and destination, the transmitted data has to be in some agreed form. That is, it must adhere to a protocol, or set of rules, that the destination (and possibly intermediate participants in the communication) can understand and handle as the data as the source intended.

A basic requirement of any protocol is that the data must be packaged in some well defined way. Whatever the original data is, it needs to be packaged with at least the information stating where it is being sent to and from who it is from. Depending on the protocol, additional information may be added to the original data. Note that we use the term 'data' in two different ways: to refer to the original data — the source information that the destination computer requires — and the packaged data that is actually sent between the computers. Usually we will not need to distinguish between the two, and it should be clear which of the two forms of data is meant.

As can be imagined, if all the computers in a network packaged and indicated their addresses in different ways, actual communication would be extremely difficult. With proprietary protocols this is indeed the case: one company's network protocol works fine for computers on its network, but makes it difficult to communicate with computers on another network. This has lead to the development of open standards for network communications.

To understand the theory of how data is passed from one computer to another, we first examine the physical requirements for the communication to take place: the cables, wires, routers and computers. Following this, we examine the logical side: the contents of packets and the descriptions of protocols.

Consider a network (like the above one) that needs to pass data from source A to destination L. If there is a large distance between the source and the destination devices (e.g. 1 000 kilometres) it becomes far too expensive to create a physical point-to-point connection, i.e. a connection that permanently links the two, as shown in blue below.

It is sometimes also necessary to communicate between a single source and multiple destinations. Creating dedicated connections between the source and each destination is possible. For example, some of the connections from A are shown below in blue

There are two approaches for one-to-one and one-to-many communication.

  1. Build a communication network of dedicated point-to-point connections. While this is straightforward in theory, in practise it becomes very expensive. Imagine the number of dedicated connections in the simple network above if all devices are to be directly connected to each other.

  2. Build a network in which each device may be a part of the connection between others, i.e. each device is a node of the network. This choice is the simplest and, more importantly, is relatively inexpensive. If the devices at each node can be a part of a path between the source and destination(s), then this approach is also robust to failure as several viable paths from one point to another may exist.

Exercise 1

Draw two paths from E to J in the above network.

Solution can be found at the end of the Unit.

Circuit Switching

Circuit switching is commonly used in dedicated networks. The typical example of a circuit switched network is the telephone network, which creates paths between devices by activating switches along the path connecting source to destination. The data is transmitted, with no delay, through the transmission medium directly to the destination device.

Advantages of Circuit Switching

The main advantage of circuit switching is that there is no delay in receiving the data, and there is therefore no jitter. Once the connection has been made, data is transmitted at a constant rate.

Disadvantages of Circuit Switching

In a dedicated network, when data is not being transmitted through a point-to-point connection, the connection is not being used and is therefore a wasted resource.

Such networks are expensive to install over large geographical areas. Additionally, there is a delay while pathways between two devices is found.

Packet Switching

Packet switching establishes a path, or connection, between source and destination by directing data towards its destination through intermediate devices. The term 'switching' is in the sense of the intermediate devices knowing where to pass on data as if physical switches connecting the devices were being closed. Packet switching breaks up data into packets and transmits and processes these packets as they pass through the network. A packet is a chunk of data, of pre-defined size, used for transmission. For example, a large document is typically divided into a number of packets; it is not transmitted in one piece to its destination.

How the packets are constructed depends on the protocol being used, and is discussed later in this unit. However, each packet is transmitted from the source and follows a logical path towards its destination. When a packet is passed to a node, it is stored there briefly before being passed onto another node along the route to the destination. This cycle is repeated until the destination node is finally reached.

A major difference between packet and circuit switching is that each packet can take a different path to arrive at the destination. This means that packets may arrive at the destination in a sequence different to the one in which they were originally sent. However, this is not a problem if, as is typical, the protocol requires the packets be numbered for re-assembly in their original sequence at the destination.

However, the delays from storing the packets at each node, and their subsequent reconstruction at the destination, can have an effect on real time processing. The figure below illustrates this. The red packet takes a different path to the blue packet and consequently arrives out of sequence. Each packet can travel a separate path based on various criteria. Such a criterion might be the shortest path or the least congested path.

Advantages of Packet Switching

Packet switching fully utilises the network infrastructure, since it is only when data is being sent that the connections are used. Another advantage is that there is little cost in establishing direct connections.

Disadvantages of Packet Switching

Due to delays, real-time processing can become 'jittery'. This is not helped when a network becomes saturated with traffic, which increases the delays between packets sent.

To Do

Read more about circuit and packet switching in your textbooks and the Internet. Try to find specific real-world examples for each.

To Do

Do Review Question 1