Download Routing and Forwarding

Document related concepts

Drift plus penalty wikipedia , lookup

Zero-configuration networking wikipedia , lookup

Piggybacking (Internet access) wikipedia , lookup

Distributed firewall wikipedia , lookup

Network tap wikipedia , lookup

Backpressure routing wikipedia , lookup

Asynchronous Transfer Mode wikipedia , lookup

Internet protocol suite wikipedia , lookup

RapidIO wikipedia , lookup

Peering wikipedia , lookup

Computer network wikipedia , lookup

IEEE 802.1aq wikipedia , lookup

Deep packet inspection wikipedia , lookup

Net bias wikipedia , lookup

Wake-on-LAN wikipedia , lookup

Airborne Networking wikipedia , lookup

Cracking of wireless networks wikipedia , lookup

Multiprotocol Label Switching wikipedia , lookup

IEEE 1355 wikipedia , lookup

TCP congestion control wikipedia , lookup

Quality of service wikipedia , lookup

Recursive InterNetwork Architecture (RINA) wikipedia , lookup

Routing wikipedia , lookup

Routing in delay-tolerant networking wikipedia , lookup

Transcript
Routing and Forwarding
Dr. Ramana
I.I.T Rajasthan
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
1 / 80
Outline of the Lectures
1
2
3
4
Internetworking
The Internet
Addressing
Packet Forwarding Algorithm
Routing Architecture
Internet Architecture
Intradomian Routing
Interdomian Routing
Router Architectures
IP Header
Router functions
Router Components
Packet Flow
Router Architectures
Resource Allocation and Congestion Control
Congestion Control Mechanism
Congestion Avoidance Mechanisms
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
2 / 80
Internetworking
Internetworking - Introduction
Communication among the users from different networks which
are based on different networking technologies
Challenges:
Resource heterogeneity while offering fairly predictable services
Scalability – Addressing, Routing, Forwarding ‘
A simple internetwork
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
3 / 80
Internetworking
(Cont.)
Protocol layers used in Internetworking
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
4 / 80
Internetworking
Internet
Standalone
Mainframe
Local Area
Network
Ethernet
switch
Router
Wide Area Network
(e.g. ATM)
Router
Router
Wide Area Network
(e.g. ATM)
Local Area
Network
Ethernet
switch
Router
Information
server
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
LAN PCs
and workstations
5 / 80
Internetworking
(Cont.)
Residential
user
Subscriber
connection
High-speed link
(e. g. SONET)
Internet service
provider (ISP)
Router
Internet
ATM
switch
Firewall
host
Router
Private
WAN
High-speed
link
Ethernet
switch
Information
server
ATM
Network
LAN PCs
and workstations
Figure 1.6 A Networking Configuration
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
6 / 80
Internetworking
(Cont.)
LAN 1
LAN 2
Frame relay
WAN
Router
(X)
End system
(A)
Router
(Y)
End system
(B)
TCP
IP
LLC
MAC
Physical
TCP
t1
t6
t2
t5
t3
t4
IP
LLC
MAC
t7
LAPF
Physical Physical
LAPF
t8
t1, t6, t7, t10, t11, t16
=
=
=
=
Dr. Ramana ( I.I.T Rajasthan )
t9
LLC
MAC
Physical Physical
t11
t16
t12
t15
t13
t14
IP-H
TCP-H
Data
t2, t5
LLC1-H
IP-H
TCP-H
Data
t3, t4
MAC1-H LLC1-H
IP-H
TCP-H
Data
MAC1-T
FR-H
IP-H
TCP-H
Data
FR-T
t12, t15
LLC2-H
IP-H
TCP-H
Data
t13, t14
MAC2-H LLC2-H
IP-H
TCP-H
Data
t8, t9
TCP-H
IP-H
LLCi-H
MACi-H
IP
t10
TCP header
IP header
LLC header
MAC header
MACi-T
FR-H
FR-T
= MAC trailer
= Frame relay header
= Frame relay trailer
Routing and Forwarding
IP
LLC
MAC
Physical
MAC2-T
7 / 80
Internetworking
The Internet
Internet Protocol Stack
OSI
MIME
BGP
FTP
HTTP
SMTP
Application
TELNET
TCP
SNMP
Presentation
UDP
ICMP
=
=
=
=
=
=
=
Border Gateway Protocol
File Transfer Protocol
Hypertext Transfer Protocol
Internet Control Message Protocol
Internet Group Management Protocol
Internet Protocol
Multipurpose Internet Mail Extension
OSPF
RSVP
SMTP
SNMP
TCP
UDP
=
=
=
=
=
=
IGMP
OSPF
RSVP
Transport
Transport (host-to-host)
Network
Open Shortest Path First
Resource ReSerVation Protocol
Simple Mail Transfer Protocol
Simple Network Management Protocol
Transmission Control Protocol
User Datagram Protocol
Internet
Data Link
Network
Access
Physical
Physical
A Comparison of the OSI and TCP/IP Protocol Architectures
Some Protocols in the TCP/IP Protocol Suite
Dr. Ramana ( I.I.T Rajasthan )
Application
Session
IP
BGP
FTP
HTTP
ICMP
IGMP
IP
MIME
TCP/IP
Routing and Forwarding
8 / 80
Internetworking
Addressing
IP Addresses
Hierarchical addressing embedding fairly logical structure, that is
parts of an IP address correspond to some sort of hierarchy in the
internetwork
IP address = (network part + host part)
Scalable addressing mechanism - Class based and classless
addressing
0
Network (7 bits)
1 0
1 1 0
1 1 1 0
1 1 1 1 0
Class A
Host (24 bits)
Network (14 bits)
Host (16 bits)
Network (21 bits)
Host (8 bits)
Class B
Class C
Multicast
Class D
Future Use
Class E
IPv4 Address Formats
Dr. Ramana ( I.I.T
Rajasthan )
Examples
a) class A – 12.190.16.54
b) class B – 132.10.45.235
c) class C – 201.18.1.34
Routing and Forwarding
9 / 80
Internetworking
Addressing
Subnetting
Dividing a network into smaller networks (subnets)
Takes few bits from host portion from IP address to represent the
subnet in a network
Netmask (aka Subnet mask) consists 1’s for network+subnet
portion and 0’s for host portion. It is used to extract network
number from an IP address.
Used with class based addressing. For example,
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
10 / 80
Internetworking
Addressing
Supernetting
Aggregate several smaller networks into a large network
Blocks of contiguous IP addresses from the same class are
merged
Used with classless addressing
Allocates address space on any address bit boundary (instead of
on 8-bit segments)
Number of blocks of IP address merged must always powers of 2
Network numbers are represented as value/length, where length
denotes number of bits in the network prefix. Example:
192.4.16/20, where 20 is length.
Also known as Classless Internet Domain Routing (CIDR)
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
11 / 80
Internetworking
Packet Forwarding Algorithm
Forwarding Algorithm
1
2
D = destination of IP address
for each forwarding table entry (SubnetID, Subnetmask, Nexthop)
D1 = Subnetmask & D
if D1 = SubnetID
if NextHop is an interface
deliver datagram directly to destination
else
deliver datagram directly to Next Hop
Forwarding algo in CIDR is almost same. Except that, each
forwarding table entry will have value/length and forwarding rule match for the longest prefix.
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
12 / 80
Internetworking
Packet Forwarding Algorithm
(Cont.)
Subnet ID
128.96.34.0
128.96.34.128
128.96.33.0
Subnetmask
255.255.255.128
255.255.255.128
255.255.255.0
Next hop
Interface 0
Interface 1
R2
Forwarding table at R1
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
13 / 80
Internetworking
Packet Forwarding Algorithm
Example to be Solved - I
subnet ID
128.96.39.0
128.96.39.128
128.96.40.0
192.4.153.0
(default)
Subnetmask
255.255.255.128
255.255.255.128
255.255.255.128
255.255.255.192
1
128.96.39.10
2
128.96.40.12
3
128.96.40.151
4
192.4.153.17
5
192.4.153.90
Dr. Ramana ( I.I.T Rajasthan )
Nexthop
Interface 0
Interface 1
R2
R3
R4
Routing and Forwarding
14 / 80
Internetworking
Packet Forwarding Algorithm
Example to be Solved - II
net/mask length
c4.5e.2.0/23
c4.5e.4.0/22
c4.5e.C0.0/19
c4.5e.40.0/18
c4.4c.0.0/14
c0.0.0.0/2
80.0.0.0/1
1
c4.4b.31.2E
2
c4.5e.05.09
3
c4.4d.31.2E
4
c4.5e.03.87
5
c4.5e.7F.12
6
c4.5e.D1.02
Dr. Ramana ( I.I.T Rajasthan )
Nexthop
A
B
C
D
E
F
G
Routing and Forwarding
15 / 80
Routing Architecture
Internet Architecture
Internet Architecture
Stub AS: connects to one other AS only
Multihomed AS: connects more than one AS, but refuses to carry transit traffic
Transit AS: connects more than one other AS, and carries local and transit traffic
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
16 / 80
Routing Architecture
Internet Architecture
Routing - Classification
Intradomain routing – routing within an AS, use interior routing
protocols such as RIP and OSPF
Interdomain routing – routing between ASs use exterior routing
protocols such as EGP and BGP
Intradomain routing algorithms
Distance vector algorithm – Node sends its knowledge about the
network to all its neighbours
Link state routing algorithm – Node broadcasts its knowledge about
the neighbours to the entire network
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
17 / 80
Routing Architecture
Intradomian Routing
Distance Vector Routing a.k.a Bellman-Ford Algorithm
Example topology
Dr. Ramana ( I.I.T Rajasthan )
Distance to reach by each node
Node A B C D E F
A
0
1
1
∞ 1
1
B
1
0
1
∞ ∞ ∞
C
1
1
0
1
∞ ∞
D
∞ ∞ 1
0
∞ ∞
E
1
∞ ∞ ∞ 0
∞
F
1
∞ ∞ ∞ ∞ 0
G
∞ ∞ ∞ 1
∞ 1
Routing and Forwarding
G
∞
∞
∞
1
∞
1
0
18 / 80
Routing Architecture
Intradomian Routing
Nodes periodically send updates even if none has changes
Triggered updates are initiated whenever a node receives an
update from others that cause it to change its routing information
Count to Infinity – a situation that prevents the network from
stabilizing
Example, when a link between A and E fails, B and C advertise a
distance of 2.
Update cycle C → B → A → C
Solutions – Take a small value for ∞ as 16 or,
Split horizon – don’t send the routes it learned from a neighbour to
that neighbour itself
Example, node B may have (E,2,A), so B do not send (E,2) in the
updates sent to A
Do not work if routing loop involves more than 2 nodes
speed of convergence is low
RIP (Routing Information Protocol) implements DV algorithm
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
19 / 80
Routing Architecture
Intradomian Routing
Link State Routing Algorithm
Each node announces about its neighbours and the link costs to
them to all the nodes in the network in LSP (link state packets)
Reliable flooding: make sure that a copy of LSP sent by a node
reached every other node in the network
Once a node obtains network-wide knowledge, it uses Dijkstra’s
routing algorithm (a.k.a forward search algorithm) to compute
routes to all the destinations
Open Shortest Path First (OSPF) is a link state approach
It introduces multiple routing areas within AS (further classification
within AS)
OSPF messages are protected by password
Routing metrics – Queue lengths, hops, delay, speed, cost etc.,
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
20 / 80
Routing Architecture
Intradomian Routing
Dijksra’s shortest-path algorithm
1
2
M = {s}
for each n in N − {s}
1
3
C(n) = l(s, n)
while (N 6= M)
1
2
M = M ∪ {w} such that C(w) is the minimum for all w in (N − M)
for each n in (N − M)
1
C(n) = MIN(C(n), C(w) + l(w, n)
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
21 / 80
Routing Architecture
Intradomian Routing
Routing Areas in OSPF
LSPs are sent within routing area
Similar to AS boarder router, area boarder routers forward routing
information across routing areas
Scalability often given importance over shortest-path
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
22 / 80
Routing Architecture
Interdomian Routing
Interdomain Routing
Determine network reachability between autonomous systems
Policy: prefer AS X than AS Y, prefer AS Y only if no other path,
do not carry traffic between AS X and AS Y
Focus on finding the best, nonlooping, policy-compliant path
Challenges
Scalability (exchange of large amount of information)
Impossible to calculate meaningful path costs for a path crosses
multiple ASs (i.e., selecting optimal path is impossible)
Trust between different ASs
Exterior gateway protocol – carries the reachability information
Advertises complete paths as an enumerated list of ASs to reach
a particular network
BGP could announce the routes, withdraw some router, or refuse
to announce a route to a particular AS even if it has one
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
23 / 80
Routing Architecture
Interdomian Routing
Routes advertised by BGP
AS1 announce networks 192.4.54, 192.4.23, 192.12.69 can be
reached on path (AS 1, AS 2) to other ASs.
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
24 / 80
Routing Architecture
Interdomian Routing
(Cont.)
A BGP speaker per AS responsible to send network reachability
information to the BGP speakers of other ASs
BGP messages are carried using TCP
Periodic hello messages are sent even if no update
Boarder routers are one through which traffic enters and leaves an
AS
Interior BGP is used to redistribute the information (learned about
other ASs) within an AS
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
25 / 80
Routing Architecture
Dr. Ramana ( I.I.T Rajasthan )
Interdomian Routing
Routing and Forwarding
26 / 80
Router Architectures
IP Header
Internet Protocol Version 4 – RFC 791
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
27 / 80
Router Architectures
IP Header
IP Fragmentation
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
28 / 80
Router Architectures
IP Header
(Cont.)
a) Unfragmented Packet b) Fragmented packets
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
29 / 80
Router Architectures
Router functions
Router functions
Basic forwarding functions
IP Header validation
Packet lifetime control
Checksum recalculation
Destination address lookup
Fragmentation
Handling IP options
Complex forwarding functions
Packet classification
Packet translation
Traffic prioritization
Routing processing functions
Handing routing updates
Sending routing updates
Router management (monitoring of various operations)
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
30 / 80
Router Architectures
Router functions
(Cont.)
Forwarding table
Optimized for lookup a destination IP address against set of IP
prefixes
Could be implemented in hardware as lookup needs to be done for
every packet
Routing table
Optimized for storing/updating network topology and calculating
changes in network topology
Implemented in software
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
31 / 80
Router Architectures
Router Components
Router Components
Network interface - contains multiple ports which provide
connectivity to various physical links
Forwarding engine
does lookup and determine outgoing interface
packet classifying - to provide quality of services at the outgoing link
Queue manager
stores the packets in appropriate buffers at the outgoing port
implements policies for dropping packets due to buffer overflows
schedules packets depending on the packets priorities
Traffic manager
shapes outgoing traffic to meet service level agreements (SLAs)
traffic policing to check the voilation of SLAs by the received traffic
marking of traffic that has voilated the SLAs
Backplane - shared/switched circuit through which packets are
transfered between the incoming (ingress) and outgoing (egress)
ports
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
32 / 80
Router Architectures
Packet Flow
Packet flow in a router
Router
Control
Processor
Routing
Table
Control plane
Data plane
Forwarding
Table
Buffer
3
Buffer
8
4
1
Input
Network
Interface
2
Queue
Manager
Forwarding
Engine
9
Traffic
Manager
10
Output
Network
Interface
11
7
5
6
Backplane
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
33 / 80
Router Architectures
Packet Flow
Packet processing: Fast path and slow path
Fast path
Packet processed and transfered from ingress to egress network
interfaces via backplane
To achieve high speeds, operations are implemented in customized
hardware
Time-critical operation
All basic and complex forwarding functions (except fragmentation
and handling IP options)
Slow path
Packets partially processed at the ingress interface and forwarded
to CPU for further processing
CPU directly forwards the packets to egress interface once it
completes the processing
Non time-critical operation
Routing processing functions
Processing of data packets that lead to errors in the fast path and
generation of ICMP packets
Fragmentation and handling IP options and ARP packet processing
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
34 / 80
Router Architectures
·
Router Architectures
Click Modular Router - Software Router
12
E. Kohler et al.
FromDevice(eth0)
FromDevice(eth1)
Classifier(...)
ARP
queries
Classifier(...)
ARP
responses
ARP
queries
IP
ARPResponder
(1.0.0.1 ...)
to Queue
ARP
responses
IP
ARPResponder
(2.0.0.1 ...)
to Queue
to ARPQuerier
to ARPQuerier
Paint(1)
Paint(2)
Strip(14)
CheckIPHeader(...)
GetIPAddress(16)
LookupIPRoute(...)
to Linux
DropBroadcasts
DropBroadcasts
CheckPaint(1)
CheckPaint(2)
ICMPError
redirect
IPGWOptions(1.0.0.1)
ICMPError
redirect
IPGWOptions(2.0.0.1)
ICMPError
bad param
FixIPSrc(1.0.0.1)
ICMPError
bad param
FixIPSrc(2.0.0.1)
DecIPTTL
DecIPTTL
ICMPError
TTL expired
IPFragmenter(1500)
ICMPError
TTL expired
IPFragmenter(1500)
ICMPError
must frag
Dr. Ramana ( I.I.T Rajasthan )
ICMPError
must frag
from Classifier
from Classifier
ARPQuerier(1.0.0.1, ...)
ARPQuerier(2.0.0.1, ...)
ToDevice(eth0)
ToDevice(eth1)
RoutingFig.
and
8. Forwarding
An IP router configuration.
35 / 80
Router Architectures
Router Architectures
Shared CPU Architectures
Shared CPU module, which hosts
Buffer, L2/L3 processing (inbound, outbound), forwarding engine,
forwarding table, queue manager, traffic managfer
Network Interfaces
Shared backplane - through which packets are transfered between
CPU and Network Interfaces
Typically packets will transfer between shared backplane twice (for
inbound and outbound), which is considered as limmitation.
This can be improved by shifting some functional units, such as
forwarding engine, forwarding cache, buffer, queue manager,
traffic manager to the Network Interfacing Unit (AKA line card).
This is called as shared CPU with route caches.
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
36 / 80
Router Architectures
Router Architectures
(Cont.)
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
37 / 80
Router Architectures
Router Architectures
Shared Forwarding Engine Architectures
Shared Nothing Architectures: Replaces shared backplane with
switched backplane
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
38 / 80
Router Architectures
Router Architectures
Further Reading
Implementation of Modular router through software modules –
http://read.cs.ucla.edu/click/
IP Router Architectures: An Overview http://www.cs.virginia.edu/c̃s757/papers/awey99.pdf
Study of Internet Router Architectures http://home.iitj.ac.in/r̃amana/Study-of-Internet-RouterArchitectures.pdf
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
39 / 80
Resource Allocation and Congestion Control
Introduction
Network resources - link bandwidth and buffer space at routers
Resource allocation - process by with network elements effectively
and fairly allocates their resources for the competing traffic flows
Overprovisiong - is not practically possible
Evaluating resource allocation mechanisms
Effective resource utilization - stable (packets would continue to go
through the network at higer loads) or unstable (network
experiences congestion collapse)
Fairness - how fairly resource
are being allocation to the competing
P
flows - Jain’s fairness =
Dr. Ramana ( I.I.T Rajasthan )
( ni=1 x i )2
P
n ni=1 x i 2
Routing and Forwarding
40 / 80
Resource Allocation and Congestion Control
(Cont.)
Metric for Effective utilization, power = ratio of throughput and
delay (assumptions - sinlgle flow and infinite queues)
No alternitive metic available
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
41 / 80
Resource Allocation and Congestion Control
Taxonomy of Resource Allocation Mechanisms
Router-centric vs Host-centric (not mutually exclusive)
Router-centric - routers make decision on droping the packets and
appropriately inform hosts
Host-centric - hosts observe the network conditions and adjust their
behaviour
Reservation-based vs Feedback-based
Reservation-based system - implies router-centric mechanism.
Resources are reserved as per the request made by host at the
time of connection setup.
Feedback-based system - can imply either router- or host-centric
explicit - sending messages, like choke packets, ECNs
implicit - triggering and understanding packets drops, like RED
The resources allocation mechanisims are tied to the underlying
service model of the network
Best-effort - Responsibilty falls mostly with hosts with some
assistance from routers (Feedback based)
QoS based - Requires significant router involvement (fine-grained
or coarse-grained) (Reservation based)
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
42 / 80
Resource Allocation and Congestion Control
Congestion Control Mechanism
Congestion Control Algorithm (CCA), RFC 1122,2581
Introduced in late 1980’s by Van Jacobson as part of transport
layer mechanism
Congestion collapse due to improper response to the congestion
events
Loss based, delay based, equation based
Loss of an Ack or Retransmission timeout =⇒ congestion in the
network
Congestion window (cwnd) – determines number of bytes that can
be outstanding
MaxWindow = MIN(CongestionWindow, AdvertisedWindow)
EffectiveWindow = MaxWindow - NumberOfBytesOutStanding
(i.e, LastByteSent - LastByteAcked)
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
43 / 80
Resource Allocation and Congestion Control
Congestion Control Mechanism
Updating of Congestion Window
Multiplicative/Exponential increase
(MI) – Phase Slow-start (SS)
Dr. Ramana ( I.I.T Rajasthan )
Additive/Linear increase (AI) –
Phase Congestion avoidance (CA)
Routing and Forwarding
44 / 80
Resource Allocation and Congestion Control
Congestion Control Mechanism
(Cont.)
Trasition from MI and AI – via a threshold slow-start threshould
ssthresh
Events that trigger reduction in cwnd
Retransmission timeout
Tripple duplicate Acks (fast retransmission)
How much reduction?
cwnd = 1 MSS
cwnd = cwnd/2 (fast recovery)
Variants of CCA
TCP Tahoe - Fast Retransmit
TCP Reno - Fast Retransmit + Fast Recovery
TCP New reno - Fast Retransmit + Fast Recovery + Avoid multiple
reductions
TCP-Vegas
TCP-Few (fractional window increase)
TCP Cubic
TCP-TFRC
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
45 / 80
Resource Allocation and Congestion Control
Congestion Control Mechanism
Congestion window progression
Congestion
Window
Initial
Slowstart
Dr. Ramana ( I.I.T Rajasthan )
Timeouts
may still
occur
Slowstart
to pace
packets
Fast
Retransmit
and Recovery
Routing and Forwarding
Time
46 / 80
Resource Allocation and Congestion Control
Congestion Control Mechanism
Fast Retransmission
S
e
q
u
e
n
c
e
Retransmission
X
Duplicate Acks
N
o
Time
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
47 / 80
Resource Allocation and Congestion Control
Congestion Control Mechanism
Multiple Losses
S
e
q
u
e
n
c
e
X
X
X
X
Now what?
Retransmission
Duplicate Acks
N
o
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
48 / 80
Resource Allocation and Congestion Control
Congestion Control Mechanism
TCP-Reno vs TCP-NewReno
TCP Reno with a bursty packet loss
Reduction of window size multiple times
Timeouts because it does not receive enough duplicate
acknowledgements
TCP NewReno with a bursty packet loss
Ack that arrives after retransmission would be a partial Ack, and
indicate that second loss occurred
Recovers one packet loss per RTT
NewReno timeouts a) when there are fewer than 3 dupacks for
first loss b) when partial ack is lost
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
49 / 80
Resource Allocation and Congestion Control
Congestion Control Mechanism
TCP-Vegas
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
50 / 80
Resource Allocation and Congestion Control
Congestion Avoidance Mechanisms
Implicit Feedback Schemes
During congestion, implicit schemes drop packets while explicit
schemes generate notifications
Proactive dropping vs Reactive dropping
Proactive dropping of packets is a.k.a AQM (Active queue
management)
Advantages of AQM
Maintains average queue size small
Reduces the number of packets dropped in the router
Eliminates the global Congestion window synchronization problem
Low queuing delay
Example of an AQM is Random Early Dectection (RED)
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
51 / 80
Resource Allocation and Congestion Control
Congestion Avoidance Mechanisms
RED
Drops the packet before queue really become overflow
Packet dropping policy is governed by four paramters Average
queue length Qavg , Minimum and maximum threshoulds on queue
lentgh Qmin and Qmax , respectively, and packet dropping
probability Pa
Droping rules - If Qavg < Qmin
S. Floyd and V. Jacobson, ”Random early detection gateways for
congestion avoidance,” IEEE/ACM Trans. on Networking, vol. 1,
pp. 397413, August 1993.
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
52 / 80
Resource Allocation and Congestion Control
Congestion Avoidance Mechanisms
(Cont.)
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
53 / 80
Resource Allocation and Congestion Control
Queuing Disciplines
Queuing Disciplines
Governs how packets to be buffered while waiting to be
transmitting (other words the order in which packets to be
transmitted)
It directlt affects the latency of packets
Dropping policy (ex. Front drop or Tail drop or RED) - determines
which packet to be dropped - is different from queuing discipline
Issues
bounded/predictable delays
efficient implementation
Types
First In First Out
Priority based
Round Robin (RR)
Fair Queueing (FQ)
Weigthed RR
Weighted FQ
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
54 / 80
Resource Allocation and Congestion Control
Queuing Disciplines
(Cont.)
FIFO
Dr. Ramana ( I.I.T Rajasthan )
Round Robin
Routing and Forwarding
55 / 80
Resource Allocation and Congestion Control
Queuing Disciplines
(Cont.)
J. Bennett and H. Zhang, ”Hierarchical packet fair queueing
algorithm,” in Proc. ACM SIGCOMM 96, pp. 143156, Palo Alto,
CA, August 1996.
A. Kortebi, L. Muscariello, S. Oueslati, and J. Roberts, ”On the
scalability of fair queueing,” in Proc. Third Workshop on Hot
Topics in Networks (HotNets-III), San Diego, CA, November 2004.
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
56 / 80
Resource Allocation and Congestion Control
Quality of Services
QoS on the Internet
Internet traffic
Data - ex. emails
Stored videos/audio - ex. youtubes
Real time interactive traffic
Mission criticle data
QoS - to meet the requirements of the applications by the Internet
which offers best-effor service
QoS approach
Fine-grained approach - offers QoS guarantees at flow/application
level
Coarse-grained appoach - offers QoS guarantees for an
aggregated traffic
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
57 / 80
Resource Allocation and Congestion Control
Quality of Services
Application requirements
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
58 / 80
Resource Allocation and Congestion Control
Quality of Services
Example
Audio application
Playback buffer for audio
application
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
Distribution of delays
59 / 80
Resource Allocation and Congestion Control
Quality of Services
Taxonomy of applications
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
60 / 80
Resource Allocation and Congestion Control
Quality of Services
Integrated Services Architecture (ISA)
Developed in late 90s
Fine-grained QoS approach
Meant for providing QoS guarantees at flow level (micro level)
Service classes
Guaraneteed service (GS) - traffic specificiations (TSpec) to be
always met
Controlled service (CS) - traffic specificiations will be met with high
probability
Best effort service (BE)
Components of ISA
Flow specifications
Admission control
Reservation protocol
Packet classifying and scheduling
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
61 / 80
Resource Allocation and Congestion Control
Quality of Services
Flow Specifications
Agrement between the application and network
Consists of two separable parts
Rspec - type of service required from the networks (ex. GS?, CS?,
BE?)
Tspec - describes exact amount of service required from the
network (ex. max delay 100ms, min data rate 1Mbps)
Tspecs are important and must be acurately described as the
flows are admitted as per Tspecs.
Token bucket scheme
Scheme for specifying Tspecs
Governed by two parameters - avg. rate R bits/sec and bucket size
B bytes
Leaky bucket scheme - maintains - avg. rate R bits/sec
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
62 / 80
Resource Allocation and Congestion Control
Quality of Services
Leaky Bucket - Illustration
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
63 / 80
Resource Allocation and Congestion Control
Quality of Services
Token Bucket - Illustration
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
64 / 80
Resource Allocation and Congestion Control
Quality of Services
Token Bucket Scheme
Token replenishment
rate R bps
Token
generator
1. Router puts tokens
into bucket at
predetermined rate.
2. Tokens can
accumulate up
to bucket size;
excess tokens
discarded
Bucket
size B bits
4. Router's queue regulator
requests tokens equal to
to size of the next packet.
Arriving
packets
3. Traffic seeks
admittance
to network.
Regulator
5. If tokens are available,
packet is queued for
transmission
Departing
packets
6. If tokens are not available,
packet is either queued for
transmission but marked as
excess, buffered for later transmission,
or discarded.
Token Bucket Scheme
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
65 / 80
Resource Allocation and Congestion Control
Quality of Services
Tspec - Example
Flow A R = 1 Mbps B = 1 Byte (to be spent immediately)
Flow B R = 1 Mbps B = 125 KBytes
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
66 / 80
Resource Allocation and Congestion Control
Quality of Services
Exercise
Find out the bucket size B for the Tspecs R=2.4Mbps and max
burst duration 10millisec?
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
67 / 80
Resource Allocation and Congestion Control
Quality of Services
Admission control and Resource Reservation
On receiving a request with Tspecs, the router has to decide
whether it can admit the flow
Often gets confused with policing (which will come into effect once
flow is admitted and deal with packets instead of flows)
Resources reservation can be soft-state (which does not need
explicit tear-down)
Reservation can be made by either sender or receiver
Receiver based reservation approach is suitable for both uni- and
multi-cast traffic
RSVP - resource reservation protocol used in ISA
Receiver based reservation
Soft-state reservation
Reservation alive requests are periodically made and routers keeps
the reservations alive
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
68 / 80
Resource Allocation and Congestion Control
Quality of Services
Example of RSVP
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
69 / 80
Resource Allocation and Congestion Control
Quality of Services
Differentiated Services Architecture
ISA is too expensive as it requires maintain lot of state
information, so doesn’t scale
It could be realized may be in future when applications with finer
QoS requirements come up
Differentiated Services (a.k.a) DiffServ, provides coarse grained
QoS, often at class level (instead of flow level)
Currently been used in the Internet
No explicit reservations like ISA/RSVP
Every packet carries the kind of the service required
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
70 / 80
Resource Allocation and Congestion Control
Quality of Services
Architecture
Service level agreements (SLA) within domain
Edge routers do traffic conditioning
Packet classification based on data in the IP and transport protocol
headers.
Traffic shaping, policing and marking
Mark the packet with bit pattern corresponding to the appropriate
aggrigated class
edge routers maintain per-flow state
Core routers
No per-flow operations
Process packets based on packet marking and defined per hop
behavior.
core routers maintain per class state
More scalable than IntServ as no per flow state or signaling
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
71 / 80
Resource Allocation and Congestion Control
Quality of Services
SLA
Contract that exists between a customer and a service provider on type of service, for example,
Network availability - free of network outages 99.95%
Network connection - 10 Mbps download and 5 Mbps upload and
average bandwidth will not be less than the specified amount for
more than 0.1% per month
Loss rate - avg. monthly packet loss on core network will not
exceed 0.2%
Latency - avg. monthly latency will be 50ms or less
Jitter - avg. monthly jitter 250µs, the maximum jitter will not exceed
10ms more than 0.2% per month.
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
72 / 80
Resource Allocation and Congestion Control
Quality of Services
Per-hop Behaviors (PHBs)
A Per-Hop Behaviour is effectively a way of forwarding a particular
flow or group of flows (Behaviour Aggregate) of traffic on a
DiffServ node.
A flow, or flows, of packets marked with a particular DSCP
(DiffServ Code Point) field in the IP Header will be subject to a
particular method of forwarding and rules as encapsulated in the
Behaviour Aggregate.
DSCP is 6 bits in length used from Type-of-service field of IP
header.
Two PHBs defined so far.
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
73 / 80
Resource Allocation and Congestion Control
Quality of Services
Types of PHBs
Expedited forwarding (EF) aka premium service (type P)
Possible service: providing a virtual leased line
That is, EF packets are forwarded with minimal delay and loss
Admitted based on peak rate
Unused premium goes to best effort
Assured forwarding (type A)
Possible service: strong assurance for traffic within profile & allow
source to exceed profile
Admitted based on expected capacity usage profiles
Traffic unlikely to be dropped if user maintains profile
Out-of-profile traffic marked
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
74 / 80
Resource Allocation and Congestion Control
Quality of Services
DSCP Values
Per Hop Behaviour
(PHB)
IP
Precedence
DiffServ Code Point (DSCP)
Default (Best Effort)
0
000000
Assured Forwarding
Class 1
Class 2
Class 3
Class 4
Expedited
Forwarding
Low Drop
Probability
Medium Drop
Probability
High Drop
Probability
AF11
AF12
AF13
001010
001100
001110
AF21
AF22
AF23
010010
010100
010110
AF31
AF32
AF33
011010
011100
011110
AF41
AF42
AF43
100010
100100
100110
EF
1
2
3
4
5
101110
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
75 / 80
Resource Allocation and Congestion Control
Quality of Services
Edge Router Policing
AF “in” set
Arriving
packet
Is packet
marked?
Token
available?
no
Clear “in” bit
Forwarding
engine
Not marked
EF set
Token
available?
Dr. Ramana ( I.I.T Rajasthan )
no
Routing and Forwarding
Drop packet
76 / 80
Resource Allocation and Congestion Control
Quality of Services
Shaping vs Policing
Shaping buffers nonconforming traffic too, while policing drop
nonconforming traffic
Shaping requires additional memory
Shaping introduces delay as it buffers nonconforming traffic,
however policing does not introduce additional delays
Shaping applied to out-bound traffic, policing can applied to
in-bound or out-bound
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
77 / 80
Resource Allocation and Congestion Control
Quality of Services
MultiProtocol Label Switching
Tries to combine some of the properties of virtual circuits with the
flexibility and robustness of datagrams
The path that a packet will follow in this environment is the exact
same path that it would have followed if MPLS were not
involvedthe path chosen by the IP routing algorithms.
All that has changed is the forwarding algorithm.
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
78 / 80
Resource Allocation and Congestion Control
Dr. Ramana ( I.I.T Rajasthan )
Quality of Services
Routing and Forwarding
79 / 80
Resource Allocation and Congestion Control
Quality of Services
(Cont.)
Dr. Ramana ( I.I.T Rajasthan )
Routing and Forwarding
80 / 80