- 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.
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 :
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.
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.
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.
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.