Você está na página 1de 35

Computer Networks:

Switching and Queuing

Ivan Marsic
Rutgers University
Chapter 4 Switching and Queuing Delay Models

Switching and Queuing Delay


Models

Chapter 4

Topic:
Packet Switching in Routers
Router Architecture
Forwarding Table Lookup
Switching Fabric Design
How Queuing Happens

Why Routers?
(Recall Chapter 1)
Avoid needing direct link between all hosts
(totally connected graph)
Redundancy: If one path fails, find an
alternative path

Routing Delays
Source

Destination

Source

Router

Destination

transmission
time

propagation
time

Time

router
delay

detail

(a)
transmission
time (2nd link)

router
processing
time

(b)

Router Components

Input port

Output port

Input port

Output port

Network layer protocol

Network port
(bidirectional)

Link layer protocol

Switching
fabric

Link layer protocol

How Router Forwards Packets

Services to Incoming Packets


1

Receiving and storing packets

Forwarding decision for packets


2
3
Moving packets from input to output port

4
Transmission of packets

Distribution of Protocol Layers


Key:
L3 = End-to-End Layer
L2 = Network Layer
L1 = Link Layer

Network

L2
Router B

Router A

L3 L2 L1

End system

L1

L2
Router C

Note that router has a single (common) Network Layer protocol,


but each connection has a dedicate Link Layer protocol

End system

Forwarding Algorithms

Routing
function

Forwarding
algorithm

Unicast routing

Unicast routing
with Types of Service

Multicast routing

Longest prefix match


on destination address

Longest prefix match


on destination address
+ exact match on
Differentiated Services
field of IPv4 header

Longest match on
source address
+ exact match on
source address,
destination address,
and incoming interface

Router Architectures
CPU
packets

CPU

Memory

NFE
Processor

Memory

NFE
Processor

Line Card
#1

Line Card
#4

Line Card
#1

CPU
Memory

CPU
Memory

Line Card
#4

Line Card
#2

Line Card
#5

Line Card
#2

CPU
Memory

CPU
Memory

Line Card
#5

Line Card
#3

Line Card
#6

Line Card
#3

CPU
Memory

CPU
Memory

Line Card
#6

(a)

(b)

First generation router

Second generation router

CPU
Memory

packets

Line Card
#1

Fwd
Engine

Fwd
Engine

Line Card
#4

Line Card
#2

Fwd
Engine

Fwd
Engine

Line Card
#5

Line Card
#3

Fwd
Engine

Fwd
Engine

Line Card
#6

(c)

Third generation router

Switching via Memory / via Bus


Input port

CPU
Memory

Forwarding & Routing


processor

Network layer

Output port

First generation router

Link layer
Line card

Line card

packets

System bus

Input port

Output port

NFE processor

NFE processor

CPU
Memory

Network layer
Link layer

Routing processor

packets

Line card

Line card

Second generation router


System bus

Crossbar Switch Fabric


Input

N x N switching elements
allows N simultaneous packets
switched (in the best case
when all packets going to
different outputs)

Output

Goal: Reduce # Switching Elements


System bus (in 1st and 2nd generation archs)
allows only one packet switched at a time
Crossbar allows up to N packets switched at
a time
Something in the middle? (+cheaper!)

Banyan Switch Fabric


1
Packet
with tag 1

Input port
tag
0
1

Input port
tag

Output port
tag
0
1

(b)

(a)
8x8 Banyan has only 12
switching elements
(while 8x8 crossbar
requires 64)
But, much greater
likelihood of collisions

Input port
tag
000

Output port
tag

00

00

01

01

10

10

11

11

Output port
tag
000

001

001

010

010

011

011

100

100

101

101

110

110

111

111

Packet
with tag 100
100

(c)
Packet
with tag 001
001

Reducing Collisions
(Show slide with a collision example)
Collisions can be reduced if packets are
ordered on input ports by their output port
number
The router cannot choose the ordering of
arriving packets, but we can insert a sorting
hardware between the input network ports
and the switching fabric

Batcher Network
Comparator
Input
numbers

Output
numbers

Low

High

(b)

(a)
Input
list

7
4

3
4

5
2

5
6

6
1
7

Output
list

3
3

(c)

7
9

Batcher-Banyan Network

Batcher
sort
network

Trap
network

Shuffle
exchange
network

Banyan
network

Why Batcher-Banyan Network


Packets
with tags 1, 0, 0, 2
1
0
0
2

Empty input

Batcher sorter
0

0
1
0

0
0

1
2

Trap
network

Banyan network
0
0
1
1
2

This figure is meant to illustrate why a concentrator is needed,


because otherwise the gap in the input sequence will cause
collision in the Banyan, but the example does not work for a
4x4 network -- need an 8x8 network example!!!!

2
3

Topic:
Router Delays
& Queuing Models
Where & Why Queuing Happens
Littles Law
Queuing Models

M / M / 1, M / M / 1/ m, M / G / 1
Networks of Queues

Delay Components in Forwarding


Time

First bit received

Reception delay =
Input port

Fwd decision
queuing delay

t xI

Last bit received

Forwarding decision delay = tf


Fabric traversal
queuing delay
Switch fabric traversal delay = ts

Switch fabric
Transmission
queuing delay
Output port

First bit transmitted

Transmission delay =

t xO

Last bit transmitted

Road Intersection Analogy

Head of Line
Blocking

Where & Why Queuing Happens


At input ports, Head Of Line queuing
At output ports, if output link is too
narrow (low data rate) for incoming traffic
Inside switch fabric, if collision occurred

An Input-queued Switch

Input ports

Switch fabric

Arbiter

Output ports

General Service Model


Server

System

Arriving
customers

in

Departing
customers

Interarrival
time = A2 A1

out

Input
sequence

C1

C2

Ci
Time

A1
Output
sequence

C3

A2

A3

C1

Service
time = X1

Ai
C2

X2
Waiting
time = W 3

C3

X3

Ci

Xi

Simple Queuing Model

System

Arriving packets

Queue

Server

Queued packets

Serviced packet

Source
Source
Arrival rate
= packets per second

Service rate
= packets per second

Departing
packets

Delay Time
Total delay of customer i = Waiting + Service time
Ti = W i + Xi

Server
Service rate
Arrival rate
customers
unit of time

customers
unit of time

NQ
Customers in queue
Customer
in service
N
Customers in system

Why Queuing Happens?

C1

C2

C3

Arrival times sequence

Departure times sequence


Server

Time

C1

C2

C3

Time

Arrival Sequences

Sequence 1
0

(arrivals)

(departures)
t (s)

Server
Server

Service
delay
Sequence 3
0

t (s)
4

Queuing
delay
Sequence 4

t (s)
4

Sequence 2

t (s)
4

Cumulative
Number of arrivals, A(t)
Number of departures, B(t)

Birth and Death Processes

A(t)

T1
T2
N(t)

B(t)

Time

N(t)

Time

Littles Law
Average number of packets in the system =
arrival rate average time that packet
spends in the system
N=T
Problem
We would like to know more, such as what are
the probabilities of finding different number of
customers on arrival, etc.

Intuition for the Balance Principle

Room 0

Room n 1

Room n

Room n + 1

t(n+1 n)
t(n n+1)

t(n n+1) t(n+1 n) 1

See: Global Balance Equations

Transition Probability Diagram

n1

n1

M/G/1 Example
A2 = 9:30

A4 = 10:10

A1 = 9:05

(a)

A3 = 9:55

A6 = 11:05
A5 = 10:45

X1 = 30

X2 = 10

X3 = 75

X4 = 15

X5 = 20

X6 = 25

9:00 9:05

9:35

9:45

9:55

11:10

Customer 5
service time = 15 min
Customer 6
arrives at 11:05

(c)

Residual service time r()

(b)

11:45

Time

Customer 4
service time = 20 min
Server

Service time for customer 3


X3 = 75 min
75
Customer 6
arrives at 11:05
Time

5
9:55

11:25

11:10

Customers 4 and 5
waiting in queue
Ni = 2

Customer 3 in service;
Residual time = 5 min

Residual service time r()

Expected Residual Time

X1
Time
X1

X2

XM(t)

Você também pode gostar