Professional Documents
Culture Documents
Lecture 5 - Routing in The Internet
Lecture 5 - Routing in The Internet
Routing protocols
HEDSPI Project
Hanoi University of Technology
by
Ngo Hong Son
This course materials contains charts and texts provided by Keio University, Japan 1
Overview
Last week
What is routing?
Static and dynamic routing
Routing algorithms
Today: Routing protocols in the real Internet
Hierarchical routing
Intra-domain routing: RIP, OSPF
Inter-domain routing: BGP
2
Hierarchical routing
Autonomous System
Intra and Inter domain routing
3
Overview
The routing we studied so far
are ideal
All nodes are identical
Networks are “flat”
This is not the case in practice
5
Autonomous System (AS)
A set of routers with the same routing policy (routing protocol,
metric…) is aggregated into an AS
Gateway: router connect between two ASes
Each AS has an unique number (ASN - 16 bits or 32 bits).
Source: http://www.cidr-report.org
Number of AS by time
Source: http://www.potaroo.net/
2008
7
Hierarchical routing protocols
Inside an AS: Intra-domain routing protocols
Also named IGP: Interior Gateway Protocol
RIP: Routing Information Protocol
OSPF: Open Shortest Path First
IS-IS, IGRP, EIGRP (Cisco)…
Among ASes: Inter-domain routing protocols
Also named EGP: Exterior Gateway Protocol
BGP (v4): Border Gateway Protocol
8
Intra-domain and Inter-domain
routing
AS2
EGP
RIP domain EGP
EGP
AS4 EGP IGP
IGP AS3
RIP domain
IGP
AS5 OSPF domain
RIP domain
RIP domain
Intra-domain routing protocol
RIP
OSPF
10
RIP ( Routing Information Protocol)
IGP
RIP v.1, currently use RIP v.2
Distance-vector algorithm
Routing metric: # of hops (max = 15 hops)
Net A
133.27.4.0/24
Router A Router C
To 133.27.4.0/24
1 hop
Net B
Router B
133.27.5.0/24
Router D
12
Review: DV routing (2)
Friend of friend is friend
Net A
133.27.4.0/24
Net A
133.27.4.0/24
Net A
133.27.4.0/24
Router A Router C
To 133.27.4.0/24
1 hop
Net B
Router B
133.27.5.0/24
Router D
To 133.27.4.0/24 15
2 hop
RIP: Exchange information
Routing table of router is exchanged
Periodic
Node advertise its distance-vector with neighbors every
30s
Each message contains up to 25 routing table entries
In practice, multiple messages are sent
Triggered
When every entry changes, send copy of entry to
neighbors
Neighbors use to update their tables
16
RIP timer (1)
Update timer
Exchange routing table every 30 sec
Invalid timer
Updated every time router receives information
If it is time out (180sec), it becomes hold down status
Hold down timer
Router keeps routing information for 180 sec
Not refer the worse update (to avoid the loop)
Possibly down status
Flush timer
Update every time router receives information
If 240sec passed, routing entry
17
RIP timer (2)
no
update update
update
↓ ↓ ↓
When it is timeout,
hold down timer starts
Invalid timer
When it is timeout,
This info will be deleted
from RIP database
Flush timer
When it is timeout,
Routing info will be deleted
from routing table
0 30 60 90 120 150 180 210 240 270 300 330 360 390 420
18
Ping-pong failure
If 192.168.0.0/24 is down…
B can update 192.168.0.0 info to A
Packets to 192.168.0.0/24 become loop status
A will update 192.168.0.0 info to B
Count up to infinity!
192.168.0.0/24 conn 192.168.1.0/24 conn
192.168.1.0/24 conn 192.168.2.0/24 conn
192.168.2.0/24 B 192.168.0.0/24 A
A B
19
20
OSPF: Open Shortest Path First
IGP
Open: Open standard by IETF (current
version, version 3, defined in RFC 2740 )
Shortest Path First: Implement the link-state
Dijkstra algorithm.
LSA (link state advertisement) via flooding in
the entire AS
21
Some advanced features
Security: OSPF messages are authenticated
Large AS: Hierarchical OSPF
Classless routing (able to use Variable-
Length Subnet Masking -VLSM )
Different metric for each link based on TOS
(is not used in practice)
22
Hierarchical OSPF
Why we have to divide the network into small area?
If we have more than 100 routers….
Link state update is delivered all the time
Number of re-calculation increase
Need more memory, need more CPU power
Number of link state update become large
Routing table become large
Area
Group of routers which share the same LSA
23
Hierarchical OSPF
24
Router types
ABR - Area border routers: “summarize” distances
to nets in own area, advertise to other Area Border
routers.
ASBR - Autonomous system boundary router:
connect to other AS’s.
BR - backbone routers: run OSPF routing limited to
backbone.
Internal Router - Has only OSPF neighbor
relationships with routers in the same area.
25
Which information is exchanged
among routers?
Link-State Advertisement (LSA): Contain the link
and the cost to the neighbor
For example, node A
link to B, cost 30 A 20
link to D, cost 20 D
link to C, cost 10 C
10
20
30 50
For example, node D
link to A, cost 20 B E
link to E, cost 20
link to C, cost 50
26
OSPF metric
Default value is existing
100Mbps / bandwidth of interface
But these days administrator assign the original
value
During the calculation of routing table
Smallest cost to the one path will be selected
If cost are same
Router will do load balancing
27
OSPF default cost
Link Bandwidth Default OSPF cost
56Kbps serial link 1785
64Kbps serial link 1562
T1 (1.544Mbps) serial link 65
E1 (2.048Mbps) serial link 48
4Mbps Token Ring 25
Ethernet 10
16Mbps Token Ring 6
FDDI or Fast Ethernet 1
Gigabit Ethernet / 10G network 1
28
Link state flooding
LSAX
LSAX
X A X A
X has link to A, cost 10 LSAX
X has link to C, cost 20 C B D C B D
(a) (b)
X A X A
LSAX LSAX
C B D C B D
LSAX
(c) (d) 29
Designated router (DR )
To improving efficiency on exchanging link state
Each router forms an adjacency with the designated
router (DR)
Exchanging link state through DR
If DR fails, use a BDR (Backup DR)
How to select DR and BDR?
B A C B A C
D E D E
30
31
RIP vs. OSPF
RIP OSPF
33
BGP – Border Gateway
Protocol
The glue of Internet, to connect multiple ASes in the
Internet
Using NLRI (Network Layer Reachability
Information)
Allow AS to obtain reachability information from other ASes
Propagate this information to internal routers within AS
Determine best route based on reachability information and
policy
Allow setting routing policies
Selecting outbound paths
Announcing internal routes
34
BGP: Path vector routing
Which routing protocol can be used to connect multiple ASes?
No universal metric – policy decisions
LS: No, Metric are not the same, LS database too large – entire
Internet
DV: Bellman-Ford algorithm may not converge
Solution: Path vector routing
1 2 A
A
A B B→A C
3 A
1 C→B→A
A
D E
2 A 4 A
35
D→A D→A best path
C→B→A ×
Loop free mechanism
Detecting loop depending on whether that router is
included in path of received routing information or not
B will cancel the route to A, which B includes in path
C
A !!LOOP!!
A
D→C→B→A
A
C→B→A
36
D
eBGP and iBGP
External BGP vs. Internal BGP
Distribution of reachability information
1. 3a sends to 1c its prefix reachability info by eBGP
2. 1c sends prefix to all internal routers (1b, 1d, …) in AS1 by iBGP
3. 2a obtains prefix from 1b by eBGP
eBGP session
3c iBGP session
3a 2c
3b 2a
AS3 2b
1c AS2
1a 1b
AS1 1d 37
BGP can implement policy
When gateway router sends and receives
route advertisement
BGP can specify the policy
import policy
export policy
38
Path attributes
ORIGIN
source of routing information (IGP/EGP/incomplete)
AS_PATH
NEXT_HOP
MED (MULTI_EXIT_DISCRIMINATOR)
LOCAL_PREF
ATOMIC_AGGREGATE
AGGREGATOR
COMMUNITY
39
BGP route selection
STEP 1: NEXT_HOP reachability
STEP 2: Compare LOCAL_PREF
STEP 3: Compre AS_PATH length
STEP 4: Compare ORIGIN
STEP 5: Compare MED
STEP 6: Compare EBGP/IBGP
STEP 7: Compare internal cost to reach NEXT_HOP
router
STEP 8: Compre Router ID
40
How to implement routing
policy
Route filtering
Using BGP attribute
AS_PATH PREPEND
MED
LOCAL_PREF
41
Example
43
Example
Network Next Hop Metric LocPrf Weight Path
8.5.192.0/22 203.178.136.14 100 0 2516 209 13989 13989 13989 13989
203.178.136.14 100 0 2516 209 13989 13989 13989 13989
203.178.136.14 100 0 2516 209 13989 13989 13989 13989
8.5.196.0/24 203.178.136.14 100 0 2516 209 13989 13989 13989 13989
203.178.136.14 100 0 2516 209 13989 13989 13989 13989
203.178.136.14 100 0 2516 209 13989 13989 13989 13989
8.5.200.0/22 203.178.136.14 100 0 2516 209 13989 13989 13989 13989
203.178.136.14 100 0 2516 209 13989 13989 13989 13989
45
Summary
Hierarchical routing
RIP
OSPF
BGP
49
Next week: Transport Layer
Transport layer principles
UDP and TCP
Flow control
Congestion control
50