routing: exterior gateway protocols and autonomous systems

35
Network Architecture and Design 1 Routing: Exterior Gateway Protocols and Autonomous Systems Border Gateway Protocol (BGP) Reference D. E. Comer, Internetworking with TCP/IP, ISBN 1- 13-018380-6, 4 th Ed., Vol. 1, Ch. 15.

Upload: oswald

Post on 14-Jan-2016

55 views

Category:

Documents


0 download

DESCRIPTION

Routing: Exterior Gateway Protocols and Autonomous Systems. Border Gateway Protocol (BGP) Reference D. E. Comer, Internetworking with TCP/IP, ISBN 1-13-018380-6, 4 th Ed., Vol. 1, Ch. 15. Autonomous System (AS). - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Routing: Exterior Gateway Protocols and Autonomous Systems

Network Architecture and Design 1

Routing: Exterior Gateway Protocols and Autonomous Systems

Border Gateway Protocol (BGP)

Reference

D. E. Comer, Internetworking with TCP/IP, ISBN 1-13-018380-6, 4th Ed., Vol. 1, Ch. 15.

Page 2: Routing: Exterior Gateway Protocols and Autonomous Systems

Network Architecture and Design 2

Autonomous System (AS)

AS = collection of networks under a single technical administration & sharing the same routing policy

AS# can be 1 to 65535 (64512 – 65535 private) Internal Gateway Protocols (IGPs) operate within an AS to ensure IP

connectivity within it Exterior Gateway Protocols (EGPs) run between ASs to enable

routing policies between them

Page 3: Routing: Exterior Gateway Protocols and Autonomous Systems

Network Architecture and Design 3

BGP Necessity

Q: how will the traffic between AS1 and AS20 flowQ: will AS 2 allow this trafficQ: how would you solve this problem with OSPF or EIGRP

Company A(AS 1)

Company B(AS 2)

2 Mbps

AS 10(service provider)

AS 20(network X)

Page 4: Routing: Exterior Gateway Protocols and Autonomous Systems

Network Architecture and Design 4

BGP Characteristics Distance-vector protocol with enhancements:

Reliable updates (TCP port 179) Incremental, triggered updates only

Full BGP tables exchanged after conn. setup

Only changes (delta) sent afterwards Rich metrics (called path attributes) Periodic keepalives to verify TCP connectivity

Designed to scale to huge internetworks Full Internet Routing Table (FIRT) = 100.000

routes, 7000 ASs, 40MB approx.

Page 5: Routing: Exterior Gateway Protocols and Autonomous Systems

Network Architecture and Design 5

BGP Characteristics BGP session = TCP connection port 179 Two routers with BGP session established are

called peers or neighbors No periodic updates Triggered updates are batched and rate-limited

(every 5 seconds for internal peer, every 30 seconds for external peer)

Needs an IGP to provide TCP connectivity between BGP peers

Page 6: Routing: Exterior Gateway Protocols and Autonomous Systems

Network Architecture and Design 6

BGP Table and Routing Table

BGP has its own table, in addition to the IP routing table

Information can be exchanged between the two

Routing Table

BGP Table

BGPIGP/Static

Page 7: Routing: Exterior Gateway Protocols and Autonomous Systems

Network Architecture and Design 7

Sample BGP configurations

Customer connected to Internet Service Provider (ISP)

Customer connected to several Service Providers (multi-homed)

Service Provider networks (transit autonomous systems)

Service Providers exchanging traffic at an exchange point (e.g. AIX, MAE-East,…)

Backbone of large enterprise networks

Page 8: Routing: Exterior Gateway Protocols and Autonomous Systems

Network Architecture and Design 8

Configuration #1

Large customer or small ISP connecting to the Internet

Leafautonomous

systemInternetBGP

Page 9: Routing: Exterior Gateway Protocols and Autonomous Systems

Network Architecture and Design 9

Configuration #2Customer connecting to several service-providers

(multi-homed customer) BGP is mandatory in this case Public AS# needed for the customer Provider-independent address space for the customer

Customer Internet

Internetservice

provider #1

Internetservice

provider #2

Page 10: Routing: Exterior Gateway Protocols and Autonomous Systems

Network Architecture and Design 10

Configuration #3Service providers exchanging traffic at exchange points

(*IX)

Internetservice

provider #1

Internetservice

provider #2

Internetservice

provider #3

Internetservice

provider #4

*IX

Page 11: Routing: Exterior Gateway Protocols and Autonomous Systems

Network Architecture and Design 11

Configuration #4Transit AS (carrying traffic from other AS’es)

Leaf AS

Internet

Leaf AS

Transit AS

BG

P

Page 12: Routing: Exterior Gateway Protocols and Autonomous Systems

Network Architecture and Design 12

BGP Message Types

OPEN Initialize communication

UPDATE Advertise or withdraw routes

NOTIFICATION Response to an incorrect message

KEEPALIVE Actively test peer connectivity

Page 13: Routing: Exterior Gateway Protocols and Autonomous Systems

Network Architecture and Design 13

BGP Path Attributes

BGP metrics are called path attributes Part of the BGP Update Packet Implemented as TLVs (Type-Length-

Value) Used by BGP peers as route selection

criteria Well-known vs Optional attributes

Page 14: Routing: Exterior Gateway Protocols and Autonomous Systems

Network Architecture and Design 14

Well-known Attributes

Well-known attributes must be recognized by all compliant

implementations Well-known mandatory attributes

must be present in all update messages Well-known discretionary attributes

could be present in update messages All well-known attributes are propagated to

other neighbors

Page 15: Routing: Exterior Gateway Protocols and Autonomous Systems

Network Architecture and Design 15

Optional Attributes Optional attributes

recognized by some implementations (could be private), expected not to be recognized by everyone

Optional transitive attributes propagated to other neighbors if not recognized

Optional non-transitive attributes discarded if not recognized

Recognized optional attributes are propagated to other neighbors based on their meaning (not constrained by transitive bit)

Page 16: Routing: Exterior Gateway Protocols and Autonomous Systems

Network Architecture and Design 16

Well-known Mandatory Attributes Origin Code

Specifies the origin of a BGP route IGP = route originated in an IGP (network command) EGP = route originated in an EGP (and redistributed) Incomplete (?) = route redistributed into BGP from

IGP/static AS_Path

sequence of AS numbers through which the network is accessible

Next_Hop IP address of the next-hop router

Page 17: Routing: Exterior Gateway Protocols and Autonomous Systems

Network Architecture and Design 17

Well-known Discretionary Attributes

Local preference Used for consistent routing policy within AS

Atomic aggregate informs the neighbor AS that the originating router

aggregated routes

Page 18: Routing: Exterior Gateway Protocols and Autonomous Systems

Network Architecture and Design 18

AS-Path Attribute The AS-path attribute is empty when a local route is

inserted in the BGP table The sender’s AS number is prepended to the AS-

path attribute when the routing update crosses AS boundary

The receiver of BGP routing information can use the AS-path to determine through which AS the information has passed

An AS that receives routing information with its own AS number in the AS-path silently ignores the information

Page 19: Routing: Exterior Gateway Protocols and Autonomous Systems

Network Architecture and Design 19

AS-Path Attribute

Page 20: Routing: Exterior Gateway Protocols and Autonomous Systems

Network Architecture and Design 20

Next Hop Attribute

Next-hop attribute indicates the next-hop IP address used for packet forwarding

Usually set to the IP address of the sending BGP router

Can be set to a third-party IP address to optimize routing

Page 21: Routing: Exterior Gateway Protocols and Autonomous Systems

Network Architecture and Design 21

Next Hop Processing in Shared Media

If the receiving BGP router is in the same subnet as the current next-hop, the next-hop address is not changed to optimize packet forwarding

Page 22: Routing: Exterior Gateway Protocols and Autonomous Systems

Network Architecture and Design 22

Next Hop Processing in NBMA

BGP next-hop processing can break connectivity with improper network designs over partially-meshed WAN networks

Correct use of subinterfaces and subnets alleviates the problem

Page 23: Routing: Exterior Gateway Protocols and Autonomous Systems

Network Architecture and Design 23

BGP Session Establishment

BGP does not auto-discover Neighbors - they must be configured manually

Configuration must be done on both sides of the connection

Both routers will attempt to connect to the other with a TCP session on port number 179

Only one session will remain if both connection attempts succeed

Source IP address of incoming connection attempts is verified against a list of configured neighbors

Page 24: Routing: Exterior Gateway Protocols and Autonomous Systems

Network Architecture and Design 24

Example Network

AS 37

AS 123

1.2.3.4

AS 21

37.0.0.1

2.3.4.6

2.3.4.5

3.4.5.7

3.4.5.6

4.5.6.8

4.5.6.7

21.0.0.1

Page 25: Routing: Exterior Gateway Protocols and Autonomous Systems

Network Architecture and Design 25

BGP Neighbors – Idle State

Initially all BGP sessions to the neighbors are idle

as123>show ip bgp sum

BGP table version is 1, main routing table version 1

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State

2.3.4.5 4 21 0 0 0 0 0 never Idle

3.4.5.6 4 37 0 0 0 0 0 never Idle

Page 26: Routing: Exterior Gateway Protocols and Autonomous Systems

Network Architecture and Design 26

BGP Neighbors – Steady State

All neighbors shall be up (no state info)

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State2.3.4.5 4 21 17 22 10 0 0 0:01:473.4.5.6 4 37 11 17 10 0 0 0:07:07

Page 27: Routing: Exterior Gateway Protocols and Autonomous Systems

Network Architecture and Design 27

External BGP - EBGP BGP neighbors in different AS

Router B:

router bgp 110

network 150.10.0.0

neighbor 131.108.10.1 remote-as 109

Router A:

router bgp 109

network 131.108.0.0

neighbor 131.108.10.2 remote-as 110

AS 109

AS 110

131.108.0.0

150.10.0.0

131.108.10.0

.1

.2

A

B

Page 28: Routing: Exterior Gateway Protocols and Autonomous Systems

Network Architecture and Design 28

External BGP - EBGP

Page 29: Routing: Exterior Gateway Protocols and Autonomous Systems

Network Architecture and Design 29

Internal BGP - IBGP BGP Neighbors in same AS

Router B:

router bgp 109

network 131.108.0.0

neighbor 131.108.30.1 remote-as 109

neighbor 131.108.30.1 update-source lo0

Router A:

router bgp 109

neighbor 131.108.10.2 remote-as 109

neighbor 131.108.30.2 update-source lo0 Update source is loopback0 to make sessions insensitive to

topology changes within the AS

131.108.30.1

A

B

131.108.30.2

AS 109

Page 30: Routing: Exterior Gateway Protocols and Autonomous Systems

Network Architecture and Design 30

Internal BGP - IBGP

Page 31: Routing: Exterior Gateway Protocols and Autonomous Systems

Network Architecture and Design 31

BGP Attributes – AS Path

AS-Path Contains the list of AS’s traversed by

the update Sending router updates AS with its own

AS Used for loop detection:

if a router receives an update containing its own AS, then it discards it

Page 32: Routing: Exterior Gateway Protocols and Autonomous Systems

Network Architecture and Design 32

BGP Attributes – AS Path

AS-Path Ordered list of

AS’s traversed by route update

AS-Set Route update

traversed one or more members of a set

1983

1981

192.2.0.0/24

192.2.1.0/24

1982192.2.3.0/24

1980192.2.2.0/24

192.2.0.0/24, 1980 1983

192.2.1.0/24, 1980 1981

192.2.2.0/24, 1980

192.2.3.0/24, 1980 1982

192.2.0.0/22 {1980, 1981, 1982, 1983}

Page 33: Routing: Exterior Gateway Protocols and Autonomous Systems

Network Architecture and Design 33

BGP Attributes – AS Path

AS-Path – Loop detection670

1560

146.124.54.0/24

210

A

B

C

1. Router A sends update for 146.124.54.0/24 with AS_PATH: 1560

1. Router A sends update for 146.124.54.0/24 with AS_PATH: 1560

2. Router B sends update for 146.124.54.0/24 with AS_PATH: 670 1560 (pre-pends its AS path)

2. Router B sends update for 146.124.54.0/24 with AS_PATH: 670 1560 (pre-pends its AS path)

3. Router C sends update for 146.124.54.0/24 with AS_PATH: 210 670 1560 (pre-pends its AS path)

3. Router C sends update for 146.124.54.0/24 with AS_PATH: 210 670 1560 (pre-pends its AS path)

4. Router A detects its own AS in the update’s AS_PATH and discards it

4. Router A detects its own AS in the update’s AS_PATH and discards it

Page 34: Routing: Exterior Gateway Protocols and Autonomous Systems

Network Architecture and Design 34

BGP Attributes – Local Preference Local Preference

Is sent only to routers in the same AS Path with highest local-preference is preferred Default is 100

65000

Need to go to 65500

A

B

6500165002

65003

65500

Local Pref 120

Page 35: Routing: Exterior Gateway Protocols and Autonomous Systems

Network Architecture and Design 35

End of Fifth Lecture