RIP, OSPF, and BGP protocols

Routing protocols help routers automatically learn and update routes.
The three most important routing protocols are:

  • RIP
  • OSPF
  • BGP

These represent distance-vector, link-state, and path-vector protocols.


🌟 1. RIP (Routing Information Protocol)

βœ” Type: Distance-vector routing protocol

RIP selects routes based on hop count.

βœ” Key Characteristics

  • Metric Used: Hop Count
    • Maximum hop count = 15
    • 16 = Unreachable
  • Algorithm: Bellman–Ford
  • Updates: Sent every 30 seconds
    β†’ slow convergence
  • Port: UDP 520
  • Versions:
    • RIP v1: Classful (does not support subnet masks)
    • RIP v2: Classless (supports CIDR, subnetting, multicast updates)

βœ” Where RIP is used?

  • Very small networks
  • Simple topologies
  • Low-cost implementations

βœ” Advantages

  • Very easy to configure
  • Low overhead
  • Lightweight protocol

βœ” Limitations

  • Not scalable
  • Slow convergence
  • Hop count limitation
  • Inefficient for medium/large networks

βœ” Remember

RIP = simple + small networks only


🌟 2. OSPF (Open Shortest Path First)

βœ” Type: Link-state routing protocol

OSPF builds a complete map of the network and calculates the shortest path.

βœ” Key Characteristics

  • Metric Used: Cost (based on bandwidth)
    Higher bandwidth = lower cost
  • Algorithm: Dijkstra’s SPF (Shortest Path First)
  • Updates: Only when a change occurs
    β†’ very fast convergence
  • Port: IP Protocol 89
  • Classless: Supports VLSM, CIDR, and subnetting
  • Security: Supports authentication

βœ” Hierarchical Design

OSPF organizes networks into areas for efficiency.

  • Area 0 (Backbone Area): Core of OSPF
  • Additional areas connect to Area 0

βœ” Key OSPF Terms

  • LSA (Link-State Advertisement):
    Messages that share network information
  • DR/BDR (Designated Router / Backup DR):
    Reduces update overload in multi-access networks (e.g., LAN)

βœ” Advantages

  • Very fast convergence
  • Highly scalable
  • Efficient routing
  • Supports large enterprise networks

βœ” Limitations

  • More complex to configure
  • Requires more CPU and memory than RIP

βœ” Remember

OSPF = Fast + Efficient + Enterprise Networks


🌟 3. BGP (Border Gateway Protocol)

βœ” Type: Path-vector routing protocol

Used for routing between Autonomous Systems (AS) across the Internet.

βœ” Key Characteristics

  • Used by: ISPs, large organizations, backbone routers
  • Metric: Path attributes
    (AS-PATH, NEXT-HOP, LOCAL-PREF, etc.)
  • Algorithm: Policy-based routing
    β†’ Decisions are based on routing policies, not shortest path
  • Updates: Only when changes occur
    β†’ very stable
  • Port: TCP 179

βœ” Key Terms

  • AS (Autonomous System):
    A group of routers under one organization (e.g., ISP)
  • eBGP (External BGP):
    Routing between different AS
  • iBGP (Internal BGP):
    Routing within the same AS

βœ” Advantages

  • Extremely scalable
  • Can handle the entire Internet routing table
  • Supports policy-based routing (flexible and powerful)

βœ” Limitations

  • Complex to configure
  • Needs powerful routers
  • Slow convergence compared to OSPF

βœ” Remember

BGP = Internet’s main routing protocol (very large networks)


🌟 4. Quick Comparison

FeatureRIPOSPFBGP
TypeDistance-vectorLink-statePath-vector
Best ForSmall networksEnterprise networksInternet-scale routing
MetricHop CountCost (bandwidth)Path attributes
AlgorithmBellman-FordDijkstra (SPF)Policy-based
UpdatesEvery 30 secOnly on changesOnly on changes
ConvergenceSlowFastSlow-to-medium
PortUDP 520IP protocol 89TCP 179
ScalabilityLowHighVery High
VersionRIP v1/v2OSPFv2/v3BGP-4

🌟 5. Quick Mnemonics

βœ” RIP

β€œ15 hops is all you RIP!”
Limited to 15 hops β†’ small networks.

βœ” OSPF

β€œOpen to all areas, cost matters!”
Multi-area + cost-based metric.

βœ” BGP

β€œBiggest Global Protocol!”
Used on the Internet between ISPs.


🌟 6. Exam Focus Points

  • RIP uses hop count, max 15
  • OSPF uses cost (based on bandwidth)
  • BGP uses path attributes
  • RIP uses UDP 520
  • OSPF uses IP Protocol 89
  • BGP uses TCP 179
  • OSPF divides networks into areas (Area 0 = backbone)
  • BGP is used for inter-AS routing
  • RIP is slow, OSPF is fast, BGP is very scalable

These points regularly appear in IBPS IT Officer, SBI SO, RBI Grade B DSIM/DEPR Tech, internal promotions and other exams.


🌟 7. Final Summary

  • RIP β†’ Simple, small networks, hop count metric, slow updates
  • OSPF β†’ Fast, scalable, Dijkstra’s algorithm, enterprise networks
  • BGP β†’ Highly scalable, Internet routing, policy-based, TCP 179

Each protocol has different strengths depending on the size and requirement of the network.