2. Network Layer 4-2
What is mobility?
spectrum of mobility, from the network perspective:
no mobility high mobility
mobile user, using
same access point
mobile user, passing
through multiple
access point while
maintaining ongoing
connections (like cell
phone)
mobile user,
connecting/
disconnecting
from network
using DHCP.
3. Network Layer 4-3
Mobility: Scenario
home network: permanent
“home” of mobile
(e.g., 128.119.40/24)
Permanent address:
address in home
network, can always be
used to reach mobile
e.g., 128.119.40.186
wide area
network
correspondent
4. Network Layer 4-4
How do you contact a mobile friend:
search all phone
books?
call her parents?
expect her to let you
know where he/she is?
I wonder where
Alice moved to?
Consider friend frequently changing
addresses, how do you find her?
5. Network Layer 4-5
Mobility: approaches
Let routing handle it: routers advertise permanent
address of mobile-nodes-in-residence via usual
routing table exchange.
routing tables indicate where each mobile located
no changes to end-systems
Let end-systems handle it:
Ask help from some agents (parents)
6. Network Layer 4-6
Mobility: approaches
Let routing handle it: routers advertise permanent
address of mobile-nodes-in-residence via usual
routing table exchange.
routing tables indicate where each mobile located
no changes to end-systems
let end-systems handle it:
Ask help from some agents (parents)
not
scalable
to millions of
mobiles
7. Network Layer 4-7
Mobility: Vocabulary
home network: permanent
“home” of mobile
(e.g., 128.119.40/24)
Permanent address:
address in home
network, can always be
used to reach mobile
e.g., 128.119.40.186
home agent: entity that will
perform mobility functions on
behalf of mobile, when mobile
is remote
wide area
network
correspondent
8. Network Layer 4-8
Mobility: more vocabulary
Care-of-address: address
in visited network.
(e.g., 79,129.13.2)
wide area
network
visited network: network
in which mobile currently
resides (e.g., 79.129.13/24)
Permanent address: remains
constant (e.g., 128.119.40.186)
foreign agent: entity in
visited network that
performs mobility
functions on behalf of
mobile.
correspondent: wants
to communicate with
mobile
9. Network Layer 4-9
Mobility: registration
End result:
Foreign agent knows about mobile
Home agent knows location of mobile
wide area
network
home network
visited network
1
mobile contacts
foreign agent on
entering visited
network
2
foreign agent contacts home
agent home: “this mobile is
resident in my network”
10. Network Layer 4-10
Mobility via Indirect Routing
wide area
network
home
network
visited
network
3
2
4
1
correspondent
addresses packets
using home address
of mobile
home agent intercepts
packets, forwards to
foreign agent
foreign agent
receives packets,
forwards to mobile
mobile replies
directly to
correspondent
11. Network Layer 4-11
Forwarding datagrams to remote mobile
Permanent address:
128.119.40.186
Care-of address:
79.129.13.2
dest: 128.119.40.186
packet sent by
correspondent
dest: 79.129.13.2 dest: 128.119.40.186
packet sent by home agent to foreign
agent: a packet within a packet
dest: 128.119.40.186
foreign-agent-to-mobile packet
12. Network Layer 4-12
Indirect Routing: comments
Mobile uses two addresses:
permanent address: used by correspondent (hence
mobile location is transparent to correspondent)
care-of-address: used by home agent to forward
datagrams to mobile
foreign agent functions may be done by mobile itself
triangle routing: correspondent-home-network-
mobile
inefficient when
correspondent, mobile
are in same network
13. Network Layer 4-13
Indirect Routing: moving between networks
suppose mobile user moves to another
network
registers with new foreign agent
new foreign agent registers with home agent
home agent update care-of-address for mobile
packets continue to be forwarded to mobile (but
with new care-of-address)
Mobility, changing foreign networks
transparent: on going connections can be
maintained!
14. Network Layer 4-14
Mobility via Direct Routing
wide area
network
home
network
visited
network
4
2
4
1
correspondent
requests, receives
foreign address of
mobile
correspondent forwards
to foreign agent
foreign agent
receives packets,
forwards to mobile
mobile replies
directly to
correspondent
3
15. Network Layer 4-15
Mobility via Direct Routing: comments
overcome triangle routing problem
non-transparent to correspondent:
correspondent must get care-of-address
from home agent
What happens if mobile changes networks?
16. Network Layer 4-16
Mobile IP
RFC 3220
has many features we’ve seen:
home agents, foreign agents, foreign-agent
registration, care-of-addresses, encapsulation
(packet-within-a-packet)
three components to standard:
agent discovery
registration with home agent
indirect routing of datagrams
17. Network Layer 4-17
Mobile IP: agent discovery
agent advertisement: foreign/home agents advertise
service by broadcasting ICMP messages (typefield = 9)
RBHFMGV
bits
reserved
type = 16
type = 9 code = 0
= 9
checksum
= 9
router address
standard
ICMP fields
mobility agent
advertisement
extension
length sequence #
registration lifetime
0 or more care-of-
addresses
0 8 16 24
R bit: registration
required
H,F bits: home
and/or foreign agent
19. Network Layer 4-19
A Link-State Routing Algorithm
Dijkstra’s algorithm
net topology, link costs
known to all nodes
accomplished via “link
state broadcast”
all nodes have same info
computes least cost paths
from one node (‘source”) to
all other nodes
gives routing table for
that node
Notation:
c(i,j): link cost from node i
to j. cost infinite if not
direct neighbors
D(v): current value of cost
of path from source to
dest V
p(v): predecessor node
along path from source to
v, that is next v
N: set of nodes whose
least cost path definitively
known
20. Network Layer 4-20
Dijkstra’s algorithm, more discussion
Why the algorithm is correct ?
Is this algorithm always correct ?
A
B
C
1
1
-3
21. Network Layer 4-21
Distance Vector Routing Algorithm
iterative:
continues until no nodes
exchange info.
self-terminating: no
“signal” to stop
asynchronous:
nodes need not exchange
info/iterate in lock step!
distributed:
each node communicates
only with directly-
attached neighbors
Key Idea
Given my distance to a
neighboring node
Given the distances from the
neighboring nodes to remote
nodes
My distances to remote nodes
22. Network Layer 4-22
Distance Vector Routing Algorithm
Distance Table data structure
each node has its own
row for each possible destination
column for each directly-
attached neighbor to node
example: in node X, for dest. Y
via neighbor Z:
D (Y,Z)
X
distance from X to
Y, via Z as next hop
c(X,Z) + min {D (Y,w)}
Z
w
=
=
D ()
Y
Z
Y
1
7
Z
2
5
X
via
23. Network Layer 4-23
Distance table gives routing table
D ()
A
B
C
D
A
1
7
6
4
B
14
8
9
11
D
5
5
4
2
E
cost to destination via
A
B
C
D
A,1
D,5
D,4
D,2
Outgoing link
to use, cost
Distance table Routing table
24. Network Layer 4-24
Distance Vector Routing: overview
Iterative, asynchronous:
each local iteration caused
by:
message from neighbor: its
least cost path change
from neighbor
Distributed:
each node notifies
neighbors only when its
least cost path to any
destination changes
neighbors then notify
their neighbors if
necessary
wait for (msg from neighbor)
recompute distance table
if least cost path to any dest
has changed, notify
neighbors
Each node:
25. Network Layer 4-25
Comparison of LS and DV algorithms
Message complexity
LS: with n nodes, E links,
O(nE) msgs sent each
DV: exchange between
neighbors only
convergence time varies
Speed of Convergence
LS: O(n2) algorithm requires
O(nE) msgs
may have oscillations
DV: convergence time varies
may be routing loops
count-to-infinity problem
Robustness: what happens
if router malfunctions?
LS:
node can advertise
incorrect link cost
each node computes only
its own table
DV:
DV node can advertise
incorrect path cost
each node’s table used by
others
• error propagate thru
network
26. Network Layer 4-26
Chapter 4 roadmap
4.1 Introduction and Network Service Models
4.2 Routing Principles
4.3 Hierarchical Routing
4.4 The Internet (IP) Protocol
4.5 Routing in the Internet
4.6 What’s Inside a Router
4.7 IPv6
4.8 Multicast Routing
4.9 Mobility
27. Network Layer 4-27
Hierarchical Routing
aggregate routers into
regions, “autonomous
systems” (AS)
routers in same AS run
same routing protocol
“intra-AS” routing
protocol
routers in different AS
can run different intra-
AS routing protocol
special routers in AS
run intra-AS routing
protocol with all other
routers in AS
also responsible for
routing to destinations
outside AS
run inter-AS routing
protocol with other
gateway routers
gateway routers
a
b
b
a
a
C
A
B
d
A.a
A.c
C.b
B.a
c
b
c
a
b
b
b
a
a
a
C
A
B
d
A.a
A.a
A.a
A.c
A.c
A.c
C.b
C.b
C.b
B.a
B.a
B.a
c
c
b
b
c
c
c
28. Network Layer 4-28
Intra-AS and Inter-AS routing
Gateways:
•perform inter-AS
routing amongst
themselves
•perform intra-AS
routers with other
routers in their
AS
inter-AS, intra-AS
routing in
gateway A.c
network layer
link layer
physical layer
a
b
b
a
a
C
A
B
d
A.a
A.c
C.b
B.a
c
b
c
29. Network Layer 4-29
Intra-AS and Inter-AS routing
Host
h2
a
b
b
a
a
C
A
B
d c
A.a
A.c
C.b
B.a
c
b
Host
h1
Intra-AS routing
within AS A
Inter-AS
routing
between
A and B
Intra-AS routing
within AS B
We’ll examine specific inter-AS and intra-AS
Internet routing protocols shortly
30. Network Layer 4-30
DHCP: Dynamic Host Configuration Protocol
Goal: allow host to dynamically obtain its IP address
from network server when it joins network
Allows reuse of addresses (only hold address while
connected an “on”
Support for mobile users who want to join network
31. Network Layer 4-31
DHCP client-server scenario
223.1.1.1
223.1.1.2
223.1.1.3
223.1.1.4 223.1.2.9
223.1.2.2
223.1.2.1
223.1.3.2
223.1.3.1
223.1.3.27
A
B
E
DHCP
server
arriving DHCP
client needs
address in this
network
host broadcasts “DHCP discover” msg
DHCP server responds with “DHCP offer” msg
host requests IP address: “DHCP request” msg
DHCP server sends address: “DHCP ack” msg
33. Network Layer 4-33
Internet AS Hierarchy
Intra-AS border (exterior gateway) routers
Inter-AS interior (gateway) routers
34. Network Layer 4-34
Intra-AS Routing
Also known as Interior Gateway Protocols (IGP)
Most common Intra-AS routing protocols:
RIP: Routing Information Protocol
OSPF: Open Shortest Path First
Border : Interior Gateway Routing Protocol
(Cisco proprietary)
35. Network Layer 4-35
RIP ( Routing Information Protocol)
Distance vector algorithm
Included in BSD-UNIX Distribution in 1982
Distance metric: # of hops (max = 15 hops)
Can you guess why?
Distance vectors: exchanged among neighbors every
30 sec via Response Message (also called
advertisement)
Each advertisement: list of up to 25 destination nets
within AS
36. Network Layer 4-36
RIP: Example
Destination Network Next Router Num. of hops to dest.
w A 2
y B 2
z B 7
x -- 1
…. …. ....
w x y
z
A
C
D B
Routing table in D
37. Network Layer 4-37
RIP: Example
Destination Network Next Router Num. of hops to dest.
w A 2
y B 2
z B A 7 5
x -- 1
…. …. ....
Routing table in D
w x y
z
A
C
D B
Dest Next hops
w - -
x - -
z C 4
…. … ...
Advertisement
from A to D
38. Network Layer 4-38
RIP: Link Failure and Recovery
If no advertisement heard after 180 sec -->
neighbor/link declared dead
routes via neighbor invalidated
new advertisements sent to neighbors
neighbors in turn send out new advertisements (if
tables changed)
link failure info quickly propagates to entire net
poison reverse used to prevent ping-pong loops
(infinite distance = 16 hops)
39. Network Layer 4-39
RIP Table processing
RIP routing tables managed by application-level
process called route-d (daemon)
advertisements sent in UDP packets, periodically
repeated
physical
link
network forwarding
(IP) table
Transprt
(UDP)
routed
physical
link
network
(IP)
Transprt
(UDP)
routed
forwarding
table
40. Network Layer 4-40
RIP Table example (continued)
Router: giroflee.eurocom.fr
Three attached class C networks (LANs)
Router only knows routes to attached LANs
Default router used to “go up”
Route multicast address: 224.0.0.0
Loopback interface (for debugging)
Destination Gateway Flags Ref Use Interface
-------------------- -------------------- ----- ----- ------ ---------
127.0.0.1 127.0.0.1 UH 0 26492 lo0
192.168.2. 192.168.2.5 U 2 13 fa0
193.55.114. 193.55.114.6 U 3 58503 le0
192.168.3. 192.168.3.5 U 2 25 qaa0
224.0.0.0 193.55.114.6 U 3 0 le0
default 193.55.114.129 UG 0 143454
41. Network Layer 4-41
OSPF (Open Shortest Path First)
“open”: publicly available
Uses Link State algorithm
LS packet dissemination
Topology map at each node
Route computation using Dijkstra’s algorithm
OSPF advertisement carries one entry per neighbor
router
Advertisements disseminated to entire AS (via
flooding)
Carried in OSPF messages directly over IP (rather than TCP
or UDP
42. Network Layer 4-42
OSPF “advanced” features (not in RIP)
Security: all OSPF messages authenticated (to
prevent malicious intrusion)
Multiple same-cost paths allowed (only one path in
RIP)
For each link, multiple cost metrics for different
TOS (e.g., satellite link cost set “low” for best effort;
high for real time)
Integrated uni- and multicast support:
Multicast OSPF (MOSPF) uses same topology data
base as OSPF
Hierarchical OSPF in large domains.
44. Network Layer 4-44
Hierarchical OSPF
Two-level hierarchy: local area, backbone.
Link-state advertisements only in area
each nodes has detailed area topology; only know
direction (shortest path) to nets in other areas.
Area border routers: “summarize” distances to nets
in own area, advertise to other Area Border routers.
Backbone routers: run OSPF routing limited to
backbone.
Boundary routers: connect to other AS’s.
45. Network Layer 4-45
Inter-AS routing in the Internet: BGP
Figure 4.5.2-new2: BGP use for inter-domain routing
AS2
(OSPF
intra-AS
routing)
AS1
(RIP intra-AS
routing) BGP
AS3
(OSPF intra-AS
routing)
BGP
R1 R2
R3
R4
R5
46. Network Layer 4-46
Internet inter-AS routing: BGP
BGP (Border Gateway Protocol): the de facto
standard
Path Vector protocol:
similar to Distance Vector protocol
each Border Gateway broadcast to neighbors
(peers) entire path (i.e., sequence of AS’s) to
destination
BGP routes to networks (ASs), not individual
hosts
E.g., Gateway X may send its path to dest. Z:
Path (X,Z) = X,Y1,Y2,Y3,…,Z
47. Network Layer 4-47
BGP operation
Q: What does a BGP router (gateway) do?
Receiving and filtering route advertisements from
directly attached neighbor(s).
Route selection.
To route to destination X, which path )of
several advertised) will be taken?
Sending route advertisements to neighbors.
48. Network Layer 4-48
Why different Intra-/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
50. Network Layer 4-50
Internet inter-AS routing: BGP
Suppose: gateway X send its path to peer gateway W
W may or may not select path offered by X
cost, policy (don’t route via competitors AS), loop
prevention reasons.
If W selects path advertised by X, then:
Path (W,Z) = w, Path (X,Z)
Note: X can control incoming traffic by controlling it
route advertisements to peers:
e.g., don’t want to route traffic to Z -> don’t
advertise any routes to Z
51. Network Layer 4-51
BGP: controlling who routes to you
Figure 4.5-BGPnew: a simple BGP scenario
A
B
C
W
X
Y
legend:
customer
network:
provider
network
A,B,C are provider networks
X,W,Y are customer (of provider networks)
X is dual-homed: attached to two networks
X does not want to route from B via X to C
.. so X will not advertise to B a route to C
52. Network Layer 4-52
BGP: controlling who routes to you
Figure 4.5-BGPnew: a simple BGP scenario
A
B
C
W
X
Y
legend:
customer
network:
provider
network
A advertises to B the path AW
B advertises to X the path BAW
Should B advertise to C the path BAW?
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!
53. Network Layer 4-53
BGP messages
BGP messages exchanged using TCP.
BGP messages:
OPEN: opens TCP connection to peer and
authenticates sender
UPDATE: advertises new path (or withdraws old)
KEEPALIVE keeps connection alive in absence of
UPDATES; also ACKs OPEN request
NOTIFICATION: reports errors in previous msg;
also used to close connection