</>
ShikshaCSLearn. Code. Grow.
๐Ÿ”
โ˜• Support Us
ShikshaCSโ€บNotesโ€บComputer Networks
Computer Networks
๐Ÿ•’ 9 min read

Routing Protocols (RIP, OSPF, BGP)

The three protocols that actually keep the internet's traffic flowing correctly.

RIP (Routing Information Protocol)

RIP is a classic distance-vector protocol that uses hop count as its only metric โ€” the path with the fewest routers to pass through is considered 'best', regardless of actual link speed. RIP has a maximum hop limit of 15 (16 is considered 'unreachable'), which makes it unsuitable for large networks โ€” it's mainly used today in small, simple networks or for teaching routing fundamentals.

OSPF (Open Shortest Path First)

OSPF is a link-state protocol widely used WITHIN large organizations (this is called an 'Interior Gateway Protocol'). It considers link bandwidth (not just hop count) when calculating the best path, converges quickly after network changes, and scales well to large enterprise networks by dividing them into logical 'areas' to reduce processing overhead.

BGP (Border Gateway Protocol)

BGP is the protocol that runs the ENTIRE internet's inter-organization routing โ€” it's how independent networks (like different ISPs) exchange routing information with each other, deciding how traffic flows BETWEEN organizations (this is called an 'Exterior Gateway Protocol'). BGP makes routing decisions based on configurable policies (business agreements, path preferences), not just pure technical shortest-path calculations.

Interior vs Exterior Gateway Protocols

RIP and OSPF are Interior Gateway Protocols (IGPs) โ€” they operate WITHIN a single organization's network (called an Autonomous System). BGP is the sole major Exterior Gateway Protocol (EGP) in practical use โ€” it connects different Autonomous Systems together, which is exactly how data crosses between, say, your ISP's network and a website's hosting provider's network.

Why the Internet Needs All Three Types

Within a single company's large network, OSPF efficiently manages internal routing. Between different companies and ISPs across the globe, BGP makes the high-level decisions about which provider's network to route through. RIP, while largely outdated for production use, remains valuable for understanding foundational distance-vector concepts before tackling more complex protocols.

๐ŸŒ Real-World Use

When you access a website hosted in another country, BGP is what determines which chain of ISPs and networks your data actually travels through to get there โ€” and BGP misconfigurations by a single ISP have historically caused major real-world internet outages affecting millions of users at once.

๐Ÿ’ก Pro Tip

A commonly asked comparison question: 'is OSPF used between different companies like BGP?' โ€” the answer is NO. OSPF is strictly an Interior Gateway Protocol used INSIDE one organization's network; BGP is what connects separate organizations' networks together on the wider internet.

๐Ÿงช Quick Self-Test

Check what you just learned โ€” no pressure, just practice.

1. What is the maximum hop count in RIP before a route is considered unreachable?

2. Which protocol is used to route traffic BETWEEN different organizations across the internet?

3. OSPF is an example of which type of protocol?

โ† Back to all Notes