Ch5 Lect 10,11,12
Ch5 Lect 10,11,12
Network Layer:
The Control Plane
Routing
Algorithm
control
plane
data
plane
7
Autonomous Systems terminology
Stub AS: has connection to only one other AS, only
carries local traffic. It can connect to other private
networks that are not seen by the Internet. (E.g.,
UC and CalState network - CENIC)
Multi-homed Stub AS: has connection to more than
one AS, but only carries local traffic
Transit AS: has connection to more than one AS
and carries transit traffic, e.g., ISPs
local traffic: traffic with source and destination in
AS
transit traffic: traffic that passes through the AS
8
Stub and Transit Networks
Private
Network:
Invisible to
Internet
AS 1 AS 2
AS 4
AS 3
AS 5
AS 1 is a multi-homed stub network
AS 3 and AS 4 are transit networks
AS 2 and AS 5 are stub networks
9
Routing and Autonomous Systems
10
Interdomain and Intradomain routing
AS 2 AS 5
AS 1
AS 6
AS 7
AS 3
AS 4
12
EGP and IGP
AS 1
2 AS 2
13
Interconnected ASes and forwarding
3c
3a 2c
3b 2a
AS3 2b
1c AS2
1a
1d
1b AS1 IP forwarding table
configured by both intra- and
inter-AS routing algorithm
Intra-AS
Routing
Inter-AS
Routing
• intra-AS routing
algorithm algorithm determine entries for
destinations within AS
Forwarding
table • inter-AS & intra-AS
determine entries for
external destinations
routing
table
routing table
lookup
IP
incoming IP Forwarding outgoing IP
datagrams datagrams 16
Chapter 5: outline
5.1 introduction
5.2 routing protocols
link state
distance vector
5.3 intra-AS routing in the Internet:
RIP
OSPF
5.4 inter-AS routing in the Internet: BGP
19
Routing algorithm classification
21
Chapter 5: outline
5.1 introduction
5.2 routing protocols
link state
distance vector
5.3 intra-AS routing in the Internet:
RIP
OSPF
5.4 inter-AS routing in the Internet: BGP
Triggered means that if any link dropped will tell all neighbors
Rip Example
assume:
• link cost is “1” on all hops
• all updates occur simultaneously
• initially each router only knows its directly
connected interfaces --> cost = 0
After First Update
After Second Update
After Third Update
Last Update for Convergence
Realiastic Example of RIP
Received Dijkstra’s
LSAs Link
Algorithm
IP Routing
State
Table
Database
OSPF Message
Header Body of OSPF Message
backbone
area
border
routers
area 3
internal
routers
area 1
area 2
2b
2a 2c
∂
1b 3b
2d
1a 1c 3a
∂ 3c
AS 2
1d 3d
AS 1 eBGP connectivity AS 3
iBGP connectivity
2d
Network Layer: Control Plane 5-46
Path attributes and BGP routes
advertised network (referred to as prefix in BGP)
includes BGP attributes
• prefix + attributes = “route”
three important attributes:
• ORIGIN: advertising AS
• AS-PATH: list of ASes through which advertisement has
passed
• NEXT-HOP: indicates specific internal-AS router to next-
hop AS
Policy-based routing:
• gateway receiving route advertisement uses import policy to
accept/decline path (e.g., never route through AS Y).
• AS export policy also determines whether to advertise path
to other neighboring ASes
Network Layer: Control Plane 5-47
BGP path advertisement
AS3 3b
AS1 1b
3a 3c
1a 1c
AS2 2b 3d X
1d AS3,X
AS2,AS3,X
2a 2c
2d
AS2 router 2c receives path advertisement AS3,X (via eBGP) from AS3
router 3a
based on AS2 import policy, AS2 router 2c accepts path AS3,X, and
propagates (via iBGP) to all AS2 routers
based on AS2 export policy, AS2 router 2a advertises (via eBGP) path
AS2, AS3, X to AS1 router 1c
Network Layer: Control Plane 5-48
BGP path advertisement
AS3 3b
AS1 1b AS3,X
3a 3c
1a 1c
AS2 2b 3d X
1d AS3,X
AS2,AS3,X
2a 2c
2d
AS3 3b
AS1 1b AS3,X
1 AS3,X
3a 3c
1a 2 1c
local link AS2 2b 3d X
interfaces 2 1d 1 AS3,X
at routers AS2,AS3,X
1a, 1d 2a 2c
physical link
2d
dest interface recall: 1a, 1b, 1d learn about dest X via iBGP
… … from 1c: “path to X goes through 1c”
X 1 1d: OSPF routing: to get to 1c, forward over
… … outgoing local interface 1
AS3 3b
AS1 1b
1
3a 3c
1a 2 1c
AS2 2b 3d X
1d
2a 2c
2d
dest interface recall: 1a, 1b, 1d learn about dest X via iBGP
… … from 1c: “path to X goes through 1c”
X 2 1d: OSPF intra-domain routing: to get to 1c,
… … forward over outgoing local interface 1
1a: OSPF routing: to get to 1c, forward
over outgoing local interface 2
Network Layer: Control Plane 5-51
BGP route selection
gateway router may learn Advertise path to
about more than one route AS 1 10.0.1.0/24 AS 2
to destination AS, selects Local pref = 10
Local pref
= 100 path to
route based on: AS 51
AS
Advertise
10.0.1.0/24
Advertise path to
1. local preference value 10.0.1.0/24
Local pref = 50 Local pref = 80
attribute: policy decision
2. shortest AS-PATH AS 3 Advertise path to
AS 4
10.0.1.0/24
3. closest NEXT-HOP AS 1 Source
internal router: hot potato
routing Cost=20
AS 1 Cost=5
4. additional criteria AS 3 High bandwidth network
peers AS 4 AS 5
Customer/
Customer/ Customer/ Provider
Provider Provider
peers AS 6 AS 7 AS 8
peers AS 4 AS 5 AS 6
(ISPs, lv1)
Customer/Provider
Customer/
Provider
AS 7
peers
(stubs)
AS 8
Y
Suppose an ISP only wants to route traffic to/from its customer
networks (does not want to carry transit traffic between other ISPs)
A advertises path AW to B and to C
W is not B’s customer, B gets no “revenue” for routing
any of its traffic.
B does not advertise (selective transit) BAW to X:
B uses import and export policy to make this decision, wont take
(import) from A (or C) re W and won’t send (export) to X)
C will route W traffic and will let customers X and Y know
about path CAW
BGP: achieving policy via
advertisements
legend: provider
B network
X
W A
customer
C network:
Y
Suppose an ISP only wants to route traffic to/from its customer
networks (does not want to carry transit traffic between other ISPs)
A,B,C are provider networks (transit AS)
X,W,Y are customer (of provider networks) - stub networks, i.e.,
originate/terminate traffic only
X is dual-homed: attached to two networks
policy to enforce: X cannot route traffic from B to C via itself (X
is a stub network)
.. so X will not advertise to B a route to C (export policy)
… whereas X does accept routes from C (import policy) and possibly
other routes from B (import policy)
Import and Export Policies
Best entry is
entered in
Based on IP routing
Policies attributes
Policies
table
BGP BGP
updates IP routing updates
table depart
arrive
60
BGP Message Types
BGP messages exchanged between peers over TCP session
BGP messages:
• OPEN (Type 1): opens TCP connection to remote BGP peer
(port 179) and authenticates sending BGP peer
• UPDATE (Type 2): advertises new path (or withdraws old)
• KEEPALIVE (Type 3): keeps connection alive in absence
of UPDATES; also ACKs OPEN request
• NOTIFICATION (Type 4): reports errors in previous msg;
also used to close connection
Network Prefix
10.0.1.0/24,
10.0.1.0/24, AS 2 AS 4 ORIGIN {1}
ORIGIN {1}
10.0.1.0/24,
ORIGIN {1}
10.0.1.0/24 AS 1 AS 5
10.0.1.0/24,
ORIGIN {1} AS 3 10.0.1.0/24,
ORIGIN {1}
63
AS-PATH attributes
each AS that propagates a route prepends its own AS number
• AS-PATH creates a full path to reach the network prefix 10.0.1.0/24
path information prevents routing loops from occurring
path information also provides information on the length of a path (no. of
ASes enroute, by default, a shorter route is preferred)
Note: BGP aggregates routes according to CIDR rules
10.0.1.0/24,
10.0.1.0/24, AS 2 AS 4 AS-PATH {4,2,1}
AS-PATH {1}
10.0.1.0/24,
AS-PATH {2,1}
AS 1 AS 5
10.0.1.0/24, AS 3
AS-PATH {1} 10.0.1.0/24,
AS-PATH {3,1} 64
NEXT-HOP attributes
each router that sends a route advertisement, includes its own IP
address of the forwarding port in a NEXT-HOP attribute
the attribute provides information for the routing table of the receiving
router in the next AS on the path
128.100.11.1 128.143.71.21
AS 1 AS 5
AS 3
10.0.1.0/24, 10.0.1.0/24,
NEXT-HOP {128.100.11.1} NEXT-HOP {128.143.71.21}
65
Putting it all together
AS 1 eBGP
IGP router
AS 3 R1
10.0.1.0/24,
iBGP
10.0.1.0/24,
NEXT-HOP {128.100.11.1} NEXT-HOP {128.100.11.1}