TheHingineer

  • Computer Networks


  • CN Part-1

  • CN Part-2

  • CN Part-3

  • CN Part-4

  • CN Part-5

  •  Routing Protocols: RIP, OSPF, and BGP in Computer Networks

     Routing Protocols kya hote hain?

    • Jab routers dynamically ek doosre ke saath routing information exchange karte hain aur automatically best paths discover karte hain, toh wo jin rules aur communication standards ko follow karte hain unhe Routing Protocols kehte hain.

    • Internet ko manage karne ke liye networks ko Autonomous Systems (AS) mein baanta gaya hai. Ek AS ek single administrative entity (jaise Airtel, Jio, ya Google) dwara manage hone wale routers ka group hota hai.

    • Routing protocols do categories mein divide hote hain:

      • IGP (Interior Gateway Protocols): Ek hi AS ke andar use hone wale protocols (e.g. RIP, OSPF).
      • EGP (Exterior Gateway Protocols): Alag-alag AS ke beech internet-scale routing ke liye use hone wale protocols (e.g. BGP).

     1. RIP (Routing Information Protocol)

    • RIP sabse puraana Distance Vector IGP protocol hai jo Bellman-Ford algorithm par based hai.

    • Metric: RIP ka metric sirf Hop Count hota hai (packet kitne intermediate routers se hokar guzrega). Link speed ya bandwidth ko RIP ignore kar deta hai!

    • Max Hop Count: 15. Agar hop count 16 ho jaye, toh destination ko Unreachable (Infinity) declare kar diya jaata hai. Isliye RIP sirf chote networks (maximum 15 routers) ke liye suitable hai.

    • Update Mechanism: Har 30 seconds mein router apni complete routing table UDP port 520 par broadcast (RIPv1) ya multicast 224.0.0.9 (RIPv2) karta hai.

     2. OSPF (Open Shortest Path First)

    • OSPF modern enterprise networks ka sabse popular Link State IGP protocol hai jo IETF dwara open standard banaya gaya (RFC 2328).

    • Algorithm: Dijkstra’s Shortest Path First (SPF) algorithm use karta hai.

    • Metric: Cost. OSPF metric link bandwidth par calculate hoti hai: Cost = Reference Bandwidth (100 Mbps) / Interface Bandwidth. Fast fiber links ko low cost milti hai, jisse OSPF hamesha high-speed path chunta hai.

    • Hierarchical Areas: Badi enterprises mein OSPF network ko Areas mein divide karta hai:

      • Backbone Area (Area 0): Core central area jisse baaki sabhi standard areas connect hote hain.
      • ABR (Area Border Routers): Jo do areas ke beech traffic route karte hain.
    • Convergence: Bohot fast convergence. Update periodic nahi hota, sirf topology change hone par Triggered LSA (Link State Advertisements) multicast address 224.0.0.5 aur 224.0.0.6 par flood karta hai.

     3. BGP (Border Gateway Protocol)

    • BGP pure Global Internet ka routing protocol hai! Yeh ek Path Vector EGP (Exterior Gateway Protocol) hai jo alag-alag Autonomous Systems (ISPs, Telcos, Data Centers) ke beech traffic route karta hai.

    • Metric: BGP hop count ya link speed par nahi chalta, balki Routing Policies, AS-Path, aur Business Rules par chalta hai (Policy-based Routing).

    • AS-Path Attribute: Har route update mein list of AS numbers hoti hai jinse packet hokar guzrega (e.g., AS100 -> AS200 -> AS300). Agar router ko AS-Path mein apna hi AS number dikhta hai, toh wo loop detect karke packet reject kar deta hai (Loop-free routing).

    • Reliability: BGP reliable delivery ke liye TCP Port 179 par connection banata hai.

     RIP vs OSPF vs BGP Comparison (Exam High-Yield!)

    Feature RIP OSPF BGP
    Protocol Type Distance Vector (IGP) Link State (IGP) Path Vector (EGP)
    Underlying Algorithm Bellman-Ford Dijkstra’s SPF Best Path Selection (Policy based)
    Routing Metric Hop Count (Max 15) Cost (Inversely proportional to Bandwidth) Path Attributes (AS-Path, Weight, Local Pref)
    Transport Layer Protocol UDP Port 520 Direct IP (Protocol 89) TCP Port 179
    Convergence Speed Slow Very Fast Slow to Moderate (huge internet table)
    Network Scale Small LANs / offices Medium to large enterprise networks Global Internet backbone

     Summary Table

    Routing Protocol Summary Punchline
    RIP Hop-count based, simple, limited to 15 hops.
    OSPF Bandwidth-cost based, hierarchical Area 0 design, fast Dijkstra calculations.
    BGP The glue of the Internet. Inter-domain routing via TCP 179 and AS-Path policies.
    Scroll to Top