0% found this document useful (0 votes)
48 views47 pages

L4 - Switching

Chapter 4 - Switching

Uploaded by

Mohi Gpt4
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views47 pages

L4 - Switching

Chapter 4 - Switching

Uploaded by

Mohi Gpt4
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 47

Networking & Communication I

El Mehdi Amhoud
College of Computing
Mohammed VI Polytechnic University
College of
Computing

Pr. Amhoud
The network core
• Mesh of interconnected routers mobile network
national or global ISP

• packet-switching: hosts break application-


layer messages into packets
College of
local or
Computing
• network forwards packets from one router regional ISP
Pr. Amhoud
to the next, across links on path from home network content
source to destination provider
network datacenter
network

enterprise
network
routing College of
Computing

Pr. Amhoud
forwarding
forwarding
College of
Computing

Pr. Amhoud
Introduction
• Switching methods are used in LAN networks
Mesh : Direct point to point
Star : central controller
Bus: multipoint configuration
Ring: circular configuration
• Previous configurations are not adapted to larger networks
College of
Computing

Pr. Amhoud

• Switches create a temporary connection between 2


or more hosts
• A Switched Network is a set of interlinked nodes

5
Introduction : Switching at different layers
• Switching at the Physical layer
• Only circuit switching

• Switching at the Data-Link layer


• Packet switching (packets here are frames)
• Virtual circuit switching
College of
Computing
• Switching at the Network layer
Pr. Amhoud
• Packet switching (datagram switching)
• Virtual circuit switching

• Switching at the Application layer


• Message switching, e.g. email

6
Introduction & Outline

Switch based
networks

Circuit switched Packet switched Message


College of switched
Computing
networks networks networks
Pr. Amhoud

Datagram Virtual circuit


networks networks

7
Circuit-switched networks
• Set of switches connected by physical links (cables)
• Circuit switching is done at the physical layer
• A connection between 2 switches can have 1 or more links

• Each link can be divided to N FDM (Frequency division multiplexing) or TDM (time division
multiplexing) channels
College of
• Each connection uses only one dedicated channel on each link Computing

Pr. Amhoud

• 3 Transmission phases:
Setup phase
Data transfer
Teardown phase

8
Circuit-switched networks

College of
Computing

Pr. Amhoud

• Without FDM / TDM • With FDM / TDM


1 physical link 1 physical link that supports N channels

9
Circuit switched networks : Transmission phases
Setup phase:
• A dedicated link needs to be established
• Host A makes a request of connection to host B Host A
• Request must be accepted by all switches between A & B
• Each switch finds the dedicated channel to the next switch
• An Acknowledgment is sent from B to A in opposite direction and resources
(links & channels) are booked for this communication College of1
Computing 2
• Transfer can start Pr. Amhoud
• Example: Telephone

Data transfer: 3
Data is not packetized, continuous flow
Teardown phase:
A or B can teardown the communication Host B
Signal is sent to all switches to release resources
10
Circuit switched networks : Performance
Example 1: Circuit switched network using a 4 × 4 switch

College of
Computing

Pr. Amhoud

Is the link with or without FDM ?

Which stations cannot communicate ?

11
Circuit switched networks : Performance
Example 2: Circuit switched network using a 4 × 8 switch

College of
Computing

Pr. Amhoud

12
Circuit switched networks : Performance
Efficiency:
• Low efficiency: Resource allocated during the entire communication
• Telephone: Resources released after finishing communication
• Computers can be connected without an activity

Delay:
College of
Allocated resources : Assume there is No delay during data Computing
transfer at switches, Pr. Amhoud
what is the total delay for a circuit switched communication ?

Total delay = time for communication establishment


+ transfer time + time for teardown

13
Structure of a circuit switch
Circuit switches:
• Crossbar switch: Connects N inputs to M outputs in a grid ( using electronic transistors )
N × M crosspoints are required (example: N=M=1000, 1 million crosspoint)
Impractical and complex
Loss of material ( in practice , not all users use resources at same time. Example : telephone)

College of
Computing

Pr. Amhoud

3x4 switch

6x6 switch

14
Structure of a circuit switch
• Multistage switch: Combines the crossbar switch in 3 stages

n
n
n×k k×n
N/n × N/n
⋮ ⋮ ⋮
N n College of
Computing

n Pr. Amhoud
n

n×k k×n
N × N switch N/n × N/n
1st stage 2nd stage 3rd stage
with N /n with 𝐤 with N /n
Total number of cross-points ? crossbars crossbars crossbars

𝑁 N N 𝑁 𝑁
n×k +k × + n × k = 2𝑘𝑁 + 𝑘( )2
𝑛 n n 𝑛 𝑛
15
Packet switched networks

• Transmitted data is sent in small packets (datagrams)


• Packet switching is connectionless: no reserved bandwidth or links, no scheduled processing time
for arriving packets
• Packet switching is done at the network layer (can be done also at the data link layer)

College of
• At Switch/Router: Computing
First packet arrived is first served Pr. Amhoud
No scheduled processing time
Each packet is processes independently from others
❑ Delay / Loss can occur

16
Packet switched networks

Example: Datagram network 4 1


• The 4 packets use different paths
• Links might be busy
• Arrival can be out of order
• Different transmission time
• Packets dropped: retransmission College of
Computing
• Reordering done by upper layers
router Pr. Amhoud
• Connectionless : no setup, no teardown phases 4 1

17
Packet switched networks : Performance

• Every packet contains a header that has the destination address Destination Output port
address
• The destination address remains the same during transmission
1000 2
Efficiency:
1500 1
• Better than circuit switched networks
2000 3
• Resources allocated only when there are packets to transmit
…. College of
….
• If there is a delay between 2 packets, then this delay can be used to Computing
transmit packets from other messages
Pr. Amhoud
2
1
3
4

18
Packet switched networks : Performance

Example:
Host-A Host-B

Transmission
time
Waiting Total
time delay
College of
Computing

Pr. Amhoud

Delay:
Delay is not uniform for all packets
TOTAL DELAY : 3 d𝑡𝑟ans +3 d𝑝rop + W1 +W2
Waiting time at a router before forwarding
𝑑𝑡𝑟 : transmission time
Find total delay when 2 routers are involved ??
𝑑𝑝rop : propagation delay
Wi: waiting time at router i
19
Packet-switching: store-and-forward

L bits
per packet
3 2 1
source destination
R bps R bps

• packet transmission delay: takes L/R seconds to transmit (push out) L- College of
bit packet into link at R bps Computing

• store and forward: entire packet must arrive at router before it can be Pr. Amhoud
transmitted on next link One-hop numerical example:
▪ L = 10 Kbits
▪ R = 100 Mbps
▪ one-hop transmission delay = 0.1
msec

20
Packet-switching: store-and-forward

L bits
per packet
3 2 1
source destination
R bps R bps

• packet transmission delay: takes L/R seconds to transmit (push out) L- College of
bit packet into link at R bps Computing

• store and forward: entire packet must arrive at router before it can be Pr. Amhoud
transmitted on next link

Exercise:
1. End-to-end transmission time of 1 packet ? Solution:
2. End-to-end transmission time of all the 3 packets ? 1. 2L/R
3. End-to-end transmission time for 1 packet over a path made of N links ? 2. 4L/R

21
Packet-switching: queueing

R = 100 Mb/s
A C

D
B R = 15 Mb/s
E
queue of packets
Queueing in real life? waiting for transmission College of
over output link Computing
Cause ?
Queueing occurs when work arrives faster than it can be serviced:Pr. Amhoud

22
Packet-switching: queueing

R = 100 Mb/s
A C

D
B R = 15 Mb/s
loss in real life?
E
queue of packets
waiting for transmission College of
over output link Computing

Pr. Amhoud

Packet queuing and loss: if arrival rate (in bps) to link exceeds transmission rate (bps) of link for some
period of time:
• packets will queue, waiting to be transmitted on output link
• packets can be dropped (lost) if memory (buffer) in router fills up

23
How do packet delay and loss occur?
▪ packets queue in router buffers, waiting for turn for transmission
▪ queue length grows when arrival rate to link (temporarily) exceeds output link capacity
▪ packet loss occurs when memory to hold queued packets fills up

packet being transmitted (transmission delay) College of


Computing

Pr. Amhoud
A

B
packets in buffers (queueing delay)
free (available) buffers: arriving packets
dropped (loss) if no free buffers
24
Packet delay: four sources
transmission
A propagation

B Processing
Queueing
College of
dTotal = dprocess + dqueue + dtrans + dprop Computing

Pr. Amhoud

dprocess: processing delay dqueue: queueing delay


▪ check bit errors ▪ time waiting at output link for transmission
▪ determine output link ▪ depends on congestion level of router
▪ typically < microsecs ▪ typically ~ micro to milliseconds

25
Packet delay: four sources
transmission
A propagation

B processing
queueing
College of
dTotal = dprocess + dqueue + dtrans + dprop Computing

Pr. Amhoud

dtrans: transmission delay: dprop: propagation delay:


▪ L: packet length (bits) ▪ d: length of physical link
▪ R: link transmission rate (bps) ▪ s: propagation speed (~2x108 m/sec)
▪ dtrans = L/R ▪ dprop = d/s
dtrans and dprop
very different
26
Caravan analogy

100 km 100 km

ten-car caravan toll booth toll booth toll booth


(aka 10-bit packet) (aka link)

▪ car ~ bit; caravan ~ packet; toll service ~ link ▪ time to “push” entire caravan
College of through toll
transmission booth onto highway =?
Computing

▪ toll booth takes 12 sec to service car (bit Pr. Amhoud


✓ (10 cars)/(5 cars/minute) 2 mins
transmission time)
▪ “propagate” at 100 km/hr ▪ time for last car to propagate from 1st to 2nd toll
both:
▪ Q: How long until caravan is lined up before
✓ 100km/(100km/hr) = 1 hr
2nd toll booth?
✓ A: 62 minutes

27
Caravan analogy

100 km 100 km

ten-car caravan toll booth toll booth


(aka 10-bit packet) (aka router)

College of
▪ suppose cars now “propagate” at 1000 km/hr Computing
▪ and suppose toll booth now takes one min to service a car Pr. Amhoud

▪ Q: Will cars arrive to 2nd booth before all cars serviced at first booth?

A: Yes! after 7 min, first car arrives at second booth; three cars still at first booth

28
Packet queueing delay

▪ a: average packet arrival rate

average queueing delay


▪ L: packet length (bits)
▪ R: link bandwidth (bit transmission rate)

L .a arrival rate of bits “traffic


: College of
R service rate of bits intensity” Computing
traffic intensity = La/R 1
Pr. Amhoud

▪ La/R ~ 0: avg. queueing delay small La/R ~ 0


▪ La/R -> 1: avg. queueing delay large
▪ La/R > 1: more “work” arriving is more than can be
serviced - average delay infinite!

La/R -> 1 29
Packet loss

▪ queue (aka buffer) preceding link in buffer has finite capacity


▪ packet arriving to full queue dropped (aka lost)
▪ lost packet may be retransmitted by previous node, by source end system, or not at all

College of
buffer Computing
(waiting area) packet being transmitted
A Pr. Amhoud

B
packet arriving to
full buffer is lost

30
Throughput

▪ throughput: rate (bits/time unit) at which bits are being sent from sender to receiver
• instantaneous: rate at given point in time
• average: rate over longer period of time

College of
Computing

Pr. Amhoud

link
pipecapacity
that can carry link that
pipe capacity
can carry
server sends bits
fluid at rate
Rs bits/sec Rfluid at rate
c(Rbits/sec
(fluid) into pipe
(Rs bits/sec) c bits/sec)

31
Throughput

Rs < Rc What is average end-end throughput?

Rs bits/sec Rc bits/sec

Rs > Rc What is average end-end throughput? College of


Computing

Pr. Amhoud

Rs bits/sec Rc bits/sec

bottleneck link
link on end-end path that constrains end-end throughput
32
Throughput: network scenario

▪ 3 types of links : Client / server / shared


Rs
▪ per-connection end-end throughput:
Rs Rs min(Rc,Rs,R/10)

▪ In practice: Rc or Rs is often the bottleneck


R College of
Computing
▪ The Link Utilization is :
Pr. Amhoud
Rc Rc Botttleneck
Link Throughput
Rc

10 connections (fairly) share backbone


bottleneck link R bits/sec
33
Virtual circuit networks
• Intersection between Packet and circuit switching

• Three phases of data transfer

• Resources can be allocated during the setup ( circuit ) or on demand ( packet )

• Data is packetized into packets with local headers College of


Computing

• All packets follow the same path ( circuit ) Pr. Amhoud

• Implementation is done at the data link layer

• Global and local addressing are involved

34
Virtual circuit networks

Global addressing: is a unique address known from the whole network

Virtual circuit identifier (VCI): small number used at the switch level
The VCI of a frame changes after each Switch

College of
Computing

Pr. Amhoud
Input Output
data 10 data 20 2 data 5
1 Port VCI Port VCI
1 20 2 5
1 10 3 50
3 data 50

35
Virtual circuit networks
S3
Input Output
Setup phase: Port VCI Port VCI
host A sends a request to destination B and waits for an 2 20 3 -
Ack

S1 receives the demand from host 1 A


S1 assigns Port-1, input VCI and output port 3
S1 S3
S1 forward to port 3, so S2 does the same 1 2 College of
Computing 3 B
Table of S2 ?
Pr. Amhoud
VCI=70
3 2
Same for S3, table of S3 ? S2
Host B receives the demand packet and assigns a VCI for 1 2
frames coming from host A (VCI 70)
B send an ACK back to host A, S3, S2, S1 then completes
the VCI in their tables S2
S1
Input Output Input Output
Port VCI Port VCI Port VCI Port VCI
1 20 3 - 1 50 2 -
36
Virtual circuit networks
S3
Input Output
Port VCI Port VCI
Acknowledgment step:
2 20 3 70

• host B sends an ACK to S3


• S3 sends the ACK to S2 A
• S2 sends the ACK to S1 S1 S3
• S1 sends the ACK to host A with input VCI 1 2 College of
Computing 3 B
3 Pr. Amhoud 2 VCI=70
S2
50 20
1 2

S1 S2
Input Output Input Output
Port VCI Port VCI Port VCI Port VCI
1 20 3 50 1 50 2 20
37
Virtual circuit networks

Transmission phase :
All switches use their table to forward packets from A to B A
S1 S3
Teardown phase : 1 2
3 B
Host A sends a special message called teardown request VCI=70
3 2
Host B sends a teardown confirmation, and all switches S2
delete their tables. 2
1 College of
Computing

Efficiency : Pr. Amhoud


When resources are reserved in advance : same as circuit
switching
On-demand resources is possible : same as packet switching ,
so different delays.

Delay :
transmission time , propagation time, setup, teardown

38
Application 1: throughput

• What is the maximum throughput achievable between sender and receiver in the scenario shown
below?

College of
Computing

1.5 Mbps Pr. Amhoud

39
Application 1b: end-to-end throughput

1. What is the maximum achievable end-end throughput (in


Mbps) for each of four client-to-server pairs, assuming that
the middle link is fairly shared (divides its transmission rate
equally)?
2. Which link is the bottleneck link? Format as Rc, Rs, or R
3. Assuming that the servers are sending at the maximum rate College of
possible, what are the link utilizations for the server links Computing
(RS)? Answer as a decimal
Pr. Amhoud
4. Assuming that the servers are sending at the maximum rate
possible, what are the link utilizations for the client links
(RC)? Answer as a decimal
5. Assuming that the servers are sending at the maximum rate
possible, what is the link utilizations for the shared link (R)?
Answer as a decimal

40
Application 1b: end-to-end throughput

1. What is the maximum achievable end-end throughput (in


Mbps) for each of four client-to-server pairs, assuming that
the middle link is fairly shared (divides its transmission rate
equally)? 30
2. Which link is the bottleneck link? Format as Rc, Rs, or R Rs
3. Assuming that the servers are sending at the maximum rate College of
possible, what are the link utilizations for the server links Computing
(RS)? Answer as a decimal 1 Pr. Amhoud
4. Assuming that the servers are sending at the maximum rate
possible, what are the link utilizations for the client links
(RC)? Answer as a decimal 0.38
5. Assuming that the servers are sending at the maximum rate
possible, what is the link utilizations for the shared link (R)?
Answer as a decimal 0.4

41
Application 2: end-to-end delay

1. What is the transmission delay of link 1?


2. What is the propagation delay of link 1?
3. What is the total delay of link 1?
4. What is the transmission delay of link 2?
College of
5. What is the propagation delay of link 2? Computing
6. What is the total delay of link 2? Pr. Amhoud

7. What is the transmission delay of link 3?


8. What is the propagation delay of link 3?
9. What is the total delay of link 3?
10. What is the total delay?

42
Application 2: end-to-end delay

1. What is the transmission delay of link 1? 0.00016


2. What is the propagation delay of link 1? 6.67E-6
3. What is the total delay of link 1? 0.00017
4. What is the transmission delay of link 2? 0.0016
College of
5. What is the propagation delay of link 2? 0.017
Computing
6. What is the total delay of link 2? 0.018 Pr. Amhoud

7. What is the transmission delay of link 3? 1.60E-5


8. What is the propagation delay of link 3? 1.00E-5
9. What is the total delay of link 3? 2.60E-5
10. What is the total delay? 0.018

43
Application 3: Circuit switching
• Consider the circuit-switched network shown in the figure
below, with circuit switches A, B, C, and D. The number of
circuits between each two switches is shown in the figure

1. What is the maximum number of connections that can be ongoing in the


network at any one time?
2. Suppose that these maximum number of connections are all ongoing. What
College of
happens when another call connection request arrives to the network, will it Computing
be accepted? Answer Yes or No
Pr. Amhoud
3. Suppose that every connection requires 2 consecutive hops, and calls are
connected clockwise. For example, a connection can go from A to C, from B
to D, from C to A, and from D to B. With these constraints, what is the
maximum number of connections that can be ongoing in the network at any
one time?
4. Suppose that 15 connections are needed from A to C, and 16 connections
are needed from B to D. Can we route these calls through the four links to
accommodate all 31 connections? Answer Yes or No

Introduction: 1-44
Application 3: Circuit switching
• Consider the circuit-switched network shown in the figure
below, with circuit switches A, B, C, and D. The number of
circuits between each two switches is shown in the figure

1. What is the maximum number of connections that can be ongoing in the


network at any one time? 58
2. Suppose that these maximum number of connections are all ongoing. What
College of
happens when another call connection request arrives to the network, will it Computing
be accepted? Answer Yes or No No
Pr. Amhoud
3. Suppose that every connection requires 2 consecutive hops, and calls are
connected clockwise. For example, a connection can go from A to C, from B
to D, from C to A, and from D to B. With these constraints, what is the is the
maximum number of connections that can be ongoing in the network at any
one time? 28
4. Suppose that 15 connections are needed from A to C, and 16 connections
are needed from B to D. Can we route these calls through the four links to
accommodate all 31 connections? Answer Yes or No No

Introduction: 1-45
Application exercises
Circuit switching:

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 × 108 m/s:

a. What is the total delay if 1000 bits of data are exchanged during the data-transfer phase?
College of
b. What is the total delay if 100,000 bits of data are exchanged during the data-transfer Computing
phase?
Pr. Amhoud
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?

46
Application exercises
VCI vs Routing table

1. Can a routing table in a datagram network have two entries with the same destination address? Explain.

2. Can a switching table in a virtual-circuit network have two entries with :


With the same input port number?
With the same output port number?
With the same incoming VCIs? College of
Computing
With the same outgoing VCIs?
With the same incoming values (port, VCI)? Pr. Amhoud

With the same outgoing values (port, VCI)?

47

You might also like