Border Gateway Protocol
description
Transcript of Border Gateway Protocol
Border Gateway Protocol (BGP)
Ejaz Ahmed
PATH VECTOR ROUTING
Path vector routing is similar to distance vector routing. Path vector routing is similar to distance vector routing. There is at least one node, called the speaker node, in each There is at least one node, called the speaker node, in each AS that creates a routing table and advertises it to speaker AS that creates a routing table and advertises it to speaker nodes in the neighboring nodes in the neighboring ASsASs.. ..
The topics discussed in this section include:The topics discussed in this section include:
Initialization Initialization Sharing Sharing Updating Updating
Initial routing tables in path vector routing
Stabilized tables for four autonomous systems
BGP
Border Gateway Protocol (BGP) is an Border Gateway Protocol (BGP) is an interdomaininterdomain routing routing protocol using path vector routing. It first appeared in 1989 protocol using path vector routing. It first appeared in 1989 and has gone through four versions. and has gone through four versions.
The topics discussed in this section include:The topics discussed in this section include:Types of Autonomous Systems Types of Autonomous Systems Path Attributes Path Attributes BGP Sessions BGP Sessions External and Internal BGP External and Internal BGP Types of Packets Types of Packets Packet Format Packet Format Encapsulation Encapsulation
Border Gateway Protocol (BGP)
When a pair of AS’s agree to exchange routing information, each must designate a router that will speak BGP on its behalf.These two routers are called the BGP peers of one another.They are normally near the edge of AS (hence called Border Routers).Each AS can have more than one BGP speakers.Internal Routers do not implement BGP.
Border Gateway Protocol (BGP)
Coordination Among Multiple BGP Speakers– If an AS has multiple routers each communicating with a
peer in an outside AS, BGP can be used to coordinate among routers in the AS to guarantee that all propagate consistent information.
– A consistent view of the interior routers are provided by the IGP.
– A consistent view of the routers exterior to the AS can be provided by having all BGP Speakers within the AS, maintain BGP connection with each other.
Connection between BGP speakers of different AS are referred to as external links while connections between BGP speakers within the same AS is referred as internal links.
BGP Characteristics
Propagation of Reachability Information:– BGP allows an AS to advertise destinations that are
reachable either in or through it and learn such information from other AS.
Path Information– In addition to specifying destinations that can be
reached and a next hop for each, BGP advertisements include path information that allows the receiver to learn a series of ASs along a path to the destination.
BGP Characteristics
Next-hop Paradigm– Like distance-vector routing protocols, BGP supplies
next hop information for each destination.
Policy Support– BGP can implement policies.– A router running BGP can be configured to distinguish
between the set of destinations reachable by computers inside the AS and the set of destinations advertised to other autonomous systems.
BGP Characteristics
Incremental Updates– To conserve network bandwidth, BGP does not pass full
information in each update.– Full information is only passed once, and latter only
updates are sent (deltas).
Classless Addressing– BGP supports CIDR addresses.– A mask is sent along each address.
Route Aggregation– BGP allows multiple related destinations to be grouped
into one entry.
BGP Characteristics
Authentication– Authentication is also provided in BGP.– Sender is verified using an authentication code.– Different authentication codes can be used.
Reliable Transport– BGP is unusual among routing protocols because it uses
TCP for all communication.– This eliminates the need to implement explicit
fragmentation, retransmission, Acks, and sequencing.– Uses TCP port 179.
BGP Routing Information Base (RIB)
Routes are stored in Routing Information Base (RIB)RIB consists of three distinct parts– Adj-RIBs-In– Loc-RIB– Adj-RIBs-Out
BGP Routing Information Base (RIB)
Adj-RIB-In– Store routing information that has been learned from the inbound
UPDATE messages. These contents represent the routes that are available as input to the decision process.
Loc-RIB– Store local routing information that has been selected by applying
local policies to the information contained in Adj-RIB-In.– Routes that would be used by the local BGP speaker are present in
the Loc-RIB.
Adj-RIB-Out– Store routing information that the BGP speaker has selected for
advertisement to its peers (external links). This information will be carried out in the UPDATE message to the peers.
14
BGP Operations (Simplified)
Establish session onTCP port 179
Exchange allactive routes
Exchange incrementalupdates
AS1
AS2
While connection is ALIVE exchangeroute UPDATE messages
BGP session
Types of BGP messages
BGP packet header
• Minimum message size is 19 octets.• Maximum allowable length is 4096 octets.
• In the initial message the Marker contains all 1’s.
Open message
BGP OPEN Message
A router uses OPEN message to establish a connection with another neighboring router.It declares its AS number and other operating parameters.Hold Time tells the peer the duration it should hold the connection when no communication is going on– The receiver is required to start a timer using this value– The timer is reset each time a message is received.– If the timer expires the receiver assumes the sender is
no longer available and stops forwarding datagrams along routes learned from that sender.
– Hold Time is either zero or at least three seconds.
BGP OPEN Message
BGP Identifier field contains a 32 bit integer that uniquely identifies the sender.– The sender uses the same identifier if it has
peer relationships with multiple peers.– The router chooses one of is IP addresses to use
with all BGP peers.The last field of an OPEN message is optional.If present, the field Option Length specifies the length measured in octets, of the optional field.
BGP OPEN Message
When parameters are present, each parameter in the list is preceded by a two octet header with the first octet specifying the type and the other specifies the length.If no parameters are specified, the value of Option Length is zero and message ends here.Only one parameter type is specified; Type 1 is reserved for authentication.
BGP OPEN Message
When a receiver accepts an incoming OPEN message, BGP machine replies with a KeepAlive message.A KeepAlive message acts as an ACK for the open message.
Update message
BGP UPDATE MessageUnfeasible route length– Specifies the size of withdrawn destinations– If zero then no destination are being withdrawn.
WITHDRAW ROUTES– Contains list of addresses to be withdrawn– Each destination is encoded as 2 tuple of the form <length, prefix>
PATH ATTR. LEN– Specifies the total length of the Path Attributes field in octets.– Value of zero indicates no NLRI is present.
PATH ATTRIBUTES– Additional information apart from NextHop are contained in Path
Attributes.
BGP UPDATE MessageA sender can use Path Attributes to specify– A next hop for the destination– A list of autonomous systems along the path to the destinations.– Whether the path was learned from another AS or derived from
within the sender’s AS.
Attribute Type Attribute Length Attribute Value
Flags Code
Unused4-7
1 if length field is 2 3
1 for partial / 0 for complete2
1 for transitive/ 0 for non transitive1
1 optional/ 0 Welknown0
DescriptionFlag Bits
BGP UPDATE MessageBGP attributes are classified into four categories– Well-known mandatory– Well-known discretionary– Optional transitive– Optional non-transitive
Well known attributes are those that must be implemented in all BGP routers.Mandatory attributes must be present in all UPDATE messages; otherwise the connection will fail.Discretionary attributes may or may not be present in all UPDATEmessages.Optional attributes are those that do not have to be recognized by all BGP implementations.Transitive attributes are passed on to other peers.
BGP UPDATE Message
Length field follows the type field (1 or 2 octet long).Receiver uses the type field to get length field and then from contents of length field determine the size of value field.
Preference used within an AS5
Routes have been aggregated6
ID of AS that aggregated the route7
Multiple AS exit points 4
Next hop to use for destination3
List of AS on path to destination2
Specify the origin of the path info1
DescriptionTYPE CODE
BGP supports classless addressing and CIDR.
Note:Note:
BGP Attributes
Value Code Reference----- --------------------------------- ---------
1 ORIGIN [RFC1771]2 AS_PATH [RFC1771]3 NEXT_HOP [RFC1771]4 MULTI_EXIT_DISC [RFC1771]5 LOCAL_PREF [RFC1771]6 ATOMIC_AGGREGATE [RFC1771]7 AGGREGATOR [RFC1771]8 COMMUNITY [RFC1997]9 ORIGINATOR_ID [RFC2796]
10 CLUSTER_LIST [RFC2796]11 DPA [Chen]12 ADVERTISER [RFC1863]13 RCID_PATH / CLUSTER_ID [RFC1863]14 MP_REACH_NLRI [RFC2283] 15 MP_UNREACH_NLRI [RFC2283] 16 EXTENDED COMMUNITIES [Rosen]
...255 reserved for development
From IANA: http://www.iana.org/assignments/bgp-parameters
Mostimportantattributes
Not all attributesneed to be present inevery announcement
Attributes are Used to Select Best Routes
192.0.2.0/24pick me!
192.0.2.0/24pick me!
192.0.2.0/24pick me!
192.0.2.0/24pick me!
Given multipleroutes to the sameprefix, a BGP speakermust pick at mostone best route(Note: it could reject them all!)
30
ASPATH Attribute
AS7018135.207.0.0/16AS Path = 6341
AS 1239Sprint
AS 1755Ebone
AT&T
AS 3549Global Crossing
135.207.0.0/16AS Path = 7018 6341
135.207.0.0/16AS Path = 3549 7018 6341
AS 6341
135.207.0.0/16AT&T Research
Prefix Originated
AS 12654RIPE NCCRIS project
AS 1129Global Access
135.207.0.0/16AS Path = 7018 6341
135.207.0.0/16AS Path = 1239 7018 6341
135.207.0.0/16AS Path = 1755 1239 7018 6341
135.207.0.0/16AS Path = 1129 1755 1239 7018 6341
Keepalive message
Notification message
Error codesError codes
Reading Guidelines
RFC 1771