Circuit and Packet Switching
Circuit and Packet Switching
Module:2
Need of Switches
• Whenever we have multiple devices, we have the problem of how to connect them
to make one-to-one communication possible.
• One solution is to make a point-to-point connection between each pair of devices (a
mesh topology) or between a central device and every other device (a star topology).
• These methods, however, are impractical and wasteful when applied to very large
networks.
• The number and length of the links require too much infrastructure to be cost-
efficient, and the majority of those links would be idle most of the time.
• Other topologies employing multipoint connections, such as a bus, are ruled out
because the distances between devices and the total number of devices increase
beyond the capacities of the media and equipment.
• A better solution is switching
Switches - Introduction
• A switched network consists of a series of interlinked nodes, called
switches.
• Switches are devices capable of creating temporary connections
between two or more devices linked to the switch.
• In a switched network, some of these nodes are connected to the end
systems (computers or telephones, for example).
• Others are used only for routing
Three Methods of Switching
Delay
• Although a circuit-switched network normally has low efficiency, the delay in this
type of network is minimal.
• During data transfer the data are not delayed at each switch; the resources are
allocated for the duration of the connection
• There is no waiting time at each switch.
• The total delay is due to the time needed to create the connection, transfer data,
and disconnect the circuit.
PACKET SWITCHING NETWORKS
• 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.
• In packet switching, there is no resource allocation for a packet.
• This means that there is no reserved bandwidth on the links, and there is no scheduled
processing time for each packet.
• Resources are allocated on demand.
• The allocation is done on a first-come, first-served basis.
• When a switch receives a packet, no matter what the source or destination is, the packet
must wait if there are other packets being processed.
• This lack of reservation may create delay
• Ex: we do not have a reservation at a restaurant, we might have to wait.
Datagram Networks
• In a datagram network, each packet is treated independently of all
others
• Packets in this approach are referred to as datagrams.
• Datagram switching is normally done at the network layer.
• The switches in a datagram network are traditionally referred to as
routers
Datagram Networks
• All four packets (or datagrams) belong to the same message, but may travel
different paths to reach their destination.
• This is so because the links may be involved in carrying packets from other
sources and do not have the necessary bandwidth available to carry all the
packets from A to X.
• This approach can cause the datagrams of a transmission to arrive at their
destination out of order with different delays between the packets.
• Packets may also be lost or dropped because of a lack of resources.
• In most protocols, it is the responsibility of an upper-layer protocol to
reorder the datagrams or ask for lost datagrams before passing them on to
the application
Datagram Networks
• The datagram networks are sometimes referred to as connectionless
networks.
• The term connectionless here means that the switch (packet switch)
does not keep information about the connection state.
• There are no setup or teardown phases.
• Each packet is treated the same by a switch regardless of its source or
destination.
Datagram Networks
Routing Table
• Each switch (or packet switch) has a routing table which is based on
the destination address.
• The routing tables are dynamic and are updated periodically.
• The destination addresses and the corresponding forwarding output
ports are recorded in the tables.
Datagram Networks
Destination Address
• Every packet in a datagram network carries a header that contains,
among other information, the destination address of the packet.
• When the switch receives the packet, this destination address is
examined; the routing table is consulted to find the corresponding
port through which the packet should be forwarded.
• This address, unlike the address in a virtual-circuit network, remains
the same during the entire journey of the packet.
Datagram Networks
Efficiency
• The efficiency of a datagram network is better than that of a circuit-
switched network;
• Resources are allocated only when there are packets to be
transferred.
• If a source sends a packet and there is a delay of a few minutes before
another packet can be sent, the resources can be reallocated during
these minutes for other packets from other sources
Datagram Networks
• Delay
• There may be greater delay in a datagram network than in a virtual-
circuit network.
• Although there are no setup and teardown phases, each packet may
experience a wait at a switch before it is forwarded.
• In addition, since not all packets in a message necessarily travel
through the same switches, the delay is not uniform for the packets of
a message
Datagram Networks
Virtual-Circuit Networks
• A virtual-circuit network is a cross between a circuit-switched network and a datagram network.
• It has some characteristics of both.
1. As in a circuit-switched network, there are setup and teardown phases in addition to the data
transfer phase.
2. Resources can be allocated during the setup phase, as in a circuit-switched network, or on
demand, as in a datagram network.
3. As in a datagram network, data are packetized and each packet carries an address in the
header.
4. As in a circuit-switched network, all packets follow the same path established during the
connection.
5. A virtual-circuit network is normally implemented in the data-link layer, while a circuit-
switched network is implemented in the physical layer and a datagram network in the
network layer. But this may change in the future
Virtual-Circuit Networks
• Addressing
• In a virtual-circuit network, two types of addressing are involved: global and local (virtual-
circuit identifier).
• Global Addressing
• A source or a destination needs to have a global address—an address that can be unique in the
scope of the network or internationally if the network is part of an international network.
• However, a global address in virtual-circuit networks is used to create a virtual-circuit identifier
Virtual-Circuit Networks
Virtual-Circuit Identifier
• The identifier that is actually used for data transfer is called the virtual-circuit
identifier (VCI) or the label.
• A VCI, unlike a global address, is a small number that has only switch scope;
• It is used by a frame between two switches.
• When a frame arrives at a switch, it has a VCI; when it leaves, it has a different
VCI
Virtual-Circuit Networks
Three Phases
• As in a circuit-switched network, a source and destination need to go
through three phases in a virtual-circuit network: setup, data transfer,
and teardown.
• In the setup phase, the source and destination use their global
addresses to help switches make table entries for the connection.
• In the teardown phase, the source and destination inform the
switches to delete the corresponding entry.
• Data transfer occurs between these two phases
Virtual-Circuit Networks
• Data-Transfer Phase
• To transfer a frame from a source to its destination, all switches need
to have a table entry for this virtual circuit.
Virtual-Circuit Networks
Setup Phase
• In the setup phase, the source and destination use their global addresses to help
switches make table entries for the connection
• In the setup phase, a switch creates an entry for a virtual circuit.
• For example, suppose source A needs to create a virtual circuit to B.
• Two steps are required: the setup request and the acknowledgment.
Setup Request
• A setup request frame is sent from the source to the destination.
Virtual-Circuit Networks
Acknowledgment
• A special frame, called the acknowledgment frame, completes the
entries in the switching tables
Virtual-Circuit Networks
• Teardown Phase
• In this phase, source A, after sending all frames to B, sends a special
frame called a teardown request.
• Destination B responds with a teardown confirmation frame.
• All switches delete the corresponding entry from their tables.
Virtual-Circuit Networks
• Efficiency
• Resource reservation in a virtual-circuit network can be made during the setup or can
be on demand during the data-transfer phase.
• In the first case, the delay for each packet is the same; in the second case, each packet
may encounter different delays.
• There is one big advantage in a virtual-circuit network even if resource allocation is on
demand.
• The source can check the availability of the resources, without actually reserving it.
• Consider a family that wants to dine at a restaurant.
• Although the restaurant may not accept reservations (allocation of the tables is on
demand), the family can call and find out the waiting time.
• This can save the family time and effort.
Virtual-Circuit Networks
• Delay in Virtual-Circuit Networks
Problem 1
A path in a digital circuit-switched network has a data rate of 1 Mbps. The exchange of
1000 bits is required for the setup and teardown phases. The distance between two
parties is 5000 km.
Answer the following questions if the propagation speed is 2 × 10^8 m:
a. What is the total delay if 1000 bits of data are exchanged during the data transfer
phase?
b. What is the total delay if 100,000 bits of data are exchanged during the data-
transfer phase?
c. What is the total delay if 1,000,000 bits of data are exchanged during the data-
transfer phase?
d. Find the delay per 1000 bits of data for each of the above cases and compare
them. What can you infer?
Solution 1:
• We assume that the setup phase is a two-way communication and the teardown phase is a one-
way communication. These two phases are common for all three cases.
• The delay for these two phases can be calculated as three propagation delays and three
transmission delays
• 3 [(5000 km)/ (2 ×10^8 m/s)]+ 3 [(1000 bits/1 Mbps)] = 75 ms + 3 ms = 78 ms
• We assume that the data transfer is in one direction; the total delay is then delay for setup and
teardown + propagation delay + transmission delay
a. 78 + 25 + 1 = 104 ms
b. 78 + 25 + 100 = 203 ms
c. 78 + 25 + 1000 = 1103 ms
d. In case a, we have 104 ms. In case b we have 203/100 = 2.03 ms. In case c, we have 1103/1000
= 1.101 ms. The ratio for case c is the smallest because we use one setup and teardown phase to
send more data.
Problem 2
Solution 2
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.
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
TRANSMISSION IMPAIRMENT
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.
• Variables P1 and P2 are the powers of a signal at points 1 and 2,
respectively
TRANSMISSION IMPAIRMENT
TRANSMISSION IMPAIRMENT
TRANSMISSION IMPAIRMENT
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.
TRANSMISSION IMPAIRMENT
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.
• These devices act as a sending antenna, and the transmission medium acts as the receiving
antenna.
• Crosstalk is the effect of one wire on the other.
• One wire acts as a sending antenna and the other as the receiving antenna.
• Impulse noise is a spike (a signal with high energy in a very short time) that comes from power
lines, lightning, and so on.
TRANSMISSION IMPAIRMENT
TRANSMISSION IMPAIRMENT
TRANSMISSION IMPAIRMENT
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:
one by Nyquist for a noiseless channel, another by Shannon for a
noisy channel.
DATA RATE
• Noiseless Channel: Nyquist Bit Rate
Note: Increasing the levels of a signal may reduce the reliability of the system.
DATA RATE
DATA RATE
DATA RATE
• Noisy Channel: Shannon Capacity
DATA RATE
DATA RATE
DATA RATE
DATA RATE
PERFORMANCE
Bandwidth
• Bandwidth in Hertz
• Bandwidth in hertz is the range of frequencies contained in a composite signal or
the range of frequencies a channel can pass.
• For example, we can say the bandwidth of a subscriber telephone line is 4 kHz.
• Bandwidth in Bits per Seconds
• Number of bits per second that a channel, a link, or even a network can transmit.
• For example, one can say the bandwidth of a Fast Ethernet network (or the links
in this network) is a maximum of 100 Mbps.
• This means that this network can send 100 Mbps.
PERFORMANCE
Relationship
• There is an explicit relationship between the bandwidth in hertz and
bandwidth in bits per second.
• Basically, an increase in bandwidth in hertz means an increase in
bandwidth in bits per second.
• Example:
• 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
PERFORMANCE
Throughput
• Measure of how fast we can actually send data through a network.
• Although, at first glance, bandwidth in bits per second and throughput seem the
same, they are different.
• A link may have a bandwidth of B bps, but we can only send T bps through this
link with T always less than B.
• In other words, the bandwidth is a potential measurement of a link; the
throughput is an actual measurement of how fast we can send data.
• 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.
PERFORMANCE
• 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.
PERFORMANCE
Latency (Delay)
• The latency or 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.
• Latency = propagation time + transmission time + queuing time +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.
• For example, in a vacuum, light is propagated with a speed of 3 × 108 m/s. It is lower in air; it is
much lower in cable.
PERFORMANCE
PERFORMANCE
Transmission Time
• In data communications we don’t send just 1 bit, we send a message
• The first bit leaves earlier; the last bit leaves later.
• The transmission time of a message depends on the size of the
message and the bandwidth of the channel.
• Transmission time = (Message size) / Bandwidth
PERFORMANCE
PERFORMANCE
PERFORMANCE
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
PERFORMANCE
Bandwidth-Delay Product
• Bandwidth and delay are two performance metrics of a link
• The bandwidth-delay product defines the maximum number of bits that can fill the link
PERFORMANCE
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.
Problem 1
Problem 1
Problem 2
Problem 2
Problem 3
Problem 3