BGP – PATH ATTRIBUTES

A Path Attribute is a characteristics of an advertised BGP route.

Four Categories of PATH Attributes.

  1. Well-Known Mandatory
  2. Well-Known Discretionary
  3. Optional Transitive
  4. Optional Non-Transitive

Well-Known Attributes – These are those BGP Path attributes which should be recognized by all BGP routers.

  • Well-Known Mandatory – Are those Well-Known attributes that must be included in all BGP Update messages.
  1. ORIGIN
  2. AS_PATH
  3. NEXT_HOP
  • Well-Known Discretionary – Are those Well-Known attribute, that may or may not include in a specific Update Messages.
  1.  LOCAL_PREF
  2. ATOMIC_AGGREGATE

Optional Attributes – There are those BGP attributes which may or not recognized or supported by a BGP router.

  • Optional Transitive – Are those optional attributes in which a BGP process should accept the PATH in which it is included and it should pass the Path in to its peers.
  1. AGGREGATOR
  2. COMMUNITY
  • Optional Non-Transitive – Are those optional attributes in which if a BGP process doesn’t recognize a attribute, it can just ignore the Update message and not need to pass to its peers.
  1. MULTI_EXIT_DISC(MED)
  2. ORGINATOR_ID
  3. CLUSTER_LIST

 

1. ORIGIN

Specifies the origin of the route. When BGP have multiple route , it uses ORIGIN as one factor to select the preferred route.

 * IGP     * EGP    * Incomplete

2. AS_PATH

It contains a list of ASs, through which the PATH will traverse to reach the destination. New AS number  prepend to the existing list.

3. NEXT_HOP

It contains the IP address of the Next-Hop router in the path specified.

Selecting Next-Hop :-

a. If the advertising peers are in different AS, NH = IP of the advertising router

b. If the advertising peers are in same AS and adv route is in same its AS, NH = IP address of the Neigbor that advertised.

c. If the advertising peers are in same AS, but adv route is in different AS, NH = IP address of the external Peer from which route is learned.

4. LOCAL_PREF

  • Used to communicate a BGP router’s degree of preference for an advertised route.
  • If an iBGP router receives multiple PATH to a same destionation, decision taking is done using this attribute.
  • Route with higest LOCAL_PREF is selected

5, MULTI_EXIT_DISC (MED)

  • When LOCAL_PREF can influence only traffic leaving the AS, MED can be used to influence the traffic that comes into AS.
  • One AS says to another AS, that which is its preferred ingress point.

 6. ATOMIC_AGGREGATE and AGGREGATOR

Atomic Aggregate attribute is used by the BGP speaking router when it advertise a aggregated route to its peer to mention that it is a less-specific route. The peers should keep this attribute when sending to its own peers.

Aggregator Attribute is used optionally to mention which the is origin router which aggregation happened and the AS which that router is residing.

 7. COMMUNITY

Simplifies policy enforcement. If a set of destinations have same properties and policies, we can make it as one Community and can be represented using COMMUNITY attribute.

COMMUNITY Attribute format :  AA:NN (Where AA – AS Number, NN – Community Identifier).

Well-Known Communities

INTERNET –  All routes advertised without any specific community by default belongs to INTERNET. It can be advertised freely without any restrictions.

NO_EXPORT – Routes received using this attributes cannot be advertised to eBGP peers.

NO_ADVERTISE – Cannot be advertised both eBGP and iBGP peers.

LOCAL_AS – Cannot advertise to eBGP peers including peers in other Autonomous System within a Confederation.

8. ORIGINATOR_ID

ORIGINATOR_ID attribute contains the RID of the originator of that specific route in the Local AS.

9. CLUSTER_LIST

Contains a sequence of Router Reflection cluster IDs through which the route have passed.

 

 

 

 

www.pdf24.org    Send article as PDF   

BGP – Finite State Machine

IDLE State

  • BGP Always beging with Idle state. All incoming connection in this state will be refused.
  • BGP Process initializes all BGP resources.
  • Start the ConnectRetry Timer
  • Initializes a TCP connection to neighbor
  • Listen for TCP initialization from neighbor.
  •  And changes its state to CONNECT.

CONNECT State

  • Waits for TCP connection to complete.
  • If TCP conn successful, it will clear ConnectRetry Timer.
  • Completes Initialization and sends a OPEN Message to neighbor.
  • And changes the state to OPENSENT State.

ACTIVE State

  • Keep on trying to initialize a  TCP connection to complete neighbor.
  • If TCP conn successful, it will clear ConnectRetry Timer.
  • Completes Initialization and sends a OPEN Message to neighbor.
  • And changes the state to OPENSENT State.

OPENSENT State

  • Send OPEN Message and Wait for a OPEN Message from neighbor too.
  • Once OPEN received its verifies the fields.
  • If any error, sent NOTIFICATION and change to IDLE state.
  • If no Error, a KEEPALIVE message is sent and keepalive timer is reset.
  • HOLD timer is negotiated by selecting the least value.
  • If negotiated HOLD is zero, keepalive and hold timer are not started.
  • Determines whether eBGP or iBGP.
  • Change the state to OPENCONFIRM.

 OPENCONFIRM State

  • Waits for either a Keepalive or Notification Message.
  • If Keepalive, change the state to ESTABLISHED state
  • If Notification,  or a TCP disconnect, or HOLD timer expires change to IDLE state.

ESTABLISHED State

  • BGP peer connection is fully established and BGP routers can exchange their UPDATE/KEEPALIVE/NOTIFICATION messages.
  • If UPDATE or KEEPALIVE Hold Timer is restarted.
  • If NOTIFICATION, changed to IDLE state.

 

www.pdf24.org    Send article as PDF   

BGP – Points to Remember

  • As all EGP(Exterior Gateway Protocols) , BGP also is used to route between Autonomous Systems (ASs).
  • BGP uses TCP port 179, which makes the peer relationship between BGP Peers reliable.

AS PATH

A list of AS numbers which a route traverse is known as AS_PATH attribute.

An AS_PATH is created by appending each AS number to existing AS_PATH.

AS_PATH helps to find out the lowest Path by counting the number of AS numbers included in the AS_PATH attribute of eac route.

AS_PATH also helps to identify the loop. If a router gets a route with AS_PATH with its own AS number it will know that there exists a loop

BGP Message Types

Before establishing a BGP peer connection, the two neighbors must perform the standard TCP 2-way handshake and open a TCP connection to port 179. All BGP messages are unicast to the one neighbor over the TCP connection.

Four BGP Messages are :

  1. OPEN
  2. KEEPALIVE
  3. UPDATE
  4. NOTIFICATION

 

OPEN MESSAGE

Once the TCP connection is established , both the neighbors will send an OPEN Message. Each neighbors use this message for identify and to specify its BGP operations. OPEN Messages contains the following informations.

BGP version number – Specifies whether its contains BGP versions 2,3 or 4.  Unless specified by command neighbor version, it will be BGPv4.

Autonomous System Number – AS number of the Originating router. This decide whether it will be a eBGP or iBGP.

Hold Time –  The max time in secs that can be elapsed without getting any update or keepalives.  The holdtime must be either 0(in which no keepalives are sent) or atleast 3. Cisco default is 180 seconds. If both the neighbors have different holdtime, its negotiated to smaller one.

 BGP Identifier –  This is an IP address which identifies a BGP neighbor.  Cisco uses same process as it select OSPF router-id.

Optional Parameters – This field will be used to advertise support for capabilities such as Authentication, Multiprotocol support and route refresh.

 KEEPALIVE MESSAGE

If a router accepts with the options specified in the OPEN message, it will send a KEEPALIVE message. Subsequent keepalive will be send every 60 secs by default in CISCO routers or a period equal to 1/3rd of the holdtime.

UPDATE MESSAGE

Contains feasible routes,  withdrawn routes, or both. Contains following information.

Network Layer Reachability Information(NLRI) – Contains tuples (Length, Prefix). ie if update is having information regarding route 192.168.1.0/19, It will contain (19, 192.168.1.0)

PATH Attributes – Contains the attributes for the above NLRI, which helps BGP to choose shortest PATH, detect Routing Loops, and determining Routing Policy.

Withdrawn Routes – Tuples (Length, Prefix) which are unreachable and are being withdrawn from the service.

 NOTIFICATION MESSAGE

Send by BGP neighbors when there is any error  occurred during BGP operations. Example, when a BGP  v3 router receives a BGP OPEN Message with BGP v4, it sends back a NOTIFICATION Message and close the connection. Then the BGPv4 router need to establish a new connection sending with a BGP v3 OPEN Message.

www.pdf24.org    Send article as PDF