2-Module 2-15-Feb-2021Material I 15-Feb-2021 Circuit and Packet Switching Datagram

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 51

Circuit and packet switching

By, J. Dheeba/SCOPE

J. Dheeba/SCOPE
Learning outcomes
• Familiarize with the switching concepts.
• Understand the working principle of different switching techniques

J. Dheeba/SCOPE
Switching
• Whenever we have multiple devices, we have the problem of how to
connect them to make one-to-one communication possible.
• 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.

J. Dheeba/SCOPE
• A switch is connected to a set of links and, for each of these links,
runs the appropriate data link protocol to communicate with the
node at the other end of the link.
• A switch’s primary job is to receive incoming packets on one of its
links and to transmit them on some other link.
• This process is called switching.

J. Dheeba/SCOPE
Switching in networking

J. Dheeba/SCOPE
Taxonomy of switched network

Switching

Circuit Switching Message Switching Packet Switching

Virtual circuit Datagram

J. Dheeba/SCOPE
Circuit switched network
• A connection between two stations is a dedicated path made of one
or more links.
• Each link is normally divided into n channels by using FDM or TDM

J. Dheeba/SCOPE
Setup Phase
a circuit (channel) is reserved on
each link, and the combination of
circuits or channels defines the
dedicated path
data-transfer phase
Tear down

J. Dheeba/SCOPE
• 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.
• These resources, such as channels (bandwidth in FDM and time slots in TDM),
switch buffers, switch processing time, and switch input/output ports, must
remain dedicated during the entire duration of data transfer until the
teardown phase.
• The data are a continuous flow sent by the source station and
received by the destination station, although there may be periods of
silence.

J. Dheeba/SCOPE
• At the physical layer, we can have only circuit switching
• At the data-link layer, we can have packet switching. However, the
term packet in this case means frames or cells.
• At the network layer, we can have packet switching. In this case,
either a virtual-circuit approach or a datagram approach can be used.
• At the application layer, we can have only message switching. The
communication at the application layer occurs by exchanging
messages.

J. Dheeba/SCOPE
J. Dheeba/SCOPE
• Efficiency
• resources are allocated during the entire duration of the connection
• These resources are unavailable to other connections.
• In a telephone network, people normally terminate the communication when
they have finished their conversation.
• However, in computer networks, a computer can be connected to another
computer even if there is no activity for a long time.
• In this case, allowing resources to be dedicated means that other connections
are deprived.

J. Dheeba/SCOPE
• Delay
• 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

J. Dheeba/SCOPE
Packet switching
• If the message is going to pass through a packet-switched network, it
needs to be divided into packets of fixed or variable size.

3 MB

Packets
1 MB 1 MB 1 MB

• In packet switching, there is no resource allocation for a packet


J. Dheeba/SCOPE
• there is no reserved bandwidth on the links.
• Resources are allocated on demand
• allocation is done on a first come, first-served basis
• Each packet will have a source and destination IP address
with sequence number.
• Sequence number helps in ; reordering the packet, find
out the missing packets and send acknowledgements

J. Dheeba/SCOPE
• Two approaches for packet switching
• Datagram approach
• Virtual circuit networks

J. Dheeba/SCOPE
Datagram approach
• each packet is treated independently of all others.
• Packets in this approach are referred to as datagrams
• Datagrams contains destination information and the intermediate
devices use this information to forward the data packet to the correct
destination
1 2 3 4
Source
A

Destination
B

C
J. Dheeba/SCOPE
Datagram approach
• each packet is treated independently of all others.
• Packets in this approach are referred to as datagrams
• Datagrams contains destination information and the intermediate
devices use this information to forward the data packet to the correct
destination
Source
A
4 3
2 1
D

Destination
B

C
J. Dheeba/SCOPE
Datagram approach
• each packet is treated independently of all others.
• Packets in this approach are referred to as datagrams
• Datagrams contains destination information and the intermediate
devices use this information to forward the data packet to the correct
destination
Source
A
4 3
2 1
D

Destination
B

C
J. Dheeba/SCOPE
Datagram approach
• each packet is treated independently of all others.
• Packets in this approach are referred to as datagrams
• Datagrams contains destination information and the intermediate
devices use this information to forward the data packet to the correct
destination
Source
A

1 D
4 3

Destination
B
2
C
J. Dheeba/SCOPE
Datagram approach
• each packet is treated independently of all others.
• Packets in this approach are referred to as datagrams
• Datagrams contains destination information and the intermediate
devices use this information to forward the data packet to the correct
destination
Source
A
3
D
1

Destination
B
4
C 2
J. Dheeba/SCOPE
Datagram approach
• each packet is treated independently of all others.
• Packets in this approach are referred to as datagrams
• Datagrams contains destination information and the intermediate
devices use this information to forward the data packet to the correct
destination
Source
A

3 D

1
Destination
B
2
C 4
J. Dheeba/SCOPE
Datagram approach
• each packet is treated independently of all others.
• Packets in this approach are referred to as datagrams
• Datagrams contains destination information and the intermediate
devices use this information to forward the data packet to the correct
destination
Source
A

4 1 2 3 D

Destination
B

C
J. Dheeba/SCOPE
Datagram approach
• each packet is treated independently of all others.
• Packets in this approach are referred to as datagrams
• Datagrams contains destination information and the intermediate
devices use this information to forward the data packet to the correct
destination
Source
A

4 3 2 1 D

Destination
B

C
J. Dheeba/SCOPE
Datagram approach
• each packet is treated independently of all others.
• Packets in this approach are referred to as datagrams
• Datagrams contains destination information and the intermediate
devices use this information to forward the data packet to the correct
destination
Source
A

4 3 2 1 D

Destination
B

C
J. Dheeba/SCOPE
• 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
• datagram networks are sometimes referred to as connectionless
networks
• connectionless here means that the switch (packet switch) does not
keep information about the connection state.
• There are no setup or teardown phases.

J. Dheeba/SCOPE
• Routing Table (forwarding table)
• how are the packets routed to their destinations in a datagram network?
• In this type of network, each switch (or packet switch) has a routing table
which is based on the destination address
Destination address Output Port

• The routing tables are dynamic and are updated periodically.


• This is different from the table of a circuit switched network (discussed later)
in which each entry is created when the setup phase is completed and
deleted when the teardown phase is over

J. Dheeba/SCOPE
• Example, for the given network the forwarding table or the routing
table is as follows,

Forwarding table/routing table for Switch 2

Destination Port
A 3
B 0
C 3
D 3
E 2
F 1
G 1
H 2

J. Dheeba/SCOPE
• Destination Address
• Every packet in a datagram network carries a header that contains,
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

J. Dheeba/SCOPE
• Efficiency
• 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.

J. Dheeba/SCOPE
• 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.

J. Dheeba/SCOPE
• Consider two terminals A and B connected in the network with a help
of router Transmission Delay in a link
Link capacity or the data rate is R bits/sec

R Bits/sec

T = L/R sec

A B

L Length of the message is L bits Total time to send this L bits in


a link is L/R sec
J. Dheeba/SCOPE
Calculating transmission delay in network
• Suppose that a user at one end of Canada sends a 1-Mbit file to a
remote server on the other end over a data link operating at 64
kbps.

J. Dheeba/SCOPE
• Note: Bit rate
• In computer networks, the bit rate of the physical layer is always
expressed in bits per second.
• Conversions
Bit rate Bits per second
1 Kbps 103
1 Mbps 106
1 Gbps 109
1 Tbps 1012

J. Dheeba/SCOPE
Virtual circuit approach
• referred to as a connection-oriented model, requires setting up a virtual
connection from the source host to the destination host before any data is
sent.
• A pre-planned route is set before the messages are sent. Route is decided
using virtual circuit identifier
• Path is fixed for the duration of a logical connection
• connection setup phase, it is necessary to establish a “connection state” in
each of the switches between the source and destination hosts.
• All packets travel in the same path as in circuit switching network.
• It is implemented at the data link layer
• Connection state is an entry in virtual circuit table
J. Dheeba/SCOPE
• Virtual table
• virtual circuit identifier (VCI) – unique identifier which carries the connection
of the switch. (local address)
• incoming interface
• outgoing interface

J. Dheeba/SCOPE
• Sending data between host A and host B.
• manually create a new virtual connection between host A and host B
• First the administrator identifies a path through the network from A
to B
• Administrator will pick a VCI value which is currently not used in the
link

J. Dheeba/SCOPE
VC table Switch 1 Table
• For our example, Suppose the VCI value 5
Incoming Incoming Outgoing Outgoing
is chosen for the link from host A to
interface VCI interface VCI
switch 1
2 5 1 11
• 11 is chosen for the link from switch 1 to
switch 2
VC table Switch 2 Table
• 7 is chosen for the link from switch 2 to
switch 3

VC table Switch 3 Table

4
J. Dheeba/SCOPE
• Example, for the given network the forwarding table or the routing
table is as follows,

Forwarding table/routing table for Switch 2

Destination Port
A 3
B 0
C 3
D 3
E 2
F 1
G 0
H 0

J. Dheeba/SCOPE
• The following figure shows a routing table of a switch.

Find the output port for packets with the following destination
addresses:
Packet 1: 7176 Packet 2: 1233 Packet 3: 8766 Packet 4: 9144

J. Dheeba/SCOPE
Solution:
Packet 1: 2
Packet 2: 3
Packet 3: 3
Packet 4: 2

J. Dheeba/SCOPE
Performance
• Bandwidth
• bandwidth in hertz (4kHz)
• bandwidth in bits per second. (100Mbps – means that the network can
transmit 100 megabits in one second)
• Throughput
• measure of how fast we can actually send data through a network
• 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 (T is the actual measurement )
• Delay
• 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

J. Dheeba/SCOPE
• Throughput
Bandwidth - 10 Mbps

• The network has the capability of passing 12,000 frame per minute each
frame carrying 10,000 bits. What is the throughput of the network

1 frame = 10,000 bits


12,000 frames = 12,000 x 10,000 bits

Throughput = 12,000 x 10,000 bits


60

= 2,000,000 bps = 2 Mbps

J. Dheeba/SCOPE
• Delay (latency)
• four types of delay that contribute to overall delay
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.

Propagation time depends on distance and speed.

Propagation delay = distance (m) / speed (m/sec)

J. Dheeba/SCOPE
• What is the propagation time if the distance between the two points
is 12,000 km? Assume the propagation speed to be 2.4 × 108 m/s in
cable.

• Solution
Propagation delay = distance (m) / speed (m/sec)
= 12,000 km / 2.4 x 108
= 12,000 x 1000 / 2.4 x 108

J. Dheeba/SCOPE
Transmission time

• Consider two terminals A and B connected in the network with a help


of router Transmission Delay in a link
Link capacity or the data rate is R bits/sec

R Bits/sec

T = L/R sec

A B

L Length of the message is L bits Total time to send this L bits in


a link is L/R sec
J. Dheeba/SCOPE
• Queueing Delay: time spent waiting in a queue at any point along the
route

<= 5 Mbps 5 Mbps

A B

J. Dheeba/SCOPE
• Queueing Delay: time spent waiting in a queue at any point along the
route
P3 P2

10 Mbps P1

5 Mbps

A B

Processing Delay: time required to process a packet


J. Dheeba/SCOPE
• Bandwidth-Delay Product
• bandwidth-delay product defines the number of bits that can fill the link.
• How many bits can fit on a link with a 2 ms delay if the bandwidth of
the link 1 Mbps

No. of bits = Bandwidth x delay


= 1 Mbps x 2ms
= 12,000 bits

J. Dheeba/SCOPE
What is the length of a bit in a channel with a propagation speed of 2 x
108 m/s if the channel bandwidth is
a. 1 Mbps?
b. 10 Mbps?
c. 100 Mbps?

(bit length) = (propagation speed) × (bit duration)


Bit duration = 1/bandwidth

J. Dheeba/SCOPE
• Practice problems for this chapter is given in teams

• Thank you.

J. Dheeba/SCOPE

You might also like