Network Layer Network Layer
Mobile network Gl b l P Global ISP
Data Link Layer
Home network Regional ISP
Data Link Layer
Institutional network
Yanmin Zhu D p tm t f C mp t Department of Computer Science and Engineering
Network Layer 1
Data Link Layer Data Link Layer Home network Regional ISP Yanmin - - PowerPoint PPT Presentation
Network Layer Network Layer Mobile network Gl b l Global ISP P Data Link Layer Data Link Layer Home network Regional ISP Yanmin Zhu Institutional network D p Department of Computer tm t f C mp t Science and Engineering 1 Network
Network Layer Network Layer
Mobile network Gl b l P Global ISP
Home network Regional ISP
Institutional network
Network Layer 1
Network Layer Network Layer
Link state Distance Vector
Distance Vector Hierarchical routing
RIP
Datagram format IPv4 addressing OSPF BGP
g
ICMP IPv6
Network Layer 4-2
Network Layer Network Layer
ti l ith routing algorithm local forwarding table header value output link
0100 0101 0111 3 2 2
value in arriving
1001 1
0111
value in arriving packet’s header 2 3
Network Layer 4-3
Network Layer Network Layer
5
w v
2 5 3 5
u y
x z 2 1 3 1 1 2 Graph: G = (N E) 1 Graph: G = (N,E) N = set of routers = { u, v, w, x, y, z } E = set of links ={ (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) } Remark: Graph abstraction is useful in other network contexts Example: P2P, where N is set of peers and E is set of TCP connections
Network Layer 4-4
Example: P2P, where N is set of peers and E is set of TCP connections
Network Layer Network Layer
5
w v
2 5 3 5
u y
x z 2 2 1 3 1 2 e.g., c(w,z) 5
inversely related to bandwidth
y
1 inversely related to bandwidth,
congestion Cost of path (x1, x2, x3,…, xp) = c(x1,x2) + c(x2,x3) + … + c(xp-1,xp) Q ti Wh t’ th l t t th b t d ? Question: What’s the least-cost path between u and z ? Routing algorithm: algorithm that finds least-cost path
Network Layer 4-5
Network Layer Network Layer
Global:
all routers have complete
topology, link cost info
“link state” algorithms
link state algorithms Decentralized:
router knows physically-
p y y connected neighbors, link costs to neighbors
iterative process of
periodic update in response to link
iterative process of
computation, exchange of info with neighbors “di t t ” l ith
Network Layer 4-6
“distance vector” algorithms
Network Layer Network Layer
Link state Distance Vector
Distance Vector Hierarchical routing
RIP
Datagram format IPv4 addressing OSPF BGP
g
ICMP IPv6
Network Layer 4-7
Network Layer Network Layer
5
w v
5 3
u
z 2 2 3 1 5
y
x 1 3 2
y
x 1
Introduction 1-8
Network Layer Network Layer
net topology, link costs
known to all nodes
accomplished via “link
state broadcast” x to y; = ∞ if not direct neighbors D(v): current value of cost
all nodes have same info
computes least cost paths
from one node (‘source”) to D(v): current value of cost
d d from one node ( source ) to all other nodes
gives forwarding table
f th t d p(v): predecessor node along path from source to v N': set of nodes whose for that node
iterative: after k
iterations, know least cost N : set of nodes whose least cost path definitively known
Network Layer 4-9
, path to k dest.’s
Network Layer Network Layer
1 Initialization: 1 Initialization: 2 N' = {u} 3 for all nodes v 4 if v adjacent to u 4 if v adjacent to u 5 then D(v) = c(u,v) 6 else D(v) = ∞ 7 8 Loop 9 find w not in N' such that D(w) is a minimum 10 add w to N' 11 update D(v) for all v adjacent to w and not in N' : 12 D(v) = min( D(v), D(w) + c(w,v) ) ( ) ( ( ) ( ) ( ) ) 13 /* new cost to v is either old cost to v or known 14 shortest path cost to w plus cost from w to v */ 15 until all nodes in N'
Network Layer 4-10
15 until all nodes in N
Network Layer Network Layer
Step N' D(v) p(v) D(w) p(w) D(x) p(x) D(y) p(y) D(z) p(z) Step 1 2 N u ux D(v),p(v) 2,u 2,u 2 D(w),p(w) 5,u 4,x 3 D(x),p(x) 1,u D(y),p(y) ∞ 2,x D(z),p(z)
2 3 4 uxy uxyv uxyvw 2,u 3,y 3,y 4,y 4,y 4 y 5 uxyvwz 4,y 5
w v
2 5 3 5
u y
x z 2 1 3 1 2
Network Layer 4-11
y
1
Network Layer Network Layer
w v u y
y
Network Layer 4-12
Network Layer Network Layer
A D C B
1 1+e e
A D B
2+e 1+e 1
A D B
2+e 1+ 1 0 0
A D B
2+e e 1+e 1
C
e e 1 1
C C
1+e 1
C
e
initially … recompute … recompute … recompute
Network Layer 4-13
initially routing
Network Layer Network Layer
Link state Distance Vector
Distance Vector Hierarchical routing
RIP
Datagram format IPv4 addressing OSPF BGP
g
ICMP IPv6
Network Layer 4-14
Network Layer Network Layer
x y v y
Network Layer 4-15
Network Layer Network Layer
5
w v
2 5 3 5
u y
x z 2 1 3 1 2
y
1
Network Layer 4-16
Network Layer Network Layer
5
w v
5 3 5
u
z 2 2 3 1 5
y
x 1 3 1 2
1
t cos t next hop des t cos t next hop des t cos t next hop
x w y v x w y u 2 U x 2 X w 3 W y Inf
4-17
z z z Inf
Network Layer Network Layer
For each neighbor v x maintains For each neighbor v, x maintains
Network Layer 4-18
Network Layer Network Layer
x(y) v{ ( , ) v(y)}
Network Layer 4-19
Network Layer Network Layer
each local iteration caused by:
local link cost change
local link cost change DV update message from
neighbor
link cost or msg from neighbor)
each node notifies
i hb l h i DV
neighbors only when its DV changes
neighbors then notify
if DV to any dest has
g y their neighbors if necessary
if DV to any dest has changed, notify neighbors
Network Layer 4-20
Network Layer Network Layer
node x table Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)} = min{2+0 , 7+1} = 2 Dx(z) = min{c(x,y) + Dy(z), c(x,z) + Dz(z)} = min{2+1 7+0} = 3 x y z cost to x y z cost to node x table = min{2+1 , 7+0} = 3 x y z 0 2 7 ∞ ∞ ∞ ∞ ∞ ∞ from x y z from 2 0 1 7 1 0 3 2 ∞ ∞ ∞ x y z cost to 7 1 0 1 2
y
node y table from x y z ∞ ∞ ∞ ∞ ∞ ∞ 2 0 1
x
z 1 2 7 z ∞ ∞ ∞ x y z cost to node z table from x y z x y ∞ ∞ ∞ ∞ ∞ ∞
Network Layer 4-21
z 7 1 time
Network Layer Network Layer
node x table Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)} = min{2+0 , 7+1} = 2 Dx(z) = min{c(x,y) + Dy(z), c(x,z) + Dz(z)} = min{2+1 7+0} = 3 x y z cost to x y z cost to x y z cost to node x table = min{2+1 , 7+0} = 3 x y z 0 2 7 ∞ ∞ ∞ ∞ ∞ ∞ from x y z 0 2 3 from x y z 0 2 3 from 2 0 1 7 1 0 2 0 1 3 1 0 ∞ ∞ ∞ z x y z cost to x y z cost to x y z cost to 7 1 0 3 1 0 1 2
y
node y table from x y z ∞ ∞ ∞ ∞ ∞ x y z 0 2 7 from y x y z 0 2 3 from ∞ 2 0 1 2 0 1 7 1 0 2 0 1 3 1 0
x
z 1 2 7 z ∞ ∞ ∞ z z x y z cost to x y z cost to x y z cost to 7 1 0 3 1 0 node z table from x y z 0 2 3 from x y z 0 2 7 from x y z x y ∞ ∞ ∞ ∞ ∞ ∞ 2 0 1 3 1 0 3 1 0 2 0 1
Network Layer 4-22
z z z 7 1 3 1 0 3 1 0 time
Network Layer Network Layer
Count-to-infinity problem
23 Network Layer
Network Layer Network Layer
Introduction 1-24
Network Layer Network Layer
LS: with n nodes, E links,
O(nE) msgs sent
DV: exchange between
DV: exchange between
neighbors only
convergence time varies node can advertise
incorrect link cost
each node computes only
LS: O(n2) algorithm requires
each node computes only
its own table
( ) g q O(nE) msgs
may have oscillations
DV ti i
DV node can advertise
incorrect path cost
each node’s table used by
DV: convergence time varies
may be routing loops count-to-infinity problem each node s table used by
k
Network Layer 4-25
count to infinity problem
network
Network Layer Network Layer
Link state Distance Vector
Distance Vector Hierarchical routing
RIP
Datagram format IPv4 addressing OSPF BGP
g
ICMP IPv6
Network Layer 4-26
Network Layer Network Layer
internet = network of can’t store all dest’s in
routing tables!
routing table exchange
networks
each network admin may
want to control routing in its
routing table exchange
would swamp links! want to control routing in its
Network Layer 4-27
Network Layer Network Layer
“intra-AS” routing
protocol
r ut rs in diff r nt AS routers in different AS
can run different intra- AS routing protocol
Network Layer 4-28
Network Layer Network Layer
3b 3a 2a AS3 2c 2b 3c 1d 1c AS3 AS1
AS2
1a 2b 1b
Intra-AS Routing algorithm Inter-AS Routing algorithm
intra-AS sets entries
f int n l d sts
Forwarding table
for internal dests
inter-AS & intra-As
sets entries for
Network Layer 4-29
external dests
Network Layer Network Layer
router should
router should
3a 2c 3c 3b 3a 1c 2a AS3
AS2
1a 2c 2b 1b
Network Layer 4-30
1d AS1 1b
Network Layer Network Layer
installs forwarding table entry (x,I) 3c
x
3b 3a 1c 2a AS3 AS2 1 2c 2b
Network Layer
4-31
1d AS1 1a 1b
Network Layer Network Layer
this is also job of inter-AS routing protocol!
3b 3a 1 2a AS3 2c 2b 3c
1d 1c AS1
AS2
1a 2b 1b
Network Layer 4-32
Network Layer Network Layer
this is also job of inter-AS routing protocol!
Learn from inter-AS protocol that subnet x is reachable via Hot potato routing: Choose the gateway Use routing info from intra-AS protocol to determine Determine from forwarding table the interface I that leads x is reachable via multiple gateways Choose the gateway that has the smallest least cost protocol to determine costs of least-cost paths to each
interface I that leads to least-cost gateway. Enter (x,I) in forwarding table Network Layer 4-33
Network Layer Network Layer
Link state Distance Vector
Distance Vector Hierarchical routing
RIP
Datagram format IPv4 addressing OSPF BGP
g
ICMP IPv6
Network Layer 4-34
Network Layer Network Layer
RIP: Routing Information Protocol
OSPF: Open Shortest Path First IGRP: Interior Gateway Routing Protocol (Cisco
Network Layer 4-35
Network Layer Network Layer
Link state Distance Vector
Distance Vector Hierarchical routing
RIP
Datagram format IPv4 addressing OSPF BGP
g
ICMP IPv6
Network Layer 4-36
Network Layer Network Layer
B A
D
Network Layer 4-37
Network Layer Network Layer
Network Layer 4-38
Network Layer Network Layer
Destination Network Next Router Num. of hops to dest.
…. …. ....
Network Layer 4-39
Network Layer Network Layer
Dest Next hops w
x
Advertisement from A to D
x 1 z C 4 …. … ...
D ti ti N t k N t R t N f h t d t
Destination Network Next Router Num. of hops to dest.
Network Layer 4-40
…. …. ....
Network Layer Network Layer
routes via neighbor invalidated routes via neighbor invalidated new advertisements sent to neighbors neighbors in turn send out new advertisements (if neighbors in turn send out new advertisements (if
poison reverse used to prevent ping pong loops poison reverse used to prevent ping-pong loops
Network Layer 4-41
Network Layer Network Layer
Transprt
routed
Transprt
routed
network forwarding (IP) t bl Transprt (UDP) network (IP) Transprt (UDP) forwarding t bl physical link (IP) table physical link (IP) table
Network Layer 4-42
physical physical
Network Layer Network Layer
Link state Distance Vector
Distance Vector Hierarchical routing
RIP
Datagram format IPv4 addressing OSPF BGP
g
ICMP IPv6
Network Layer 4-43
Network Layer Network Layer
LS packet dissemination LS packet dissemination topology map at each node route computation using Dijkstra’s algorithm
carried in OSPF messages directly over IP (rather than TCP
Network Layer 4-44
Network Layer Network Layer
Multicast OSPF (MOSPF) uses same topology data Multicast OSPF (MOSPF) uses same topology data
Network Layer 4-45
Network Layer Network Layer
Network Layer 4-46
Network Layer Network Layer
Link-state advertisements only in area each node has detailed area topology; only know each node has detailed area topology; only know
Network Layer 4-47
Network Layer Network Layer
Link state Distance Vector
Distance Vector Hierarchical routing
RIP
Datagram format IPv4 addressing OSPF BGP
g
ICMP IPv6
Network Layer 4-48
Network Layer Network Layer
Network Layer 4-49
Network Layer Network Layer
3a 2c 3c
eBGP session iBGP session
3b 3a 1c 2a AS3
AS2
1a c 2b
Network Layer 4-50
1d AS1 1a 1b
Network Layer Network Layer
1c can then use iBGP do distribute new prefix
1b can then re-advertise new reachability info
3a 2c 3c
eBGP session iBGP session
3b 3a 1c 2a AS3
AS2
1a c 2b
Network Layer 4-51
1d
AS1
1a 1b
Network Layer Network Layer
prefix + attributes = “route”
AS-PATH: contains ASs through which prefix
NEXT-HOP: indicates specific internal-AS router
Network Layer 4-52
Network Layer Network Layer
1
1.
2.
3.
4.
Network Layer 4-53
.
Network Layer Network Layer
OPEN: opens TCP connection to peer and
UPDATE: advertises new path (or withdraws old) UPDATE: advertises new path (or withdraws old) KEEPALIVE keeps connection alive in absence of
NOTIFICATION: reports errors in previous msg;
Network Layer 4-54
Network Layer Network Layer
legend: provider
W X
g customer p network
Y
customer network: A,B,C are provider networks
X does not want to route from B via X to C .. so X will not advertise to B a route to C
Network Layer 4-55
Network Layer Network Layer
legend: provider
W X
g customer p network
Y
customer network: A advertises path Aw to B B advertises path BAw to X B advertises path BAw to X Should B advertise path BAw to C?
No way! B gets no “revenue” for routing CBAw since No way! B gets no revenue for routing CBAw since
B wants to force C to route to w via A
Network Layer 4-56
B wants to route only to/from its customers!
Network Layer Network Layer
Network Layer 4-57
Network Layer Network Layer
Link state Distance Vector
Distance Vector Hierarchical routing
RIP
Datagram format IPv4 addressing OSPF BGP
g
ICMP IPv6
Network Layer 4-58
Network Layer Network Layer
Link state Distance Vector
Distance Vector Hierarchical routing
RIP
Datagram format IPv4 addressing OSPF BGP
g
ICMP IPv6
Network Layer 4-59
Network Layer Network Layer
Introduction 1-60