Introduction
 1
Lecture 19
Network Layer
(Routing Protocols)
slides are modified from J. Kurose & K. Ross
University of Nevada – Reno
Computer Science & Engineering Department
Fall 2011
CPE 400 / 600Computer Communication Networks
cover.jpg
Network Layer
4-2
Comparison of LS and DV algorithms
Message complexity
rLS: with n nodes, E links,O(nE) msgs sent
rDV: exchange betweenneighbors only
mconvergence time varies
Speed of Convergence
rLS: O(n2) algorithm requiresO(nE) msgs
mmay have oscillations
rDV: convergence time varies
mmay be routing loops
mcount-to-infinity problem
Robustness: what happensif router malfunctions?
LS:
mnode can advertiseincorrect link cost
meach node computes onlyits own table
DV:
mDV node can advertiseincorrect path cost
meach node’s table used byothers
error propagate thrunetwork
Network Layer
4-3
Chapter 4: Network Layer
r4. 1 Introduction
r4.2 Virtual circuit anddatagram networks
r4.3 What’s inside arouter
r4.4 IP: InternetProtocol
mDatagram format
mIPv4 addressing
mICMP
mIPv6
r4.5 Routing algorithms
mLink state
mDistance Vector
mHierarchical routing
r4.6 Routing in theInternet
mRIP
mOSPF
mBGP
r4.7 Broadcast andmulticast routing
Network Layer
4-4
Hierarchical Routing
scale: with 200 milliondestinations:
rcan’t store all dest’s inrouting tables!
rrouting table exchangewould swamp links!
administrative autonomy
rInternet = network of networks
reach network admin may wantto control routing in its ownnetwork
Our routing study thus far - idealization
rall routers identical
rnetwork “flat”
… not true in practice
Network Layer
4-5
Hierarchical Routing
raggregate routers intoregions, “AutonomousSystems” (AS)
rrouters in same AS runsame routing protocol
m“intra-AS” routing protocol
mrouters in different AS canrun different intra-ASrouting protocol
Gateway router
rDirect link to router inanother AS
Network Layer
4-6
3b
1d
3a
1c
2a
AS3
AS1
AS2
1a
2c
2b
1b
Intra-AS
Routing
algorithm
Inter-AS
Routing
algorithm
Forwarding
table
3c
Interconnected ASes
rforwarding table  configuredby both intra- and inter-ASrouting algorithm
mintra-AS sets entries forinternal dests
minter-AS & intra-As setsentries for external dests
Network Layer
4-7
3b
1d
3a
1c
2a
AS3
AS1
AS2
1a
2c
2b
1b
3c
Inter-AS tasks
rsuppose router in AS1receives datagramdestined outside of AS1:
mrouter should forwardpacket to gatewayrouter, but which one?
AS1 must:
1.learn which dests arereachable through AS2,which through AS3
2.propagate thisreachability info to allrouters in AS1
Job of inter-AS routing!
Network Layer
4-8
Example: Setting forwarding table in router 1d
rsuppose AS1 learns (via inter-AS protocol) that subnetx reachable via AS3 (gateway 1c) but not via AS2.
rinter-AS protocol propagates reachability info to allinternal routers.
rrouter 1d determines from intra-AS routing info thatits interface I  is on the least cost path to 1c.
minstalls forwarding table entry (x,I)
3b
1d
3a
1c
2a
AS3
AS1
AS2
1a
2c
2b
1b
3c
x
Network Layer
4-9
Example: Choosing among multiple ASes
rnow suppose AS1 learns from inter-AS protocol thatsubnet x is reachable from AS3 and from AS2.
rto configure forwarding table, router 1d mustdetermine towards which gateway it should forwardpackets for dest x.
mthis is also job of inter-AS routing protocol!
3b
1d
3a
1c
2a
AS3
AS1
AS2
1a
2c
2b
1b
3c
x
Network Layer
4-10
Learn from inter-AS
protocol that subnet
x is reachable via
multiple gateways
Use routing info
from intra-AS
protocol to determine
costs of least-cost
paths to each
of the gateways
Hot potato routing:
Choose the gateway
that has the
smallest least cost
Determine from
forwarding table the
interface I that leads
to least-cost gateway.
Enter (x,I) in
forwarding table
Example: Choosing among multiple ASes
rnow suppose AS1 learns from inter-AS protocol thatsubnet x is reachable from AS3 and from AS2.
rto configure forwarding table, router 1d mustdetermine towards which gateway it should forwardpackets for dest x.
mthis is also job of inter-AS routing protocol!
rhot potato routing: send packet towards closest oftwo routers.
Network Layer
4-11
Chapter 4: Network Layer
r4. 1 Introduction
r4.2 Virtual circuit anddatagram networks
r4.3 What’s inside arouter
r4.4 IP: InternetProtocol
mDatagram format
mIPv4 addressing
mICMP
mIPv6
r4.5 Routing algorithms
mLink state
mDistance Vector
mHierarchical routing
r4.6 Routing in theInternet
mRIP
mOSPF
mBGP
r4.7 Broadcast andmulticast routing
Network Layer
4-12
RIP (Routing Information Protocol)
rdistance vector algorithm
rincluded in BSD-UNIX Distribution in 1982
rdistance metric: # of hops (max = 15 hops)
D
C
B
A
u
v
w
x
y
z
destination   hops
      u                1
      v                2
      w               2
      x                3
      y                3
      z                2
 
From router A to subnets:
Network Layer
4-13
RIP advertisements
rdistance vectors: exchanged amongneighbors every 30 sec via ResponseMessage
malso called advertisement
reach advertisement: list of up to 25destination subnets within AS
Network Layer
4-14
RIP: Example
Destination Network  Next  Router      Num. of hops to dest.
 wA2
yB2
 zB7
x--1
….….....
w
x
y
z
A
C
D
B
Routing/Forwarding table in D
Network Layer
4-15
RIP: Example
Destination Network  Next  Router      Num. of hops to dest.
 wA2
yB2
  zB A7 5
x--1
….….....
Routing/Forwarding table in D
w
x
y
z
A
C
D
B
 Dest     Next  hops
   w  -     1
   x  -     1
   z  C     4
   ….  …    ...
Advertisement
from A to D
Network Layer
4-16
RIP: Link Failure and Recovery
If no advertisement heard after 180 sec -->neighbor/link declared dead
mroutes via neighbor invalidated
mnew advertisements sent to neighbors
mneighbors in turn send out new advertisements iftables changed
mlink failure info propagates to entire net
mpoison reverse used to prevent ping-pong loops
infinite distance = 16 hops
Network Layer
4-17
RIP Table processing
rRIP routing tables managed by application-levelprocess called route-d (daemon)
radvertisements sent in UDP packets, periodicallyrepeated
physical
link
network     forwarding
   (IP)            table
Transprt
  (UDP)
routed
physical
link
network
   (IP)
Transprt
  (UDP)
routed
forwarding
table
Network Layer
4-18
Chapter 4: Network Layer
r4. 1 Introduction
r4.2 Virtual circuit anddatagram networks
r4.3 What’s inside arouter
r4.4 IP: InternetProtocol
mDatagram format
mIPv4 addressing
mICMP
mIPv6
r4.5 Routing algorithms
mLink state
mDistance Vector
mHierarchical routing
r4.6 Routing in theInternet
mRIP
mOSPF
mBGP
r4.7 Broadcast andmulticast routing
Network Layer
4-19
OSPF (Open Shortest Path First)
r“open”: publicly available
ruses Link State algorithm
mLS packet dissemination
mtopology map at each node
mroute computation using Dijkstra’s algorithm
rOSPF advertisement carries one entry per neighborrouter
radvertisements disseminated to entire AS (viaflooding)
mOSPF messages directly over IP (rather than TCP or UDP)
Network Layer
4-20
OSPF “advanced” features (not in RIP)
rsecurity: all OSPF messages authenticated
mto prevent malicious intrusion
rmultiple same-cost paths allowed
monly one path in RIP
rFor each link, multiple cost metrics for different TOS
me.g., satellite link cost set “low” for best effort; high for realtime
rintegrated uni- and multicast support:
mMulticast OSPF (MOSPF) uses same topology database as OSPF
rhierarchical OSPF in large domains
Network Layer
4-21
Hierarchical OSPF
04-33
Network Layer
4-22
Hierarchical OSPF
rtwo-level hierarchy: local area, backbone
mLink-state advertisements only in area
meach nodes has detailed area topology
only know direction (shortest path) to nets in other areas
rarea border routers: “summarize” distances  to netsin own area, advertise to other Area Border routers
rbackbone routers: run OSPF routing limited tobackbone
rboundary routers: connect to other AS’s
Network Layer
4-23
Chapter 4: Network Layer
r4. 1 Introduction
r4.2 Virtual circuit anddatagram networks
r4.3 What’s inside arouter
r4.4 IP: InternetProtocol
mDatagram format
mIPv4 addressing
mICMP
mIPv6
r4.5 Routing algorithms
mLink state
mDistance Vector
mHierarchical routing
r4.6 Routing in theInternet
mRIP
mOSPF
mBGP
r4.7 Broadcast andmulticast routing
Network Layer
4-24
Internet inter-AS routing: BGP
rBGP (Border Gateway Protocol):
mthe de facto standard
rallows subnet to advertise its existence torest of Internet: “I am here”
rBGP provides each AS a means to:
1.Obtain subnet reachability information fromneighboring ASs
2.Propagate reachability information to all AS-internal routers
3.Determine “good” routes to subnets based onreachability information and policy
Network Layer
4-25
BGP basics
rpairs of routers (BGP peers) exchange routing infoover semi-permanent TCP connections: BGP sessions
mBGP sessions need not correspond to physical links
rwhen AS2 advertises a prefix to AS1:
mAS2 promises it will forward datagrams towardsthat prefix
mAS2 can aggregate prefixes in its advertisement
3b
1d
3a
1c
2a
AS3
AS1
AS2
1a
2c
2b
1b
3c
eBGP session
iBGP session
Network Layer
4-26
Distributing reachability info
rusing eBGP session between 3a and 1c, AS3 sendsprefix reachability info to AS1
m1c can then use iBGP do distribute new prefix infoto all routers in AS1
m1b can then re-advertise new reachability info toAS2 over 1b-to-2a eBGP session
rwhen router learns of new prefix, it creates entry forprefix in its forwarding table
3b
1d
3a
1c
2a
AS3
AS1
AS2
1a
2c
2b
1b
3c
eBGP session
iBGP session
Network Layer
4-27
Path attributes & BGP routes
radvertised prefix includes BGP attributes
mprefix + attributes = “route”
rtwo important attributes:
mAS-PATH: contains ASs through which prefixadvertisement has passed: e.g, AS 67, AS 17
mNEXT-HOP: indicates specific internal-AS routerto next-hop AS
may be multiple links from current AS to next-hop-AS
rwhen gateway router receives route advert.,uses import policy to accept/decline
Network Layer
4-28
BGP route selection
rrouter may learn about more than 1 routeto some prefix
mRouter must select route
relimination rules:
1.local preference value attribute: policy decision
2.shortest AS-PATH
3.closest NEXT-HOP router: hot potato routing
4.additional criteria
Network Layer
4-29
BGP messages
rBGP messages exchanged using TCP
rBGP messages:
mOPEN: opens TCP connection to peer andauthenticates sender
mUPDATE: advertises new path (or withdraws old)
mKEEPALIVE keeps connection alive in absence ofUPDATES; also ACKs OPEN request
mNOTIFICATION: reports errors in previous msg;also used to close connection
Network Layer
4-30
BGP routing policy
rA,B,C are provider networks
rX,W,Y are customer (of provider networks)
rX is dual-homed: attached to two networks
mX does not want to route from B via X to C
m.. so X will not advertise to B a route to C
A
B
C
 
W
 
X
Y
legend:
 
customer
network
 
provider
 
network
 
Network Layer
4-31
BGP routing policy (2)
rA advertises path AW  to B
rB advertises path BAW to X
rShould B advertise path BAW to C?
mNo way! B gets no “revenue” for routing CBAWsince neither W nor C are B’s customers
mB wants to force C to route to w via A
mB wants to route only to/from its customers!
A
B
C
 
W
 
X
Y
legend:
 
customer
network
 
provider
 
network
 
Network Layer
4-32
Why different Intra- and Inter-AS routing ?
Policy:
rInter-AS: admin wants control over how its trafficrouted, who routes through its net
rIntra-AS: single admin, so no policy decisions needed
Scale:
rhierarchical routing saves table size and reducesupdate traffic
Performance:
rInter-AS: policy may dominate over performance
rIntra-AS: can focus on performance