You are on page 1of 50

ITT350:

Computer Networks
Module 5: Switching

Instructor: Dr. Iqra Altaf Gillani


Motivation
A network is a set of connected devices. When we have multiple devices, problem
is how to connect them to make one-to-one communication possible.
Motivation
A network is a set of connected devices. When we have multiple devices, problem
is how to connect them to make one-to-one communication possible.

Naive solution: Point-to-point connection between each pair of devices. This is not
possible for large networks.
Motivation
A network is a set of connected devices. When we have multiple devices, problem
is how to connect them to make one-to-one communication possible.

Naive solution: Point-to-point connection between each pair of devices. This is not
possible for large networks.

Alternate solution: Use switching techniques ⇒ Switched communication


networks
Switched Communication Networks
The network consists of interconnected
nodes among which information is
exchanged via different routes controlled
by the switching mechanism.

Switches are devices capable of creating


temporary connections between two or
more devices connected to it. Some are
connected to end-devices and some act
as relay.
Types of switched Networks
Circuit Switching
A circuit-switched network consists of a set of switches connected by physical
links. A connection between two stations is a dedicated path made of one or more
links. However, each connection uses only one dedicated channel on each link.

Each link is normally divided into n channels by using FDM or TDM.


Circuit Switching
A circuit-switched network consists of a set of switches connected by physical
links. A connection between two stations is a dedicated path made of one or more
links. However, each connection uses only one dedicated channel on each link.

Each link is normally divided into n channels by using FDM or TDM.


Circuit Switching phases
1. Circuit establishment (setup phase)
2. Data Transfer (circuit maintenance)
3. Teardown (Circuit disconnect)
Circuit Switching phases
1. Circuit establishment (setup phase)

Establish end-to-end connection and reserve resources.

2. Data Transfer (circuit maintenance)

Retain and use reserved resources for data transfer. Generally, full-duplex mode.

3. Teardown (Circuit disconnect)

Terminate connection and release resources for others use.


Circuit Switching key points
● It takes place at physical layer.
● Before starting communication, stations reserve resources such as bandwidth
in case of TDM and time slots in case of TDM.
● Data sent as continuous flow and not packetised.
● No addressing involved during data transfer. Data routed based on occupied
band (FDM) or time-slot (TDM). But, end-to-end addressing is required to
make connections.
Delay in Circuit Switching
Delay is minimal during data transfer as the resources are reserved.
Delay in Circuit Switching
Delay is minimal during data transfer as the resources are reserved.

Total delay=

Create connection +

Data transfer +

Disconnect circuit
Pros-cons of Circuit Switching
Advantages:
Pros-cons of Circuit Switching
Advantages:

● After path is established data communication without any delay.


● Suitable for continuous traffic.
● Data delivery is in-order as there is a dedicated path.

Disadvantages:
Pros-cons of Circuit Switching
Advantages:

● After path is established data communication without any delay.


● Suitable for continuous traffic.
● Data delivery is in-order as there is a dedicated path.

Disadvantages:

● Initial delay in setting up circuit could be large.


● Inefficient for bursty data.
● Data rate needs to be constant.
● Link utilization is low.
Example of Circuit Switching
Efficiency: Low in efficiency as once resources are allocated these are unavailable
for others.

Applications: Public Switched Telephone Network (PSTN)

The switching centres used for the switching are organised in different levels like
regional offices, toll offices, end offices.
Types of switched Networks
Message switching
In this switching method, a different strategy is used, where instead of establishing
a dedicated physical line between the sender and the receiver, the message is
sent to the nearest directly connected switching node.

This node stores the message, checks for errors, selects the best available route
and forwards the message to the next intermediate node.
Message switching: store and forward
Once a node checks and forwards message, the line becomes free again for other
messages, while the process is being continued in some other nodes.

Due to the mode of action, this method is also known as store-and-forward


technology where the message hops from node to node to its final destination.

Each node stores the full message, checks for errors and forwards it.
Message switching key points
● In this switching technique, more devices can share the network bandwidth,
as compared with circuit switching technique.
● Temporary storage of message reduces traffic congestion to some extent.
● Higher priority can be given to urgent messages, so that the low priority
messages are delayed while the urgent ones are forwarded faster.
● Basic idea:
○ Each network node receives and stores the message
○ Determines the next leg of the route, and
○ Queues the message to go out on that link.
Pros-cons and example of Message switching
Advantages:

● Line efficiency is greater (sharing of links).


● Data rate conversion is possible.
● Even under heavy traffic, packets are accepted, possibly with a greater delay
in delivery.
● Message priorities can be used, to satisfy the requirements, if any.
Pros-cons and example of Message switching
Advantages:
● Line efficiency is greater (sharing of links).
● Data rate conversion is possible.
● Even under heavy traffic, packets are accepted, possibly with a greater delay
in delivery.
● Message priorities can be used, to satisfy the requirements, if any.
Disadvantages:
● Message of large size monopolizes the link and storage
Pros-cons and example of Message switching
Advantages:

● Line efficiency is greater (sharing of links).


● Data rate conversion is possible.
● Even under heavy traffic, packets are accepted, possibly with a greater delay
in delivery.
● Message priorities can be used, to satisfy the requirements, if any.

Disadvantages:

● Message of large size monopolizes the link and storage

Application: Telegraph message switching centres


Types of switched Networks
Packet switching
The basic approach is not much different from message switching. It is also based
on the same ‘store-and-forward’ approach. However, to overcome the limitations
of message switching, messages are divided into subsets of equal length called
packets.
This approach was developed for long-distance data communication (1970) and it
has evolved over time. In packet switching approach, data are transmitted in short
packets (few Kbytes).
Packet switching vs. Circuit switching
Main difference between Packet switching and Circuit Switching is that the
communication lines are not dedicated to passing messages from the source to
the destination.

In Packet Switching, different messages (and even different packets) can pass
through different routes, and when there is a "dead time" in the communication
between the source and the destination, the lines can be used by other sources.
Packet switching vs. Circuit switching
Main difference between Packet switching and Circuit Switching is that the
communication lines are not dedicated to passing messages from the source to
the destination.

In Packet Switching, different messages (and even different packets) can pass
through different routes, and when there is a "dead time" in the communication
between the source and the destination, the lines can be used by other sources.

There is no prior resource allocation and it is generally done on demand on a first


cum first serve basis.

Two approaches: Virtual-circuit and datagram


Types of switched Networks
Virtual-circuit Packet Switching
Like circuit-switching it has a setup and teardown phase in addition to data
transfer phase.

Resources can be allocated during setup phase or on demand. However, like


circuit-switching all packets follow same path established during setup phase.
Virtual-circuit Packet Switching
Like circuit-switching it has a setup and teardown phase in addition to data
transfer phase.

Resources can be allocated during setup phase or on demand. However, like


circuit-switching all packets follow same path established during setup phase.

Two types of addressing used:

● Global address: source and destination needs to have a global address,


unique in scope of the network. Only required to create VCI.
● Virtual Circuit identifier (VCI): identifier or label used for actual data transfer. It
is small number with scope of only a switch.
Overall idea
1. Setup phase: source and destination use their
global addresses to help switched nodes make
entries for connection.
2. Data transfer phase: Each intermediate switch
uses its local switching table to forward the data.
3. Teardown phase: source and destination inform
switched nodes to delete corresponding entries in
their local tables.
Setup phase - Request frame
Source and destination use their global addresses to make a virtual connection. A
setup frame request is sent from source to destination. It fills up only three entries
in the table.
Setup phase - ACK frame
Source and destination use their global addresses to make a virtual connection. A
setup frame request is sent from source to destination. It fills up only three entries
in the table.
Data Transfer and teardown phase
Data transfer uses only VCIs.

After all data is send a teardown request


frame is sent and destination sends
teardown confirmation frame ⇒ all
corresponding table entries are deleted.
Efficiency and performance
In virtual-switching, all belonging to the same source and destination travel the
same path; but the packets may arrive at the destination with different delays if
resource allocation is on demand. But, if done during setup phase then all packets
have same delay.

It is slower than circuit-switching as different virtual circuits may compete over


same resources.
Total Delay
Applications
Connection-oriented switching useful in switched WANs or Public data networks.

Popular protocols using this approach are

● Frame Relay
● Asynchronous transfer mode (ATM)
● X.25
● Multiprotocol Label switching (MPLS)
Types of switched Networks
Datagram Switching

In data communications, we need to send messages from one end system to


another. If the message is going to pass through a packet-switched network, it
needs to be divided into packets of fixed or variable size. The size of the packet is
determined by the network and the governing protocol.

Idea: Each packet is treated independent of all others. Packets are called
datagrams.

Normally done at network layer, so intermediate switches are routers.


Overall idea
Each packet has a header which contains full information about packet’s destination.
Intermediate nodes examine header to decide to which node to send packet so that
it reaches its destination. In this decision multiple factors may be considered:

● Shortest path to destination


● Finding a free node to eliminate bottleneck

Routing tables used for forwarding.

Different packets can take different

routes, can be delayed, dropped

⇒ Connectionless approach.
Efficiency and application
Efficiency: Better than circuit-switched networks as resources are allocated on
demand.

Delay: May be greater than virtual-circuit as each packet needs to experience


waiting time at switches. It is not uniform.

Main application: Internet


Delay
Delay - Pipelining
General delay for M hops and N packets
Pipelining - Packet size
Pipelining - Packet size
Q: In a packet switched network, packets are routed
from source to destination along a single path with
two intermediate nodes. If the message size is 24
bytes and each packet contains a header of 3 bytes,
find the optimum packet size.
Q: In a packet switched network, packets are routed
from source to destination along a single path with
two intermediate nodes. If the message size is 24
bytes and each packet contains a header of 3 bytes,
find the optimum packet size.
Soln: 9 bytes
References
● Chapter 8 [BAF]
● Lecture 18, 19 [AP-NPTEL]
● Note: Source of all images unless specified is [BAF] book (4th Edition).

You might also like