BGP - [Part 2] - BASIC INTERVIEW QUESTIONS

   Question -1 Explain Border Gateway Protocol ?

  • RIP, OSPF and EIGRP are all different routing protocol but these protocols have one thing in common, they always want to find the shortest path to the destination. But if you require path manipulation (Means you have multiple Internet connections and you want to influence some packets to take one path and some packets to take another ), then you will have to use BGP
  • BGP is Exterior Gateway Protocol (EGP) so it allow the communication between different autonomous systems. Right now we can use only BGP as EGP, only one EGP is available in industry. It is the protocol used between Internet service providers (ISPs) and also can be used between an Enterprise and an ISPs.
  • Basically BGP was developed for reliability, scalability, and control, not developed for speed.
  • BGP uses the concept of autonomous systems (AS). An autonomous system is a group of networks under a common administration.
  • AS numbers - 1 to 64511 are public,  AS numbers - 64512 to 65535 are private AS numbers which can be used for non-internet usage.
  • BGP neighbors are also known as peers and we have to configure this statically.
  • Once BGP neighbors establish a neighbor relationship, they will share their full routing table. Afterwards, only changes to the routing table will be forwarded to peers. 
  • Basically BGP was not designed to perform load balancing, in BGP path will be chosen because of policy, will not chosen based on bandwidth 

Question - 2 How many types of BGP ?

There are two types of BGP
External BGP (EBGP) - Used for routing between autonomous systems
Internal BGP (IBGP) - Used for routing within the autonomous system.

Question - 3 Explain BGP is IGP or EGP?

BGP is a EGP(Exterior Gateway Protocol), it allow the communication between different Autonomous System. Interior Gateway Protocols (IGPs) is allow the communication within an Autonomous System (one routing domain) only.

Question - 4 Which type port used by BGP ?

BGP uses TCP port 179

Question - 5 What Administrative Distance of BGP ?

Administrative distance of EBGP is 20
Administrative distance of IBGP is 200

Question - 6 Which type authentication used by BGP ?

Authentication used in BGP is MD5

Question - 7 Can I use BGP instead of any IGP?

No, because BGP is allow the communication between autonomous systems but IGP is allow the communication within an autonomous systems only.

Question - 8 Can routers run multiple instance of BGP at a time ?

Routers can run only one instance of BGP at a time.

Question - 9 What is category of BGP protocol ?

BGP allows organizations or any company known as Autonomous Systems to advertise and route traffic between each other. BGP is a Path Vector Protocol, BGP uses some attributes to a route to help administrators provide some additional information that can be used to route traffic.

Question - 10 Which version of BGP that first supported the CIDR ?

BGP the current versions i.e BGP-4 version supports CIDR

Question - 11 What is the difference between BGP Speaker and Peers or Neighbors ?

  • Speaker - Any device which is running BGP is known as BGP speaker
  • Peer or Neighbor - When two BGP speakers establish a BGP connection to exchanging routing information, then these speakers are known as BGP peers or neighbors

Question - 12 Explain loop prevention mechanism in BGP ?

BGP uses two mechanism to prevent loops:- 
  • Split Horizon Rule (This mechanism for IBGP) - When a router learn routes from an IBGP peer, that router does not advertise the same routes to another IBGP peer. 
Check the below diagram, there are three Routers within the same Autonomous system, and all off these are IBGP peer of each other, Router R1 can send the routes to R2, and Router R2 will learn these routes, but Router R2 cannot advertise the same routes to Router R3.

  • By using AS_PATH (This mechanism for EBGP) - When an EBGP peer advertises to an EBGP peer, then BGP router adds its own ASN to the AS_PATH. If a BGP router receives an update then it will check AS_PATH list, if it found its own ASN in that list , the router will ignores that route.
Check the below diagram there are four different Router in four different Autonomous System, all of these are EBGP peer for each other, when Router R1 is advertising to EBGP peer R2, then it will add its own Autonomous System number 500 to AS_Path, and the same thing will do all other router, and finally when Router R1 receives an update, and it found its own ASN in the AS Path list, so it will ignore this routes

Note - A BGP router does not add its ASN when advertising to an IBGP peer.

Question - 13 What are different BGP Message Types ?

  • Open - It contain some parameters like Autonomous System Number, Authentication Values, Version, Hold Time and Router ID. It is used to establish a neighbor relationship and exchange the parameters.
  • Keep-alive - To maintain the neighbor relationship and to ensure that the remote peer is still available or not , Keep alive messages are sent periodically (Every 60 second by default). If the router does not receive Keep-alive message from remote peer within the Hold Down period (by default-180 seconds), then router will declare that remote peer dead .
  • Update - It exchange Path Attributes and the associated prefix/Length(NLRI) that use those attributes. Once BGP neighbors establish a neighbor relationship, they will share their full routing table. Afterwards, only changes (such as loss of network availability) to the routing table will be forwarded to peers. in the form of update message. Update messages are used to exchange routes between peer.
  • Notification - A Notification message will be sent when an error is occur with the BGP session, like hold down timer expire, any changes in neighbor capabilities, or a BGP session reset is requested. This causes the BGP connection to down.

Question - 14 Explain all states of BGP ?

  • Idle -  In this state BGP process will be administratively down or waiting for the next retry attempt.
  • Connect -  In this state BGP process is waiting for the TCP connection to be completed. If TCP connection is successfully completed, it will continue to the Open-Sent state and  if TCP connection is failed then It will continue to the Active state
  • Active - 
  1. In Active State BGP will try another attempt of TCP three-way handshake to establish a connection with the remote BGP neighbor. If this process is successfully completed, it will continue to the next state Open-Sent state. 
  2. If TCP process is failed or BGP neighbor is trying to open TCP connection using an invalid IP then BGP remains in ACTIVE state.
  3. If CONNECT_RETRY Timer expires in ACTIVE state then BGP will go back to the connect state. 
  4. If any other input Error like BGP STOP, BGP Transport Connection Closed and BGP Transport Fatal Error then BGP will go back to IDLE state.
  • Open-Sent - The TCP connection has been established between neighbor, and a BGP Open message has sent to the neighbor, but the router has not yet been received matching Open message from the neighbor.
  • Open-Confirm - In this state open message has been sent to and received from the both router. After that both router will receive a BGP keep-alive message, it will confirm that all neighbor-related parameters matched.
  • Established - Now all neighbor parameters have been matched, the neighbor relationship has been established between both router and the neighbors can now exchange Update messages.

Question - 15 What will happen, if my BGP neighbor is stuck in Idle or Active State, and What Should I Do?

  • If BGP neighbor is stuck in Idle State - It can be due to some physical connectivity failure or the neighbor is not defined or configured properly with respective Autonomous System.
  • If BGP neighbor is stuck in Active State - 
Before answer of this question, you should know about Connect and Active state in depth. 
  1. In Connect state BGP process is waiting for the TCP connection to be completed. If TCP connection is successfully completed, it will continue to the Open-Sent state and  if TCP connection is failed then It will continue to the Active state.
  2. In Active State BGP will try another attempt of TCP three-way handshake to establish a connection with the remote BGP neighbor. If this process is successfully completed, it will continue to the next state Open-Sent state. 
  3. If TCP process is failed or BGP neighbor is trying to open TCP connection using an invalid IP then BGP remains in ACTIVE state.
  4. If CONNECT_RETRY Timer expires in ACTIVE state then BGP will go back to the connect state. 
  5. If any other input Error like BGP STOP, BGP Transport Connection Closed and BGP Transport Fatal Error then BGP will go back to IDLE state.
  6. If BGP stuck in Active state you can use these two command “debug ip bgp” and “debug ip tcp transactions” to get the exact cause of TCP connection failure. 
  7. BGP also can be stuck in Active state due to lack of the “update-source” or “ebgp-multihop” command.

Question - 16 What is the default BGP ConnectRetry timer, and can we change it manually?

The default BGP ConnectRetry timer is 120 seconds. If CONNECT_RETRY Timer expires in ACTIVE state then BGP will go back to the connect state. Right now we cannot change it manually.

Question - 17 Default BGP timers ?

  • Hold Down timer - By default Hold Down Timer is 180 Seconds. We can change it manually. This is the amount of time, how long a router will wait between hearing messages from it's neighbor.
  • Keep-alive Interval - By default Keep-alive Interval is 60 seconds, after every 60 Seconds BGP neighbors send Keep-alive message to inform I am live.
  • Advertisement Interval - This is the amount of time which introduced a minimum delay between updates for a neighboring session to maintain the most stable routing table. In Cisco, the default advertisement interval is 30 seconds for eBGP neighbors and 0 seconds for iBGP neighbors
  • Scan Timer - By default Scan timer is 60 seconds. We can change it manually
    SHARE

    Anubhav Upadhyay

    Hello and welcome to networktopic Blog. My name is Anubhav. I am a Senior Network Egineer. I have created this blog specially to serve interview questions and answer on Network Routing and Switching, I will try my best to serve correct and updated networking knowledge for you as per my corporate experience.

    • Image
    • Image
    • Image
    • Image
    • Image
      Blogger Comment
      Facebook Comment

    1 comments:

    1. Thanks for your effort. Your blog help me alot.

      ReplyDelete

    If you like my posts then please comment and if you don’t like then please suggest me to improve, and if you have any query related to post then please text me through the comment box or mail me on upadhyayambition@gmail.com , I will try my best to solve your queries as soon as possible.