Module 2
Circuit and Packet Switching
Circuit and Packet Switching
Switched Communications Networks – Circuit Switching – Packet Switching –
Comparison of Circuit Switching and Packet Switching – Implementing Network
Software, Networking Parameters(Transmission Impairment, 1 Data Rate and
Performance)
Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Internet as a black box
Application Application
Transport Transport
Network Network
Data link Message Message Data link
Physical Physical
Internet
A B
2 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Internet as a combination of LANs and WANs connected
together
3 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
• .
Switched Communications Networks
• the passage of a message from a source to a destination involves many decisions
• When a message reaches a connecting device, a decision needs to be made to select one
of the output ports through which the packet needs to be send out.
• Types of switching to be discuss
• Circuit switching
• Packet Switching Datagram Approach
Virtual Circuit Switching Switched Virtual Circuit
Permanent virtual Circuit
4 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Example for Circuit and Packet Switching
A good example of a circuit-switched network is the early telephone systems in
which the path was established between a caller and a callee when the telephone
number of the callee was dialed by the caller. When the callee responded to the
call, the circuit was established. The voice message could now flow between the
two parties, in both directions, while all of the connecting devices maintained the
circuit. When the caller or callee hung up, the circuit was disconnected. The
telephone network is not totally a circuit-switched network today.
5 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Example for Circuit and Packet Switching
• The network layer is designed as a packet-switched network.
• Individual datagrams are then transferred from the source to the destination.
• The received datagrams are assembled at the destination before recreating the
original message.
• The packet-switched network layer of the Internet was originally designed as a
connectionless service, but recently there is a tendency to change this to a
connection-oriented service.
6 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
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.
7 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Circuit Switching
8 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Circuit Switching
Circuit switching takes place at the physical layer
Before starting communication, the stations must make a reservation for the resources to be
used during the communication.
Data transferred between the two stations are not packetized (physical layer transfer of the
signal). The data are a continuous flow sent by the source station and received by the
destination station, although there may be periods of silence.
There is no addressing involved during data transfer. The switches route the data based on
their occupied band (FDM) or time slot (TDM). Of course, there is end-to-end addressing
used during the setup phase.
9 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Circuit Switching- Phases
The actual communication in a circuit-switched network requires three phases:
connection setup, data transfer, and connection teardown.
Setup Phase
Data transfer Phase
Tear down Phase
10 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Circuit Switching- Technology in Telephone Networks
The telephone companies have previously chosen the circuit switched approach to
switching in the physical layer; today the tendency is moving toward other
switching techniques.
For example, the telephone number is used as the global address, and a signaling
system (called SS7) is used for the setup and teardown phases.
11 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
12 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Packet Switching
Network
A connectionless
packet-swtiched network
R1 R2
Sender Network
R4
R3 R5 Out of order Receiver
13 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Packet Switching
• digital networking communications method that groups all transmitted data –
regardless of content, type, or structure – into suitably sized blocks, called packets.
• Packet switching features delivery of variable-bit-rate data streams (sequences of
packets) over a shared network.
• When traversing network adapters, switches, routers and other network nodes,
packets are buffered and queued, resulting in variable delay and throughput
depending on the traffic load in the network.
14 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Packet Switching
• Packet switching contrasts with another principal networking paradigm, circuit
switching, a method which sets up a limited number of dedicated connections of
constant bit rate and constant delay between nodes for exclusive use during the
communication session.
• In case of traffic fees (as opposed to flat rate), for example in cellular
communication services, circuit switching is characterized by a fee per time unit
of connection time, even when no data is transferred, while packet switching is
characterized by a fee per unit of information.
15 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Two major packet switching modes exist
1. Connectionless packet switching, also known as datagram switching
2. Connection-oriented packet switching, also known as virtual circuit switching.
• In the first case each packet includes complete addressing or routing information.
The packets are routed individually, sometimes resulting in different paths and out-
of-order delivery. The forwarding decision is based on the destination address of
the packet
• In the second case a connection is defined and pre allocated in each involved node
during a connection phase before any packet is transferred. The forwarding
decision is based on the label of the packet.
16 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Connectionless Packet Switching Network-
Datagram Switching
Network
A connectionless
packet-swtiched network
R1 R2
4 3 2 1 2
Sender 1
Network
4
2
3
R4 1
3 3
4 1 3 4 2
R3 R5 Out of order Receiver
17 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Forwarding Process in Connectionless Network
Routing table Legend
Destination Output SA: Source address
address interface DA: Destination address
A 1
B 2
H 3
Send the packet
out of interface 2
Destination
address
1 2
SA DA Data SA DA Data
3 4
A routing table is a set of rules, often viewed in table format, that is used to determine where
data packets traveling over an Internet Protocol (IP) network will be directed. All IP-enabled
devices, including routers and switches, use routing tables.
18 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Delay in Connectionless Network
Destination
Souce
Total delay
2
Time Time Time Time
19 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
A Connection Oriented Packet Switched Network –
Virtual Circuit
4 3 2 1
4
3
2
1
4 3 2 1 4 3 2 1
20 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Forwarding Process in a Connection oriented
Network Routing Table
Incoming Outgoing
Legend
SA: Source address
Port Label Port Label DA: Destination address
1 L1 2 L2 L1, L2: Labels
1 2
3 4
The forwarding decision is based on the label of the packet.
Multiprotocol Label Switching (MPLS), which can be used for IP over
virtual
21 Dr.circuits. Each
S. Deepa Nivethika, circuit
SCOPE, VIT, Chennaiis identified by a label. 06-08-2024
Flow of one packet in an established virtual circuit
A to B Legend
Incoming Outgoing
A B Data Datagram
Port Label Port Label
Network 66 Virtual circuit
1 14 3
R1 R2
2
14 A B Data
1 4
A 3
R5 Network
66 A B Data
1 2 2 3
22 A B Data 77 A B Data
3 1 4
R3 R4
Incoming Outgoing Incoming Outgoing
Port Label Port Label Port Label Port Label
1 66 3 22 1 22 4 77
A to B A to B
24 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Delay in a connection-oriented network
Source Destination
1
Setup
2
Total delay
3 Transmission
time
4
5
Teardown
Time Time Time Time
25 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Comparison of Circuit Switching and Packet Switching
Parameter Circuit Switching Packet Switching
Routing scheme Route selected during call setup Each packet routed independently
Multiplexing scheme Circuit multiplexing/ TDM,FDM Packet multiplexing shared media
access networks, Statistical
Multiplexing
Addressing scheme Hierarchical numbering plan Hierarchical address space
Information representation Analog voice or PCM coded voice Binary information
End terminal Telephone, modem Computer
Transmission system Analog and digital data over Digital data over different
different transmission media transmission media
Traffic Real time interactive Heavy traffic
Application Telephone network for bi- Internet for datagram and reliable
directional, real time transfer of stream service between computers
26 voice signals
Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Implementing Network Software
Network architectures and protocol specifications are essential things, but a good
blueprint is not enough to explain the phenomenal success of the Internet:
Some of the issues involved in implementing a network application on top of the
Internet , such programs are simultaneously an application (i.e., designed to
interact with users) and a protocol (i.e., communicates with peers across the
network).
27 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Implementing Network Software- Application
Programming Interface (Sockets)
• The place to start when implementing a network application is the interface
exported by the network.
• Since most network protocols are implemented in software (especially those high
in the protocol stack), and nearly all computer systems implement their network
protocols as part of the operating system, when we refer to the interface “exported
by the network,” we are generally referring to the interface that the OS provides to
its networking subsystem. This interface is often called the network application
programming interface (API).
28 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Implementing Network Software- Application
Programming Interface (Sockets)
The main abstraction of the socket interface, not surprisingly, is the socket. A good
way to think of a socket is as the point where a local application process attaches to
the network.
The interface defines operations for creating a socket, attaching the socket to the
network, sending/ receiving messages through the socket, and closing the socket.
29 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Implementing Network Software- Application
Programming Interface (Sockets)
Socket creation Steps
Step 1: create a socket, which is done with the following operation:
int socket(int domain, int type, int protocol)
Step 2 : depends on whether you are a client or a server. On a server machine, the
application process performs a passive open the server says that it is prepared to
accept connections, but it does not actually establish a connection
30 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Implementing Network Software- Application
Programming Interface (Sockets)
The server does this by invoking the following three operations:
• int bind(int socket, struct sockaddr *address, int addr len)
• int listen(int socket, int backlog)
• int accept(int socket, struct sockaddr *address, int *addr len)
31 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Implementing Network Software- Application
Programming Interface (Sockets)
On the client machine, the application process performs an active open; that is, it says
who it wants to communicate with by invoking the following single operation:
int connect(int socket, struct sockaddr *address, int addr len)
32 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Implementing Network Software- Application
Programming Interface (Sockets)
Once a connection is established, the application processes invoke the following two
operations to send and receive data:
int send(int socket, char *message, int msg len, int flags)
int recv(int socket, char *buffer, int buf len, int flags)
The first operation sends the given message over the specified socket, while the
second operation receives a message from the specified socket into the given buffer.
Both operations take a set of flags that control certain details of the operation
33 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Networking Parameters
(Transmission Impairment, Data Rate and Performance)
Transmission Impairment
Signals travel through transmission media, which are not perfect. The imperfection
causes signal impairment. This means that the signal at the beginning of the medium
is not the same as the signal at the end of the medium. What is sent is not what is
received.Three causes of impairment are attenuation, distortion, and noise
34 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Transmission Impairment - Attenuation
Attenuation means a loss of energy. When a signal, simple or composite, travels
through a medium, it loses some of its energy in overcoming the resistance of the
medium. That is why a wire carrying electric signals gets warm, if not hot, after a
while. Some of the electrical energy in the signal is converted to heat. To compensate
for this loss, amplifiers are used to amplify the signal.
Decibel
To show that a signal has lost or gained strength, engineers use the unit of the decibel.
The decibel (dB) measures the relative strengths of two signals or one signal at two
different points. Note that the decibel is negative if a signal is attenuated and positive
if a signal is amplified.
35 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Transmission Impairment - Attenuation
P2
dB 10 log 10
P1
Variables P1 and P2 are the powers of a signal at points 1 and 2, respectively.
36 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Transmission Impairment - Attenuation
Example: Suppose a signal travels through a transmission medium and its power is
reduced to one-half. Find the attenuation (loss of power).
Solution: dB=10 log (P/2P)= -3 dB
Example: A signal travels through an amplifier, and its power is increased 10 times
Find the amplification (gain of power).
Solution: dB=10 log (10P/P)= 10 dB
37 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Transmission Impairment - Distortion
• Distortion means that the signal changes its form or shape.
• Distortion can occur in a composite signal made of different frequencies. Each
signal component has its own propagation speed through a medium and, therefore,
its own delay in arriving at the final destination. Differences in delay may create a
difference in phase if the delay is not exactly the same as the period duration.
• In other words, signal components at the receiver have phases different from what
they had at the sender.The shape of the composite signal is therefore not the same
38 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Transmission Impairment - Noise
• Noise is another cause of impairment. Several types of noise, such as thermal noise,
induced noise, crosstalk, and impulse noise, may corrupt the signal. Thermal noise
is the random motion of electrons in a wire which creates an extra signal not
originally sent by the transmitter. Induced noise comes from sources such as
motors and appliances.
• To find the theoretical bit rate limit, we need to know the ratio of the signal power
to the noise power.The signal-to-noise ratio is defined as:
SNR = average signal power/ average noise power
39 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Types of Noise
Thermal Noise/ White Noise - Thermal noise is the electronic noise generated by the
thermal agitation of the charge carriers (usually the electrons) inside an electrical conductor at
equilibrium, which happens regardless of any applied voltage.
Induced Noise - Induced noise is the noise generated in a circuit by a varying magnetic or
electrostatic field produced by another circuit.
Crosstalk Noise - Crosstalk is a type of noise signal that corrupts the actual signal while
transmission through the communication medium.
Impulse Noise - Impulse noise is a category of noise that includes unwanted, almost
instantaneous (thus impulse-like) sharp sounds (like clicks and pops)—typically caused by
electromagnetic interference, scratches on disks, gunfire, explosions, and synchronization issues
in digital audio.
40 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Data Rate
A very important consideration in data communications is how fast we can send data, in
bits per second over a channel. Data rate depends on three factors:
1. The bandwidth available
2. The level of the signals we use
3. The quality of the channel (the level of noise)
Two theoretical formulas were developed to calculate the data rate:
Nyquist for a noiseless channel
Shannon for a noisy channel.
41 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Data Rate - Noiseless Channel: Nyquist Bit Rate
1
Two level signal
0
42 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Data Rate - Noiseless Channel: Nyquist Bit Rate
Example:
Consider a noiseless channel with a bandwidth of 3000 Hz transmitting a signal with
two signal levels.The maximum bit rate can be calculated as
BitRate =2 x 3000 x log2 2 =6000 bps
43 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
44 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
45 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Data Rate - Noisy Channel: Shannon Capacity
•
46 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Data Rate - Noisy Channel: Shannon Capacity
•
47 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
48 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Performance
One important issue in networking is the performance of the network-how good is it?
Important Parameters: Bandwidth, Throughput, Delay and Jitter.
Bandwidth:
In networking, we use the term bandwidth in two contexts.
The first, bandwidth in hertz, refers to the range of frequencies in a composite signal
or the range of frequencies that a channel can pass.
The second, bandwidth in bits per second, refers to the speed of bit transmission in a
channel or link.
50 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
What is the required bandwidth of a low-pass channel if we need
to send 1 Mbps by using baseband transmission?
Solution
The answer depends on the accuracy desired.
a. The minimum bandwidth, is B = bit rate/2, or 500 kHz.
b. A better solution is to use the first and the third harmonics
with B = 3 × 500 kHz = 1.5 MHz
c. Still a better solution is to use the first, third, and fifth
harmonics with B = 5 × 500 kHz = 2.5 MHz
51 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Examples
The bandwidth of a subscriber line is 4 kHz for voice or data. The bandwidth of this
line for data transmission can be up to 56,000 bps using a sophisticated modem to
change the digital signal to analog.
If the telephone company improves the quality of the line and increases the
bandwidth to 8 kHz, we can send 112,000 bps by using the same technology as
mentioned in previous Example
52 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Throughput:
The throughput is a measure of how fast we can actually send data through a
network.
the bandwidth is a potential measurement of a link; the throughput is an actual
measurement of how fast we can send data.
Throughput = Data/Time
For example, we may have a link with a bandwidth of 1 Mbps, but the devices connected to the
end of the link may handle only 200 kbps. This means that we cannot send more than 200 kbps
through this link. Imagine a highway designed to transmit 1000 cars per minute from one point to
another. However, if there is congestion on the road, this figure may be reduced to 100 cars per
minute.The bandwidth is 1000 cars per minute; the throughput is 100 cars per minute.
53 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
A network with bandwidth of 10 Mbps can pass only an average of 12,000 frames per minute
with each frame carrying an average of 10,000 bits. What is the throughput of this network?
The throughput is almost one-fifth of the bandwidth in this case
54 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Delay
Latency (Delay) defines how long it takes for an entire message to completely arrive at the
destination from the time, the first bit is sent out from the source.
• Transmission delay
• Propagation delay
• Queuing delay
• Processing delay
55 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
56 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Latency (Delay)
Total Delay = Transmission delay + Propagation delay + Queuing delay + Processing delay
Propagation Time: Propagation time measures the time required for a bit to travel from the source to the
destination.The propagation time is calculated by dividing the distance by the propagation speed.
Propagation time = Distance / Propagation speed
The propagation speed of electromagnetic signals depends on the medium and on the frequency of the signal.
Transmission Delay:Time it takes to place the complete data packet on the transmission medium.
TransmissionTime = Message Size/Bandwidth
57 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Transmission Time In data communications we don't send just 1 bit, we send a
message. The first bit may take a time equal to the propagation time to reach its
destination; the last bit also may take the same amount of time. However, there is a
time between the first bit leaving the sender and the last bit arriving at the receiver.
The first bit leaves earlier and arrives earlier; the last bit leaves later and arrives
later. The time required for transmission of a message depends on the size of the
message and the bandwidth of the channel. Transmission time =Message size
/Bandwidth
58 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Queuing Time: The third component in latency is the queuing time, the time
needed for each intermediate or end device to hold the message before it can be
processed. The queuing time is not a fixed factor; it changes with the load imposed
on the network. When there is heavy traffic on the network, the queuing time
increases. An intermediate device, such as a router, queues the arrived messages
and processes them one by one. If there are many messages, each message will have
to wait.
59 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Bandwidth – delay product
60 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Jitter Another performance issue that is related to delay is jitter. We can roughly
say that jitter is a problem if different packets of data encounter different delays and
the application using the data at the receiver site is time-sensitive (audio and video
data, for example). If the delay for the first packet is 20 ms, for the second is 45
ms, and for the third is 40 ms, then the real-time application that uses the packets
endures jitter.
61 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Problems on Attenuation
62 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
63 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
64 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
65 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
66 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Problems on Noise
67 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
68 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
69 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Data rate - Calculation
70 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
71 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
72 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
73 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
74 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024
Thank You
75 Dr. S. Deepa Nivethika, SCOPE, VIT, Chennai 06-08-2024