Overview of Circuit Switching and Packet Switching

This post gives a brief overview of circuit switching and packet switching. This post also briefly describes VC based and datagram based packet switching with examples.

This post gives a brief overview of circuit switching and two types of packet switching, namely Virtual Circuit based packet switching and datagram based packet switching.

Switching Process

Switching is the method by which data is transferred from an input port to an output port of an intermediate exchange switch. The most popular methods of switching are Circuit Switching and Packet Switching. Packet Switching can be further classified into two sub-types, namely, Virtual Ciruit (VC) switching and Datagram based packet switching.

Circuit Switching

Circuit switching is primarily used in Telephone networks and not in Computer networks. In circuit switching,

  • An End to end circuit (path) is first reserved using a separate signaling protocol
  • Data transfer proceeds only after the circuit establishment phase
  • All data of that session passes through the same circuit 
  • No other user can use this circuit till this session is completed
  • No signaling information is sent along with the data
  • Circuit is released after data transfer using the signaling protocol
An example illustrating circuit switching during a telephone call setup
An example illustrating circuit switching during a telephone call setup

Packet Switching

Packet switching is the process of transmitting data in small units called as packets. In packet switching, data that is to be transmitted is split into smaller units.  A small header containing signalling/addressing information about the source and destination nodes is added to each such small data unit, to form packets. Each packet is then routed from the source to the destination by intermediate data exchange devices, using the signalling information present in each packet. Packet switching is the switching method used in data networks for computer communication.
The diagram given below illustrates basic packet switching between a sender and a receiver through a packet switched data network.
A typical packet switching process where each packet of the same session may take different routes
A typical packet switching process where each packet of the same session may take different routes
In packet switching,
  • There is no end to end circuit reservation
  • A packet consists of a header and data
  • Each packet has signaling information in the form of source and destination addresses in the packet header.
  • Signalling information is used by intermediate data exchange devices to route packets. 
  • Exchange devices like routers and switches use a store and forward approach for transmitting packets from an input port to an output port 
  • Link utilization is efficient because there is no end to end reservation of telecommunication links and multiple connections can simultanesouly share the link.
  • Virtual Circuit and Datagram are two types of packet switching, both of which are used in Computer Communication at different layers. While VC based packet switching is used primarily at the data link layer, datagram based packet switching is used both at the data link and network layers.

VC based Packet Switching

VC based switching is a method widely used in computer communication, especially at the data link layer, to switch packets inside switched WAN networks. Popular protocols using VC based switching include X.25, Frame-Relay, ATM and MPLS.
VC based switching is also called as connection-oriented packet switching because a logical (not physical) connection is first established between sender and receiver, before data transfer starts.
In VC based switching,
  • Whenever a new session/flow of data transfer needs to happen between a source and a destination node, a connection establishment phase is executed in the switched WAN network, using a signalling protocol.
  • The signalling protocol (e.g. Label Distriution Protocol (LDP) in MPLS) is first used to identify an end to end path between the source and destination nodes. Once such a path is identified, all packets of the data session/flow MUST follow the same path. But this path is not reserved for this session alone and multiple sessions can share the links in this path.
  • After identifying the path, packet switches/routers allocate a set of  VC IDs or labels to uniquely identify this connection. These labels do not have end-to-end significance and only have local significance at each intermediate device.
  • Data is split into small units and appended with a packet header (containing labels) to form packets. 
  • Packets are switched within the WAN network through labels . Usually the length of the label is shorter than IP and layer 2 addresses thereby enabling faster lookup.
  • At each intermediate device/packet switch, the device looks at the incoming label and link. Based on this, it identifies a suitable outgoing link and an outgoing label, by consulting a local VC table. The label inside the packet header is modified accordingly and the packet is switched out of the outgoing link.
  • At the end of the data transfer phase, the labels are released from the VC table.
  • VC based switching is very useful in Switched WAN Core Backbone Networks for fast switching and better traffic Engineering

The diagram given below illustrates a sample VC based switched WAN topology involving six routers (R1 to R6), with two different flows. The first flow is shown in red colour and is through the path R1-R2-R3-R4. The second flow is shown in green colour and is through the path R5-R3-R6.

An example illustrating VC based switching for two separate flows
An example illustrating VC based switching for two separate flows

Note that all packets of the same flow follow the same path. A sample VC table at Router R3 is shown in the diagram given below:

Sample VC table at Router R3

A sample VC table at R3 containing labels for both the flows
A sample VC table at R3 containing labels for both the flows

As shown in the above VC table, the first entry is for the flow shown in red colour. It states that if a packet comes to R3 via. link 2 and with label 45, then R3 has to change the label in the packet to value 33 and send it via. its link 5. Similarly, the second entry in the table is for the flow shown in green colour. It states that if a packet comes to R3 via. link 3 and with label 22, then R3 has to change the label in the packet to value 24 and send  it via. its link 4.

Since all packets of the same flow follow the same path, prioritized treatment could be given to packets belonging to specific flows, inside packet switches, for the purpose of better Quality Of Service (QOS).

Datagram based Packet Switching

Datagram switching is simpler and more widely used than VC based switching. Datagram based packet switching is the fundamental method/technique used in the Internet for end-to-end routing of packets at the Network Layer, between remote communicating computers.
In datagram based switching, data is split into smaller units and a header containing source and destination addresses is added to each small unit to form packets. The packets of a flow are given to the network and the network treats each packet independently and routes the packet using the packet header alone.
The difference between VC based packet switching and datagram based packet switching mainly consists of the following:
 – there is no signalling/call establishment phase in datagram based switching.
 – there is no concept of labels in datagram based packet switching and packets are routed based on the destination address present in the packet header
– In datagram based packet switching, destination address is left unchanged at each intermediate device
– In datagram based packet switching, each packet of a flow need not follow the same path between the source and destination nodes and may take different routes.
The following holds true for Datagram based packet switching
  • It is also called connectionless packet switching
  • It has no connection establishment and termination phases
  • Each packet has  header information and data
  • Each packet of a data session/flow is independently handled by the network, with no correllation between other packets in the flow
  • Packets of each session may take different routes
  • Packets may also arrive out of order at the receiver
  • Very simple to implement and scales well, as there are no signalling protocols and VC tables required at intermediate nodes
  • IP and Ethernet are example protocols using the principle of Datagram based Packet Switching
The diagram given below illustrates a sample datagram based switching topology involving six routers (R1 to R6), with two different flows. The first flow (say FLOW1) is shown in red colour and is between a sender connected to R1 and a receiver connected to R4. . The second flow (say FLOW 2) is shown in green colour and is between a sender connected to R5 and a receiver connected to R6.
An example for datagram based packet switching with two different flows
An example for datagram based packet switching with two different flows
Note that in datagram based packet switching, some packets of FLOW1 take the path R1-R3-R4, whereas some other packets of the same FLOW1 take the path R1-R4 directly.
Similarly, note that some packets of FLOW2 take the path R5-R3-R6, whereas some other packets of the same FLOW2 take the path R5-R6 directly.

Overview of Channel Multiplexing Techniques

Gives a brief overview of Channel Multiplexing techniques like TDM, FDM and SDM. Also discusses their application in computer communication.

This post gives a brief overview of channel multiplexing techniques like FDM, TDM etc and as to how they are used in computer communication.

Channel multiplexing is the process of splitting or sharing the capacity of a high speed channel/telecommunication link to form multiple low capacity/low speed sub-channels. Each such sub-channel can then be used by multiple end nodes as dedicated links. Multiplexing can usually be done in different domains like time, frequency and space (and even combinations of these).

Channel Multiplexing
Channel Multiplexing

For computer communication, though multiplexing techniques like TDM, FDM were initially used mainly in backbone links connecting multiple data exchanges, later they have percolated widely into the access/last mile links too, including inside home networks.

 Time Division Multiplexing (TDM)

In TDM, a high speed data channel/link is made to carry data of multiple connections/end nodes in different time slots, in a round robin fashion. TDM is similar in concept to multitasking computers, where the main processor carries out multiple tasks simultaneously. In multitasking processors, though the processor executes only one task at any instant of time and keeps shuttling between multiple tasks in some order, because of the high speed in which it executes, each task thinks as though the processor is dedicated only to it.

Similary, in TDM, data of each connection is segmented into smaller units, so that they fit inside mini time slots. The link transmits these small units of data from multiple connections in a round robin fashion, periodically allotting a mini time slot for each user, in the time domain.

In TDM, the basic repeating unit is a frame. A TDM frame consists of a fixed number of time slots. Each time slot inside a frame carries data belonging to a specific end node/connection. Thus multiple logical sub-channels/links are created inside a single channel. It is also possible to give multiple slots within a frame to the same user, thereby having the provision of having different capacity sub-channels within the same link.

Assuming that there are “n” end users, each requiring a link with a capacity of X Kbps, then to successfully multiplex these each end users on a channel, the channel’s capacity needs to be atleast equal to n times X Kbps.

The Figure given below illustrates a sample TDM scheme with 4 users being served in a round robin fashion in the time domain.

An example TDM frame with 4 time slots serving 4 different users
An example TDM frame with 4 time slots serving 4 different users

In the example given in the figure, the TDM main channel servers a total of four users and hence creates  four sub-channels. Each user’s data is carried in a specific slot inside each frame. For e.g. Channel-1’s (User 1) data is always carried in the first slot of each frame.

The basic principle of any TDM based protocol remains the same as described above, though there are multiple variants, based on

  • the transmission speed
  • number of frames generated per second
  • the number of time slots within each frame
  • the frame structure etc.

TDM is typically used in WAN digital transmission links, in both trunk and access networks. ISDN (Integrated Services Digital Network) is an example of a protocol using TDM at the access network, to connect home users to their neares ISP, using the local loop (telephone link). In ISDN, there are a total of 3 sub-channels, with two of them known as B-Channels (Bearer Channels), each with a capacity  of 64Kbps being used to carry data and the third known as D-Channel with a capacity of 16Kbps being used to carry signalling information.

Standard T1/E1 serial links are classical examples of TDM based protocols and are used as trunk links between data exchanges. While T1 supports an aggregate rate of 1.54 Mbps with support for 24 sub-channels, each with a capacity of 64Kbps, E1 supports an aggregate rate of 2.08 Mbps with support for 32 sub-channels, each with a capacity of 64Kbps.  TDM links with higher capacity include T2, T3 and SONET Optical links.

Time Division Duplex (TDD) is a form of TDM, where within the same TDM frame, some slots are used for uplink direction (end nodes to network) and some slots are used for downlink direction (network to end nodes), thereby enabling full duplex communication using the same TDM link.

Frequency Division Multiplexing (FDM)

In FDM, the spectrum (frequency range) of a high capacity link is divided into different non-overlapping intervals/carriers. Data of different end nodes are then modulated using these different carriers, so that the resultant signal of each end node occupies a different region in the frequency domain. Between each adjacent carriers, a small guard band is left unused, so as not to cause interference between closely separated carriers.

In FDM, at any instant of time, we would have electromagnetic signals corresponding to each node/sub-channel, unlike in TDM, where at any instant of time, the channel would only have electromagnetic signal belonging to one end node/sub-channel. This is shown in the diagram given below.

 

An example FDM with 6 different frequency carriers coexisting simultaneously in the time domain
An example FDM with 6 different frequency carriers coexisting simultaneously in the time domain

Traditional FM Radio and Broadcast TV are classical examples of applications using FDM, where data belonging to each radio station/ TV channel is modulated over a different carrier, as shown in the diagram given below.

Three baseband channels modulated onto different frequency carriers to seperate them in the frequency domain
Three baseband channels modulated onto different frequency carriers to seperate them in the frequency domain

In computer communication, the concept of basic FDM and variants of FDM are widely used both in LAN and WAN environments. DSL and cable modem links are typical examples of physical layer protocols using FDM for achieving high data rates. In DSL, which also uses the standard telephone last mile local loop line, multiple sub-carriers, each with a bandwidth of 4KHz. are used to carry users data. The baseband region from 0 to 4KHZ is left for basic POTS voice calls. Above this, some number of sub-carriers are allotted for upstream traffic and a higher number of sub-carriers are alloted for downstream traffic. Similarly, cable modem has a separate frequency band for upstream traffic and a range of sub-carriers for downstream traffic.

An example diagram showing the sub-carrier spectrum allocation for POTS, DSL upstream and downstream directions are given in the diagram below:

FDM being used in ADSL, with different frequency sub-carriers for POTS, ADSL upstream and ADSL downstream (diagram courtesy Wikipedia)
FDM being used in ADSL, with different frequency sub-carriers for POTS, ADSL upstream and ADSL downstream (diagram courtesy Wikipedia)

In DSL, to achieve high data rates, a line coding technique like QAM is used on top of each sub-carrier. Thus both FDM and line coding techniques are combined at the physical layer to achieve high broadband data rates.

FDM is also used in some variants of Fast Ethernet (100 Mbps) and Gigabit Ethernet (1000 Mbps) LAN protocols, where multiple carriers are used to achieve the overall data rate supported by the underlying physical layer.

Variants of FDM

  • Wavelength Division Multiplexing (WDM) and DWDM (Dense-WDM) used in optical Networks, are based on principles similar to FDM, except that their carriers are based on different wavelengths instead of different frequencies
  • Frequency Division Duplexing (FDD) is a form of FDM, where some set  of frequencies/carriers are used for carrying uplink direction traffic and some other set of frequencies are used for carrying downlink traffic, thereby enabling full duplex communication using FDM.
  • Spread Spectrum techniques are variants of FDM, where the data is carried or spread over a wide range of frequency spectrum. In normal FDM, a single carrier is used to carry data corresponding to an end node. But in Spread spectrum techniques, multiple carriers are used to carry data corresponding to an end node, with each carrier carrying a small piece of data. FHSS (Frequency Hopping Spread Spectrum), DSS (Direct Sequence Spread Spectrum) and OFDM (Orthogonal Frequency Division Multiplexing) are different types of spread spectrum techniques. 
  • In FHSS, the frequency of the carrier varies from instant to instant, whereas in DSS, data is split into smaller units and simultanesouly carried by multiple carriers, as shown in the diagram given below
A FHSS where 8 different carriers are used, with data hopping on top of different carriers in a pre-determined order
A FHSS where 8 different carriers are used, with data hopping on top of different carriers in a pre-determined order
  • CDMA (Code Division Multiple Access) is a form of DSS, where a codeword is combined with data to spread the signal over a wide range of spectrum. 
  • OFDM is a form of DSS that is widely used in Wireless LAN protocols (802.11 a/g), wherein a set of carriers that are orthogonal (do not interfere with each other) are used to carry the data signal, as shown in the diagram below.
An OFDM scheme where 4 orthogonal frequency sub-carriers are used to spread the information over a wider spectrum
An OFDM scheme where 4 orthogonal frequency sub-carriers are used to spread the information over a wider spectrum
Orthogonal Frequency Division Multiplexing (OFDM) is used for both wired and wireless networks

Space Division Multiplexing (SDM)

In SDM, the same set of frequencies or same set of TDM signals are used in two different places that are geographically wide apart in space, so that one does not interfere with the other. Cellular communication, where the same set of carrier frequencies are reused (frequency reuse) in cells that are not close to one another is a classical example of SDM. Another example of SDM is the FM radio broadcast, where the same set of carrier frequencies are used in different cities that are geographically apart. These are examples of techniques where SDM and FDM are combined.

Combination of FDM,TDM and SDM

GSM (Global System for Mobile Communication) protocol combines both TDM and FDM, to achieve full duplex wireless communnication between the mobile handsets and the base stations. While one set of frequencies are used as base carriers from mobile handsets to base station, another set of non-overlapping frequencies are used as base carriers from base stations to mobile handsets, thereby making use of FDM principles. Within each carrier, GSM uses TDM, to carry voice and data belonging to multiple mobile users simultaneously, each in different time slots. Additionally the same set of carrier frequencies and TDM schemes are reused beyond a certain minimum distance, thereby making use of SDM. Thus GSM is an example protocol that uses FDM, TDM and SDM.