Chapter4 Tostudent
Chapter4 Tostudent
Network Layer
encapsulates segments
network physical
physical
data link
physical
into datagrams
network network
data link data link
physical physical
routing algorithms
routing algorithm
value in arriving
packet’s header
0111 1
3 2
otherwise 3
Examples
Link layer
physical layer
Recipe
To determine the
subnets, detach each
interface from its
host or router,
creating islands of
isolated networks.
Each isolated network
is called a subnet. 223.1.3.0/24
223.1.1.3
223.1.9.2 223.1.7.0
223.1.9.1 223.1.7.1
223.1.8.1 223.1.8.0
223.1.2.6 223.1.3.27
DHCP offer
src: 223.1.2.5, 67
dest: 255.255.255.255, 68
yiaddrr: 223.1.2.4
transaction ID: 654
Lifetime: 3600 secs
DHCP request
src: 0.0.0.0, 68
dest:: 255.255.255.255, 67
yiaddrr: 223.1.2.4
transaction ID: 655
time Lifetime: 3600 secs
DHCP ACK
src: 223.1.2.5, 67
dest: 255.255.255.255, 68
yiaddrr: 223.1.2.4
transaction ID: 655
Lifetime: 3600 secs
Organization 0
200.23.16.0/23
Organization 1
“Send me anything
200.23.18.0/23 with addresses
Organization 2 beginning
200.23.20.0/23 . Fly-By-Night-ISP 200.23.16.0/20”
.
. . Internet
.
Organization 7 .
200.23.30.0/23
“Send me anything
ISPs-R-Us
with addresses
beginning
199.31.0.0/16”
“Send me anything
with addresses
Organization 2 beginning
200.23.20.0/23 . Fly-By-Night-ISP 200.23.16.0/20”
.
. . Internet
.
Organization 7 .
200.23.30.0/23
“Send me anything
ISPs-R-Us
with addresses
Organization 1 beginning 199.31.0.0/16
or 200.23.18.0/23”
200.23.18.0/23
routing algorithm
value in arriving
packet’s header
0111 1
3 2
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) }
5
3
v w 5
2
u 2 1 z
3
1 2
x 1
y
v w
u z
x y
Then
dx(y) = min
v
{c(x,v) + dv(y) }
from
y ∞∞ ∞ y 2 0 1
z ∞∞ ∞ z 7 1 0
node y table
cost to
x y z y
2 1
x ∞ ∞ ∞
x z
y 2 0 1 7
from
z ∞∞ ∞
node z table
cost to
x y z
x ∞∞ ∞
from
y ∞∞ ∞
z 71 0
time
Network Layer 4-50
Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)} Dx(z) = min{c(x,y) +
= min{2+0 , 7+1} = 2 Dy(z), c(x,z) + Dz(z)}
node x table = min{2+1 , 7+0} = 3
cost to cost to cost to
x y z x y z x y z
x 0 2 7 x 0 2 3 x 0 2 3
from
from
y ∞∞ ∞ y 2 0 1
from
y 2 0 1
z ∞∞ ∞ z 7 1 0 z 3 1 0
node y table
cost to cost to cost to
x y z x y z x y z y
2 1
x ∞ ∞ ∞ x 0 2 7 x 0 2 3 x z
from
y 2 0 1 y 2 0 1 7
from
from
y 2 0 1
z ∞∞ ∞ z 7 1 0 z 3 1 0
node z table
cost to cost to cost to
x y z x y z x y z
x ∞∞ ∞ x 0 2 7 x 0 2 3
from
from
y 2 0 1 y 2 0 1
from
y ∞∞ ∞
z 71 0 z 3 1 0 z 3 1 0
time
Network Layer 4-51
Comparison of LS and DV algorithms
Message complexity Robustness: what happens
LS: with n nodes, E links, if router malfunctions?
O(nE) msgs sent LS:
DV: exchange between
node can advertise
neighbors only
incorrect link cost
convergence time varies
each node computes only
Speed of Convergence its own table
LS: O(n2) algorithm requires DV:
O(nE) msgs DV node can advertise
may have oscillations incorrect path cost
DV: convergence time varies each node’s table used by
may be routing loops
others
• error propagate thru
count-to-infinity problem
network
Network Layer 4-52
Chapter 4: Network Layer
4. 1 Introduction 4.5 Routing algorithms
4.3 What’s inside a Link state
3c
3a 2c
3b 2a
AS3 2b
1c AS2
1a 1b
1d AS1
forwarding table
configured by both
intra- and inter-AS
Intra-AS
Routing
Inter-AS
Routing routing algorithm
intra-AS sets entries
algorithm algorithm
Forwarding for internal dests
inter-AS & Intra-As
table
sets entries for
external dests
Network Layer 4-56
Inter-AS tasks AS1 must:
suppose router in AS1 1. learn which dests
receives datagram reachable through
dest outside of AS1 AS2, which through
router should AS3
forward packet to 2. propagate this
gateway router, but reachability info to all
which one? routers in AS1
Job of inter-AS routing!
3c
3a 2c
3b 2a
AS3 2b
1c AS2
1a 1b
1d AS1
Network Layer 4-57
Example: Setting forwarding table in router 1d
x
3c
3a 2c
3b 2a
AS3 2b
1c AS2
1a 1b AS1
1d
Network Layer 4-58
Example: Choosing among multiple ASes
now suppose AS1 learns from inter-AS protocol that
subnet x is reachable from AS3 and from AS2.
to configure forwarding table, router 1d must
determine towards which gateway it should forward
packets for dest x.
this is also job of inter-AS routing protocol!
x
3c
3a 2c
3b 2a
AS3 2b
1c AS2
1a 1b
1d AS1
eBGP session
3c iBGP session
3a 2c
3b 2a
AS3 2b
1c AS2
1a 1b
AS1 1d
Network Layer 4-65
Distributing reachability info
using eBGP session between 3a and 1c, AS3 sends
prefix reachability info to AS1.
1c can then use iBGP do distribute new prefix
info to all routers in AS1
1b can then re-advertise new reachability info
to AS2 over 1b-to-2a eBGP session
when router learns of new prefix, creates entry
for prefix in its forwarding table.
eBGP session
3c iBGP session
3a 2c
3b 2a
AS3 2b
1c AS2
1a 1b
AS1 1d
Network Layer 4-66
BGP route selection
router may learn about more than 1 route
to some prefix. Router must select route.
elimination rules:
1. local preference value attribute: policy
decision
2. shortest AS-PATH
3. closest NEXT-HOP router: hot potato routing
4. additional criteria
A advertises path AW to B
B advertises path BAW to X
Should B advertise path BAW to C?
No way! B gets no “revenue” for routing CBAW
since neither W nor C are B’s customers
B wants to force C to route to w via A
B wants to route only to/from its customers!
Network Layer 4-69
Why different Intra- and Inter-AS routing ?
Policy:
Inter-AS: admin wants control over how its traffic
routed, who routes through its net.
Intra-AS: single admin, so no policy decisions needed
Scale:
hierarchical routing saves table size, reduced update
traffic
Performance:
Intra-AS: can focus on performance
Inter-AS: policy may dominate over performance