• No results found

Border Gateway Protocol (BGP)

N/A
N/A
Protected

Academic year: 2022

Share "Border Gateway Protocol (BGP)"

Copied!
23
0
0

Loading.... (view fulltext now)

Full text

(1)

BGP Fundamentals

(2)

Border Gateway Protocol (BGP)

•  Runs over TCP (port 179)

–  TCP connection required before BGP session –  Need to be reachable!

•  Path vector routing protocol

–  Best path selection based on path attributes

–  Route: destination and the attributes of the path to reach the destination

•  Incremental BGP updates

(3)

What is Path Vector Routing Protocol

•  A path vector routing protocol is used to span different autonomous systems

•  It defines a route as a collection of a number of AS that it passes through from source AS to destination AS

•  This list of ASes are called AS path and used to avoid routing loop

•  AS path is also used to select path to destination

(4)

General Operation

•  BGP maintains 3 databases

–  Neighbor Table (who are the other BGP speakers exchanging routes) –  BGP table

–  Forwarding table

•  Learns multiple paths via internal and external BGP speakers

•  Picks the best path and installs it in the forwarding table

•  Policies can be used to influence the best path selection

(5)

Internal & External BGP

•  eBGP used to:

–  Exchange networks/routes between ASes

•  Aggregates and sub-aggregates

–  Implement routing policies

•  To manipulate inbound and outbound traffic

•  iBGP is used to:

–  Carry customer networks/prefixes

–  Internet routes (some or all) across the AS backbone

(6)

BGP Message Type - Open

•  After a TCP connection has been established between two BGP routers, an Open message is sent

•  Once the open message is confirmed (keepalive), the BGP session is established – become BGP peers/neighbors!

•  Contains:

•  Sender’s ASN

•  BGP version

•  BGP router ID

•  Hold-time (3 x keepalive interval)

•  Optionally authentication information

(7)

BGP Message Types - Keepalive

•  Used to acknowledge the open message

•  Sent between BGP peers periodically (every 60 seconds) to maintain the session

•  Data less packet

(8)

BGP Message Type - Update

•  BGP peers exchange network information through Update messages

–  One update for each path!

•  Contains:

–  Withdrawn routes – no more reachable

–  Path attributes – attributes for this path to reach the destinations specified by the NLRI

–  Network Layer Reachability Information (NLRI)

•  list of networks reachable through this path <prefix, length>

(9)

BGP Message Type - Notification

•  Sent when an error condition is detected

•  The BGP session is torn down immediately!

•  Contains:

–  Error code

–  Error sub-code

–  Data related to error

(10)

BGP Neighbor States

•  A BGP router goes through six different states

–  Idle

•  The router is looking for a route to its neighbor

–  Connect

•  BGP router moves from Idle to Connect state if it has found a route to its neighbor, and has started the TCP handshake

•  If the TCP session successful, sends an Open message (and transitions to OpenSent)

•  Else, move to Active state

–  Active

•  A router transitions to Active state if the initial TCP connection was not successful (in Connect state)

•  Restarts the TCP connection

•  If successful, sends an Open message

•  Else, falls back to Idle state

(11)

BGP Neighbor States

•  A BGP router goes through six different states

–  OpenSent

•  An Open message has been sent to the neighbor

•  Waiting for Open message from neighbor

•  If it receives an Open message and there are no mismatches (version, source addr same as TCP addr, ASN, router-ID, TTL, md5), sends KeepAlive, moves to OpenConfirm

•  Else (if mismatches/errors), sent Notification and falls back to Idle

–  OpenConfirm

•  waiting for the initial KeepAlive

•  If received, transitions to Established

•  If holdtimer expires or Notification received, moves to Idle

(12)

BGP State Machine

Idle

Active Connect

OpenSent

OpenConfirm

Established

(13)

BGP Neighbor Relationship

•  eBGP neighbors/peers

–  BGP session established between routers in different ASes –  Generally directly connected!

•  Session established using directly connected interface IP

•  Peering address must match the TCP session!

–  Else, we need a static route to reach the neighbor and change the eBGP TTL value (default 1)

router bgp 17821

neighbor 172.16.12.2 remote-as 65000

172.16.12.0/30

(14)

BGP Neighbor Relationship

•  iBGP neighbors/peers

–  BGP session established between routers within the same AS –  Does not need to be directly connected

•  IGP ensure reachability (TCP connection)

–  Generally using loopback addresses

AS 17821 router bgp 17821

neighbor 10.10.10.2 remote-as 17821

!

(15)

iBGP Operation

•  iBGP routers must:

–  Originate directly connected routes

–  Carry routes learned from outside the AS to all routers within the AS

•  Fully-meshed instead of redistributing!

•  Advertise routes learned from eBGP peers to all iBGP peers!

–  To prevent routing loops (in a fully-meshed network)

•  iBGP routers are not allowed to advertise iBGP learned routes to other iBGP peers!

(16)

iBGP full-mesh

router bgp 17821

neighbor 10.10.10.2 remote-as 17821 neighbor 10.10.10.3 remote-as 17821 neighbor 10.10.10.4 remote-as 17821 !

AS 17821

R1

R2

R3 R4

(17)

iBGP Peering with Loopback Interface

•  By default, routers use the exit-interface address as the source address for locally originated packets (updates)

•  Connected network can go down which might lose iBGP

(18)

iBGP Neighbor Update Source

•  This command allows the BGP process to use the IP

address of a specified interface as the source IP address of all BGP updates to that neighbor

•  A loopback interface is usually used as it will never goes down as long as the router is operational

•  All BGP message will use the referenced interface as source of the messages

(19)

BGP Synchronous Rule

•  BGP do not use or advertise any route to an external

neighbor learned by iBGP until a matching route has been learned from an IGP, i.e. OSPF or static

•  It ensure consistency of information throughout the AS

•  Avoid black hole route within an AS

•  It is safe to turn off if all routers with in the AS run full-mesh iBGP

•  Advisable to disable this feature (BCP)

(20)

Advertising Networks in BGP

•  The network statement

–  allows BGP to inject routes into BGP table and advertise to neighbors only if it already exists in the routing table!

•  Using redistribute

–  Normally with static or connected routes

router bgp 17821

address-family ipv4 unicast

network <prefix> mask <subnet-mask>

address-family ipv6 unicast network <prefix/length>

(21)

AS 111 AS 222 AS 333

iBGP iBGP iBGP

IGP IGP IGP

eBGP eBGP

How it all works?

(22)

Acknowledgement

•  Philip Smith

•  Cisco Systems

(23)

References

Related documents

In fact, we were able to conclude the 3-way handshake with 2.2 million hosts on port 179 (vs. Clearly our number is inflated by the fact that we hit not only routers, but also

secondary to SnapMirror deployment 37 SnapVault with data compression 37 SnapVault with deduplication 37 SnapVault with volume SnapMirror 38 storage efficiency 37 SnapVault

I, N.N., a servant of God, call upon thee, desire and conjure thee, O Spirit Anoch, by the wisdom of Solomon, by the obedience of Isaac, by the blessing of Abraham, by the piety

On the complex issue of how religion bears on public reason, see Kent Greenawalt, Religious Convictions and Political Choice (New York: Oxford University Press, 1988), chapters 8,

The following attributes have been identified for use with BGP: AS-Path Origin Next-hop Weight Local Preference.. Metric (Multi Exit Discriminator –

• PATH Attributes: This represents the additional information about the path of the advertised feasible routes. These path attributes are used by a BGP speaker to indicate

those Only routes used by router itself (i.e. those chosen into routing table) are propagated to chosen into routing table) are propagated to. other neighbors

It does not send the entire routing table periodically via broadcasts, as the original distance vector protocols (such as RIPv1) do, but instead uses multicast addressing