Network Routing and Communication

Routing Protocols – BGP, RIP, OSPF

Learning Outcome

5

Apply the concept to real-world networking scenarios

4

Describe how routing decisions change dynamically

3

Explain how routers choose the best path

2

Differentiate between types like RIP, OSPF, and BGP

1

Understand what a routing protocol is and why it is needed

A person in Mumbai opens Google Maps to reach a destination.

Google Maps checks different roads and traffic conditions.

Similarly Routers check different network paths available for data.

A user can sends data from Mumbai to a server in the US.

The traveler passes through many roads and cities.

Google Maps selects the fastest and safest route.

Routing protocols choose the best path for data transfer.

The data travels through multiple routers across networks.

If a road is blocked, Google Maps finds another route.

At every turn, Google Maps guides the traveler.

At every router, routing protocols decide where to send the data next.

If a network path fails, routing protocols automatically choose a new path.

The traveler safely reaches the destination.

Finally, the data successfully reaches the US server.

 What are Routing Protocols?

A routing protocol enables routers to determine the most efficient path for forwarding data across a network. When a router receives a packet, it uses these protocols to decide the best route to reach the destination, ensuring data is delivered quickly and reliably. By dynamically managing routes, routing protocols help prevent issues like routing loops, where packets circulate endlessly and cause network congestion and delays.

Static vs Dynamic Routing

There are two ways to configure network routers to forward traffic: static or dynamic routing.

Static Routing

Static routing is a method where routes are manually configured by a network administrator and do not change automatically.

Routes are manually configured by a network administrator

Does not change automatically if the network changesa

Suitable for small, simple networks

Less overhead (no protocol traffic)

No automatic updates

Low CPU and bandwidth usage

Requires manual maintenance

Not scalable

Dynamic Routing
 

Dynamic routing uses routing protocols to automatically learn and update routes based on current network conditions.

Routes are learned automatically using routing protocols

Adjusts automatically when network changes occur

Suitable for large and complex networks

Requires more CPU and bandwidth

Adapts to network failures

Uses algorithms to find best path

More scalable than static routing

Interior Gateway Protocol (IGP) vs Exterior Gateway Protocol (EGP)

There are two types of routing protocols: interior and exterior.

Interior Gateway Protocol (IGP)

IGPs are routing protocols used to exchange routing information within a single autonomous system (AS).

Used within a single network (Autonomous System.

Faster and optimized for internal routing

Examples:

  1. RIP
  2. OSPF

Interior Gateway Protocol (IGP) vs Exterior Gateway Protocol (EGP)

There are two types of routing protocols: interior and exterior.

Exterior Gateway Protocol (EGP)

Exterior Gateway Protocols (EGP) instead run on routers that belong to different organizations, or Autonomous Systems.

Used between different networks (Autonomous Systems)

Handles routing on the internet scale

Example: BGP

 

 Distance Vector vs Link State Protocols

Distance Vector

A routing method where routers share their routing tables with neighbors and choose paths based on distance (hop count).

Routers share routing information only with their immediate neighbors

Each router knows limited information (next hop and distance)

Updates are sent periodically

Slower and can sometimes create routing loops

Link State Protocol

A routing method where routers build a complete map of the network and calculate the best path using algorithms.

Routers share information with all routers in the network

Each router builds a full network map (topology)

Updates are sent only when changes occur

Faster and more accurate

Introduction to BGP

BGP is a dynamic routing protocol used to exchange routing information between different networks on the Internet. It is known as the “backbone of the Internet” because it connects large networks like ISPs.

BGP (Border Gateway Protocol) is a path vector routing protocol used to exchange routing information between different networks on the internet.

It is the main routing protocol of the internet, responsible for deciding how data travels between large networks.

Exterior Gateway Protocol (Internet-level routing)

An Exterior Gateway Protocol (EGP) is a type of routing protocol used to exchange routing information between different networks (Autonomous Systems). It operates at the internet level, connecting large networks like ISPs and enterprise networks.

EGPs help determine how data travels across the global internet, not just within a single network.

Works between networks, not inside one network

Uses Autonomous Systems (AS) to identify networks

Main example: BGP (Border Gateway Protocol)

It connects large entities like:

  • ISPs - (Internet Service Providers)
  • Data centers
  • Enterprise networks

Each network (called an Autonomous System – AS) has its own routing

EGP shares route information between these AS

Routers decide the best path based on:

Policies

Path information

Data travels across multiple networks to reach its destination

How it Works?

Path Vector Concept

The Path Vector Concept is a routing method where the entire path to a destination network is stored and shared and used by BGP where each route includes the complete path (list of Autonomous Systems - AS) that data must travel through.

 

Instead of using only distance or cost, BGP includes a list of Autonomous Systems (AS) that the data must pass through. This helps routers make better decisions and avoid routing loops.

    A BGP router advertises a route with its AS number

    The route is passed along to other AS

   Routers check the AS path list to:

   Routers check the AS path list to:

Choose the best path

How it Works?

Avoid loops

Choose the best path

Avoid loops

 Autonomous System (AS) in BGP

An Autonomous System (AS) is a group of networks and routers that are managed by a single organization and follow a common routing policy. Each AS is identified by a unique number called an Autonomous System Number (ASN).

In BGP, AS is the basic unit of routing on the Internet.

BGP uses these AS numbers to exchange routing information between different networks.

  • One AS = one administrative control (like an ISP or large company)

  • Each AS has a unique ASN

  • BGP uses AS numbers to track and manage routing paths

Why AS is Important in BGP?

  • Helps organize the internet into manageable sections

  • Allows routing decisions based on policies and rules

  • Prevents routing loops using AS path checking

AS Number (ASN)

Every AS is identified by a unique AS Number (ASN).

Types:

  1. Private ASN: Used inside organizations

  2. Public ASN: Used on the Internet (assigned globally)

How BGP Controls Internet Routing

BGP controls internet routing by exchanging network paths between Autonomous Systems (AS) and selecting the best route based on policies and path attributes, not just distance. Unlike other protocols, BGP focuses on policy-based routing, not just the shortest path.

Establishing Connections (Peering)

  • BGP routers connect with other BGP routers (called peers)

  • These connections are formed between different AS (eBGP) or within the same AS (iBGP)

Exchange of Routing Information

  • Routers share available network paths along with AS path information

  • Each route includes attributes like:

  1. AS Path

  2. Next Hop

  3. Origin

Storing Multiple Paths

  • A BGP router can store multiple routes to the same destination

  • This gives flexibility in choosing the best path

Routing policies (admin rules)

  • Path attributes

  • Applying Policies (Control Mechanism)

  • Network administrators can control routing using policies

Best Path Selection

  • BGP selects the best route based on:
  • Shortest AS path

Example:

  • Prefer cheaper routes

  • Avoid certain networks

  • Control incoming/outgoing traffic

Route Advertisement

  • After selecting the best path, the router advertises it to other peers
  • This spreads routing decisions across the internet

Basic Working Idea of BGP

BGP works by connecting different networks (Autonomous Systems) and exchanging routing information to decide the best path for data.

Routers communicate with each other, share available routes, and select the most suitable one based on rules and path attributes.

It ensures data travels efficiently across the internet between multiple networks.

 

Neighbor Connection (Peering)

  • BGP routers first establish a connection with other routers (called peers)

 

Route Exchange

  • Routers share information about the networks they can reach

  • This includes the AS path and other attributes

 

Path Storage

  • A router may receive multiple paths to the same destination

  • It stores all possible routes

 

Best Path Selection

  • The router selects the best path based on:

    1. AS path length

    2. Policies (rules set by admin)

    3. Other attributes

 

Route Advertisement

  • The selected best route is shared with other routers

  • This spreads routing information across networks

Introduction to OSPF

OSPF (Open Shortest Path First) is a dynamic routing protocol used to find the best path in a network. It uses a more advanced method than RIP and is suitable for large and complex networks. OSPF is a link-state routing protocol used to find the most efficient path for data in a network.

It calculates the best path using an algorithm called Shortest Path First (SPF)

Works within a single organization (Interior Gateway Protocol)

A Link State Protocol is a routing method where each router builds a complete view of the network topology. Routers share information about their directly connected links with all other routers in the network.

Using this shared data, every router independently calculates the best path using the shortest path algorithm.

In OSPF, routers do not blindly trust neighbors like RIP does.

 

Each router creates a map of the entire network (called Link-State Database)

 

Routers share information about their direct connections (links)

 

All routers independently calculate the best path using the same data

Link State Protocol Concept

A cost metric is a numerical value used by routing protocols to determine the best path for data transmission. It represents how “expensive” or “efficient” a path is between source and destination.

The path with the lowest cost value is selected as the best path.

Cost Metric

Cost Metric in OSPF

In OSPF, cost is not random. It’s calculated based on bandwidth.

    Cost is inversely proportional to bandwidth

    (Higher bandwidth → Lower cost → Better path)

    Standard formula used: Cost = Reference Bandwidth / Interface Bandwidth

    Default reference bandwidth = 100 Mbps (can be changed)

Areas in OSPF

An OSPF Area is a logical grouping of routers within a network used to divide and organize large networks. It helps reduce routing overhead by limiting the amount of information each router must process.

Each area maintains its own link-state information while still being connected to the overall network.

    Why Areas Are Used?

To reduce routing table size

To improve network performance

To limit the spread of updates

To make large networks more manageable and scalable

OSPF Hierarchy

OSPF uses a hierarchical design with multiple areas connected together.

Backbone Area (Area 0)

  • The central and most important area
  • All other areas must connect to it
  • Responsible for inter-area communication

If Area 0 breaks, the whole OSPF network starts having an identity crisis.

 Other Areas (Non-Backbone Areas)

  • Also called regular areas (Area 1, Area 2, etc.)
  • Connect to Area 0
  • Handle routing within their own area

Area Border Router (ABR)

  • A router that connects Area 0 with other areas

  • Maintains separate routing information for each area

  • Transfers summarized routing information between areas

Fast Convergence

Fast convergence means how quickly a routing protocol can detect a network change and update all routers with the new best path.

In OSPF, convergence happens very quickly, minimizing downtime and data loss.

When a link goes down or a new route appears, OSPF routers:

  • Detect the change almost immediately

  • Share updated information with other routers

  • Recalculate the best path using the SPF algorithm

What Happens During Convergence?

When a network change occurs (like a link failure):

Router detects the failure immediately

Sends update (LSA – Link State Advertisement) to neighbors

All routers update their Link State Database (LSDB)

Each router recalculates the best path using an algorithm

New routes are installed in the routing table

Advantages of OSPF over RIP

Faster Convergence

 

  • OSPF reacts immediately to network changes using triggered updates.

  • RIP waits for periodic updates (30 sec), so it takes longer to adjust routes.

No Hop Count Limitation

 

  • OSPF has no fixed hop limit, so it can support very large networks.

  • RIP is limited to 15 hops, making it unsuitable for big networks.

Better Path Selection (Uses Cost)

 

  • OSPF uses bandwidth-based cost, choosing faster and more efficient paths.

  • RIP uses only hop count, which may select slower routes.

Supports Hierarchical Design (Areas)

 

  • OSPF divides networks into areas, improving scalability and management.

  • RIP has a flat structure, which becomes inefficient as the network grows.

 Efficient Use of Bandwidth

  • OSPF sends updates only when changes occur (event-driven).

  • RIP sends full routing tables every 30 seconds, wasting bandwidth.

 Loop Prevention Mechanism

  • OSPF uses a complete network topology and SPF algorithm, reducing chances of loops.

  • RIP can suffer from routing loops, even though it uses basic prevention techniques.

Supports Large and Complex Networks

 

  • OSPF is designed for enterprise-level networks with many routers and paths.

  • RIP is suitable only for small and simple networks.

More Accurate and Reliable Routing

 

  • OSPF considers multiple factors (like bandwidth) for smarter decisions.

  • RIP’s simple logic can lead to less optimal routing paths.

 Introduction to RIP

RIP (Routing Information Protocol) is a dynamic routing protocol used by routers to automatically share information about network paths. It helps routers decide the best path to send data by exchanging routing tables with neighboring routers.

RIP belongs to the Distance Vector routing protocol category and is one of the oldest routing protocols used in networking.

Distance Vector Concept

The Distance Vector concept is a routing method used by routers to find the best path to a destination network.

It is based on two simple ideas:

  • Distance → How far the destination is (measured using a metric like hop count)

  • Vector → The direction or next router to send data to

How it Works?

Each router keeps a routing table

It shares this table with its neighboring routers regularly

Routers update their tables based on the information received

The path with the shortest distance is selected as the best path

 Hop Count Metric

The hop count metric is a method used by routing protocols (like RIP) to measure the distance between a source and a destination network. RIP uses hop count as its metric to determine the best path.

A hop means one router

 

Every time data passes through a router, the hop count increases by 1

 

The path with the lowest hop count is chosen as the best path

 Maximum Hop Limit (15)

The Maximum Hop Limit in RIP is the highest number of hops (routers) a packet is allowed to pass through to reach a destination. RIP has a maximum limit of 15 hops.

Maximum valid hops = 15

 

Hop count = 16 → considered unreachable (infinite distance)

What It Means?

If a destination network is within 15 hops, RIP considers it reachable

 

If it requires more than 15 hops, RIP assumes the network is too far or unreachable

Why This Limit Exists?

Prevents routing loops from continuing forever.

 

Keeps the network stable and avoids endless updates.

 

Makes routing decisions faster (less overthinking, unlike humans).

Advantages

Simple Configuration

 

RIP is very easy to configure and understand, making it ideal for beginners learning routing concepts

Low Resource Usage

 

 It uses very little CPU and memory, so it works well even on low-performance routers

Automatic Updates

 

 Routers automatically exchange routing tables at regular intervals without manual intervention

Widely Supported

 

RIP is supported by most networking devices and vendors, allowing easy compatibility

Easy Troubleshooting

 

Its simple working mechanism makes it easier to identify and fix network issues

Load Balancing

 

RIP can use multiple paths with equal hop count to distribute network traffic efficiently

Limitations

Hop Limit (15)

RIP cannot support large networks because it allows a maximum of only 15 hops

Slow Convergence

It takes more time to update routing information when network changes occur

Weak Metric System

RIP only considers hop count and ignores important factors like bandwidth and delay

Routing Loops

There is a risk of routing loops where data packets circulate unnecessarily in the network

Periodic Updates

RIP sends full routing updates every 30 seconds, which can waste bandwidth

Not Scalable

It does not perform well in large and complex networks

Security Limitations

RIP provides only basic authentication, which is not very secure

Basic Working of RIP

The basic working of RIP is based on routers exchanging routing information and selecting the shortest path using hop count.

Routing Table Creation

Each router creates a routing table containing directly connected networks

Periodic Updates (Every 30 Seconds)

Routers send their entire routing table to neighboring routers regularly

Receiving and Comparing Routes

When a router receives an update, it compares it with its current routing table

Hop Count Calculation

The router adds +1 hop to the received route before updating its table

Best Path Selection

The route with the lowest hop count is selected as the best path

Table Update

If a better path is found, the routing table is updated accordingly

Propagation of Changes

Updated information is shared with other routers, spreading across the network

Route Expiry (Timeout)

If a route is not updated within a certain time, it is marked as invalid

Summary

5

OSPF is fast and scalable; RIP is slower and limited to 15 hops.

4

BGP controls routing between large internet networks.

3

RIP uses hop count; OSPF uses a full network map.

2

Static routing is manual; dynamic routing adjusts automatically.

1

Routing protocols find the best path and avoid loops.

Quiz

What does BGP exchange between networks?

A. Files

B. Packets

C. Routing information

D. Passwords

Quiz-Answer

C. Routing information

What does BGP exchange between networks?

A. Files

B. Packets

D. Passwords

Routing Protocols – BGP, RIP, OSPF

By Content ITV

Routing Protocols – BGP, RIP, OSPF

  • 114