:::: OSPF and BGP ::::

 Advanced OSPF & BGP Interview Questions & Answers - Mock Q&A Format


Question 1: What are the different types of OSPF packets and their usage?

Answer:

  • Hello Packet: Initiates and maintains neighbor relationships (contains Router ID, Hello/Dead intervals).

  • DBD (Database Description): Summarizes LSDB, exchanged during Exstart/Exchange.

  • LSR (Link State Request): Requests specific LSAs.

  • LSU (Link State Update): Sends full LSA details.

  • LSAck (Link State Acknowledgment): Acknowledges receipt of LSAs.


Question 2: How does OSPF prevent loops?

Answer:

  • OSPF uses Dijkstra’s SPF algorithm to calculate shortest paths.

  • Intra-area: Each router maintains identical LSDBs, preventing loops.

  • Inter-area: ABRs do not advertise LSAs back into the area from which they were received (split-horizon like behavior).


Question 3: What are stub areas in OSPF?

Answer:

  • Stub Area: Allows LSA 1, 2, 3; blocks LSA 5.

  • Totally Stubby Area: Allows only LSA 1 and 2; blocks 3, 5 (Cisco proprietary).

  • Not So Stubby Area (NSSA): Allows 1, 2, 3, and 7; blocks LSA 5. Type 7 LSAs get converted to Type 5 by ABR.

  • Totally NSSA: Allows only 1, 2, 7; blocks 3 and 5.


Question 4: What is the function of an ABR in OSPF?

Answer:

  • Connects multiple OSPF areas.

  • Generates Type 3 Summary LSAs to summarize routes between areas.

  • Does not forward LSAs back into the originating area.


Question 5: What metric does OSPF use and how is it calculated?

Answer:

  • OSPF uses Cost as a metric: Cost = Reference Bandwidth / Interface Bandwidth

  • Default Reference Bandwidth = 100 Mbps.


Question 6: What are OSPF neighbor states?

Answer:

  1. Down – No Hello packets seen.

  2. Init – Hello received but not seen own Router ID.

  3. 2-Way – Bidirectional Hello seen.

  4. ExStart – DR/BDR and master-slave negotiation.

  5. Exchange – DBDs exchanged.

  6. Loading – LSRs sent, LSUs received.

  7. Full – Fully adjacent.


Question 7: Difference between DR/BDR and master/slave in OSPF?

Answer:

  • DR/BDR: Used in broadcast/multicast networks to reduce LSA flooding.

  • Master/Slave: Decides control during DBD exchange (ExStart).


Question 8: When do routers remain in 2-way state?

Answer:

  • Routers that are neither DR nor BDR remain in 2-Way state with other DROTHER routers to avoid unnecessary full adjacencies.


Question 9: Explain all 7 LSA types in OSPF.

Answer:

  1. Type 1 (Router LSA) – Generated by every router.

  2. Type 2 (Network LSA) – Generated by DR.

  3. Type 3 (Summary LSA) – Generated by ABR.

  4. Type 4 (ASBR Summary) – Generated by ABR for ASBR reachability.

  5. Type 5 (External) – Generated by ASBR.

  6. Type 6 (Multicast) – Not used often.

  7. Type 7 (NSSA External) – Generated by ASBR in NSSA, converted to 5 by ABR.


Question 10: What are the BGP message types?

Answer:

  1. Open – Session establishment.

  2. Keepalive – Maintains session.

  3. Update – Advertise/Withdraw routes.

  4. Notification – Errors/Session teardown.


Question 11: Difference between iBGP and eBGP?

Answer:

  • iBGP: Same AS, TTL = 255, needs full mesh or RR/Confed.

  • eBGP: Different AS, TTL = 1, allows AS path filtering.

  • iBGP uses split-horizon, eBGP uses AS-PATH filtering for loop prevention.


Question 12: What is a BGP Route Reflector?

Answer:

  • Avoids full mesh in iBGP.

  • One RR, multiple clients.

  • RR forwards updates between clients.

  • Common in ISPs (e.g., Airtel POPs).


Question 13: BGP Path Selection Attributes Order?

Mnemonic: WE LOVE OUR AS, ME IN OUR ROLE

  1. Weight – Highest.

  2. Local Preference – Highest.

  3. Locally originated – Prefer.

  4. AS Path – Shortest.

  5. Origin – IGP < EGP < Incomplete.

  6. MED – Lowest.

  7. eBGP over iBGP

  8. IGP metric to next hop – Lowest.

  9. Oldest route – Prefer.

  10. Router ID – Lowest.


Question 14: What is Next-Hop-Self and Update-Source in BGP?

Answer:

  • Next-Hop-Self: Used in iBGP to rewrite next-hop IP to router’s own IP.

  • Update-Source: Used to specify source interface (usually loopback) for BGP sessions.


Question 15: What is AS Path and how does it prevent loops?

Answer:

  • Lists AS numbers the route has traversed.

  • If router sees its own AS in path, it discards it – preventing loops.


Question 16: What is Local Preference?

Answer:

  • BGP attribute for outbound path selection.

  • Higher = Better.

  • Default = 100.

  • Local to AS, propagated within AS.


Question 17: What is MED?

Answer:

  • Multi Exit Discriminator: Suggests preferred entry point into your AS.

  • Lower = Better.

  • Not propagated beyond one AS hop.


Question 18: What is BGP Community?

Answer:

  • Tags assigned to BGP routes.

  • Used for route filtering or traffic engineering.

  • Example: 10001:100 = “Don’t advertise to US clients.”


Question 19: What is BGP Confederation?

Answer:

  • Divides a large AS into multiple sub-ASes internally.

  • Reduces iBGP full-mesh requirement.

  • Externally seen as one AS.


Question 20: Route Reflector vs Confederation – Final Recap

Answer:

  • Route Reflector: One router reflects routes to clients.

  • Confederation: Breaks AS into sub-ASes.

  • Use RR for simplicity (e.g. Airtel POPs).

  • Use Confederation for regional control (e.g. AWS, Tata).


🎉 Congratulations! You’ve completed 20 expert-level OSPF & BGP Q&As.

Comments

Popular posts from this blog

TCL Interview Programs

Python Interview Programs

-: Networking interview questions :-