0% found this document useful (0 votes)
144 views

CN2-01-Network Layer - 1

The document discusses computer networks and the network layer. It describes that the network layer is responsible for delivering packets from the source host to the destination host, possibly across multiple networks. It discusses key tasks of the network layer like logical addressing and routing. It also covers different design issues of the network layer like store-and-forward packet switching, connectionless and connection-oriented services, and routing algorithms.

Uploaded by

priyanshu kumari
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)
144 views

CN2-01-Network Layer - 1

The document discusses computer networks and the network layer. It describes that the network layer is responsible for delivering packets from the source host to the destination host, possibly across multiple networks. It discusses key tasks of the network layer like logical addressing and routing. It also covers different design issues of the network layer like store-and-forward packet switching, connectionless and connection-oriented services, and routing algorithms.

Uploaded by

priyanshu kumari
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/ 270

COMPUTER NETWORKS

( 12CS63 )

19.01.2016 12:04 1
You never really learn much
from hearing yourself talk

George Clooney

19.01.2016 12:04 2
Real listening is
a willingness to
let the other person
change you

Alan Alda
19.01.2016 12:04 3
I hear and I forget

I see and I remember

I do and I understand
Confucius
19.01.2016 12:04 Confucius 4
Let us

together

19.01.2016 12:04 Confucius 5


Computer Networks
Organization of Network layers
seven layers, belonging to three subgroups :
• layers 1, 2, 3 : network support layers
(hardware + software)
• layer 4 : transport layer(software)
• layers 5, 6, 7 : user support layers (software)

layers 1, 2, 3 :
deal with moving data from one device to
another ….
electrical specs, physical connections,
physical
19.01.2016 12:04
addressing, timing, reliability 6
Computer Networks
Organization of the Network layers
layer 4 :
links the two subgroups viz. network
support and user support layers
ensures that lower layers transmit
entities in a form that the upper layers
can make use of
layers 5, 6, 7 :
allow interoperability among unrelated
software systems
19.01.2016 12:04 7
Computer Networks
Network layer
responsible for delivery from source host
to destination host
handles delivery of packet from its point-
of-origin to its final destination possibly
across multiple networks

19.01.2016 12:04 8
Computer Networks
Network layer
source to destination delivery

19.01.2016 12:04 9
Computer Networks
Network layer
Tasks of network layer

• logical addressing :
including logical addresses of the
sender and receiver

• routing :
sending packets to their final destination
through intermediate networks
19.01.2016 12:04 10
Computer Networks
Network Layer
Topics to be discussed:
• network layer design issues

• routing algorithms

• congestion control algorithms

• quality of service
19.01.2016 12:04 11
Computer Networks
Network Layer
Goal
end-to-end transport of packets from source
node all the way to destination node
(compare with data link layer)

may require transfer through many sets of


intermediate routers ( multiple hops ), in
communication subnets

is the lowest layer that deals with end-to-


end transport
19.01.2016 12:04 12
Computer Networks
Network Layer
How
transport of packets is achieved through:
• knowledge of subnets (set of all routers)

• choice of appropriate paths

• choice of paths also to take care of


balancing the load on links / routers

19.01.2016 12:04 13
Computer Networks
Network Layer
Design issues :
 services provided to the transport layer
 internal design of the subnet

• store-and-forward packet switching


• services provided to the transport layer
• connection-less service
• connection-oriented service
• comparison of datagram and virtual-
circuit subnets
19.01.2016 12:04 14
Computer Networks
Network Layer
Design issues
Store-and-Forward Packet switching

1 routers + links receive, store,


verify checksum, forward

2 transmit 2
Customers’ Link
Customers’
equipment equipment
leased service leased
line provider line

__

19.01.2016 12:04 Environment of network layer protocols 15


Computer Networks
Network Layer
Design issues
Services provided to the transport layer
NL provides services to the TL at the
NL-TL interface

NL services are designed to cater to :


• services should be independent of
router technology
• TL should be shielded from the number /
type / topology of routers in the subnet
19.01.2016 12:04 16
Computer Networks
Network Layer
Design issues
Services provided to the transport layer

NL services are designed to cater to :

• network addresses made available to


TL should use a uniform numbering
plan, even across LANs and WANs

connection-less service vs. connection-oriented service


19.01.2016 12:04 17
Computer Networks
Network Layer

Connectionless Service (Ex. the Internet)


packets moved to the subnet individually
and routed independent of each other
no advance set up is needed
each packet must carry the full destination
address
in this context, packets are called datagrams
and the subnet is called datagram subnet

19.01.2016 12:04 18
Computer Networks
Network Layer

Connection-oriented Service (Ex. ATM)


path from source to destination is
established before sending data packets -
called Virtual Circuit or VC

subnet is called VC subnet

19.01.2016 12:04 19
Computer Networks
Network Layer
Connection - oriented Service
A virtual circuit :
• is a circuit or path between points in a
network
• appears to be a discrete, physical path,
but …..
• is actually a managed pool of circuit
resources from which …..
• specific circuits are allocated, as
needed,
19.01.2016 12:04
to meet traffic requirements 20
Computer Networks
Network Layer
Connectionless Service
Datagram subnet

assume that message


is 4 times longer than Router tables
maximum packet size
• destination
network layer has to • outgoing line
break it into 4 packets
1, 2, 3, 4
19.01.2016 12:04 21
Computer Networks
Network Layer
process P1 in host H1 is required to send
a long message to P2 in H2
every router has an internal table with
table entries : (a) destination (b) outgoing
line for that destination
packets 1, 2, 3 from H1 arrive at A, are stored
(for error checking) at A before forwarding
packets from A arrive at F thro C and E,
are encapsulated in a DLL frame and sent
to H2 on LAN
19.01.2016 12:04 22
Computer Networks
Network Layer
packet 4 arriving at A may need to be
treated differently, and sent to F through,
say, path BDE
for this to happen, A takes a decision
based on some analysis, updates its
tables and sends the packet
Routing algorithm is required to
(a) manage tables
(b) take decisions
19.01.2016 12:04 23
Computer Networks
Network Layer
Connection - oriented Service
virtual circuit (VC) subnet is needed
choosing a new route for every packet
sent is avoided
when a connection is established, …
a route from source host to destination
host is chosen
this is done as part of connection setup
connection details are stored in tables
inside routers
19.01.2016 12:04 24
Computer Networks
Network Layer
Connection - oriented Service
the stored route is used for all data traffic
flowing over the connection
analogous to telephone system

when connection is released, VC is


terminated

each packet carries an id indicating which


VC it belongs to
19.01.2016 12:04 25
Computer Networks
Network Layer
Connection - oriented Service
Virtual - Circuit (VC) subnet is required

Router tables
• source /
destination
• connection ID
Router tables
19.01.2016 12:04 26
Computer Networks
Network Layer
Connection - oriented Service

host H1 has established connection-1


with host H2
1st line of A’s table : if a packet bearing
connection id 1 comes in from H1,
send it
19.01.2016 12:04
to C and give connection id 1 27
Computer Networks
Network Layer
Connection - oriented Service
1st line of C’s table : route packet to E,
also with connection id 1

host H3 also establishes connection with


H2, sends packet with connection id 1
2nd line of A’s table : if a packet bearing
connection id 1 comes in from H3, ….
send it to C and give connection id 2
(also called label switching)
19.01.2016 12:04 28
Computer Networks
Network Layer
Connection - oriented Service
(a) setting up of VC between hosts before
data is sent - this phase is called connection setup
(b) packet transfer
0
(c) connection release 3 1
0 0
3 1 3 1 2
Switch 1 Switch 2
2 2
VC table entries
II IVCI OI OVCI
2 5 1 11 Switch 1 0
Switch 3
3 11 2 7 Switch 2 4
3 1
Host A 0 7 1 4 Switch 3
sender Host B
2
19.01.2016 12:04 receiver 29
Computer Networks
Connection setup phase :
establishment of connection state in each
of the switches between source and
destination host
connection state for a single connection
consists of an entry in the VC table
VC table contains entries for each switch:
(a) virtual circuit identifier (VCI) :
uniquely identifies the connection, carried
inside header of packets belonging to this
connection
19.01.2016 12:04 30
Computer Networks
VC table contains entries for each switch:
(b) incoming interface (II) on which
packets arrive at the switch

(c) outgoing interface (OI) on which


packets leave the switch

(d) a different VCI (OVCI) is used for


outgoing packets

19.01.2016 12:04 31
Computer Networks
Network Layer
VC :
choose route from source to destination
set up connection
add identifier (VC number) to each packet
(router replaces connection ids in
outgoing packets - called label switching)
store details in router tables
use the route for transporting all packets
release connection, terminate VC
19.01.2016 12:04 32
Computer Networks
Network Layer
Comparison of Datagram and VC subnets
complicated lookup setup time

bandwidth
router memory

easy traffic load balancing


in queue

dynamic allotment
of CPU cycles,
buffers, bandwidth
19.01.2016 12:04 33
Computer Networks
Network Layer
Routing algorithms
• Shortest Path Routing
• Flooding
• Distance Vector Routing
• Link State Routing
• Hierarchical Routing
• Broadcast Routing
• Multicast Routing
19.01.2016 12:04 34
Computer Networks
Network Layer
Routing algorithms
routing algorithm is a part of the Network
Layer software that is responsible for

deciding ……….

which output line should be used to


transmit or forward an incoming packet at
a router
19.01.2016 12:04 35
Computer Networks
Network Layer
Routing algorithms
Case of datagram : decision to be made
afresh every time a packet arrives, since
the best route can change dynamically

Case of VC : routing decision to be made


when a new VC is to be set up
route remains in force for an entire
session (say ftp or remote login or telnet)
-- called session routing
19.01.2016 12:04 36
Computer Networks
Network Layer
Two processes inside Router

Routing Forwarding
filling in and handling packet as
updating .......... it arrives, i.e.
routing tables looking up routing
use of table to ascertain
routing algorithm out - going line and
send packet

19.01.2016 12:04 37
Computer Networks
Network Layer
Desirable features in routing algorithm
• correctness
• simplicity
(#)
• robustness (tolerance to faults, topology
& traffic changes, router
crashes)
• stability (quick convergence to equilibrium)
• fairness
• optimality
(#) : without requiring all jobs in all hosts to be aborted and the network to be
rebooted every time some router crashes
19.01.2016 12:04 38
Computer Networks
Network Layer
classes of routing algorithm :
• non-adaptive or static
• adaptive or dynamic

19.01.2016 12:04 39
Computer Networks
Network Layer

Non-adaptive algorithm : (static routing)


routing decisions are not based on
measurements or estimates of current
traffic or topology

choice of route is computed in advance,


off-line and ….

downloaded to routers at boot time


19.01.2016 12:04 40
Computer Networks
Network Layer
Adaptive algorithm : (dynamic routing)
routing decisions are changed
commensurate with topology and traffic
changes
adaptive algorithms differ in :
• where they get info : from neighbouring
or all routers
• when they change routes : every few
msec or when load or topology changes
• optimization metrics used : distance or
number of hops or estimated transit time
19.01.2016 12:04 41
Computer Networks
Network Layer
Example (Cost of VC vs datagram) AT 5.5

Consider the following two cases :


(i) a VC service implementation using 3-byte
header and 8 bytes of storage for VCid
(ii) a datagram implementation service using
15-byte header
The average duration of a session is 1000
seconds during which 200 packets are
transmitted. The average no. of hops is 4.
19.01.2016 12:04 42
Computer Networks
Network Layer
Example AT 5.5

Assume :
(i) cost of transmission capacity is 0.5
paisa per 106 bytes per hop
(ii) cost of router memory is 0.5 paisa per
byte and depreciates in 2 years @ 40
hours per week
Compute and compare the cost of overheads in
the above two implementations (VC and
datagram) for the given set of parameters
19.01.2016 12:04 43
Computer Networks
Network Layer
Example AT 5.5

Computation of cost of Memory :

Duration of working in 2 years


= (2 x 52 x 40 x 3600) = 1.5 x 107 seconds

Cost per byte-second


= (0.5 paisa ÷ 1.5 x 107) = 0.33 x 10-7 paisa

19.01.2016 12:04 44
Computer Networks
Network Layer
Example AT 5.5

No. of routers required for 4 hops = 5


VC implementation :
Router memory required = 5 x 8 = 40 bytes
Session duration = 1000 seconds
Memory requirement = 40000 byte-secs
Cost = 4 x 104 x 0.33 x 10-7 paisa
= 1.33 x 10-3 paisa
19.01.2016 12:04 45
Computer Networks
Network Layer
Datagram implementation :
No. of bytes of additional header ( over the
VC case implementation ) to be transmitted
= 12 per packet per hop = 12 x 200 x 4
= 9600 byte-hops
Transmission cost = 0.5 x 10-6 per byte-hop,
Cost = 9600 x 0.5 x 10-6 paisa
= 4.80 x 10-3 paisa
Compared with 1.33 x 10-3 paisa for the VC case,
Datagram implementation is costlier for the
given set of parameters
19.01.2016 12:04 46
Computer Networks
Network Layer
Shortest Path Routing:
build a graph of the subnet with :
• each node of the graph representing a router
• each arc of the graph representing a
communication line or link
‘shortest path’
depends on the
metric chosen :
• number of hops : ABC = ABE = 2 (equal)
• geographic distance : ABC (= 9) > ABE (= 4)
19.01.2016 12:04 47
Computer Networks
Network Layer
Shortest Path Routing: metrics
• other metrics based on performance i.e.
hourly test runs using standard test packets :
queuing delay
transmission delay

generally, as a function of one or more of :


distance, bandwidth, average traffic,
measured delay, mean queue length,
communication cost, others
19.01.2016 12:04 48
Computer Networks
Network Layer
Shortest Path Routing: (Dijkstra’s algorithm)
1. Label (in parentheses) each node with
its distance from the source node
along the best known path
2. Initially, no paths are known ; so, label
all nodes with ∞
3. Initially, make all labels tentative
4. Make the label permanent (filled in circle : )
after it is discovered that a label
represents the shortest path from the
source to that node
19.01.2016 12:04 49
Computer Networks
Network Layer
Shortest Path Routing
1. Start by marking node A as permanent,
indicated by a filled-in circle

filled in circle :
permanent

19.01.2016 12:04
finding shortest path from A to D 50
Computer Networks
Network Layer
Shortest Path Routing
2. Examine, in turn, each of the nodes
adjacent to A
working
node 7
2 2 3 3

2
6 1 2 2
4

19.01.2016 12:04
finding shortest path from A to D 51
Computer Networks
Network Layer
Shortest Path Routing
3. Continue

7
2 3 3
2
2
1 2 2
6
4

19.01.2016 12:04
finding shortest path from A to D 52
Computer Networks
Network Layer
Shortest Path Routing
4. Continue

7
2 3
2 3

2
6 1 2 2
4

19.01.2016 12:04
finding shortest path from A to D 53
Computer Networks
Network Layer
Shortest Path Routing
5. Continue
7
2 3
2 3

2
1 2
6 2
4

19.01.2016 12:04
finding shortest path from A to D 54
Computer Networks
Network Layer
Shortest Path Routing
6. Continue
7
2 3
3
2
2
1
6 2 2
4

19.01.2016 12:04
finding shortest path from A to D 55
Computer Networks
Network Layer
Shortest Path Routing
Source Dest

filled in circle :
permanent

19.01.2016 12:04 finding shortest path from A to D 56


Computer Networks
Network Layer
Shortest Path Routing :
Example of Dijkstra’s Algorithm
Shortest path from
a to d is via
b and c

demo of an example
graph available at :
19.01.2016 12:04 http://optlab-server.sce.carleton.ca/POAnimations2007/DijkstrasAlgo.html 57
Computer Networks
Network Layer
Dijkstra’s algorithm
1. Router builds graph of
network and identifies
source and destination
nodes, say V1 and V2
2. It builds a matrix, called
the adjacency matrix
3. Each entry of matrix
indicates weight
4. [ i, j ] is the weight of a
link between nodes Vi and Vj
19.01.2016 12:04 58
Computer Networks
Network Layer
5. If there is no direct link between Vi and
Vj, this weight is identified as infinity
6. Builds a status record set for every
node on the network. The record
contains three fields:
Predecessor field - the first field shows the
previous node
Length field - the second field shows the sum of
the weights from the source to that node
Label field - the last field shows the status of
node -- each node can have one status mode:
permanent or tentative
19.01.2016 12:04 59
Computer Networks
Network Layer
6. Initializes the parameters of the status
record set (for all nodes) and sets their
length to infinity and their label to tentative
7. Sets a T-node. For example, if V1 is to be the
source T-node, the router changes V1's label
to permanent - when a label changes to
permanent, it never changes again
8. Updates the status record set for all tentative
nodes that are directly linked to the source T-
node
19.01.2016 12:04 60
Computer Networks
Network Layer
9. Looks at all of the tentative nodes and
chooses the one whose weight to V1 is
lowest. That node is then the destination T-
node
10. If this node is not V2 (the intended
destination), the router goes back to step 9
11. If this node is V2, the router extracts its
previous node from the status record set
and does this until it arrives at V1. This list
of nodes shows the best route from V1 to V2

19.01.2016 12:04 61
Computer Networks
Network Layer
Flooding ( static method )
every incoming packet is sent on every
outgoing line, except the one it arrived on

generates large numbers of duplicate


packets endlessly

so, measures are required to damp the


process
19.01.2016 12:04 62
Computer Networks
Network Layer
Flooding ( static method )
damping the process of flooding : (a)
a hop counter (ideally, initialized to
source-to-destination path length) is kept
in the header of each packet

count is decremented each hop

packet is discarded when hop count = 0


19.01.2016 12:04 63
Computer Networks
Network Layer
Flooding ( static method )
damping the process of flooding : (b)
source router introduces a sequence number
in each packet it receives from its hosts
each router maintains a list, per source
router, containing which sequence
numbers originating at that source has
been ‘seen’
if incoming packet serial number is
already on the list , it is not flooded
19.01.2016 12:04 64
Computer Networks
Network Layer
Flooding ( static method )
damping the process of flooding : (c)
Selective flooding

routers do not send every incoming


packet out every time

send only on those lines that are going


approximately in the right direction

19.01.2016 12:04 65
Computer Networks
Network Layer
Flooding ( static method ) : Uses
Flooding is not practical in most applications,
but is highly robust and so, is desirable in :

• military : disaster recovery / fault


tolerance requirements

• distributed database : especially during


updation of all databases concurrently

19.01.2016 12:04 66
Computer Networks
Network Layer
Distance Vector Routing (dynamic method)
Bellman - Ford / Ford - Fulkerson Algorithm
each router maintains a table (i.e. vector),
indexed by, and containing one entry for, each
router in the subnet; each entry has two parts :

(a) the best known distance to each


destination (#)
{ metric could be number of hops, time delay,
total no. of packets in queue along the path, … }
(b) preferred outgoing line to use to reach there
{ table is updated by exchanging information
with neighbours } (#) : by use of ECHO packets
19.01.2016 12:04 67
Computer Networks
Network Layer
Distance Vector Routing
each router takes the following actions :
(a) it counts the weight of the links directly
connected to it and saves the information
to its table
(b) in a specific period of time, it send its
table to its neighbour routers (not to all
routers) and receives the routing table of
each of its neighbours
(c) based on the information in its neighbours'
routing tables, it updates its own
19.01.2016 12:04 68
Computer Networks
Network Layer
Distance Vector Routing
Metrics used : no. of hops (neighbour = 1)
queue length (exam each queue)
delay (use ECHO packets)
assume that delay is used as metric and
router knows delay to each of its neighbors:
every T msec, each router sends to each
neighbour a list of its estimated delays to
each destination and also receives a similar
list from
19.01.2016 12:04
each neighbour 69
Computer Networks
Network Layer
Distance Vector Routing
Subnet of 12 routers delay vectors received
from the neighbours of J
28,I

18,H

30,I

J-AG 26 (8+18) AF31 AC33


J-IG 41 (10+31) IF30 IC28
J-HG 18 (12+6) HF31 HC31
J-KG 37 (6+31) KF46 KC42
Same calculation is performed
for all other destinations measured or estimated
19.01.2016 12:04 delay by J 70
Computer Networks
Example : Network Layer PD 3.3

For the network shown above, give the datagram


forwarding table (destination, next hop) for each node.
The links are labelled with relative costs.
Criteria : each packet should be forwarded via
the lowest-cost path to its destination.
19.01.2016 12:04 71
Computer Networks
Example : Network Layer PD 3.3
Destination Next Hop Destination Next Hop
B C A E
C C C E
D C A B D E
E C E E
F C F E
Destination Next Hop Destination Next Hop
A A A E
B E B E
D E C D C E
E E E E
F F F E
19.01.2016 12:04 Forwarding Tables 72
Computer Networks
Example : Network Layer PD 3.3

Destination Next Hop Destination Next Hop


A C A C
B B B C
C C E F C C
D D D C
F C E C

Forwarding Tables

19.01.2016 12:04 73
Computer Networks
Example : Network Layer PD 3.3

19.01.2016 12:04 74
Computer Networks
Distance Vector Routing :
Example (distance) PD 4.15

Work out DV tables


3 when :
A C
(a) each node knows
6 the distances to its
immediate neighbours
8 1 (b) each node has
B F
2 reported the info it had
in (a) to its immediate
neighbours
D E (c) step (b) happens a
2
second time
19.01.2016 12:04 75
Computer Networks
Distance Vector Routing :
Example (distance) PD 4.15

Work out DV tables


when :
(a) each node knows
the distances to its
immediate neighbours
(b) each node has
reported the info it had
in (a) to its immediate
neighbours
(c) step (b) happens a
second time
19.01.2016 12:04 76
Computer Networks
Distance Vector Routing :
Example PD 4.15

19.01.2016 12:04 77
Computer Networks
Distance Vector Routing :
Example PD 4.15

19.01.2016 12:04 78
Computer Networks
Distance Vector Routing :
Example PD 4.15

19.01.2016 12:04 79
Computer Networks
Network Layer
Distance Vector Routing Example AT 5.9
Consider the subnet shown in the figure
(next slide).
Distance vector routing is used, and the
following vectors have come in to router C :
from B : (5, 0, 8, 12, 6, 2)
from D : (16, 12, 6, 0, 9, 10)
from E : (7, 6, 3, 9, 0, 4)
The measured delays to B, D and E are 6, 3 and
5 respectively.
Give C’s new routing table indicating outgoing
line to use and the expected delay.
19.01.2016 12:04 80
Computer Networks
Network Layer
Distance Vector Routing Example AT 5.9

19.01.2016 12:04 81
Computer Networks
Network Layer
Distance Vector Routing : Example AT 5.9
Vectors coming
into C from → B D E
A 5 16 7
B 0 12 6
C 8 6 3
D 12 0 9
E 6 9 0
F 2 10 4
Measured
Delay
C to B/D/E 6 3 5
19.01.2016 12:04 82
Computer Networks
Network Layer Example AT 5.9

{r} B D E C - B - {r} C - D - {r} C - E - {r} Line


A 5 16 7
B 0 12 6
C 8 6 3
D 12 0 9
E 6 9 0
F 2 10 4
Measured
Delay
6 3 5
C-B/D/E

19.01.2016 12:04 83
Computer Networks
Network Layer Example AT 5.9

{r} B D E C - B - {r} C - D - {r} C - E - {r} Line


A 5 16 7 6+5=11 3+16=19 5+7=12 B

B 0 12 6 6 3+12=15 5+6=11 B

C 8 6 3 6+8=14 (0) 3+6=9 (0) 5+3=8(0) -

D 12 0 9 6 +12=18 3 5+9=14 D

E 6 9 0 6+6=12 3+9=12 5 E

F 2 10 4 6+2=8 3+10=13 5+4=9 B


Measured
Delay
6 3 5
C-B/D/E

19.01.2016 12:04 84
Computer Networks
Network Layer
Distance Vector Routing : converges, but slowly
The count-to-infinity problem
metric used : number of hops
five node linear subnet example
X


B ←
C →
D →
E →

• A is initially down ; A is initially


• entries by other nodes up ; later
is infinity; goes down
• A comes up (or link A-B cut)
19.01.2016 12:04 85
Computer Networks
Network Layer
Distance Vector Routing : demerits
(a) the delay metric used in ARPANET was
queue length;
line bandwidths were not taken into
account;
when low bandwidth lines (56 Kbps) were
upgraded to higher values (230 Kbps,
1.544 Mbps) …. caused problems

(b) count-to-infinity problem


19.01.2016 12:04 86
Computer Networks
Complete topology
Network Layer and all delays are
experimentally
Link State Routing measured and
distributed to every
Each router : router in the subnet
(a) discovers its neighbours and learns
their network addresses
(b) measures delay (or cost) to each of its
neighbours (have a reasonable estimate)
(c) constructs a packet containing
addresses and delays (or costs)
(d) sends this packet to all other routers
(e) computes the shortest path to every
other router (Dijkstra’s algorithm)
19.01.2016 12:04 87
Computer Networks
Network Layer
Link State Routing : (a) Learning about neighbours

First task after booting - learn who the


neighbours are

Sends a special HELLO packet on each


point-to-point line

Expects response (from router at other


end) giving its identity
19.01.2016 12:04 88
Computer Networks
Network Layer
Link State Routing : (a) Learning about neighbours

routers A, C , F connected to a LAN graph model of (a) with


LAN modelled as node N
19.01.2016 12:04 89
Computer Networks
Network Layer
Link State Routing : (b) Measuring line cost
Send ECHO packet
Other router is required to respond
Measure round-trip delay ; divide by 2
For better results, repeat test, use average
Issue : take load into account ?
Yes - start round-trip timer when ECHO
packet is queued (treats lightly loaded path as shorter)
No - start round-trip timer when ECHO
packet reaches the front of queue
19.01.2016 12:04 90
Computer Networks
Network Layer
Link State Routing : (b) Measuring line cost
problem of including load in delay calculations
wild oscillations
of routing tables,
erratic routing

Line 1

Line 2

solution : distribution of load over multiple lines


19.01.2016 12:04 91
Computer Networks
Network Layer
Link State Routing : (c) Constructing Link State Packets
identity
seq. no.
age
list of
neighbors
L D
(#)

Information collected regarding neighbours


is to be sent to all other routers
Action required : construction of packets;
when to construct ?
19.01.2016 12:04 (#) → L : List of neighbours ; D : Delay 92
Computer Networks
Network Layer
Link State Routing : (c) Constructing Link State Packets
Packets can be built : (when ?)

at regular intervals

event-driven
(ex. neighbour / link going down /
coming up / change of properties)

19.01.2016 12:04 93
Computer Networks
Network Layer
Link State Routing : (d) Distributing Link State Packets
Need : reliable distribution ---- issue
as the packets are distributed and
installed, routers getting the first LS
packets will change their routes →
over a period of time, different routers
may use different versions of topology →
inconsistencies, loops, unreachable
machines, ……
19.01.2016 12:04 94
Computer Networks
Network Layer
Link State Routing : (d) Distributing Link State Packets
Basic distribution algorithm : flooding
LSP
from Y X A X A X sends a copy of new LSP
(received with highest
sequence number) to A and C
C B D C B D

(a) (b)

X A X A

C B D C B D
B accepts the copy of
(c) LSP which arrived first (d)
19.01.2016 12:04 95
Computer Networks
Network Layer
Link State Routing : (d) Distributing Link State Packets
Basic distribution algorithm : flooding
Why Seq. no. ? → to keep control of the flood :
each packet contains a sequence no.
sequence no. is incremented for each new
packet sent
other routers keep track of the following
information pair they ‘ see ’ :
{source
19.01.2016 12:04
router & sequence no.} → 96
Computer Networks
Network Layer
Link State Routing : (d) Distributing Link State Packets

When a new LS packet comes in : check


against list of all packets already ‘seen’ →
(i) new ? → forward to all lines except on
which it arrived
(ii) duplicate ? → discard
(iii) sequence no. is lower than highest no.
already seen ? → treat it as obsolete and discard
Issues? → →
19.01.2016 12:04 97
Computer Networks
Network Layer
Link State Routing : (d) Distributing Link State Packets
Issues :
(i) Sequence numbers wrapping around
→ confusion
Solution : use a 32-bit sequence number ;
@ 1 LS packet per sec, wrap around time
= 137 years ; this possibility can be ignored
(ii) Router crash : sequence is broken, set
to 0 at reboot, next packet rejected as
duplicate
19.01.2016 12:04 98
Computer Networks
Network Layer
Link State Routing : (d) Distributing Link State Packets
Issues :
(iii) If sequence no. is corrupted i.e.
received with (even 1 bit) error, packets
will be rejected as obsolete
(#)
e.g. number 4 is received as 65,540 ? →
packets 5 through 65,540 will be rejected
as obsolete, since current sequence
number is thought to be 65,540
19.01.2016 12:04 (#) 65540 = 00000000000000010000000000000100 99
Computer Networks
Network Layer
Link State Routing : (d) Distributing Link State Packets
Issues :
(c) If sequence no. is corrupted….

Solution :
include age of packet after the sequence no.
decrement it once per second
when age becomes zero, discard the link
state packet from that router
19.01.2016 12:04 100
Computer Networks
Network Layer
Link State Routing : (e) Computation of new route
(i) once a router has accumulated a full
set of LSPs …..
it constructs the entire subnet graph,
because every link is represented

(ii) Dijkstra’s algorithm is run locally to


construct the shortest path to all possible
destinations;
19.01.2016 12:04 101
Computer Networks
Network Layer
Link State Routing : (e) Computation of new route
(iii) results of this algorithm is installed in
the routing tables

(iv) normal operation is resumed

19.01.2016 12:04 102


Computer Networks
Network Layer
Link State Routing : (d) Distributing Link State Packets

Packet buffer
for Router B

19.01.2016 12:04 103


Computer Networks
Network Layer
Hierarchical Routing
growth of Networks in size →
increase in routing tables →
increase in RAM (to hold tables) CPU time (to
scan the tables) / bandwidth (to send status reports)
→ infeasibility of every router having info
about every other router →
routing is better accomplished if done
hierarchically e.g. as in telephone network
19.01.2016 12:04 104
Computer Networks
Network Layer
Hierarchical Routing
routers are divided into regions
each router is concerned about routers
only within its region
need not be concerned about the internal
structure of other regions

for large networks, an n-level hierarchy


may be necessary
19.01.2016 12:04 105
Computer Networks
Network Layer
Hierarchical Routing
routers.. regions.. clusters.. zones.. groups
two-level hierarchy with five regions :

1A Region
Region
Region
Region

7 entries

↑regions ↑path lengths


17 entries
(1A to 5C)
19.01.2016 12:04 106
Computer Networks
Network Layer
Example : 720 routers (how many levels of hierarchy ?)
No hierarchy → each router needs 720
routing table entries
• 24 regions x 30 routers → 30 local + 23
= 53 remote entries
• 8 clusters x 9 regions x 10 routers →
7 for clusters + 8 for regions + 10 local = 25

Optimal no. of levels for an N router subnet


= ln N (due to Kamoun and Kleinrock,1979)
19.01.2016 12:04 107
Computer Networks
Network Layer
Example : AT 5.12

For hierarchical routing with 4800 routers,


what region & cluster sizes should be
chosen to minimize the size of routing
table for a 3-layer hierarchy ?
Assume that a solution with k clusters of
k regions of k routers is close to optimal
i.e. k ≈ (4800)1/3
Use trial and error to check out the
combination , where all the three
parameters (clusters + regions + routers)
are in the general vicinity of k
19.01.2016 12:04 108
Computer Networks
Network Layer
Example : AT 5.12

One combination :
15 clusters, with each cluster having …….
16 regions , with each region having …….
20 routers
Total = 51 entries

19.01.2016 12:04 109


Computer Networks
Network Layer
Broadcast Routing :
hosts may need to send messages to
many destinations simultaneously so that
those interested read the data (#)
Methods :
• sending a distinct packet to each
destination
• flooding
• multi-destination routing
• spanning tree routing
• reverse path forwarding
(#) live programs, weather reports, data updates110
19.01.2016 12:04
Computer Networks
Network Layer
Broadcast Routing :
sending a packet to all destinations
simultaneously … called broadcasting

1. Send a distinct packet to each destination :


→ waste of bandwidth and …..
→ source needs to have a full list of all
destinations
2. Flooding → generation of too many
packets, consumption of too much
bandwidth
19.01.2016 12:04 111
Computer Networks
Network Layer
Broadcast Routing :
3. Multi-destination routing
• each packet contains a list of desired
destinations
• when a packet arrives at a router, router
checks all destinations
• router determines the set of output lines
needed (best route to at least one
destination)
19.01.2016 12:04 112
Computer Networks
Network Layer
Broadcast Routing :
3. Multi-destination routing
• router generates a new copy of the
packet for each output line to be used
and includes, in each packet, only those
destinations that are to use the line
i.e. the destination set is partitioned
among the output lines

19.01.2016 12:04 113


Computer Networks
Network Layer
Broadcast Routing :
4. Spanning-tree routing
a spanning tree is a subset of the subnet ;
includes all routers, but contains no loops
each router copies an incoming broadcast
packet onto all the spanning tree (ST) lines,
except the incoming line
this method generates absolute minimum
no. of packets required and makes
excellent use of bandwidth
Issue : Router must have knowledge of ST
19.01.2016 12:04 114
Computer Networks
Network Layer
Broadcast Routing :
5. Reverse path forwarding

a router forwards only one copy of packet;


the others are dropped

the copy that is forwarded is the one that


has travelled the shortest path from the
source to the router

19.01.2016 12:04 115


Computer Networks
Network Layer
Broadcast Routing :
5. Reverse path forwarding
a broadcast packet arrives at router →
router checks to see if the packet arrived
on the line normally used to send packets
to the source of broadcast →
if yes → highly probable that the
broadcast itself followed the best route →
therefore, it is the first copy to arrive →
19.01.2016 12:04 116
Computer Networks
Network Layer
Broadcast Routing :
5. Reverse path forwarding
in this case, router forwards copy of this
packet to all lines except the incoming line

if the broadcast packet arrived on any


other line, the packet is discarded as
likely duplicate

19.01.2016 12:04 117


Computer Networks
Network Layer
Broadcast Routing :
5. Reverse path forwarding

Sink tree : definition

the set of optimal routes from all sources


to a given destination form a sink tree
rooted at the destination

19.01.2016 12:04 118


Computer Networks
Network Layer
Broadcast Routing :
5. Reverse path forwarding

Hops

1

3
4
5
Subnet A sink tree for router I
19.01.2016 12:04
Tree built by reverse 119
path forwarding
Computer Networks
Network Layer
Broadcast Routing :
5. Reverse path forwarding
hop - 1 : I sends packets to F, H, J, N (four)
hop - 2 : eight packets are generated - five
arrive on preferred lines (A, D, G, O, M)
hop - 3 : six packets are generated - three
arrive on preferred lines (E, C, K)
hop - 4 : four packets are generated - two
arrive on preferred lines (B, L)

total : 4 hops and 14 packets


19.01.2016 12:04 (compare with 5 hops and 24 packets) 120
Computer Networks
Network Layer
Broadcast Routing :
5. Reverse path forwarding
Advantages:
• ease of implementation, efficient
• does not require routers to know about
STs (as in ST routing)
• does not have overhead of a destination
list (as in multi-destination routing)
• does not require any special process for
damping (as in flooding)
19.01.2016 12:04 121
Computer Networks
multicasting :
Network Layer sending message
to a selected group
Multicast Routing :
a group of processes working together for
Example :
implementing a common function database
a distributed
system
small groups may use point-to-point
messaging
use of point-to-point messaging for large
groups is expensive
multicast routing method involves sending
messages to well-defined groups, large in
size, but far less than the whole network
19.01.2016 12:04 122
Computer Networks
Network Layer
Multicast Routing :
Requires group management

methods are needed to :


• create / destroy group
• to allow processes to join / leave groups

when a process joins / changes group, it


informs its host about this
19.01.2016 12:04 123
Computer Networks
Network Layer
Multicast Routing :

routers should learn and know which host


belongs to which group :

• hosts should inform their routers about


change of group
or
• routers should query hosts periodically
19.01.2016 12:04 124
Computer Networks
Network Layer
Multicast Routing : pruning of spanning trees
each router computes a spanning tree
covering all other routers
when a process sends a multicast packet
to a group, …..
the first router examines its spanning tree
it prunes the tree by removing all lines
that do not lead to hosts that are
members of the group; use of PRUNE message
(i.e. retains only required lines)
19.01.2016 12:04 Multicast packets are forwarded only along the appropriate spanning tree 125
Computer Networks
Network Layer
Multicast Routing : each router computes
a spanning tree covering all other routers
network with
two groups ∙
1 and 2
some routers are spanning
attached to hosts tree for
that belong to one left-most
or both groups
router

pruned pruned
ST for ∙ ∙ ST for
group 1 group 2

19.01.2016 12:04 126


Computer Networks
Network Layer
Multicast Routing : pruning of spanning trees
Link state case :
each router is aware of complete topology,
including host-group relationship

• start at the end of each path


• work towards root
• remove all routers not belonging to the
group in question
19.01.2016 12:04 127
Computer Networks
Network Layer
Multicast Routing : pruning of spanning trees
Distance vector case :
basic algorithm : reverse path forwarding
when a router with :
(a) no hosts interested in a particular
group and
(b) no connection to other routers
receives a multicast message for that group,
it responds with a PRUNE message,
informing sender not to send any more
multicasts
19.01.2016 12:04
for that group 128
Computer Networks
Network Layer
Multicast Routing : pruning of spanning trees
Distance vector case :

when a router with :


no group members among its own hosts has
received multicast messages on all its lines

it will also respond with PRUNE message →


the subnet is recursively pruned

19.01.2016 12:04 129


Computer Networks
Network Layer
Multicast Routing : disadvantage
poor scalability
assume :
a network has n groups
each group has an average of m members
for each group, m pruned STs must be
stored; i.e a total of mn trees
when many groups exist, considerable
storage is needed to store all the trees
19.01.2016 12:04 130
Computer Networks
Network Layer
Multicast Routing : alternative design
Core-based trees method
a single spanning tree per group is
computed
the root (or the core) is placed near the
middle of the group
to send multicast message :
• host sends to the core
• core multicasts along spanning tree
19.01.2016 12:04 Storage required is for only one tree per group 131
Computer Networks
Network Layer
Network Congestion
network congestion occurs when a link or
node is carrying so much data that its
quality of service deteriorates

typical effects include :


• queuing delay
• packet loss
• blocking of new connections
19.01.2016 12:04 132
Computer Networks
Network Layer
Network Congestion
a consequence of packet loss or blocking
of new connections is :
incremental increases in offered load lead
either only to small increases in network
throughput
or
to an actual reduction in network
throughput
19.01.2016 12:04 133
Computer Networks
Network Layer
Network Congestion
too many packets in a subnet or part of it
→ performance degradation : congestion

..
..
..
..
..
..
..
..
.
19.01.2016 12:04 134
Computer Networks
Network Layer
Network Congestion
Factors causing congestion
(a) streams of packets arriving on many
input lines, contending for the same
output line → building up of queue →
memory crunch → loss of packets
(b) slow CPUs on router → queue build
up due to bookkeeping tasks (updating
tables, queuing buffers,…) taking long
time
(c) low
19.01.2016 12:04
bandwidth lines 135
Computer Networks
Network Layer
Network Congestion
Flow control vs. Congestion control
Flow control :
• relates to point-to-point traffic between a
given sender - receiver pair
• is more a local issue
• involves some direct feedback from the
receiver to the sender to inform the
sender to slow down transmission to
facilitate
19.01.2016 12:04
the receiver to handle it 136
Computer Networks
Network Layer
Network Congestion
Flow control vs. Congestion control
Congestion control
• is a global issue
• involves the behaviour of all hosts, all
routers, store-and forward processing
within routers, other factors
Congestion control requirements :
to ensure that subnet is able to carry traffic
19.01.2016 12:04 137
Computer Networks
Network Layer
Network Congestion
Flow Control :
OFC network 1000 Gbps
Supercomputer trying FTP to PC at 1 Gbps
Congestion Control :
Store-and forward network with 1 Mbps lines
1000 large computers
500 computers are trying FTP at 100 Kbps
each to the other 500 computers
19.01.2016 12:04 total offered traffic >> what the network can handle 138
Computer Networks
Network Layer
Congestion Control Algorithms
General principles of Congestion Control
(a) open-loop :
good design : prevention of congestion
no state-related / mid-course corrections
taking prior scheduling decisions at
various points on network regarding …..
when to accept traffic, which packet to
discard & when

19.01.2016 12:04 139


Computer Networks
Network Layer
Congestion Control Algorithms
General approaches
(b) closed-loop
based on the concept of feedback loop
(i) monitor and detect place & timing of
occurrence of congestion
(ii) pass information to place of action
(iii) adjust system operation for problem
rectification
19.01.2016 12:04 140
Computer Networks
Network Layer
Congestion Control Algorithms
(b) (i) closed-loop - metrics for monitoring :
• percentage of packets discarded due
to lack of buffer space
• average queue lengths
• number of packets timing out and
requiring retransmission
• average / standard deviation of packet
delay
19.01.2016 12:04 rising numbers ? → growing congestion 141
Computer Networks
Network Layer
Congestion Control Algorithms
(b) (ii) closed-loop - transferring information
from detection point to action point :

• router detects the congestion and


announces the problem to the sources
by sending a packet (these packets increase load !)
• router warns neighbours by setting a
reserved bit (or field) in every packet when
congestion crosses a threshold level
19.01.2016 12:04 142
Computer Networks
Network Layer
Congestion Control Algorithms
(b) (iii) closed loop - adjust system
operation :

• hosts or routers periodically send probe


packets explicitly seeking feedback
about congestion
• information received is used to re-route
traffic
19.01.2016 12:04 143
Computer Networks
Network Layer
Congestion Control Algorithms
Taxonomy of algorithms :
open-loop
action at source
action at destination
closed-loop
explicit feedback - warn the source
implicit feedback - source deduces
congestion thro’ measurements
(e.g. time needed for acknowledgements to come back)
19.01.2016 12:04 144
Computer Networks
Network Layer
Congestion Control Algorithms
Congestion : load > resource
( this has to be temporary, since
congestion needs to be controlled )

two solutions :
(i) increase resources

(ii) reduce load


19.01.2016 12:04 145
Computer Networks
Network Layer
Congestion Control Algorithms
increase of resources :
• temporary use of additional lines for
increasing bandwidth between chosen
points
• increase of transmission power
(wireless)
• splitting traffic over multiple routes
• deployment of spare routers (normally
in backup mode) on-line
19.01.2016 12:04 146
Computer Networks
Network Layer
Congestion Control Algorithms
decrease of load :
• denying / degrading service to some / all
users
• have users schedule demands in a
predictable fashion

19.01.2016 12:04 147


Computer Networks
Network Layer
Congestion Control Algorithms
Congestion prevention policies (open-loop)(#)

(c)
(long →response time suffers,
small → more retransmissions)

(no. of queues,
(b) round robin /
priority)
(long →clogging,
small →timeouts)
(GBN vs SR)

(a) (piggyback)
(small window)
19.01.2016 12:04 (#) designed to minimize congestion proactively 148
Computer Networks
Network Layer
Congestion Control Algorithms
Congestion prevention policies (open-loop)
Datalink layer:
(a) re-transmission policy
a sender with a small time out retransmits all
outstanding packets ; using ‘Go-back n’ will
put a heavier load on the system than ….
a sender that uses ‘Selective repeat’
at the receiver, if receiver discards all out-of-
order packets → retransmission → extra load
Selective repeat is better than Go-back n
19.01.2016 12:04 149
Computer Networks
Network Layer
Congestion Control Algorithms
Congestion prevention policies (open-loop)
Datalink layer:
(b) acknowledgement policy :
piggybacking reduces extra traffic…
but if acknowledgements are saved and
wait till piggybacked ….
extra timeouts and retransmissions may result
(c) flow control : tight control with small
window reduces data rate →
better congestion
19.01.2016 12:04
control 150
Computer Networks
Network Layer
Congestion Control Algorithms
Congestion prevention policies (open-loop)
Network layer:
(a) VC vs. datagram inside the subnets -
some algorithms work for one, some
others for other : choice to be clear
(b) packet queuing and service policy -
routers have one queue for input line, one
queue for output line, or both
(c) order of packet processing policy :
round robin or priority - based
19.01.2016 12:04 151
Computer Networks
Network Layer
Congestion Control Algorithms
Congestion prevention policies (open-loop)
Network layer:
(d) packet discard policy :
which to drop when there is no buffer
(e) routing algorithm :
should be able to spread traffic over all lines
(f) packet lifetime management :
long → lost packets may cause clogging,
short → packets timeout → retransmissions
19.01.2016 12:04 152
Computer Networks
Network Layer
Congestion Control Algorithms
Congestion prevention policies (open-loop)
Transport layer:
issues are similar to datalink layer
determining timeout interval across
network is more difficult
too short → extra packets sent unnecessarily
too long → congestion will be reduced,
but response time will suffer whenever
packet is
19.01.2016 12:04
lost 153
Computer Networks
Network Layer
Congestion Control Algorithms
Congestion control in VC subnets (dynamic)

(a) admission control : once congestion


has been signalled, do not set-up any
more VCs till congestion is cleared
(b) allow new VCs to be set up, but avoid
problem areas or congested routers

19.01.2016 12:04 154


Computer Networks
Network Layer
Congestion Control Algorithms : VC
Avoidance of congested routes
(router-1)

A to B
(one possible route)
(router-2)

Congested subnet Redrawn subnet


19.01.2016 12:04
(congested routes omitted) 155
Computer Networks
Network Layer
Congestion Control Algorithms : VC
(c) negotiated agreement between host &
subnet specifying :
• volume and shape of traffic
• quality of service required
• other parameters, if any
reservation of resources (table / buffer
space on routers, bandwidth on lines) by
subnet guarantees availability of …..
necessary resources to satisfy agreement
wastage of resources; agree to reserve only if route is congested
19.01.2016 12:04 156
Computer Networks
Network Layer
Congestion control in datagram subnets
each router monitors utilization of its
output lines and other resources
whenever the recent utilization of an
output line increases above threshold,
that line enters a warning state
each newly-arriving packet is checked to
see if its output line is in warning state
if yes, some action is taken → →
19.01.2016 12:04 157
Computer Networks
Network Layer
Congestion control in datagram subnets
(a) Warning bit
(b) Choke packets
(c) Hop-by-hop choke packets
(d) Load shedding
(e) Random Early Detection (RED)
(f) RED with ECN

19.01.2016 12:04 158


Computer Networks
Network Layer
Congestion control in datagram subnets
(a) The Warning Bit (implicit way of traffic control)
the ‘warning state’ is signaled by setting a
special bit in packet’s header
when packet arrives at destination, transport
entity copies the bit into …..
the next acknowledgement and sends back to source
source (sees set bit) then reduces the offered traffic
when warning bit is received as reset, traffic is
increased (implicit way of traffic control)
19.01.2016 12:04 159
Computer Networks
Network Layer
Congestion control in datagram subnets
(b) Choke packets (explicit way of traffic control)

the router sends a choke packet back to


source host, giving information about the
destination field found in received packet

when source host gets choke packet, it is


required to reduce the traffic sent to the
specified destination by a %, say 50%
19.01.2016 12:04 160
Computer Networks
Network Layer
Congestion control in datagram subnets
(b) Choke packets
other packets meant for same destination
may be already on their way →
more choke packets may be generated ??
host ignores choke packets referring to
that destination for a fixed time interval

after the time interval has expired, host


listens for more choke packets →
19.01.2016 12:04 161
Computer Networks
Network Layer
Congestion control in datagram subnets
(b) Choke packets
host may increase (in smaller increments)
or decrease (100% to 50% to 25% ………..)
traffic depending on receipt of choke
packets during the ‘ listening ’ period

trigger signal other than line utilization :


• queue length or
• buffer utilization
19.01.2016 12:04 162
Computer Networks
Network Layer
Congestion control in datagram subnets
(c) Hop-by-Hop Choke packets

At high speeds or over long distances ….,

sending a choke packet all the way back


to the source is not suitable since …..

reaction may take place very slowly


19.01.2016 12:04 163
Computer Networks
Network Layer
(c) Hop-by-hop Choke packets
1
5

2
6

4 to D only here

19.01.2016 12:04 (a) a choke packet that affects only the source 164
Computer Networks
Network Layer
Congestion control in datagram subnets
(c) Hop-by-Hop Choke packets
Consider two hosts A and D (Bangalore to
New Delhi) separated by 2000 Km
i.e. RTT = 20 msec

speed = 155 Mbps (a high speed ISP)


i.e. in 10 msec, no. of bits that can be sent
= 1.55 Megabits
19.01.2016 12:04 165
Computer Networks
Network Layer
Congestion control in datagram subnets
(c) Hop-by-Hop Choke packets
if host D runs out of buffers, it will send a
choke packet which will take ≈ 20 msec to
get back to A
in this 10 msec, another 1.55 Megabits
would have been sent by A and these will
travel in the pipe
D will notice reduced flow only in the 7th
stage of the diagram
19.01.2016 12:04 alternative approach → → 166
Computer Networks
Network Layer
(c) Hop-by-hop Choke packets

1 4 impact:
greater demand
F
E reduced flow on the buffers of E

A
5
2 reduced
flow
E

(b) a choke packet that affects


3 D
each hop it passes through
F as soon as the choke packet reaches F,
it reduces flow to D; similarly, E reduces flow to F;
19.01.2016 12:04 and A reduces flow to E 167
Computer Networks
Network Layer
(d) Load Shedding
when congestion control methods fail,
routers discard or drop packets aggressively
e.g. file transfer … dropping earlier
packets may lead to retransmission of
dropped + later packets
so, applications must mark priority levels
(important, not to be discarded) , if necessary, for
their packets
19.01.2016 12:04 168
Computer Networks
Network Layer
(d) Load Shedding

file transfer applications →


desirable to retain (not drop) older
packets (old is better than new)

multimedia applications →
desirable to retain newer packets
(new is better than old)
19.01.2016 12:04 169
Computer Networks
Network Layer
(e) Random Early Detection algorithm (RED)
Routers drop packets before (“early”)
situation gets out of control. When ?
Router maintains a running average of its
queue length ; if > threshold →
congestion impending → take action
since router cannot ascertain which
source is causing congestion →
randomly picks packets for discarding
19.01.2016 12:04 170
Computer Networks
Network Layer
(e) Random Early Detection algorithm (RED)
how does the router provide feedback to
the source ? →
(i) by choke packet
(ii) do not send any feedback
source will, anyway, detect missing ACK,
(#)
concludes that the lost packets are generally
due to congestion (i.e. discards), slows
down transmission
19.01.2016 12:04 (#) OK for wired networks; not for wireless networks 171
Computer Networks
Network Layer
(f) RED and Explicit Congestion Notification (ECN)
dropping packets implicitly signals
congestion, but can hurt applications
sensitive to delay / packet loss
in ECN, bits 6 and 7 of IP TOS field are used
one bit is set by source to indicate that it is
ECN-capable and can react to a congestion
notification
the other bit is set by routers when congestion
is encountered and source responds if bit is set
19.01.2016 12:04 172
Computer Networks
Network Layer
Jitter Control
Jitter : variation in packet arrival times

e.g. : audio and video streaming :


delay of 20-30 msec is acceptable, but ….
transit time should be constant
19.01.2016 12:04 173
Computer Networks
Network Layer
Jitter Control
some packets taking 20 msec, some others
30 msec→→uneven quality of audio / video
specified deviation
should consider :
• transit time
• delay thro’ Routers

e.g. SLA can specify that :


“99% packets to be delivered
with delay of 24 ± 0.5 msec”
19.01.2016 12:04 174
Computer Networks
Network Layer
Jitter Control
jitter can be bounded by :
• computing the expected transit time for each
hop along the path
• packet arriving at the router : check to
see whether it is behind or ahead of schedule
• storing the information in the packet and
updating the same at each hop
• packet ahead of schedule ? → hold back in
buffer till scheduled time
• behind schedule ? → quickly forward the packet
19.01.2016 12:04 175
Computer Networks
Network Layer
Jitter Control
jitter can be eliminated by :
• buffering at the receiver and then ….
fetching the data from the buffer instead
of from the network in real time
e.g. video on demand application

buffering may not be acceptable in


applications that require real-time interactions
e.g. videoconferencing, VoIP
19.01.2016 12:04 176
Computer Networks
Network Layer
Quality of Service (QoS)
QoS is the overall performance of a
computer network, particularly ….
the performance as seen by the users of
the network

19.01.2016 12:04 177


Computer Networks
Network Layer
Quality of Service (QoS)
communication network forms the
backbone of any successful organization
networks transport a multitude of
applications and data, including high-
quality video and delay-sensitive data
such as real-time video & voice
bandwidth-intensive applications stretch
network capabilities
19.01.2016 12:04 178
Computer Networks
Network Layer
Quality of Service (QoS)
networks must provide secure, predictable,
measurable, and sometimes guaranteed
services
secret to a successful end-to-end
business solution :
achieving the required Quality of Service
(QoS) by managing ……
delay, delay variation (jitter), bandwidth,
and packet loss parameters on a network
19.01.2016 12:04 179
Computer Networks
Network Layer
Quality of Service (QoS)
QoS refers to a broad collection of
techniques to manage network resources
the goal of QoS is to provide guarantees
on the ability of a network to deliver
predictable results
elements of network performance within
the scope of QoS often include :
availability (uptime), bandwidth (throughput),
latency (delay), and error rate
19.01.2016 12:04 180
Computer Networks
Network Layer
Quality of Service (QoS)

QoS involves prioritization of network traffic

QoS is especially important for the new


generation of Internet applications such as:

VoIP, video-on-demand and other


consumer services
19.01.2016 12:04 181
Computer Networks
Network Layer
Quality of Service (QoS)
Flow : a stream of packets from source to
destination
needs for each flow can be characterized
by four primary parameters :
• reliability
• delay
• jitter
• bandwidth
the above parameters, put together,
determine
19.01.2016 12:04
the QoS the flow requires 182
Computer Networks
Network Layer
Quality of Service (QoS)
Requirement :
ensuring quality of service through
network and protocol design
providing QoS matched to application
needs
important for multimedia networking
characterization of needs vs. applications -
reliability ; delay ; jitter ; bandwidth
19.01.2016 12:04 183
Computer Networks
Network Layer
Quality of Service (QoS)
QoS requirements for applications
Checksum

19.01.2016 12:04 184


Computer Networks
Network Layer
Quality of Service (QoS)
loss sensitive applications :
checksumming, verifying checksum,
packet damaged in transit is not acked
and will be retransmitted eventually

delay sensitive applications :


medium: web surfing and remote login
high : videoconferencing and VoIP
19.01.2016 12:04 185
Computer Networks
Network Layer
Quality of Service (QoS)
Techniques for achieving good QoS
(a) over - provisioning (expensive)
(b) buffering (about 10 seconds before replay)
(c) traffic shaping (leaky bucket and token bucket algorithms)
(d) resource reservation (b/w, buffer space, CPU cycles)
(e) admission control (flow negotiations)
(f) proportional routing (divide traffic in proportion to link capacity)
(g) packet scheduling (fair queuing algorithm)

19.01.2016 12:04 186


Computer Networks
Network Layer
Quality of Service (QoS)
Over - provisioning
with over - provisioning of resources like :
router capacity, buffer space, bandwidth,
packets can travel really fast
but, the solution is expensive

with experience, designers can get a


better idea of how much is enough
19.01.2016 12:04 187
Computer Networks
Network Layer
Quality of Service (QoS)
Buffering
flows are buffered at the receiving end
before being delivered

has no impact on reliability or bandwidth

may increase delay, but reduces jitter


good for audio and video-on-demand
19.01.2016 12:04 188
Computer Networks
Network Layer
Quality of Service (QoS)
Buffering (at the receiving side)
t=0sec t=3sec

(receiver) t=1sec t=5sec

play back begins : t=10sec

packet no. 8 has been delayed and is not available when its play
slot comes up;
play back must stop until its arrival; creates an annoying gap in
the audio or video
can be improved by delaying the starting time → requires more buffer
19.01.2016 12:04 189
Computer Networks
Network Layer
Quality of Service (QoS)
Buffering (at the receiving side)
as the packets arrive, they are buffered at
the receiver / client system
when to start playing back needs to be
decided : most sites start at 10 seconds
problem of packet no. 8 can be overcome
by delaying the start of replay; but ……
more delay in playing back requires more
buffer space
19.01.2016 12:04 190
Computer Networks
Network Layer
Quality of Service (QoS)
Traffic shaping
non-uniform / irregular transmission of
outputs from source → congestion
Example : server handling many streams
concurrently, allowing fast forward/rewind,
user authentication, …
QoS would be better if servers / hosts can
transmit at uniform rate
traffic shaping smoothes out traffic at
source
19.01.2016 12:04
(server) end 191
Computer Networks
Network Layer
Quality of Service (QoS)
Traffic shaping
regulation of average rate / burstiness of
data transmission
when a connection is set up, customer
and carrier agree upon certain traffic
pattern (SLA)
customer sends as per SLA → carrier
delivers as per SLA ;
carrier monitors traffic flow (traffic policing)
19.01.2016 12:04 192
Computer Networks
Network Layer
Quality of Service (QoS)
Leaky bucket Algorithm each host is connected
to the network by an
interface containing a
leaky bucket i.e. a finite
internal queue

finite, internal queue

(a) water available → flows at constant rate ρ


(b) water not available → flow rate is 0
19.01.2016 12:04 (c) bucket full → additional water entering is lost 193
Computer Networks
Network Layer
Quality of Service (QoS)
Leaky bucket Algorithm
single server / host-queuing system with
constant service time
leaky bucket … finite internal queue
packet arrives when queue is full → discard
can be built into hardware interface or
implemented as part of host OS
an uneven flow is converted to a smooth
flow of packets
19.01.2016 12:04http://webmuseum.mi.fh-offenburg.de/index.php?view=exh&src=8194
Computer Networks
Network Layer
Quality of Service (QoS)
Leaky bucket Algorithm
host is allowed to put one packet per
clock tick onto the network

one packet per tick is OK with ATM

for variable size packets → allow fixed


number of bytes per tick
19.01.2016 12:04 195
Computer Networks
Network Layer
Quality of Service (QoS)
Leaky bucket Algorithm :
Example
assume: a host can produce data @ 25 MB / sec
network also runs at this speed
suppose data comes @ 1 MB bursts, one 40
msec burst every second

19.01.2016 12:04 196


Computer Networks
Network Layer
Quality of Service (QoS)
Leaky bucket Algorithm : Example
suppose, for long intervals, routers work
best at rates not exceeding 2 MB / sec

a leaky bucket with the following


specifications could be used to reduce
the average rate to 2 MB / sec:

ρ = 2 MB / sec and a capacity of C = 1 MB


19.01.2016 12:04 197
Computer Networks
Network Layer
Quality of Service (QoS)
Leaky bucket Algorithm : Example
input to leaky bucket : 25 MB/sec for 40
msec

output : 2 MB / sec for 500 msec

bursts upto 1 MB can be handled without


data loss and such bursts are spread over
0.5 sec or 500 msec
19.01.2016 12:04 198
Computer Networks
Network Layer
Quality of Service (QoS)
Leaky bucket Algorithm : Example

Input to a leaky bucket

Output from a leaky bucket


leaky bucket algorithm enforces a rigid output
pattern at the average rate, with no regard to
burstiness of the traffic
19.01.2016 12:04 199
Computer Networks
Network Layer
Quality of Service (QoS)
Leaky Bucket Algorithm : issues
enforces a rigid output pattern at the
average rate
does not allow bursty traffic
some applications may require speeding
up of output when large bursts arrive
a more flexible algorithm, preferably one
that does not lose data, is required →
19.01.2016 12:04 200
Computer Networks
Network Layer
Quality of Service (QoS)
Token Bucket Algorithm
provides a different kind of traffic shaping
allows saving of packets, upto the
maximum size of bucket, n, i.e.
bursts upto n packets can be sent at once
i.e. allows burstiness in the output stream
and gives faster response to sudden
bursts of input
19.01.2016 12:04 201
Computer Networks
Network Layer
Quality of Service (QoS)
Token Bucket Algorithm
in Token Bucket method, the bucket holds
(#)
tokens, speeds up output during arrival of
bursts, does not drop packets
Token bucket algorithm throws away
tokens (but not packets) when the bucket
fills up
(#) ( in leaky bucket algorithm, bucket holds packets )
19.01.2016 12:04 202
Computer Networks
Network Layer
Quality of Service (QoS)
Token Bucket Algorithm
5 packets
waiting to be
transmitted
2 packets
wait for
three token

3 packets
Before After leave

19.01.2016 12:04 203


Computer Networks
Network Layer
Quality of Service (QoS)
Token Bucket Algorithm
tokens are generated by a clock, once
every ∆T seconds
bucket holds tokens
packet captures token, packet is transmitted,
token is destroyed
if token is not available, packet waits for
token to be generated
token bucket method allows bursts, but
upto a regulated maximum length
19.01.2016 12:04 204
Computer Networks
Network Layer
Quality of Service (QoS)
Token Bucket Algorithm
implementation :
a variable that counts tokens
counter is incremented by 1 every ∆T and
decremented by 1 when a packet is sent
when counter = 0, no packets are sent
in the byte-count variant, counter is
incremented by k bytes every ∆T and
decremented by the length of each packet sent
19.01.2016 12:04 205
Computer Networks
Network Layer
Quality of Service (QoS)
Token Bucket Algorithm
burst length = S seconds
token bucket capacity = C bytes
token arrival rate = ρ bytes per second
maximum output rate = M bytes per second

while the burst is being output, more


tokens arrive
19.01.2016 12:04 206
Computer Networks
Network Layer
Quality of Service (QoS)
Token Bucket Algorithm
Output burst contains a maximum of
(C + ρS) bytes

for M bytes per second output rate,


no. of bytes in a burst of length S seconds
= MS
(C + ρS) = MS
19.01.2016 12:04 S = C ÷ (M - ρ) 207
Computer Networks
Network Layer
Quality of Service (QoS)
Token Bucket Algorithm
for token bucket capacity C = 250 KB
burst size M = 25 MB/sec
token arrival rate ρ = 2 MB/sec
input is a 40 msec
burst @ 25 MB/sec S works out to 10.87 msec
i.e a total of 1 MB

19.01.2016 12:04 208


Computer Networks
Network Layer
Quality of Service (QoS)
Token Bucket Algorithm
token bucket capacity C = 250 KB

token bucket capacity C = 500 KB

token bucket capacity C = 750 KB

19.01.2016 12:04 209


Computer Networks
Network Layer
Quality of Service (QoS)
Token Bucket Algorithm
token bucket capacity C = 250 KB

token bucket capacity C = 500 KB

token bucket capacity C = 750 KB

token bucket of capacity C = 500 KB


followed by a 10 MB/sec leaky bucket

19.01.2016 12:04 210


Computer Networks
Network Layer
Quality of Service (QoS)
Token Bucket Algorithm
Example - 1 AT 5.26

Consider an ATM network using token


bucket scheme in which :
a new token is put into the token bucket
once every 5 µsecs
one cell (48 bytes) uses one token
Compute : the maximum sustainable data
rate in Mbps
19.01.2016 12:04 211
Computer Networks
Network Layer
Quality of Service (QoS)
Token Bucket Algorithm
Example - 1 AT 5.26

1 token = 5 µsecs
in one second, no. of tokens = 2 x 105
No. of bytes per token = 48
= 384 bits
Data rate = 2 x 105 x 384 bps
= 76.8 Mbps
19.01.2016 12:04 212
Computer Networks
Network Layer
Quality of Service (QoS)
Token Bucket Algorithm
burst length = S seconds
token bucket capacity = C bytes
token arrival rate = ρ bytes per second
maximum output rate = M bytes per second

(C + ρS) = MS
S = C ÷ (M - ρ)
19.01.2016 12:04 213
Computer Networks
Network Layer
Quality of Service (QoS)
Token Bucket Algorithm
Example - 2 AT 5.27

Traffic from a host on a 6-Mbps network is


shaped by a token bucket
Token bucket is initially filled to its
capacity of 8 Mb
Token bucket is filled @ 1 Mbps
Compute : how long the computer can
transmit @ full 6 Mbps
19.01.2016 12:04 214
Computer Networks
Network Layer
Quality of Service (QoS)
Token Bucket Algorithm
Example - 2 AT 5.27

C = 8 Mb
M = 6 Mbps
ρ = 1 Mb / sec
S = C ÷ (M - ρ)
S = 1.6 seconds

19.01.2016 12:04 215


Computer Networks
Network Layer
Quality of Service (QoS)
Token Bucket Algorithm
Example - 3 AT 5.28

Given :
Max. packet size = 1000 bytes
Token bucket rate = 10 million bytes / sec
Token bucket size = 1 million bytes
Max. transmission rate = 50 million bytes/sec
Compute :
how long can a burst at maximum speed last
19.01.2016 12:04 216
Computer Networks
Network Layer
Quality of Service (QoS)
Token Bucket Algorithm
Example - 3 AT 5.28

ρ = 10 MB / sec
C = 1 MB
M = 50 MB / sec
S = length of burst = C ÷ (M - ρ)
= (1 MB) ÷ (50 - 10 MB / sec) = 25 msec

19.01.2016 12:04 217


Computer Networks
Network Layer
Quality of Service (QoS)
Techniques for achieving good QoS
(a) over-provisioning (expensive)
(b) buffering (about 10 seconds before replay)
(c) traffic shaping (leaky bucket and token bucket algorithms)
(d) resource reservation (b/w, buffer space, CPU cycles)
(e) admission control (flow negotiations)
(f) proportional routing (divide traffic in proportion to link capacity)
(g) packet scheduling (fair queuing algorithm)

19.01.2016 12:04 218


Computer Networks
Network Layer
Quality of Service (QoS)
Resource Reservation
Source
1
Router
Destination
1
Router
Source
2
Router
Destination
2

Source
3

19.01.2016 12:04 multiple flows passing thro’ a set of routers 219


Computer Networks
Network Layer
Quality of Service (QoS)
Resource Reservation
maintenance of QoS requires that all
packets of a flow follow the same route,
similar to (some extent like) setting up of VC
all packets belonging to a flow to follow
this route → resources can be reserved

Resources which can be reserved :


bandwidth, buffer space (memory), CPU cycles
19.01.2016 12:04 220
Computer Networks
Network Layer
Quality of Service (QoS)
Resource Reservation
(a) bandwidth :
out of the available bandwidth, a portion
can be reserved for a particular flow
(b) buffer :
when a packet arrives :
• it is deposited on NIC by the hardware
• router software copies this to buffer in
its RAM
19.01.2016 12:04 221
Computer Networks
Network Layer
Quality of Service (QoS)
Resource Reservation
(b) buffer :
• queues that buffer for transmission on
appropriate line at appropriate time

buffer is not available ? →


packets have to be discarded →
for a good QoS, reservation of buffers for
a specific flow would help
19.01.2016 12:04 222
Computer Networks
Network Layer
Quality of Service (QoS)
Resource Reservation
(c) CPU cycles
router CPU time is required to process a
packet
it is expressed as packets per second (pps)

CPU load is to be contained within limits


to ensure timely processing of packet
19.01.2016 12:04 223
Computer Networks
Network Layer
Quality of Service (QoS)
Resource Reservation
Estimation of packet delays
if packet processing time = say, 1 µsec →
it can be expected that a router can
process 106 packets per second
however, there could be idle periods due
to statistical fluctuations in the load
packets generally arrive at random and
CPU time required by each is also random
19.01.2016 12:04 224
Computer Networks
Network Layer
Quality of Service (QoS)
Resource Reservation
Estimation of packet delays
Consider :
mean arrival rate of packets (arriving randomly)
= λ packets / sec
mean processing capacity of CPU (also
random for each packet)
= µ packets per sec
mean delay T experienced by a packet is
given by the formula →
19.01.2016 12:04 (Assume : arrival and service distributions are Poisson; Use : queuing theory) 225
Computer Networks
Network Layer
Quality of Service (QoS)
Resource Reservation
Estimation of packet delays
1 1 no load → no packets→
T = ----- x -------- λ=0→T=(1÷µ)
µ (1 - ρ)
where ρ = ( λ ÷ µ ) is the CPU utilization
Ex : λ = 0.95 Mpps, µ = 1 Mpps → ρ = 0.95
→ → → mean delay = 20 µsec
For 30 routers along the route, delay = 600 µsec
19.01.2016 12:04 226
Computer Networks
Network Layer
Quality of Service (QoS)
Resource Reservation
Estimation of packet delays

Example : AT 5.30

CPU in a router can process at 2 Mpps.


Load offered to it is 1.5 Mpps.
Compute the total packet delay if the
route from source to destination contains
10 Routers
19.01.2016 12:04 227
Computer Networks
Network Layer
Quality of Service (QoS)
Resource Reservation
Estimation of packet delays
Example : AT 5.30

µ = 2 x 106 pps, λ = 1.5 x 106 pps; so


ρ = λ ÷ µ = 0.75
T = {1 ÷ 2 x 106} x {1 ÷ 1 - (0.75)}
= 0.5 x 10-6 x 4 sec = 2 µsec
For 10 routers, time spent = 20 µsec
19.01.2016 12:04 228
Computer Networks
Network Layer
Quality of Service (QoS)
Admission Control
• when a flow is offered to a Router, it has
to decide whether to admit or reject it
• decision is based on capacity and
commitments already made to other
flows
• resource requirements are application-
specific

19.01.2016 12:04 229


Computer Networks
Network Layer
Quality of Service (QoS)
Admission Control
• sender (e.g. video server), receiver and
routers are involved in the flow negotiation
• flows must be accurately described; so,
• flow Specifications are required
• the sender proposes flow specifications
• the flowspecs propagate along the route
• each router along the route examines it
and modifies, if needed
• when the specs reach the receiver, the
parameters get established
19.01.2016 12:04 230
Computer Networks
Network Layer
Quality of Service (QoS)
Admission Control
A flow specification has two parts :

• Resource specification - Rspec


the resource that the flow needs to
reserve
• Traffic specification - Tspec
defines the traffic characterization of the
flow
19.01.2016 12:04 231
Computer Networks
Network Layer
Quality of Service (QoS)
Flow Specifications translated to Resource
reservation
Example : AT C5.P408

router’s CPU capacity = 100,000 pps


flow offered to Router is 1 MB / sec
min. and max. packet size = 512 Bytes

Compute : CPU reservation required for


the above flow specifications
19.01.2016 12:04 232
Computer Networks
Network Layer
Quality of Service (QoS)
Flow Specifications translated to Resource
reservation
Packet size = 512 Bytes AT C5.P408
Flow = 1024 x 103 Bytes per second
No. of packets per second in the flow
= (1024 x 103) ÷ 512 = 2000 pps
CPU capacity = 100,000 pps
Reservation of CPU required
= (2,000 ÷ 100,000) = 2%
19.01.2016 12:04 233
Computer Networks
Network Layer
Quality of Service (QoS)
Admission Control
Flow Specifications RFC 2210 / 2211
as the flow specs propagate
along the route, each router
examines it and modifies its
parameters
bytes / sec put
into the bucket
loss of tokens
due to overflow
sender should not
exceed this limit
min. time required
to process a packet
due to network
limitations
19.01.2016 12:04 234
Computer Networks
Network Layer
Quality of Service (QoS)
Proportional Routing
routing algorithms … try to find best path
higher QoS has been achieved by splitting
traffic for each destination over multiple
paths
simple splitting method : divide traffic
equally or in proportion to capacity of
outgoing links
19.01.2016 12:04 235
Computer Networks
Network Layer
Quality of Service (QoS)
Packet Scheduling more by one
aggressive flow ;
router handling multiple flow → less by all others
imbalance in capacity allocations →
reduced QoS for resource-deprived flows
fair queuing algorithm
routers have separate queues for each
output line @ one queue for each flow
when a line becomes idle, router scans
queues in round robin fashion, takes 1st
packet on the next queue
19.01.2016 12:04 236
Computer Networks
Network Layer
Quality of Service (QoS)
fair queuing algorithm
Issue : more bandwidth is given to hosts
using large packets than those using
small packets
so, round robin is done at byte level
queues are scanned byte-by-byte, until all
packets are finished
packets are sorted in order of their
finishing time and sent in that order
19.01.2016 12:04 237
Computer Networks
Network Layer
Quality of Service (QoS)
Packet Scheduling
(bytes in the packets)
6
4
2 (output line)
4
4
5 packets
in queue
for line O Sorted order
at clock(virtual) tick 1, 1st byte of packet on
line A is sent, then B2, …. ; sorted & sent
19.01.2016 12:04 238
Computer Networks
Network Layer
Quality of Service (QoS)
Packet Scheduling Example P&D4e6.10
Suppose a router has three input flows
and one output.
The router receives the packets listed in
the table (next slide) all at about the same
time, in the order listed.
The packets are received during a period
when the output port is busy, but all
queues are otherwise empty.
19.01.2016 12:04 239
Computer Networks
Network Layer
Quality of Service (QoS)
Packet Scheduling P&D4e6.10

Give the order


in which the
packets
are transmitted
assuming :
Fair Queuing
(hint : calculate the finishing
time of packets in each flow)
19.01.2016 12:04 240
Computer Networks
Network Layer
Quality of Service (QoS)
Packet Scheduling P&D4e6.10

Calculate the finishing times Fi

The packets are


sent in the
increasing
order of Fi , i.e.
1, 7, 8, 5, 2, 3, 6, 4
160
19.01.2016 12:04 241
Computer Networks
Network Layer
Quality of Service (QoS)
Packet Scheduling
weighted fair queuing :
fair queuing gives same priority for all hosts.
some applications deserve higher
bandwidth allotment
Ex : video servers as compared to file
servers
one way is to allow 2 or more bytes (weight) per
tick or have weight proportional to no. of flows
19.01.2016 12:04 242
Computer Networks
Network Layer
Quality of Service (QoS)
Packet Scheduling
weighted fair queuing :

19.01.2016 12:04 243


Computer Networks
Network Layer
Quality of Service (QoS)
IP was designed to provide best-effort
delivery
i.e. every user receives the same level of
services
the best-effort type of delivery does not
guarantee the minimum of service, such
as bandwidth, to applications such as
real-time audio and video

19.01.2016 12:04 244


Computer Networks
Network Layer
Quality of Service (QoS)
two models have been designed to
provide QoS in the Internet at the network
(IP) layer :

• Integrated Services (IntServ)

• Differentiated Services (DiffServ)

19.01.2016 12:04 245


Computer Networks
Network Layer
Quality of Service (QoS)
Integrated Services
architecture for streaming multimedia
covered by more than 20 RFCs, starting
with RFC 2205
flow-based algorithms or integrated services
covers both applications :
(a) unicast - ex. single user streaming a video
clip from a news site
(b) multicast - a collection of digital channels
transmitting streaming videos (IP packets)
to many receivers at various locations
19.01.2016 12:04 (many to many) 246
Computer Networks
Network Layer
Quality of Service (QoS)
Integrated Services
RSVP : Resource reSerVation Protocol

described in RFC 2205


is a signalling protocol to help IP create a
flow and consequently make resource
reservation
other protocols are used for transporting
data
19.01.2016 12:04 247
Computer Networks
Network Layer
Quality of Service (QoS)
Integrated Services
RSVP : Resource reSerVation Protocol
RSVP - features :
• allows multiple senders to transmit to
multiple groups of receivers
• permits individual receivers to switch
channels freely
• optimizes bandwidth
• eliminates congestion
19.01.2016 12:04 248
Computer Networks
Network Layer
Quality of Service (QoS)
Integrated Services
RSVP : Resource reSerVation Protocol
RSVP - features :
• reservation is receiver-based
i.e. the receivers, not the sender, make
the reservation
• the receivers, not the sender, make a
decision to join or leave a multicast
group
19.01.2016 12:04 249
Computer Networks
Network Layer
Quality of Service (QoS)
Integrated Services
RSVP :
Resource reservation protocol uses
multicast routing using spanning trees
(a) each group is assigned a group address
(b) sender puts group address in the
packets to be sent to the group
(c) the standard multicast routing algorithm
builds a spanning tree covering all group
members
19.01.2016 12:04 250
Computer Networks
Network Layer
Quality of Service (QoS)
RSVP : Integrated Services
multicast senders

multicast receivers

Network MCST for H1 MCST for H2


19.01.2016 12:04 251
Computer Networks
Network Layer
Quality of Service (QoS)
Integrated Services
RSVP :
H1, H2 … multicast senders
H3, H4, H5 … multicast receivers

to get better QoS without congestion, any


receiver can send reservation message up
the spanning tree to the sender

19.01.2016 12:04 252


Computer Networks
Network Layer
Quality of Service (QoS)
Integrated Services
RSVP :
message is forwarded using the reverse
path algorithm
at each hop, router notes / reserves
necessary bandwidth ….
bandwidth is reserved all the way from the
sender to receiver along the spanning tree
19.01.2016 12:04 253
Computer Networks
Network Layer
Quality of Service (QoS)
Integrated Services
RSVP : Path messages

Path message travels from


the sender and reaches all
receivers in the multicast
path
On the way, a Path message
stores the necessary
information for the receivers
19.01.2016 12:04 254
Computer Networks
Network Layer
Quality of Service (QoS)
Integrated Services
RSVP : Resv messages

After receipt of Path message,


receiver sends a Resv message
The Resv message travels
upstream and makes resource
reservations on the routers that
support RSVP
19.01.2016 12:04 255
Computer Networks
Network Layer
Quality of Service (QoS)
Integrated Services
RSVP : Resv merging

Reservations :
R3 : 2 Mbps
R2 : 3 Mbps
R1 : 3 Mbps
reservation of bandwidth in a router
should meet the requirement of the
highest flow through it
19.01.2016 12:04 256
Computer Networks
Network Layer
Quality of Service (QoS)
Integrated Services
S1 S2 S1 S2 S1 S2
RSVP :

R3 R4 R5 R3 R4 R5 R3 R4 R5

R3 to S1 R3 to S1 R3 to S1
R3 to S2 R3 to S2
19.01.2016 12:04 R5 to S1 257
Computer Networks
Network Layer
Quality of Service (QoS)
Integrated Services
RSVP :
(a) R3 requests a channel to S1 →
reservation is done
(b) R3 requests another channel, this time
to S2, for receiving a separate
stream → reservation is done
(c) two separate channels are required
from R3 to E, since two streams are
different
19.01.2016 12:04 258
Computer Networks
Network Layer
Quality of Service (QoS)
Integrated Services
RSVP :
(d) R5 also decides to receive stream
being transmitted from S1
(e) dedicated bandwidth is reserved upto
router H
(f) router H sees that due to its already
having a feed from S1, bandwidth is
already reserved…no more reservation
19.01.2016 12:04 259
Computer Networks
Network Layer
Quality of Service (QoS)
Integrated Services
RSVP :
(g) if R3 {see (a)} and R5 {see (d)} have
sought different bandwidths, higher of
these to bandwidths is to be allotted

Example : → →

19.01.2016 12:04 260


Computer Networks
Network Layer
Quality of Service (QoS)
RSVP : Integrated Services AT 5.29

multicast senders

multicast receivers

Network MCST for H1 MCST for H2


19.01.2016 12:04 261
Computer Networks
Network Layer
Quality of Service (QoS)
Integrated Services
RSVP Example AT 5.29

R3 requests bandwidth 2 MBps from S1


R3 requests bandwidth 1 MBps from S2
R4 requests bandwidth 2 MBps from S1
R5 requests bandwidth 1 MBps from S2

What is the bandwidth required to be


reserved at Routers A, B, C, E, H, J, K, L ?
19.01.2016 12:04 262
Computer Networks
Network Layer
Quality of Service (QoS)
RSVP : Integrated Services AT 5.29

S1 S2
multicast senders

1 A 2
2
C 1
E 3
3
H 3
3 J 3
K 2
3 2 1 L 1

multicast receivers
R3 R4 R3 R5
Network
19.01.2016 12:04 2-S1 2-S1 1-S2 1-S2 263
Computer Networks
Network Layer
Quality of Service (QoS)
Issues with Integrated Services
flow-based algorithms : demerits
• require advance set up to establish each flow
so, scalability to large no. of flows is a problem
• maintain internal per-flow states in
routers, vulnerable to router crashes
• changes required to router code are
high, involves complex router-to-router
exchanges for setting up flows
19.01.2016 12:04 class-based → → → 264
Computer Networks
Network Layer
Quality of Service (QoS)
Differentiated Services (DS)
class-based methods RFC 2474, 2475, …
simpler approach to easy QoS
implementation - locally in each router
without any of the following issues :
(a) advance setup easy to
(b) involving the whole path implement

(c) reservation
(d) time consuming end-to-end negotiation
with each flow
19.01.2016 12:04 265
Computer Networks
Network Layer
Quality of Service (QoS)
Differentiated Services (DS)
DS can be offered by a set of routers
forming an administrative domain (eg. ISP)
a set of service classes with corresponding
forwarding rules is defined by administration
customer packets entering a domain carries
a Type of Service field { e.g. premium (better),
ordinary, .. }
classes may differ in terms of delay, jitter,
discarding
19.01.2016 12:04
in the event of congestion 266
Computer Networks
Network Layer
Quality of Service (QoS)
Differentiated Services (DS)
(a) Expedited forwarding : RFC 3246

two logical pipes showing different


two classes of service reservations, but a single physical link

reservation of bandwidth, separate output queue


per line, weighted fair queuing
19.01.2016 12:04 267
Computer Networks
Network Layer
Quality of Service (QoS)
Differentiated Services (DS)
(a) Expedited forwarding : RFC 3246
the routers are programmed to have two
output queues for each outgoing line :

• one for expedited packets (weighted fair


queuing, higher proportion of bandwidth
allotted)
• one for regular packets
19.01.2016 12:04 268
Computer Networks
Network Layer
Quality of Service (QoS)
Differentiated Services (DS)
(b) Assured forwarding : RFC 2597
• four priority classes, each having its
own resources
• three discard probabilities for packets in
congestion : low, medium, high

taken together, the above define twelve


service classes
19.01.2016 12:04 269
Computer Networks
Network Layer
Quality of Service (QoS)
Differentiated Services (DS)
Assured forwarding 3 steps performed by NW S/W or OS
mark packets
according
2 to class using
TOS field

classify shape into


into 1 of 4 acceptable
3 form
1 done in using
host or leaky / token
ingress buckets
router

IP header has an 8-bit type of service field


19.01.2016 12:04 ( 6 bits are used to specify service class ) 270

You might also like