Vous êtes sur la page 1sur 21

Chapter 4

Network Layer
Computer Networking: A
Top Down Approach
4th edition.
Jim Kurose, Keith Ross
Addison-Wesley, July
2007.

Last Lecture
RIP
BGP

Todays Lecture
BGP

Path Vector Routing

Path Vector Routing


Loop Prevention.
IF a router receives a meesage, checks

to see if its autonomous system is in the


path list to the destination.
If it is, looping is involved and the
message is ignored.
Policy Routing
If one of the path in the path vector is
against the policy it can ignore that
path and does not update its routing
table.

Internet inter-AS routing: BGP


BGP (Border Gateway Protocol)
BGP provides each AS a means to:
1. Obtain subnet reachability information from
neighboring ASs.
2. Propagate reachability information to all ASinternal routers.
3. Determine good routes to subnets based on
reachability information and policy.
Allows subnet to advertise its existence to

rest of Internet: I am here

BGP Basics
Pairs of routers (BGP peers) exchange routing info over TCP

connections using port 179.


For each TCP connection, the two routers at the end of the
connection are called BGP Peers
The TCP connection along with all the BGP messages sent over
the connection is called a BGP session
Internal (IBGP) neighbours
A pair of BGP speakers within the same AS

External (EBGP) neighbours

Two BGP speakers from two different AS

eBGP session

3c
3a
3b
AS3
1a
AS1

iBGP session

2a

1c
1d

1b

2c
AS2

2b

BGP Basics
BGP allows each As to learn which destinations

are reachable via its neighboring ASs.


Destinations are not hosts but instead are
CIDRized prefixes.

E.g. AS1 has four subnets attached to it

It will aggregate the prefixes of these four and will


advertise the single prefix

AS1 and AS2 send reachability information

trough their gateway routers 1b and 2a.


When a gateway router receives e-BGP learned
prefixes, the gateway router uses iBGP sessions
to distribute the prefixes to other routers in
the AS.

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, it creates entry
for prefix in its forwarding table.
eBGP session

3c
3a
3b
AS3
1a
AS1

iBGP session

2a

1c
1d

1b

2c
AS2

2b

Path Attributes & BGP Routes


In BGP an AS is recognized by its

globally unique autonomous system


number (ASN).
Assigned by ICANN Regional
Registries.
Advertised prefix includes BGP
attributes.
prefix + attributes = route
Two important attributes:
AS-PATH and NEXT-HOP

Path Attributes & BGP Routes


Two important attributes:
AS-PATH and NEXT-HOP
AS-PATH
Contains ASs through which prefix advertisement
has passed.
When a prefix is passed into an AS, the As adds
its ASN to the AS-PATH attribute.
E.g suppose that the prefix 138.16.64/24 is first
advertised from AS2 to AS1.
If AS1 then advertises the prefix to AS3, ASPATH would be AS2 AS1.
Detect and prevent looping advertisements

Routing Loop Prevention


AS2

[ Net1, (AS3,AS4) ]
AS3

[ Net1,
(AS2,AS3,AS4)]
AS1

[Net1, (AS4)]
AS4
Net1

[ Net1,
(AS1,AS2,AS3,AS4)]
AS3 wont forward this further

NEXT-HOP
The route advertised from 3a to 1c contains advertised

prefix say x and NEXT-HOP attribute.

NEXT-HOP is the IP address of the router 3a interface that lead

to 1c.

Router 1d learns about this route from iBGP.


Remember that intra AS protocol finds the least cost path
to all the subnet attached to the routers in AS1
Router 1d makes entry into the table (l,x) where l is the
interface that begins the least cost path to the gateway
router 1c.

eBGP session

3c
3a
3b
AS3
1a
AS1

iBGP session

2a

1c
1d

1b

2c
AS2

2b

NEXT-HOP
12.125.133.90

AS 7018

12.127.0.121

AS 12654

AS 6431

135.207.0.0/16
Next Hop = 12.125.133.90

135.207.0.0/16
Next Hop = 12.127.0.121

BGP Route Selection

1.
2.
3.

Router may learn about more than one route to


the some prefix. Router must select one route.
BGP sequentially invokes the following elimination
rules until one route remains
The route with highest local preference value.
This is a policy decision.
Shortest AS-PATH.
Hot Potato Routing.

Additional criteria (SEE RFC 4271)

BGP Route Selection


BGP speakers receive a lot of path-vector

advertisements from its EBGP neighbours


Advertisement processing involves 3 steps
Import policies
Path selection
Which route should I choose?
Export policies
Which route should I export to my EBGP
neighbors?

Policy Routing
Policies can be dictated by
Presence and absence of agreement to

exchange traffic
Security
Network preferences
Examples of policy
An AS may consider AS1 not secure
An AS may prefer to send its packets
via AS1 rather than AS2 because the
former charges a lower tariff

Policy Routing
ISP1
AS3

If AS1 forwards this to AS3, then ISP1


may use AS1 to reach Net1 if it chooses.
However, AS1 may not want that.
[ Net1, (AS1,AS4,AS2)]

Company
AS1
Net2

[Net1,
(AS4,AS2)]
[Net1, (AS4,AS2)]
ISP2
AS4

Net1

[Net1, (AS2)]

Company
AS2

Policy Routing
ISP1
AS3

[Net2,
(AS3,AS1)]

If AS1 doesnt want to become a transit


network, it does not export routes learnt
from EBGP. It exports only its own routes.
Company
AS1
Net2

[ Net2, (AS1)]

[Net1, (AS4,AS2)]
[Net2,
(AS4,AS1)]

ISP2
AS4

Net1

AS1 wont
export this

Company
AS2

Why different Intra- and Inter-AS routing ?


Policy:

Inter-AS: admin wants control over how its traffic

routed, who routes through its network.


Intra-AS: single admin, so no policy decisions needed

Performance:

Intra-AS: can focus on performance


Inter-AS: policy may dominate over performance

Types of BGP messages

Part of Assignment 3

Vous aimerez peut-être aussi