0% found this document useful (0 votes)
5 views66 pages

Net 4

The document provides an overview of intra-domain routing, detailing the processes of routing and forwarding, routing algorithms, and protocols such as RIP and OSPF. It explains the differences between static and dynamic routing, the significance of routing tables, and the challenges faced in routing, including convergence and scalability. Additionally, it discusses how routers learn routes and the importance of administrative distance in route selection.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views66 pages

Net 4

The document provides an overview of intra-domain routing, detailing the processes of routing and forwarding, routing algorithms, and protocols such as RIP and OSPF. It explains the differences between static and dynamic routing, the significance of routing tables, and the challenges faced in routing, including convergence and scalability. Additionally, it discusses how routers learn routes and the importance of administrative distance in route selection.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 66

Summary of Intra-Domain Routing (COE 475 – Computer Networking)

1. Introduction to Routing

 Routing determines paths for data packets in a network.

 IP Routing moves packets from router to router based on the destination IP address.

 Routing Protocols select the best paths based on cost, speed, and congestion.

2. Routing Algorithms

 Two main types:

o Link-State Algorithm (Dijkstra’s Algorithm): Each router builds a network map


and calculates the shortest path.

o Distance Vector Algorithm (Bellman-Ford Algorithm): Routers share distance


information with neighbors and update routes based on the shortest path.

3. Static vs. Dynamic Routing

 Static Routing: Manually configured routes; does not adapt to changes.

 Dynamic Routing: Uses protocols like RIP and OSPF to update routes automatically.

4. Routing Information Protocol (RIP)

 Distance vector-based protocol using hop count as the metric.

 Maximum hop limit: 15 (prevents loops).

 Updates every 30 seconds; slow convergence time.

5. Open Shortest Path First (OSPF)

 Link-state protocol that builds a full network topology.

 Uses Dijkstra’s Algorithm to compute shortest paths.

 Divides networks into hierarchical areas for scalability.

 Supports equal-cost multi-path routing.

 Uses Hello Protocol for neighbor discovery.

6. Hierarchical Routing & Autonomous Systems (AS)

 Large networks are divided into Autonomous Systems (AS).

 Intra-AS Routing: Routing within an AS (e.g., OSPF, RIP).

1
 Inter-AS Routing: Routing between ASes (e.g., BGP).

 Reduces routing table size and improves performance.

7. Routing Challenges & Solutions

 Slow Convergence Problem: Updates take time to propagate, causing loops.

o Solutions: Poison Reverse, Split Horizon, Triggered Updates.

 Scalability: Hierarchical OSPF reduces overhead.

 Security: OSPF supports authentication to prevent malicious updates.

IP Routing and the Interplay Between Routing & Forwarding

What is IP Routing?

IP routing is the process of moving data packets from one device to another across a network
until they reach their final destination. Each packet has a destination IP address in its header,
which routers use to decide where to send it next.

Think of it like mailing a letter:

1. You write the recipient's address on an envelope.

2. The postal system (routers) checks the address and forwards the letter to the next stop.

3. Eventually, the letter reaches the recipient (the final device).

Similarly, in networking, routers guide packets across the internet using routing tables and
algorithms.

Interplay Between Routing and Forwarding

Routing and forwarding are two key functions that work together to move packets through a
network:

1. Routing (Finding the Path)

o Decides the best path for packets to follow.

o Uses routing algorithms (like Dijkstra’s or Bellman-Ford) to determine the


shortest or least congested route.

2
o Updates and maintains a routing table with information on available paths.

2. Forwarding (Sending the Packets)

o Uses the routing table to decide which outgoing link to send the packet through.

o This happens at every router along the way.

o Uses a local forwarding table to quickly match a destination with an output link.

🔹 Example:
Imagine a package delivery system:

 Routing is like planning the best delivery route.

 Forwarding is like handing the package to the next truck in the chain.

Every router in a network routes packets by choosing a path and forwards them to the next
router until they arrive at their destination.

Difference Between Routing Algorithm and Forwarding Table

1️⃣ Routing Algorithm → Determines End-to-End Path

 The routing algorithm decides the best overall path a packet should take from the
source to the destination.

 It considers factors like distance, congestion, and cost to find an efficient route.

 Examples of routing algorithms:

o Link-State (Dijkstra’s Algorithm) → Builds a network map and finds the shortest
path.

o Distance Vector (Bellman-Ford Algorithm) → Uses neighboring routers’


information to update paths.

2️⃣ Forwarding Table → Determines Local Forwarding at This Router

 The forwarding table is used by each router to decide where to send a packet next.

 It doesn’t care about the entire route—just the next hop in the path.

 Each router maintains a local forwarding table, which lists:

o Destination network (where the packet is going).

3
o Next-hop router (where to send the packet).

o Output interface (which link to use).

🔹 Example:
Think of a highway toll booth:

 The booth agent (router) only decides which road (output link) to direct cars onto.

 They don’t decide the entire journey—just the next turn based on the driver’s
destination.

How They Work Together

1. The routing algorithm finds the best end-to-end path.

2. The forwarding table at each router ensures the packet moves step by step.

🚀 Analogy:

 Routing Algorithm → Plans a cross-country trip from Accra to Kumasi.

 Forwarding Table → At each junction, the GPS directs you to the next road.

Routing Protocols: How Networks Find the Best Path

A routing protocol is a set of rules that routers follow to communicate with each other and
determine the best way to forward packets.

Goals of Routing Protocols

The primary goal of a routing protocol is to determine a “good” path for data to travel through
the network. A good path is one that is:

1. Least Cost → Uses the shortest or cheapest route based on predefined metrics (hop
count, bandwidth, etc.).

2. Fastest → Minimizes delay and ensures low latency.

3. Least Congested → Avoids overloaded or failing network paths.

4. Loop-Free → Prevents packets from endlessly circulating in the network.

5. Quick to Adapt (Convergence) → Updates routes immediately when network changes


(e.g., a router failure).

4
6. Efficient in Resource Use → Minimizes CPU, memory, and bandwidth usage.

7. Scalable → Works well in both small and large networks without excessive overhead.

Key Features of Routing Protocols

🔹 Path Selection → The protocol determines which sequence of routers packets should pass
through to reach the destination.

🔹 Convergence Speed → When a router or link fails, the protocol must quickly update and
reroute traffic to prevent delays.

 Fast convergence = better performance.

 Slow convergence can cause packet loss and routing loops.

🔹 Routing Overhead → Every protocol consumes CPU, memory, and bandwidth. Efficient
protocols minimize overhead while still maintaining accurate routing.

🔹 Scalability → Some protocols work well in small networks, but struggle in large-scale
networks like the internet.

Why Routing is a Challenge?

Routing is one of the most complex parts of networking because:

 Networks constantly change (new devices, broken links, congestion).

 The internet is massive, requiring hierarchical routing to keep things manageable.

 Routers must exchange updates while minimizing bandwidth usage.

✅ Example: Imagine managing traffic in a city!

 Roads (network links) open and close due to construction.

 Traffic (data packets) needs to be rerouted efficiently.

 GPS systems (routing protocols) must update quickly to avoid congestion.

Understanding the Routing Table

5
A routing table is a key component of a router that helps it decide where to send data packets.
It acts like a map, telling the router the best way to forward packets to their destination.

Key Information in a Routing Table

Every routing table must have at least two essential pieces of information:

1️⃣ Destination Network → The final network where the packet is headed.
2️⃣ Next Hop → The next router or device the packet should be forwarded to on its way to the
destination.

📌 Hop-by-Hop Routing:

 Routers don’t know the full path to the destination. They only know the next stop (next
hop).

 Each router along the way makes its own decision about where to send the packet next.

🔹 Analogy:
Think of a bus journey from City A to City D:

 You don’t have a direct bus from A to D, but you first take a bus to City B (next hop).

 From City B, you take another bus to City C.

 Finally, you take a last bus to reach City D.

 At each stop, you only need to know where to go next, not the entire route.

How Are Routes Learned?

Routers fill their routing tables using three methods:

1️⃣ Directly Connected Networks

 If a router is physically connected to a network, it automatically knows how to reach it.

 Example: A router connected to 192.168.1.0/24 will have an entry for that network in its
routing table.

2️⃣ Static Routes (Manually Configured)

 A network administrator manually sets a specific route.

6
 Example: ip route 192.168.2.0 255.255.255.0 10.1.1.1 → This means, "To reach
192.168.2.0, send packets to 10.1.1.1 (next hop)."

 ❌ Disadvantage: If the next hop fails, the route does not change automatically.

3️⃣ Dynamic Routing Protocols (Automatic Learning)

 Protocols like RIP, OSPF, and BGP allow routers to share routing information and update
their tables automatically.

 When a network link fails, these protocols find an alternative path without manual
intervention.

Example of a Simple Routing Table

Destination Network Next Hop Interface Metric

Directly
192.168.1.0/24 eth0 0
Connected

192.168.2.0/24 10.1.1.1 eth1 1

10.0.0.0/8 192.168.3.1 eth2 2

Explanation:

 192.168.1.0/24 is directly connected to the router, so no next hop is needed.

 192.168.2.0/24 can be reached by sending packets to 10.1.1.1 via interface eth1.

 10.0.0.0/8 is farther away and requires routing through 192.168.3.1 on eth2.

Summary

✅ The routing table contains destination networks and their next hops.
✅ Routing follows a hop-by-hop approach—routers only know the next step, not the entire
journey.
✅ Routes can be learned through:
✔ Directly connected networks (automatic)
✔ Static routes (manual, fixed)
✔ Dynamic routing protocols (automatic, adaptable)

7
Directly Connected Networks

A directly connected network is a network that is physically attached to one of the router’s
interfaces. Since the router has a direct connection to this network, it automatically knows how
to reach it—without needing any routing protocol or manual configuration.

Key Features of Directly Connected Networks

✔ No special routing mechanism needed → The router does not need RIP, OSPF, or static
routes to recognize the network.
✔ Immediately accessible → As soon as the network is connected to the router, it appears in
the routing table.
✔ Automatically installed in the routing table → If the interface is UP, the router adds the
network to its routing table.
✔ If the interface goes DOWN, the route is removed automatically.

Example: Directly Connected Networks in a Router

Let’s say a router has two interfaces:

 eth0 (connected to 192.168.1.0/24)

 eth1 (connected to 10.0.0.0/8)

If both interfaces are active, the routing table looks like this:

Destination Network Next Hop Interface

Directly
192.168.1.0/24 eth0
Connected

Directly
10.0.0.0/8 eth1
Connected

🚀 What Happens If an Interface Goes Down?

 If eth0 is disconnected, the router automatically removes the entry for 192.168.1.0/24
from its routing table.

 This prevents packets from being sent to a non-existent path.

8
Real-World Analogy

Imagine a router as a security guard at a gated community:

 If a road leads directly into the community, the guard immediately knows where it goes
(directly connected network).

 If the road is blocked (interface goes down), no one can use that route anymore, and it’s
removed from the map (routing table).

How a Router Chooses Between Multiple Routing Sources

If a router learns the same destination route from multiple sources (e.g., OSPF and Static
Route), it decides which route to install in the routing table based on Administrative Distance
(AD).

Understanding Administrative Distance (AD)

 AD is a measure of trustworthiness—the lower the AD, the more preferred the route.

 A static route has an AD of 1, while OSPF has an AD of 110 (see table).

What Happens in This Case?

If a route to the same destination is learned from:


✔ A Static Route (AD = 1)
✔ OSPF (AD = 110)

👉 The static route will be chosen and installed in the routing table because it has a lower AD.
👉 OSPF's route will be ignored unless the static route is removed.

Key Takeaways

✔ Lower AD = More trusted = Installed in routing table


✔ AD is only considered within a router (not exchanged with other routers).
✔ If the static route is removed, OSPF’s route will then be used.

9
Three Key Processes in IP Routing

Every router performs three main sets of tasks to ensure proper IP routing:

1️⃣ Path Discovery

👉 Goal: Find routes to different destinations.

 Uses dynamic routing protocols (e.g., OSPF, RIP, BGP).

 Can also use static routes (manually configured by an admin).

2️⃣ Maintaining the IP Routing Table

👉 Goal: Keep an updated list of routes.

 Stores routes learned from dynamic protocols and static entries.

 Uses Administrative Distance (AD) to decide which route is more trustworthy if the
same route is learned from multiple sources.

3️⃣ Forwarding IP Packets

👉 Goal: Send packets to the correct next hop.

 When a packet arrives, the router checks the destination IP address in its routing table.

 Uses Longest Prefix Match (LPM) to find the most specific route.

Example Scenario

📌 A packet arrives with destination IP: 10.1.1.5


✔ The router checks its routing table for the best match.
✔ If both 10.1.1.0/24 and 10.0.0.0/8 exist, the router picks 10.1.1.0/24 because it is more
specific (LPM).
✔ The router forwards the packet to the next hop based on the routing table.

This process happens every time a router receives a packet! 🚀

Routing Algorithm Classification

10
Routing algorithms help determine the best path for packets. They can be classified based on
how they gather and use information:

1️⃣ Global Routing (Link State Algorithms) 🌎

 Each router knows the entire network topology and the cost of every link.

 Routers flood the network with information to build a complete network map.

 Uses Dijkstra’s Algorithm to find the shortest path.

 Example Protocols: OSPF (Open Shortest Path First), IS-IS (Intermediate System to
Intermediate System)

✅ Pros: Faster convergence, accurate routing decisions.


❌ Cons: High CPU/memory usage, more complex.

2️⃣ Decentralized Routing (Distance Vector Algorithms) 🔗

 Each router only knows its neighbors and link costs to them.

 Uses an iterative process where routers exchange distance (cost) information with
neighbors.

 Uses Bellman-Ford Algorithm to compute routes.

 Example Protocols: RIP (Routing Information Protocol), EIGRP (Enhanced Interior


Gateway Routing Protocol)

✅ Pros: Simpler, lower overhead.


❌ Cons: Slower convergence, risk of routing loops.

Summary

📌 Link State = Full network view, more accurate, but resource-intensive.


📌 Distance Vector = Knows only neighbors, simpler, but slower to update.

The diagram on page 15 represents a graph abstraction of a network. Here's what it means in
simple terms:

Graph Representation of a Network

11
A network can be modeled as a graph:

 Nodes (N) → Represent routers (network devices that forward packets).

 Edges (E) → Represent links (connections between routers).

From the given data:

 Routers (Nodes) = { u, v, w, x, y, z }

 Links (Edges) = { (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) }

How This Helps in Routing

 The graph model helps routers compute the best path between any two nodes.

 Routing algorithms (like Dijkstra’s or Bellman-Ford) use this representation to determine


shortest or least-cost paths.

Example Application

If a packet needs to go from u → z, the routing algorithm will check the shortest or best path
based on link costs and update the routing table accordingly.

Understanding the Least-Cost Path in a Network

The graph abstraction assigns a cost to each link between routers. The goal of a routing
algorithm is to find the least-cost path between two nodes (routers).

How Costs Work in Routing:

 c(x, x') represents the cost of the link between router x and x'.

 Example: c(w, z) = 5 means the cost of traveling from w to z is 5.

 Cost can be based on:

o Hop count (each link = 1)

o Bandwidth (higher bandwidth = lower cost)

o Congestion (less congestion = lower cost)

Finding the Least-Cost Path from u → z

To find the best path from u to z, we use a routing algorithm like:

 Dijkstra’s Algorithm (for Link-State routing)

12
 Bellman-Ford Algorithm (for Distance Vector routing)

Link-State Routing Algorithm Explained

Key Idea: Each router shares information about its directly connected neighbors with every
other router in the network. This allows all routers to build a complete map of the network and
compute the shortest paths independently.

How It Works:

1. Discover Neighbors

o Each router finds out which other routers are directly connected to it.

o It measures the cost of each link (e.g., based on bandwidth, congestion, or


simple hop count).

2. Share Information (Flooding)

o Each router sends updates about its neighbors to every other router in the
network.

o This is done using Link-State Advertisements (LSAs).

o Every router eventually has the same network map.

3. Build a Topological Map

o Using the collected information, each router constructs a graph representing the
network.

4. Compute Shortest Paths Using Dijkstra’s Algorithm

o Each router runs Dijkstra’s algorithm on its own map to determine the shortest
paths to all other routers.

o The result is a forwarding table, which tells the router where to send packets for
each destination.

Advantages of Link-State Routing:

✔ Fast Convergence: Since every router has a full network map, it quickly recalculates paths
when a link fails.
✔ Loop-Free Paths: Because routers compute the shortest path independently, routing loops

13
are avoided.
✔ Scalability: Works well in large networks compared to Distance Vector algorithms.

Steps of Dijkstra’s Algorithm

1️⃣ Initialize:

 Select a source node u.

 Set D(u)=0D(u) = 0D(u)=0 (cost from source to itself is 0).

 For all other nodes vvv, set D(v)=∞D(v) = \inftyD(v)=∞ (unknown cost).

 Mark all nodes as unvisited.

2️⃣ Find the Node with the Lowest Cost:

 Pick the unvisited node www with the smallest D(w)D(w)D(w) (least cost path known so
far).

 Add www to N', the set of nodes whose shortest path is now known.

3️⃣ Update Neighbor Costs:

 For each neighbor vvv of www, update D(v)D(v)D(v) as: D(v)=min⁡(D(v),D(w)+c(w,v))D(v) =


\min(D(v), D(w) + c(w, v))D(v)=min(D(v),D(w)+c(w,v))

 If D(v)D(v)D(v) is updated, set p(v) = w (record predecessor).

4️⃣ Repeat Until All Nodes Are Processed:

 Continue selecting the node with the lowest current cost, updating its neighbors, until
all nodes have their shortest path determined.

Let's apply Dijkstra’s Algorithm step by step using the graph you provided earlier:

Graph: G = (N, E)

 Nodes (Routers): N={u,v,w,x,y,z}N = \{ u, v, w, x, y, z \}N={u,v,w,x,y,z}

 Edges (Links):
E={(u,v),(u,x),(v,x),(v,w),(x,w),(x,y),(w,y),(w,z),(y,z)}E = \{ (u,v), (u,x), (v,x), (v,w), (x,w),
(x,y), (w,y), (w,z), (y,z) \}E={(u,v),(u,x),(v,x),(v,w),(x,w),(x,y),(w,y),(w,z),(y,z)}

14
Step 1: Initialization

We choose u as the source node and define:

 D(u)=0D(u) = 0D(u)=0 (distance to itself is 0)

 D(v)=D(w)=D(x)=D(y)=D(z)=∞D(v) = D(w) = D(x) = D(y) = D(z) = \


inftyD(v)=D(w)=D(x)=D(y)=D(z)=∞ (all other nodes initially unreachable)

 N' (processed nodes): Starts as empty

Step 2: Add u to N’

 N′={u}N' = \{ u \}N′={u}

 Update neighbors of u:

o D(v)=c(u,v)D(v) = c(u,v)D(v)=c(u,v)

o D(x)=c(u,x)D(x) = c(u,x)D(x)=c(u,x)

Step 3 to 15: Process Each Node Iteratively

Each step follows:

1. Pick the unvisited node with the smallest D(v)D(v)D(v)

2. Add it to N′N'N′

3. Update its neighbors' distances

4. Repeat until all nodes are processed

Distance Vector (DV) Algorithm – Simple Explanation

Think of the Distance Vector (DV) algorithm like spreading gossip in a school.

1. Tell your friends what you know

o Every router (like a student) shares what it knows about reaching different places
(routes) with its neighboring routers (friends).

2. Keep repeating the information

o Each router tells its own neighbors what it knows, and they tell their neighbors,
and so on—just like how rumors spread in school.

15
3. Add new information to your knowledge

o If a router hears about a new route (a place it didn’t know before), it adds it to
its list (routing table).

4. Choose the shortest way

o If a router already knows about a route but hears about a shorter (better) way, it
updates its table with the shorter route—just like choosing a shorter path to class
instead of a longer one.

5. Bad information spreads too!

o Just like rumors, incorrect routing information (like a broken route) can spread
quickly, making routers send data the wrong way until they correct the mistake.

This method is simple but can sometimes lead to problems if bad information spreads before
it’s corrected. 🚦

Distance Vector Algorithm & Bellman-Ford Equation (Dynamic Programming)

The Bellman-Ford equation is the foundation of the Distance Vector (DV) algorithm, which
helps routers find the shortest path in a network.

The image explains an example of the Bellman-Ford algorithm, showing how router u
determines the shortest path to z.

Key Breakdown of the Calculation:

We need to compute du(z)d_u(z)du(z), the shortest distance from u to z using the Bellman-Ford
equation:

du(z)=min⁡{c(u,v)+dv(z),c(u,x)+dx(z),c(u,w)+dw(z)}d_u(z) = \min \{ c(u,v) + d_v(z), c(u,x) + d_x(z),


c(u,w) + d_w(z) \}du(z)=min{c(u,v)+dv(z),c(u,x)+dx(z),c(u,w)+dw(z)}

From the diagram:

 c(u,v)=2c(u,v) = 2c(u,v)=2, dv(z)=5d_v(z) = 5dv(z)=5 → 2+5=72 + 5 = 72+5=7

 c(u,x)=1c(u,x) = 1c(u,x)=1, dx(z)=3d_x(z) = 3dx(z)=3 → 1+3=41 + 3 = 41+3=4

 c(u,w)=5c(u,w) = 5c(u,w)=5, dw(z)=3d_w(z) = 3dw(z)=3 → 5+3=85 + 3 = 85+3=8

Taking the minimum:

16
du(z)=min⁡(7,4,8)=4d_u(z) = \min(7, 4, 8) = 4du(z)=min(7,4,8)=4

Final Takeaway:

 The shortest path from u to z goes through x with a total cost of 4.

 In a real network, router u would update its routing table to forward packets to z via x.

This is how Bellman-Ford helps routers dynamically find the shortest paths. 🚀

Understanding the Distance Vector Algorithm (DV) and Bellman-Ford (B-F) Equation

The key idea of the Distance Vector (DV) algorithm is that each router (node) keeps a table
(called a distance vector) with estimates of the shortest paths to all other nodes in the network.
These estimates are updated by exchanging information with neighboring routers.

How the Update Works:

1. Each router maintains a table with the estimated cost (distance) to reach every other
router.

2. Periodically, it shares its distance vector with only its direct neighbors.

3. When a router (x) receives an updated distance vector from a neighbor (v), it
recalculates its own estimate using the Bellman-Ford equation:

Dx(y)←min⁡v{c(x,v)+Dv(y)}D_x(y) \leftarrow \min_v \{ c(x,v) + D_v(y) \}Dx(y)←vmin{c(x,v)+Dv(y)}

o Dx(y)D_x(y)Dx(y) = Estimated shortest distance from xxx to yyy

o c(x,v)c(x,v)c(x,v) = Cost of direct link from xxx to neighbor vvv

o Dv(y)D_v(y)Dv(y) = Distance estimate from vvv to yyy (which xxx got from vvv)

o The minimum value is selected because we always want the shortest path.

Convergence to the Optimal Path

 Under normal conditions (no sudden failures, stable network), these updates eventually
converge to the actual shortest distances.

 Over multiple iterations, each router refines its estimates until every router has the
correct shortest paths.

Example

17
Suppose router A has direct links to B and C:

 Cost to B = 2

 Cost to C = 5

 B tells A that it knows a path to D with a cost of 3.

 A updates its distance to D as:

DA(D)=min⁡(c(A,B)+DB(D),c(A,C)+DC(D))D_A(D) = \min (c(A,B) + D_B(D), c(A,C) + D_C(D))DA


(D)=min(c(A,B)+DB(D),c(A,C)+DC(D))

If DB(D)=3D_B(D) = 3DB(D)=3 and DC(D)=7D_C(D) = 7DC(D)=7, then:

DA(D)=min⁡(2+3,5+7)=min⁡(5,12)=5D_A(D) = \min (2 + 3, 5 + 7) = \min (5, 12) = 5DA


(D)=min(2+3,5+7)=min(5,12)=5

So A learns that the shortest path to D is through B with a total cost of 5.

This process repeats across the network until all routers have the best possible paths.

Distance Vector Algorithm: Iterative, Asynchronous, and Distributed

The Distance Vector (DV) algorithm is a fundamental approach for routing in computer
networks. It works by having each node update its routing table based on information received
from its neighbors.

1. Iterative and Asynchronous Process

The algorithm does not run at fixed time intervals; instead, it updates dynamically based on:

 Local link cost changes (e.g., a link failure or congestion).

 Receiving a distance vector (DV) update from a neighbor.

This means updates occur only when needed, making it efficient.

2. Distributed Operation

Each node in the network operates independently but cooperates with its neighbors. The
process follows these rules:

18
 A node only notifies its neighbors when its own DV changes.

 Neighbors then update their own DVs if necessary and may propagate the changes
further.

 This process continues until no more updates are needed, leading to convergence.

3. Step-by-Step Working of a Node

Each node follows this loop:

1. Wait for a change in local link cost or an update from a neighbor.

2. Recompute its own distance vector using the Bellman-Ford equation:

Dx(y)←min⁡v{c(x,v)+Dv(y)}D_x(y) \leftarrow \min_v \{ c(x,v) + D_v(y) \}Dx(y)←vmin{c(x,v)+Dv(y)}

3. If any distance value changes, notify neighbors.

4. Repeat until the network stabilizes.

Key Properties

✅ Adaptive: Quickly adjusts to topology changes (failures, new links).


✅ Efficient: Nodes only send updates when necessary.
✅ Simple: Each node only communicates with its neighbors.

🚨 Drawback: Can suffer from the count-to-infinity problem, where updates take a long time to
propagate in certain failure scenarios. This is mitigated using techniques like split horizon and
poison reverse.

Key Operations in the Distance Vector Algorithm

Each router in a network running the Distance Vector (DV) Algorithm follows a set of update
rules to maintain its Routing Information Base (RIB). These operations ensure efficient and
correct routing.

1. Distance Vector Exchange

19
 Each node sends its distance vector (list of estimated shortest path costs) to its directly
connected neighbors.

 This helps nodes learn about changes in the network and update their own routing
tables accordingly.

2. Rules for Updating the Routing Information Base (RIB)

When Router K receives a distance vector update from its neighbor Router J, it processes the
update using these three rules:

Rule 1: Adding a New Route

📌 If J lists a destination that K does not have in its RIB, K adds an entry:

 Next hop: J

 Distance: J’s advertised distance + cost of link (K → J)

✔ Example:
If J advertises a route to D with a distance of 5, and the cost of the link (K → J) is 2, then K adds
D to its table with distance 7.

Rule 2: Updating with a Shorter Path

📌 If J offers a shorter route to D than K currently knows, K updates its entry:

 Next hop: J

 New distance: J’s advertised distance + cost of link (K → J)

✔ Example:

 K originally has a route to D via X with distance 10.

 J advertises a route to D with distance 6.

 If the cost of (K → J) is 2, then: New distance=6+2=8\text{New distance} = 6 + 2 =


8New distance=6+2=8

o K updates D’s entry to use J instead of X with distance 8.

Rule 3: Updating an Existing Route

20
📌 If K’s route to D already lists J as the next hop, and J’s distance to D changes, then K:

 Updates the distance to reflect the change.

✔ Example:

 If K had a route to D via J with a cost of 7, and J updates its distance to D to 9,

 K recalculates: New distance=9+cost(K,J)\text{New distance} = 9 + \text{cost}(K,


J)New distance=9+cost(K,J)

 If the cost of (K → J) is 2, then: Updated distance=9+2=11\text{Updated distance} = 9 + 2


= 11Updated distance=9+2=11

Conclusion

✔ This iterative process continues until all routers have the correct shortest path information.
✔ Only necessary updates are sent, reducing overhead.
✔ Helps maintain efficient and adaptive routing in dynamic networks.

Let me know if you'd like a worked-out example or a visualization of these steps! 😊

Understanding the Distance Vector Algorithm from the Image

The Distance Vector (DV) Algorithm helps routers find the shortest path to other routers in a
network. Each node (router) shares its distance to other nodes with its neighbors. Over time,
the nodes update their tables to reflect the shortest known paths.

What’s Happening in the Image?

The image shows three routers (nodes) X, Y, and Z exchanging distance information to compute
the shortest paths. Let’s break it down step by step.

Step 1: Initial Distance Tables

Each node starts with a routing table listing the costs (distances) to itself and its direct
neighbors.

Node X’s Initial Table

21
From X To X Y Z

X 0 2 7

Y ∞ ∞∞

Z ∞ ∞∞

 X knows the direct cost to Y is 2 and to Z is 7.

 But X doesn’t initially know any indirect paths.

Node Y’s Initial Table

From Y To X Y Z

X ∞ ∞∞

Y 0 1 0

Z ∞ ∞∞

 Y knows the cost to itself (0), to Z (0), and to X (not yet).

Node Z’s Initial Table

From Z To X Y Z

X ∞ ∞∞

Y ∞ ∞∞

Z 7 1 0

 Z knows the cost to X (7), Y (1), and itself (0).

Step 2: Distance Updates Using Bellman-Ford Equation

Each node updates its table using the Bellman-Ford equation:

Dx(y)=min⁡v{c(x,v)+Dv(y)}D_x(y) = \min_v \{ c(x, v) + D_v(y) \}Dx(y)=vmin{c(x,v)+Dv(y)}

 This means that for each destination yyy, node xxx looks at all possible paths through
its neighbors and picks the shortest one.

For example:

 X wants to find the shortest path to Z.

22
 It knows:

o Direct cost from X to Z is 7.

o Cost from X → Y is 2, and Y → Z is 1.

o The total cost via Y: 2 + 1 = 3.

 Since 3 is less than 7, X updates its table to reflect this shorter path!

Now, X's updated table would reflect:

From X To X Y Z

X 0 23

Step 3: Nodes Inform Their Neighbors

 If a node finds a shorter path, it tells its neighbors.

 Neighbors then update their own tables and may pass the new information forward.

 This process repeats until no further updates are needed.

Key Takeaways

1. Each node starts with only direct link costs.

2. Nodes share distance vectors with their neighbors.

3. Nodes update their tables using the shortest known paths.

4. If a better route is found, it spreads through the network.

5. Eventually, all nodes agree on the shortest paths to each other.

The image illustrates how routers exchange distance information using the Distance Vector
Routing Algorithm to determine the shortest paths in a network.

Key Observations from the Image:

1. Three Nodes (X, Y, Z)

23
o These represent routers in a network.

o Each node maintains a routing table that stores the cost to reach other nodes.

2. Initial Routing Tables

o Each node starts with the direct cost to its neighbors.

o For example:

 Node X initially knows the cost to Y (2) and Z (7).

 Node Y knows the cost to X (2) and Z (1).

 Node Z knows the cost to X (7) and Y (1).

3. Distance Update Calculation (Bellman-Ford Equation)

o Nodes exchange their tables with neighbors.

o Each node updates its table by finding the minimum cost to reach other nodes.

o Example Calculation for Dx(z)D_x(z)Dx(z): Dx(z)=min⁡{c(x,y)+Dy(z),c(x,z)


+Dz(z)}D_x(z) = \min \{ c(x,y) + D_y(z), c(x,z) + D_z(z) \}Dx(z)=min{c(x,y)+Dy
(z),c(x,z)+Dz(z)} =min⁡{2+1,7+0}= \min \{ 2 + 1, 7 + 0 \}=min{2+1,7+0}
=min⁡{3,7}=3= \min \{ 3, 7 \} = 3=min{3,7}=3

o This means Node X finds a shorter path to Z through Y, reducing the cost from 7
to 3.

4. Final Routing Tables (After Convergence)

o All nodes eventually agree on the shortest paths.

o The updated tables reflect the optimized path costs.

Conclusion

 Routers share their distance tables with neighbors.

 Each router updates its table based on the shortest path found.

 This process continues until all routers agree on the best paths.

This is the fundamental principle of Distance Vector Routing, used in protocols like RIP (Routing
Information Protocol) for network communication.

24
The slow convergence problem in distance-vector routing happens when routers take a long
time to detect failures and update their routing tables correctly. This issue is also known as the
count-to-infinity problem. Let's break it down step by step based on your scenario:

1. Initial Routing Setup (Figure a)

 Three routers (R1, R2, R3) are connected.

 Network 1 is accessible through R1.

 R3 reaches Network 1 via R2 → R1.

 Each router maintains a distance-vector table with hop counts.

o R1 → Network 1 (direct)

o R2 → Network 1 via R1 (cost = 1)

o R3 → Network 1 via R2 (cost = 2)

2. Link Failure to Network 1 (Figure b)

 Network 1 becomes unreachable.

 R1 detects the failure first and removes the route to Network 1.

 It updates its routing table, setting the distance to Network 1 as ∞ (infinity).

 But R2 and R3 do not immediately know about the failure.

3. The Count-to-Infinity Problem Starts

 R2 still has an old route to Network 1 (via R1).

 R2 advertises this route to R1 with cost 2.

 R1, unaware of the actual failure, thinks it can reach Network 1 through R2 with a cost
of 3.

 R1 updates its table incorrectly and advertises this to R2.

 Now, R2 thinks Network 1 is reachable through R1 at cost 4.

25
 This cycle continues, increasing the hop count indefinitely (e.g., 3 → 4 → 5 …).

4. The Problem: Slow Convergence

 Routers take a long time to realize that Network 1 is truly unreachable.

 The hop count keeps increasing in small steps instead of quickly marking the route as
unreachable.

 This is why it's called the count-to-infinity problem.

5. Solutions to Fix Slow Convergence

1. Split Horizon

o Routers do not advertise routes back to the neighbor they learned them from.

o Example: R2 will not tell R1 about a route to Network 1 if it originally learned it


from R1.

2. Poison Reverse

o Instead of not advertising, routers explicitly send an infinite metric (∞) back to
the neighbor.

o Example: If R2 had a route through R1, it tells R1 that the distance is ∞.

3. Triggered Updates

o Instead of waiting for periodic updates, routers immediately inform neighbors of


a failed route.

4. Maximum Hop Count (e.g., RIP = 16)

o If a route's hop count reaches a set limit (e.g., 16 in RIP), it is considered


unreachable.

Conclusion

The slow convergence problem causes routers to take too long to react to failures due to
repeated incorrect updates. Protocols like RIP (Routing Information Protocol) suffer from this
issue, while modern routing protocols like OSPF (Open Shortest Path First) use a different
approach (link-state routing) to avoid it.

26
Interconnected Autonomous Systems (AS) in Networking

1. What is an Autonomous System (AS)?

An Autonomous System (AS) is a group of IP networks and routers under the control of a single
organization that follows a common routing policy. Each AS is assigned a unique Autonomous
System Number (ASN) by the Internet Assigned Numbers Authority (IANA) or regional
registries like ARIN, RIPE, and APNIC.

 Examples of AS owners:

o Internet Service Providers (ISPs) (e.g., AT&T, Verizon, Vodafone)

o Large enterprises (e.g., Google, Amazon, Microsoft)

o Universities and research institutions

2. How are Autonomous Systems Interconnected?

Autonomous Systems communicate with each other to exchange routing information and
ensure global internet connectivity. The connection between ASes follows two major routing
policies:

A. Interior Gateway Protocols (IGPs) – Inside an AS

 Used for routing within an AS.

 Examples: OSPF (Open Shortest Path First), IS-IS (Intermediate System to Intermediate
System), RIP (Routing Information Protocol), EIGRP (Enhanced Interior Gateway
Routing Protocol).

B. Exterior Gateway Protocols (EGPs) – Between ASes

 Used for routing between different ASes.

 The primary protocol used is BGP (Border Gateway Protocol).

 BGP enables inter-AS routing by sharing network reachability information with other
ASes.

3. Types of Interconnections Between Autonomous Systems

27
Autonomous Systems connect in different ways based on their relationships:

A. Transit AS (Provider-Customer Relationship)

 One AS (a Tier 1 or Tier 2 ISP) provides internet access to another AS.

 The provider charges the customer for internet connectivity.

 Example: A small ISP (AS 200) buys connectivity from a larger ISP (AS 100).

B. Peering (Mutual Exchange of Traffic)

 Two ASes agree to exchange traffic without payments.

 Typically used between Tier 1 ISPs or large organizations to reduce costs.

 Example: Google (AS 15169) and Microsoft (AS 8075) exchange traffic directly instead
of using a transit ISP.

C. Multihoming (AS Connected to Multiple ISPs)

 An AS connects to two or more ISPs to improve reliability and redundancy.

 If one ISP fails, traffic can be rerouted through another.

 Example: A university (AS 300) connects to both AT&T (AS 7018) and Verizon (AS 701)
to ensure continuous internet access.

4. The Role of BGP in Interconnected ASes

 BGP (Border Gateway Protocol) is the standard for exchanging routing information
between ASes.

 BGP prevents routing loops and optimizes paths for global internet routing.

 BGP policies control:

o Which routes to advertise to neighbors.

o Path selection based on metrics like AS path length and policy preferences.

5. Real-World Example of AS Interconnections

Example: Internet Routing

1. A home user (AS 4000) connects to a local ISP (AS 200).

28
2. The ISP (AS 200) connects to a Tier 1 ISP (AS 100).

3. The Tier 1 ISP connects to another Tier 1 ISP (AS 500) via peering.

4. A request from the user to a website hosted on Google Cloud (AS 15169) is routed
through multiple ASes before reaching Google’s servers.

6. Why are Interconnected ASes Important?

 Ensures global internet connectivity.

 Optimizes traffic routing for performance and reliability.

 Reduces costs through peering agreements.

 Improves redundancy and fault tolerance (via multihoming).

Making Routing Scalable: Hierarchical Routing

In real-world networks, routing must be scalable to handle millions of destinations efficiently. A


flat routing approach, where all routers are equal and maintain full routing tables, is impractical
due to:

1. Memory Limitations:

o With over 600 million destinations (IPv4/IPv6 addresses), storing all routes in
every router is impossible.

2. Excessive Routing Overhead:

o Frequent routing table exchanges would consume too much bandwidth.

3. Administrative Control:

o The internet consists of multiple networks (Autonomous Systems, AS), each


managed by different organizations.

Solution: Hierarchical Routing

Hierarchical routing divides the network into multiple levels to reduce complexity.

1. Routing Hierarchy in the Internet

The internet is organized into multiple layers:

29
A. Autonomous Systems (AS)

 Each AS is an independently managed network.

 Uses Interior Gateway Protocols (IGPs) like OSPF, RIP, EIGRP for internal routing.

 Uses Exterior Gateway Protocols (EGPs) like BGP to communicate with other ASes.

B. Subnet Hierarchy

 Within an AS, networks are divided into subnets based on IP addressing.

 Reduces routing table size by aggregating multiple IP addresses into one entry (e.g.,
CIDR).

2. Advantages of Hierarchical Routing

✅ Smaller Routing Tables → Routers store only summarized routes instead of full details.
✅ Less Routing Overhead → Reduces the amount of exchanged routing information.
✅ Faster Convergence → Routing updates affect fewer routers, reducing downtime.
✅ Administrative Control → Each AS can define its internal routing policies.

3. Real-World Example: Internet Hierarchy

The internet follows a multi-level hierarchical model:

1️⃣ Tier-1 ISPs (Backbone Providers)

 Global ISPs (e.g., AT&T, Level 3, NTT).

 Use BGP to connect large ASes.

2️⃣ Tier-2 ISPs (Regional ISPs)

 Connect to Tier-1 ISPs and provide services to local ISPs.

3️⃣ Tier-3 ISPs (Local ISPs & Enterprises)

 Serve end-users, businesses, and universities.

 Use OSPF or RIP for internal routing.

4. Hierarchical Routing in Action

30
📌 Example: A user at KNUST (AS 3000) wants to access a website hosted on Amazon AWS (AS
16509).

 Step 1: The request goes to KNUST’s local ISP (AS 200).

 Step 2: The ISP forwards it to a regional ISP (AS 500).

 Step 3: The regional ISP routes the request to a Tier-1 ISP (AS 100).

 Step 4: The Tier-1 ISP finds the shortest BGP path to Amazon’s AS (AS 16509).

 Step 5: Data travels back following the same hierarchy.

5. Key Takeaways

🔹 Hierarchical routing makes the internet scalable by reducing routing complexity.


🔹 Autonomous Systems (AS) manage their own internal routing but use BGP for external
communication.
🔹 Subnet aggregation reduces routing table size, improving efficiency.

Hierarchical Routing in Autonomous Systems (AS)

To make routing scalable, the internet is organized into Autonomous Systems (AS)—
independent networks controlled by different organizations.

1. Structure of Hierarchical Routing

🔹 Routers are grouped into regions called Autonomous Systems (AS).


🔹 Each AS has a globally unique Autonomous System Number (ASN) (e.g., AS 16509 for
Amazon AWS).
🔹 Routers within the same AS use the same intra-AS routing protocol (Interior Gateway
Protocol, IGP).
🔹 Routers in different ASes can use different routing protocols.

2. Types of Routing in an AS

A. Intra-AS Routing (Interior Gateway Protocols, IGPs)

31
 Used within an AS.

 All routers in an AS use the same protocol.

 Common IGPs:

o RIP (Routing Information Protocol) – Distance-vector protocol.

o OSPF (Open Shortest Path First) – Link-state protocol.

o EIGRP (Enhanced Interior Gateway Routing Protocol) – Cisco proprietary.

B. Inter-AS Routing (Exterior Gateway Protocols, EGPs)

 Used between different ASes.

 The primary protocol is BGP (Border Gateway Protocol).

 BGP helps ASes exchange routes and decide the best path for traffic.

3. The Role of the Gateway Router

 A gateway router is positioned at the edge of an AS.

 It connects to another AS through an external link.

 Runs both an intra-AS and inter-AS protocol:


✅ Uses an IGP for internal routing.
✅ Uses BGP for exchanging routes with other ASes.

4. Why Use Hierarchical Routing?

✅ Scalability – Reduces routing table size and updates.


✅ Efficiency – Limits routing overhead within an AS.
✅ Autonomy – Each AS can manage its own network independently.
✅ Improved Performance – Gateway routers optimize external routes using BGP.

5. Example: Data Travel Between ASes

📌 Suppose a user at KNUST (AS 3000) wants to access a website on Google (AS 15169).

1️⃣ KNUST’s internal routers use OSPF (intra-AS routing) to find the best path to its gateway
router.

32
2️⃣ The gateway router uses BGP to communicate with an ISP’s AS (AS 200).
3️⃣ ISP (AS 200) uses BGP to find a route to Google’s AS (AS 15169).
4️⃣ Google’s gateway router forwards traffic to the appropriate internal router using OSPF.
5️⃣ Response follows the same path in reverse.

6. Key Takeaways

🔹 Hierarchical routing aggregates routers into ASes for better scalability.


🔹 Intra-AS routing protocols (IGPs) handle routing within an AS.
🔹 Inter-AS routing (BGP) manages routing between ASes.
🔹 Gateway routers connect ASes and translate between different routing protocols.

Your uploaded image illustrates hierarchical routing with interconnected Autonomous Systems
(ASs). Here's a breakdown of the key concepts shown:

1. Intra-AS Routing (Interior Gateway Protocols - IGP)

🔹 Used within a single AS (e.g., AS 100 or AS 200).


🔹 All routers within an AS must use the same IGP.
🔹 Common IGP protocols:

 RIP (Routing Information Protocol) – A simple distance-vector protocol.

 OSPF (Open Shortest Path First) – A link-state protocol used in large networks.

 IGRP (Interior Gateway Routing Protocol) – Cisco proprietary, distance-vector.

2. Inter-AS Routing (Exterior Gateway Protocols - EGP)

🔹 Used to exchange routes between different ASs (e.g., AS 100 and AS 200).
🔹 ASes can run different intra-AS protocols, but must use a common inter-AS protocol.
🔹 The most widely used EGP is BGP (Border Gateway Protocol).

 BGP allows ASes to exchange network reachability information.

 It helps determine the best path for traffic between ASes.

3. Key Takeaways from the Image


33
✅ AS 100 and AS 200 are separate networks, each using its own intra-AS routing (RIP, IGRP).
✅ Gateway routers connect these ASes and use an exterior routing protocol (like BGP).
✅ Scalability – Instead of every router storing all global routes, ASes aggregate routing
information.

Your uploaded image illustrates hierarchical routing with interconnected Autonomous Systems
(ASs). Here's a breakdown of the key concepts shown:

1. Intra-AS Routing (Interior Gateway Protocols - IGP)

🔹 Used within a single AS (e.g., AS 100 or AS 200).


🔹 All routers within an AS must use the same IGP.
🔹 Common IGP protocols:

 RIP (Routing Information Protocol) – A simple distance-vector protocol.

 OSPF (Open Shortest Path First) – A link-state protocol used in large networks.

 IGRP (Interior Gateway Routing Protocol) – Cisco proprietary, distance-vector.

2. Inter-AS Routing (Exterior Gateway Protocols - EGP)

🔹 Used to exchange routes between different ASs (e.g., AS 100 and AS 200).
🔹 ASes can run different intra-AS protocols, but must use a common inter-AS protocol.
🔹 The most widely used EGP is BGP (Border Gateway Protocol).

 BGP allows ASes to exchange network reachability information.

 It helps determine the best path for traffic between ASes.

3. Key Takeaways from the Image

✅ AS 100 and AS 200 are separate networks, each using its own intra-AS routing (RIP, IGRP).
✅ Gateway routers connect these ASes and use an exterior routing protocol (like BGP).
✅ Scalability – Instead of every router storing all global routes, ASes aggregate routing
information.

Great points! The key reason for separating intra-AS and inter-AS routing is that they serve
different purposes and have different constraints. Let's break it down further:

34
1. Policy Differences

🔹 Inter-AS Routing (EGP - e.g., BGP)

 Each AS is independent and has its own routing policies.

 Admins want control over traffic entering or leaving their network.

 Routing decisions are based on business relationships (e.g., peering agreements, cost).

🔹 Intra-AS Routing (IGP - e.g., OSPF, RIP)

 A single administrator controls the AS.

 No need for complex policies—just find the best route within the AS.

 Routes are selected purely based on performance (e.g., shortest path, least delay).

2. Scalability

🔹 The Internet has millions of destinations—storing all routes in every router is impractical.
🔹 Hierarchical routing reduces:

 Routing table size (by summarizing routes within ASes).

 Update traffic (by keeping most routing updates local to the AS).

3. Performance vs. Policy Trade-off

🔹 Intra-AS Routing

 Focus is on fast convergence and low latency.

 Uses protocols like OSPF that select paths based on network performance.

🔹 Inter-AS Routing

 Business and security policies often take priority over shortest path.

 BGP may choose a longer path due to economic agreements rather than speed.

Key Takeaway

35
✅ IGP (Intra-AS routing) = Optimize network performance (shortest path, lowest delay).
✅ EGP (Inter-AS routing) = Control and policy-driven routing (who routes through whom).
✅ Hierarchical routing keeps things scalable and manageable.

Routing Information Protocol (RIP) Overview

1. Historical Background

✅ Introduced in 1982 as part of BSD-UNIX


✅ One of the oldest distance-vector routing protocols
✅ Still used in small networks but mostly replaced by OSPF/EIGRP in large-scale networks

2. Distance Vector Algorithm

🔹 Routing Metric:

 Uses hop count as a metric (each router = 1 hop)

 Maximum hop count = 15 (if 16, it's considered infinity → route is unreachable)

🔹 Periodic Updates:

 Routers broadcast updates every 30 seconds

 Updates sent via UDP (port 520)

 Each update (advertisement) can contain up to 25 destination subnets

🔹 Route Selection:

 Chooses the path with the fewest hops

 No concept of link bandwidth or congestion (unlike OSPF)

3. Limitations of RIP

⚠️Slow Convergence: Takes time to recover from link failures (count-to-infinity problem)
⚠️Scalability Issues: Max 15 hops limits use in large networks
⚠️No Load Balancing: Treats all paths equally, doesn’t consider bandwidth or delay

✅ Despite limitations, RIP is simple and easy to configure, making it useful for small networks
or as a backup protocol.

36
Page 42

Understanding RIP Routing Table Updates in Router D

Router D maintains a routing table using the Routing Information Protocol (RIP), which is a
distance vector routing protocol. In this method, each router periodically shares its routing
table with its neighbors, allowing updates to propagate through the network. Here’s how it
works for router D in the given example:

1. Distance Vector Updates

 RIP uses hop count as its metric. A hop is one router-to-router transition.

 The maximum allowed hop count is 15 (anything beyond that is considered


unreachable).

 Every 30 seconds, routers exchange updates with their directly connected neighbors.

2. Routing Table Entries in Router D

Each row in router D’s table contains:

 Destination Subnet: The subnet (network) the router wants to reach.

37
 Next Router: The next-hop router that should be used to reach that subnet.

 Hops to Destination: The number of routers (hops) needed to reach the destination.

Let’s break down the entries:

Destination Subnet Next Router Hops to Destination

w A 2

y B 2

z B 7

x (unknown) (unknown)

 To reach "w" → Router D will send packets to router A, taking 2 hops.

 To reach "y" → Router D will send packets to router B, taking 2 hops.

 To reach "z" → Router D will also use router B, but this takes 7 hops.

 To reach "x" → No clear route is listed, meaning x is either unreachable or missing from
this table.

3. How RIP Updates This Table

 Each router sends updates to its neighbors listing known destinations and hop counts.

 Router D updates its table if:

o It learns of a shorter route to an existing destination.

o It learns a new destination from its neighbors.

o A route becomes unreachable (i.e., if no update is received for 180 seconds, the
route is removed).

38
Pg 43

Understanding the Given Data

We have two tables:

1. Figure (a): Existing Routing Information Base (RIB) in Router K


This table lists known destination networks, their respective distances (hop counts),
and the next router used to reach them.

2. Figure (b): Incoming Routing Update from Router J


This table lists destination networks and their distances from Router J.

Step 1: Compare the Update Message with Existing RIB

When a router receives a routing update, it updates its RIB if:

 The new path to a destination has a lower distance (better route).

 The destination is missing in the current RIB (newly learned route).

We now compare each destination in the update message with the existing RIB.

39
Existing Distance (RIB Incoming Distance (from J) + 1
Destination Update Needed?
in K) (hop to J)

Net 1 0 (direct) 2 ❌ No change

✅ Update (shorter
Net 4 8 via L 3+1 = 4
route)

Net 17 5 via M 6+1 = 7 ❌ No change

Net 21 Not in RIB 4+1 = 5 ✅ Add new route

Net 24 6 via J 5+1 = 6 ❌ No change

Net 30 2 via Q 10+1 = 11 ❌ No change (worse)

Net 42 2 via J 3+1 = 4 ❌ No change

Step 2: Items that Cause a Change

From the comparison:

1. Net 4 gets updated because 4 (via J) is better than 8 (via L).

2. Net 21 is new, so it is added to the RIB.

Total items that change = 2.

Step 3: Router K’s Updated RIB

Now, we update the RIB of Router K:

Destination Distance Route

Net 1 0 direct

Net 2 0 direct

Net 4 4 Router J

Net 17 5 Router M

Net 21 5 Router J

Net 24 6 Router J

40
Destination Distance Route

Net 30 2 Router Q

Net 42 2 Router J

Final Answers

(a) How many items in the update message cause a change in Router K’s RIB?
✅ 2 items (Net 4 and Net 21).

(b) What is router K’s RIB after the update?


See the updated RIB table above.

RIP: Link Failure and Recovery

Routing Information Protocol (RIP) handles link failures and recovery using a timeout and
update mechanism. Here’s how it works:

1. Link Failure Detection

 If a router does not receive an advertisement from a neighbor for 180 seconds, the link
is considered down.

 The router invalidates routes that used that neighbor.

2. Propagation of Failure Information

 The router sends new advertisements to its neighbors, informing them that the affected
routes are no longer valid.

 Neighbors update their routing tables accordingly and forward the updated
information.

 This failure information quickly spreads across the entire network.

3. Preventing Loops (Poison Reverse)

 Poison Reverse is used to prevent "ping-pong" loops, where routers keep advertising
the same broken route back and forth.

41
 Instead of just removing the route, RIP sets the distance to 16 hops (infinite), ensuring it
is considered unreachable.

4. Link Recovery

 If a failed link comes back up, the router will eventually receive advertisements from its
neighbor.

 It will then update its routing table with the restored path.

 The updated route gradually propagates through the network.

Key Takeaways

 RIP detects link failure after 180 sec.

 It invalidates routes, updates neighbors, and spreads failure info.

 Poison reverse prevents routing loops by setting distance = 16.

 When a link is restored, routing updates allow recovery.

RIP Table Processing

RIP (Routing Information Protocol) manages routing tables using a daemon process and UDP-
based advertisements. Here's how it works:

1. Managed by the Routed Daemon

 RIP routing tables are handled by an application-level process called routed (daemon).

 This daemon updates and maintains the routing table based on received RIP
advertisements.

 It ensures that the router always has the best available paths to destinations.

2. Advertisement Process

 RIP sends periodic updates containing routing table information.

 These updates are transmitted using UDP (User Datagram Protocol), specifically on port
520.

 The updates are sent every 30 seconds to inform neighboring routers of the current
routes.

3. Routing Updates

42
 Each update message includes:

o A list of known network destinations

o Their respective hop counts (distances)

 When a router receives an update, it compares the new information with its existing
table:

o If the update provides a shorter route, the router updates its table.

o If the advertised distance is worse (longer route), the router ignores it (or waits
for failure detection).

Key Takeaways

✔ Daemon Process: RIP routing tables are handled by the routed daemon.
✔ UDP-Based Communication: Updates are sent via UDP port 520 every 30 seconds.
✔ Routing Table Updates: Routers adjust their tables based on new advertisements.

OSPF (Open Shortest Path First) Overview

OSPF is a link-state routing protocol designed for large and complex networks. Unlike RIP,
which relies on hop counts, OSPF provides faster convergence and more efficient routing using
Dijkstra's algorithm.

1. Why "Open"?

 OSPF is an open standard, meaning it's publicly available and not proprietary like Cisco’s
EIGRP.

 It was developed by the IETF (Internet Engineering Task Force) in 1988.

 Defined in RFC 1247, RFC 2328, and OSPFv3 for IPv6 (RFC 5340).

2. Key Features of OSPF

a) Uses Link-State Algorithm

 Each router constructs a complete topological map of the network (not just next-hop
distances like RIP).

43
 Uses Dijkstra’s Shortest Path First (SPF) Algorithm to compute the best route.

b) Link-State Packet (LSP) Dissemination

 Routers flood link-state advertisements (LSAs) to ensure all routers have the same
network view.

 Updates are triggered by changes in topology rather than periodic updates (unlike RIP's
30s interval).

 This allows for faster convergence and reduces unnecessary traffic.

c) Area-Based Hierarchy

 Supports a hierarchical structure with OSPF Areas, improving scalability.

 Area 0 (Backbone Area) connects all other areas.

d) Uses Cost Metric Instead of Hop Count

 OSPF determines the best path using a cost metric based on bandwidth (instead of RIP’s
simple hop count).

 Higher bandwidth links have lower cost, making them preferable for routing.

e) Supports Load Balancing & Multi-path Routing

 Can use multiple equal-cost paths for better load balancing.

3. How OSPF Works

1. Neighbor Discovery:

o Routers establish adjacencies by exchanging Hello packets.

2. Topology Exchange:

o Each router sends LSAs to all other routers in the OSPF area.

3. SPF Calculation:

o Using Dijkstra’s Algorithm, each router computes the shortest path tree (SPT)
for routing.

4. Routing Table Update:

o The best paths are stored in the routing table, and the router starts forwarding
packets accordingly.

44
4. OSPF vs. RIP

Feature OSPF RIP

Algorithm Link-State (Dijkstra) Distance-Vector (Bellman-Ford)

Metric Cost (based on bandwidth) Hop count

Convergence Fast Slow

Scalability Large networks (Hierarchical) Small networks (Flat structure)

Routing Updates Event-triggered (LSAs) Periodic (every 30 sec)

5. How OSPF Advertises Routes

 Unlike RIP, which uses UDP, OSPF sends messages directly over IP (Protocol 89).

 This eliminates the need for TCP or UDP, reducing overhead.

 Advertisements are flooded across the entire Autonomous System (AS) for consistency.

Conclusion

OSPF is a powerful, scalable, and efficient routing protocol ideal for large networks. It uses link-
state advertisements (LSAs), Dijkstra’s algorithm, and a cost-based metric for optimal path
selection. It is far superior to RIP in terms of convergence speed, efficiency, and scalability.

Routing Tasks in OSPF

OSPF performs multiple tasks to ensure efficient routing and fast convergence. These tasks are
divided into three main categories: Neighbor Management, Database Management, and
Routing Table Operations.

1. Neighbor Management

45
OSPF routers must discover and maintain relationships with other routers to exchange routing
information.

a) Discovery

 OSPF routers discover each other by sending Hello packets.

 If two routers agree on OSPF parameters (Area ID, Hello interval, etc.), they form an
adjacency.

 Designated Router (DR) and Backup Designated Router (BDR) are elected on multi-
access networks (e.g., Ethernet) to reduce overhead.

b) Maintenance

 OSPF periodically sends Hello packets to maintain connections.

 If a neighbor fails to respond within a timeout period, OSPF removes the route and
recalculates the shortest paths.

2. Database Management

OSPF routers store and synchronize a Link-State Database (LSDB), which contains a complete
map of the network.

a) Granularity

 The LSDB contains detailed information about the network topology.

 Each router knows the entire network structure, not just next-hop distances like RIP.

b) Maintenance (Updates)

 When topology changes, routers generate Link-State Advertisements (LSAs) and flood
them to update all routers.

 Unlike RIP, OSPF only sends updates when needed, reducing unnecessary traffic.

c) Synchronization

 When a new router joins, it synchronizes its LSDB with other routers.

 Database Description (DBD) packets and Link-State Requests (LSR) are used for
synchronization.

 OSPF ensures all routers have a consistent view of the network.

46
3. Routing Table Operations

The Routing Information Base (RIB) is built from the LSDB and determines how packets are
forwarded.

a) Metric

 OSPF uses cost as its metric, based on bandwidth.

 Formula: Cost=108Bandwidth (bps)\text{Cost} = \frac{10^8}{\text{Bandwidth


(bps)}}Cost=Bandwidth (bps)108 Example:

o 10 Mbps link → Cost = 10

o 100 Mbps link → Cost = 1

o 1 Gbps link → Cost = 0.1

o Lower cost = better path

b) Calculation

 OSPF runs Dijkstra’s Shortest Path First (SPF) algorithm to compute the best routes.

 It constructs a Shortest Path Tree (SPT) from the LSDB and selects the lowest-cost
paths.

c) Update

 When network changes occur (e.g., link failure, new router), OSPF recalculates the
shortest path and updates the routing table.

 This ensures the network adapts dynamically to topology changes.

Summary Table

Task Description

Neighbor Discovery Uses Hello packets to find OSPF routers

Neighbor Maintenance Keeps adjacencies active using periodic Hello messages

Database Granularity Stores a full network topology in LSDB

Database Maintenance Updates LSDB using LSAs only when changes occur

47
Task Description

Database Synchronization Ensures all routers have the same network view

Routing Metric Uses cost (bandwidth-based) instead of hop count

Routing Calculation Uses Dijkstra’s SPF algorithm for shortest path

Routing Table Update Adjusts routing table dynamically when topology changes

Conclusion

OSPF ensures efficient and scalable routing by maintaining neighbor relationships,


synchronizing a detailed topology database, and computing optimal routes based on link costs.
🚀

OSPFv2: Key Components

OSPFv2 (used for IPv4 networks) consists of several key components that work together to
enable efficient routing. Here’s a breakdown of these components in simple terms:

1. Hello Protocol: “Who is my neighbor?”

 OSPF routers discover and maintain connections with other routers using Hello packets.

 These packets are sent periodically to detect new neighbors and check if existing
neighbors are still active.

 If a neighbor fails to respond, OSPF removes it from the routing table and recalculates
paths.

📌 Example:

 If Router A and Router B are connected, they exchange Hello packets.

 If Router A stops receiving Hello messages from Router B, it assumes Router B is down
and updates the network topology.

2. Database Synchronization: “What info am I missing?”

48
 Once routers discover each other, they need to synchronize their Link-State Databases
(LSDBs).

 This ensures all routers have a consistent network view.

 The synchronization process uses Database Description (DBD) packets and Link-State
Requests (LSR).

📌 Example:

 A new router joins the network.

 It requests missing network information from an existing router.

 The existing router sends the missing updates, ensuring the new router has the
complete topology map.

3. Reliable Flooding Algorithm: “How do I distribute info?”

 OSPF uses flooding to distribute network topology changes.

 When a router detects a link failure or a new connection, it floods Link-State


Advertisements (LSAs) to all routers in the network.

 This ensures all routers quickly learn about topology changes.

📌 Example:

 A link between Router A and Router B fails.

 Router A floods this information to other routers.

 Other routers update their LSDBs and recalculate shortest paths.

4. Designated Router (DR) / Backup Designated Router (BDR) Election: “With whom do I want
to talk?”

 In multi-access networks (like Ethernet), flooding updates to every router can cause
high traffic.

 To reduce this, OSPF elects a Designated Router (DR) and a Backup Designated Router
(BDR).

 The DR handles most communication, and the BDR takes over if the DR fails.

49
📌 Example:

 In a network with 10 routers, flooding updates to all 10 would be inefficient.

 Instead, one router is elected as DR to handle updates efficiently.

🔹 Election Process:

 The router with the highest priority is elected DR.

 The second-highest becomes BDR.

 If there’s a tie, the router with the highest Router ID (RID) is chosen.

5. Route Computation

a) Link-State Database (LSDB)

 OSPF stores a full map of the network in the LSDB.

 Each router has the same LSDB, ensuring consistent routing decisions.

b) Dijkstra’s Algorithm

 OSPF uses Dijkstra’s Shortest Path First (SPF) algorithm to compute the best paths.

 It finds the shortest path from the router to all destinations.

c) Equal-Cost Multipath (ECMP) Routing

 If multiple paths have the same cost, OSPF splits traffic across them.

 This improves load balancing and network efficiency.

📌 Example:

 If Router A has two paths to Router Z, both with a cost of 10, OSPF can use both paths
simultaneously.

Summary Table

Component Function

Hello Protocol Discovers and maintains neighbor relationships

Database Synchronization Ensures routers have a consistent LSDB

50
Component Function

Reliable Flooding Distributes network changes using LSAs

DR/BDR Election Reduces flooding in multi-access networks

Route Computation Uses Dijkstra’s algorithm to compute shortest paths

Equal-Cost Path Routing Supports load balancing with multiple equal-cost paths

Conclusion

OSPFv2 ensures fast, efficient, and scalable routing by using Hello messages for neighbor
detection, flooding for updates, DR/BDR for efficiency, and Dijkstra’s algorithm for optimal
path selection

This image represents the OSPFv2 Packet Header Format, which is 24 octets long and is
included in every OSPF message. Below is a breakdown of each field in the header:

OSPFv2 Packet Header Fields

Field Size Description

Version (2) 8 bits Indicates the OSPF version (OSPFv2 = 2).

Specifies the OSPF packet type (e.g.,


Type 8 bits
Hello = 1, Database Description = 2).

Message Length 16 bits Total length of the OSPF packet (header +

51
Field Size Description

data).

IP address of the router sending the


Source Router IP Address 32 bits
OSPF message.

Identifies the OSPF area to which the


Area ID 32 bits
router belongs.

Checksum 16 bits Error-checking field for the OSPF packet.

Specifies the authentication type (0 =


Authentication Type 16 bits
None, 1 = Simple, 2 = MD5).

Authentication (Octets 0–3, Authentication data, depending on the


64 bits
4–7) authentication type used.

OSPF Packet Types

The Type field in the header specifies the kind of OSPF message. Common types include:

 1 – Hello Packet (Neighbor discovery and maintenance)

 2 – Database Description (DBD) (Used in LSDB synchronization)

 3 – Link-State Request (LSR) (Requests missing LSAs)

 4 – Link-State Update (LSU) (Carries LSAs to other routers)

 5 – Link-State Acknowledgment (LSAck) (Acknowledges LSU packets)

The image provides a list of the five OSPF packet types along with their meanings. Here’s a
detailed explanation:

52
OSPF Packet Types and Their Functions

1. Hello Packet

o Used to discover and maintain neighbor relationships.

o Sent periodically to multicast address 224.0.0.5 with TTL = 1 (link-local scope).

o Contains parameters like router ID, hello/dead intervals, area ID, and
authentication.

2. Database Description (DBD) Packet

o Summarizes the link-state database (LSDB).

o Used during neighbor synchronization to exchange topology information.

o Helps identify outdated/missing LSAs (Link-State Advertisements).

3. Link-State Request (LSR) Packet

o Sent by a router to request missing LSAs from a neighbor.

o Ensures both routers have the same database information.

4. Link-State Update (LSU) Packet

o Carries Link-State Advertisements (LSAs), which contain updated network


topology information.

o Sent using multicast (224.0.0.5) or unicast depending on the situation.

5. Link-State Acknowledgment (LSAck) Packet

o Confirms receipt of an LSU packet.

o Prevents unnecessary retransmissions.

OSPF Characteristics

 Uses IP Protocol #89 (OSPF is not encapsulated in TCP or UDP).

 Multicast (224.0.0.5 for all OSPF routers, 224.0.0.6 for DR/BDR).

 TTL set to 1 to prevent routing loops.

OSPFv2 Hello Message Format

53
The Hello Protocol is a crucial part of OSPF, responsible for neighbor discovery, maintenance,
and failure detection.

🔹 Functions of the Hello Protocol

1. Bidirectional Communication

o Ensures that routers can send and receive packets from each other.

o Establishes and maintains OSPF neighbor relationships.

2. Parameter Agreement

o Neighbors must agree on:

 HelloInterval (How often Hello packets are sent).

 RouterDeadInterval (Time before a neighbor is considered dead if no


Hellos are received).

3. Network Role Identification

o On broadcast networks (e.g., Ethernet), OSPF elects a Designated Router (DR)


and a Backup Designated Router (BDR).

o This reduces the number of adjacencies and minimizes overhead.

🔹 How the Hello Protocol Works

1. Hello Packet Transmission

o Sent to the well-known multicast address 224.0.0.5 (All OSPF routers).

o On non-broadcast networks (NBMA), sent directly (unicast) to neighbors.

2. Periodic Hello Exchange

o Default interval: 10 seconds (Ethernet), 30 seconds (NBMA).

o If no Hello is received within the RouterDeadInterval (typically 4 ×


HelloInterval), the neighbor is considered down.

3. DR/BDR Election (for broadcast networks)

o Highest priority router becomes the DR.

54
o Second-highest becomes the BDR.

o If a DR fails, the BDR takes over, avoiding network disruption.

OSPFv2 Database Description (DBD) Message Format

The Database Description (DBD) message is used in OSPF to synchronize link-state databases
between routers.

🔹 OSPF Database Exchange Process

1. Each router maintains a link-state database (LSDB), which contains Link State
Advertisements (LSAs).

2. When a new neighbor relationship is established, routers exchange their LSDB


summaries using DBD messages.

3. If a router finds missing or outdated LSAs, it requests updates using Link State Request
(LSR) messages.

🔹 Database Description Message Structure

 Header fields include:

o Sequence number – Ensures ordered exchange of messages.

o MTU (Maximum Transmission Unit) – Confirms both routers can handle the
same packet size.

o Flags – Indicate if more DBD packets are coming.

o LSA headers – Summary of the LSAs known by the sender.

🔹 Key Properties of OSPF Database

 Each router has a unique local view of the topology.

 LSAs contain detailed state information about links and routers.

55
 Database synchronization ensures network consistency, preventing routing loops and
incorrect paths.

🔹 Why is DBD Important?

 Ensures that OSPF neighbors have the same network topology view.

 Helps recover from link failures by updating LSAs.

 Supports fast convergence when network changes occur.

OSPFv2 Database Description (DBD) Message Format Breakdown

The Database Description (DBD) message in OSPF helps routers synchronize their Link State
Databases (LSDBs) by summarizing known Link State Advertisements (LSAs).

🔹 Key Fields in a DBD Message

1️⃣ Identifying LSAs

Each LSA has specific fields for identification:

 LS Type Field – Identifies the type of LSA (e.g., Router LSA, Network LSA, etc.).

 Link State ID Field – Unique identifier for the LSA, varying by type.

 Advertising Router Field – The Router ID of the router that originated the LSA.

2️⃣ Verifying LSA Contents

 LS Checksum Field – Ensures data integrity by detecting corruption in LSAs.

3️⃣ Identifying LSA Instances (Tracking Changes in Topology)

Since OSPF dynamically updates topology, each LSA must be tracked:

 LS Sequence Number Field

o Ensures newer LSAs replace older ones.

o Uses a linear sequence space, meaning higher sequence numbers indicate more
recent LSAs.

56
o If the maximum sequence number is reached, the LSA is refreshed with a new
instance.

 LS Age Field

o Prevents outdated LSAs from remaining in the database indefinitely.

o New sequence number every 30 minutes to maintain consistency.

o Maximum age is 1 hour; if LS Age > 1 hour, the LSA is invalid and removed.

o Premature aging allows routers to remove LSAs early if needed.

🔹 Why This Matters?

✔ Ensures routers have up-to-date topology information.


✔ Prevents loops and stale routing data in the network.
✔ Helps OSPF converge faster during topology changes.

OSPFv2 Link-State Request (LSR) Message Format

The Link-State Request (LSR) message is used in OSPF when a router detects that its Link State
Database (LSDB) is out of date and needs updated information from a neighbor.

🔹 Key Features of LSR

✅ Sent after the exchange of Database Description (DBD) packets.


✅ Requests specific LSAs from a neighbor to synchronize databases.
✅ Ensures that routers have an accurate and up-to-date view of the network topology.

🔹 LSR Message Format (Breakdown)

Field Description

OSPF Header (Type =


Identifies the packet as a Link-State Request.
3)

Specifies the type of LSA being requested (e.g., Router LSA, Network
LS Type
LSA, etc.).

57
Field Description

Link ID The unique identifier of the requested LSA.

Advertising Router The Router ID of the router that originally advertised the LSA.

... Multiple requests can be included in a single LSR message.

🔹 How the Process Works?

1️⃣ A router detects outdated LSAs after receiving DBD messages.


2️⃣ It sends an LSR message to the neighbor to request updated LSAs.
3️⃣ The neighbor responds with a Link-State Update (LSU) message containing the requested
LSAs.
4️⃣ The router processes the LSU and updates its Link State Database (LSDB).

🔹 Why is LSR Important?

✔ Ensures consistent topology information across all OSPF routers.


✔ Prevents routing loops and inconsistencies by keeping LSDBs synchronized.
✔ Helps routers recover from network changes or failures.

OSPFv2 Link-State Update (LSU) Message Format

The Link-State Update (LSU) message in OSPFv2 is used to propagate updated routing
information across the network. It contains Link-State Advertisements (LSAs), which describe
the state of a router’s links and the overall network topology.

🔹 Purpose of LSU Messages

✅ Sent periodically or when network topology changes occur.


✅ Used to advertise new or updated LSAs to neighboring routers.
✅ Helps maintain synchronization of the Link State Database (LSDB) across OSPF routers.

🔹 LSU Message Format (Breakdown)

58
Field Description

OSPF Header (Type = 4) Identifies the packet as a Link-State Update.

Number of LSAs Specifies the number of LSAs included in the update.

List of LSAs Contains one or more LSAs that describe link states.

🔹 LSA Format within an LSU

Each Link-State Advertisement (LSA) inside the LSU message follows a structured format:

LSA Field Description

LS Age Age of the LSA (prevents outdated info).

LS Type Type of LSA (e.g., Router LSA, Network LSA).

Link State ID Identifies the LSA uniquely.

Advertising Router Router ID of the sender.

LS Sequence Number Tracks LSA versions (prevents loops and stale info).

LS Checksum Ensures LSA integrity.

LS Length Length of the LSA.

Link-State Information Data describing the link (e.g., neighbor, cost, etc.).

🔹 How the Process Works?

1️⃣ A router detects a network change (e.g., a link failure or new link).
2️⃣ It generates a new LSA and sends it in an LSU message.
3️⃣ The receiving routers update their LSDB with the new LSA.
4️⃣ The routers send a Link-State Acknowledgment (LSAck) to confirm receipt.
5️⃣ If necessary, the LSA is retransmitted to ensure delivery.

🔹 Why is LSU Important?

59
✔ Ensures that all routers have the latest routing information.
✔ Helps OSPF quickly adapt to network topology changes.
✔ Supports fast convergence and improves network reliability.

OSPFv2 Designated Router (DR) Election Process

In OSPF, the Designated Router (DR) and Backup Designated Router (BDR) help reduce
overhead in broadcast and multi-access networks (e.g., Ethernet). They minimize the number
of OSPF adjacencies and ensure efficient flooding of routing updates.

🔹 How Does DR/BDR Election Work?

📌 When a new router joins an OSPF network:


1️⃣ Listens to Hello packets from neighbors.
2️⃣ If DR and BDR are already elected, the new router accepts them.
3️⃣ If no Backup Designated Router (BDR) exists:

 The router with the highest priority is elected as BDR.

 If there's a tie, the router with the highest Router ID (RID) is selected.
4️⃣ If no Designated Router (DR) exists:

 The current BDR is promoted to DR.

 A new BDR is then elected.

🔹 Key Election Rules

✔ All routers must agree on the DR and BDR based on received Hello packets.
✔ OSPF Priority:

 Default is 1 (0 means router cannot be elected as DR or BDR).

 Higher priority = higher chance of becoming DR or BDR.


✔ Router ID (RID) Tiebreaker:

 If priorities match, the router with the highest Router ID wins.

 Router ID = highest active IP address (or manually set).

60
🔹 Why Use DR and BDR?

✅ Reduces overhead by limiting full OSPF neighbor relationships.


✅ Speeds up convergence by centralizing LSA distribution.
✅ Ensures stability by keeping the BDR as a backup in case the DR fails.

Advanced Features of OSPF (Compared to RIP)

OSPF (Open Shortest Path First) is more advanced than RIP (Routing Information Protocol) due
to its efficiency, scalability, and security. Here are some key advanced features:

1️⃣ Security 🔒

✔ All OSPF messages are authenticated to prevent unauthorized access or malicious attacks.
✔ Authentication types:

 Null authentication (no security)

 Simple password authentication (weak)

 MD5 authentication (stronger)


✔ This prevents rogue routers from injecting false routing information.

2️⃣ Multiple Equal-Cost Paths

✔ Unlike RIP, which selects only one best path, OSPF allows multiple same-cost paths to be
used for load balancing.
✔ These paths are stored in the routing table and can be utilized to share network traffic
efficiently.
✔ Improves network redundancy and throughput.

3️⃣ Integrated Unicast and Multicast Support 📡

✔ Multicast OSPF (MOSPF) extends OSPF for multicast routing.


✔ Uses the same link-state database as standard OSPF.
✔ Eliminates the need for a separate multicast routing protocol in OSPF-based networks.

4️⃣ Hierarchical OSPF for Large Networks 🌎


61
✔ OSPF supports a hierarchical structure using areas:

 Backbone Area (Area 0): Connects all other areas.

 Regular Areas: Prevent excessive LSAs from overwhelming the network.


✔ Reduces routing overhead, improves scalability, and ensures faster convergence.

🔹 Summary: Why OSPF is Better than RIP?

✅ Faster convergence (RIP takes up to 180 seconds to recover).


✅ Supports security authentication (RIP has none).
✅ Load balancing over multiple equal-cost paths.
✅ More scalable (RIP struggles beyond small networks).
✅ Supports multicast with MOSPF.
✅ Hierarchical design for large networks.

🔹 Hierarchical OSPF Overview

OSPF (Open Shortest Path First) uses a two-level hierarchical structure for scalability and
efficient routing updates. The key components of this structure include:

1️⃣ Two-Level Hierarchy

✔ Backbone Area (Area 0)

 Connects all other areas.

 Handles inter-area routing.

 All non-backbone areas must communicate via Area 0.

✔ Local Areas (Area 1, Area 2, etc.)

 Each area has its own detailed topology.

 Link-state advertisements (LSAs) do not leave their area (reduces overhead).

 Only summary information is shared with other areas.

2️⃣ Key Router Types

1️⃣ Internal Routers

62
 Exist only within a single area.

 Maintain a full OSPF database only for their area.

2️⃣ Area Border Routers (ABRs)

 Connect one or more areas to the backbone.

 Summarize routes to reduce LSA flooding.

 Exchange routing information between local areas and the backbone.

3️⃣ Backbone Routers

 Operate within Area 0.

 Maintain only backbone topology information.

 Ensure connectivity between all areas.

4️⃣ Boundary Routers (ASBRs - Autonomous System Boundary Routers)

 Connect an OSPF network to external networks (other ASs).

 Import and export routes between OSPF and non-OSPF protocols (e.g., BGP, EIGRP).

3️⃣ Benefits of Hierarchical OSPF

✅ Scalability – Reduces LSA flooding and processing overhead.


✅ Faster convergence – Since LSAs don’t leave the area, updates are localized.
✅ Better summarization – ABRs reduce the number of advertised routes.
✅ Efficient routing – Shortest path calculations are simpler in smaller areas.

🔹 OSPF Areas and Their Importance

OSPF (Open Shortest Path First) uses areas to improve scalability and efficiency in large
networks. An OSPF Autonomous System (AS) or Routing Domain is divided into multiple areas
to reduce LSA flooding and optimize routing.

1️⃣ Key Characteristics of OSPF Areas

✔ Backbone Area (Area 0)

 The central hub of the OSPF network.

63
 All other areas must connect to it for inter-area routing.

 If an area cannot directly connect to Area 0, a virtual link may be required.

✔ Strict Area Hierarchy (No Loops Allowed)

 Routing between areas must go through Area 0.

 Prevents routing loops and ensures stability.

✔ Different Types of LSAs (Link-State Advertisements)

 Intra-area LSAs → Describe links within an area.

 Inter-area LSAs → Advertise routes between areas.

 Stub-network LSAs → Represent networks with no other routers.

 External LSAs → Advertise routes injected from other ASs (e.g., BGP routes).

2️⃣ Challenges in OSPF Areas

✔ Partitioning of Areas

 Link or router failures can cause an area to become disconnected from the rest of the
network.

 If an area loses its connection to the backbone, it becomes isolated and loses access to
other areas.

✔ Healing Area Partitions

 Some partitions can heal automatically by finding alternative routes.

 Some require manual intervention, such as configuring a virtual link to reconnect to


Area 0.

✔ Isolated Areas (Total Network Failure)

 If an area loses all paths to Area 0, it is completely cut off and cannot route traffic
beyond its local network.

 Solution? Redundancy is critical! Multiple paths to Area 0 prevent failures.

3️⃣ Why Are Areas Useful?

64
✅ Reduces LSA flooding → Limits updates to within an area, preventing excessive processing.
✅ Speeds up convergence → OSPF routers process fewer LSAs, leading to faster recalculations.
✅ Enhances network stability → If an issue occurs in one area, it doesn’t affect others.
✅ Supports large networks efficiently → Hierarchical design scales better than a single flat OSPF
network.

This slide provides a summary of OSPF (Open Shortest Path First) by categorizing key aspects:

🔹 OSPF Key Components

1️⃣ Neighbors (Router Adjacencies)

 Discovery: Routers discover neighbors using Hello packets.

 Maintenance: Multicast groups (224.0.0.5, 224.0.0.6) help routers maintain


adjacencies.

2️⃣ Database (Link-State Database - LSDB)

 Granularity: Stores detailed topology information for accurate routing.

 Maintenance: Uses Link-State Advertisements (LSAs) to update topology.

 Synchronization: LSAs are flooded across the network for consistency.

3️⃣ Routing Table (Best Path Calculation)

 Metric: OSPF uses cost (based on bandwidth) to determine the best path.

 Calculation: Uses Dijkstra’s Algorithm (Shortest Path First - SPF) to compute the optimal
route.

This summary breaks down the key elements of OSPF (Open Shortest Path First):

🔹 OSPF Components

1️⃣ Neighbors (Router Adjacencies)

 Discovery: Routers find neighbors using the Hello protocol.

 Maintenance: Uses multicast groups (224.0.0.5, 224.0.0.6) to maintain neighbor


relationships.

2️⃣ Database (Link-State Database - LSDB)

65
 Granularity: Stores detailed topology information using Link-State Advertisements
(LSAs).

 Maintenance: Updates use LSA flooding protocol to spread changes.

 Synchronization: Ensures all routers have consistent LSDB through the synchronization
protocol.

3️⃣ Routing Table (Shortest Path Calculation)

 Metric: Uses fixed values based on bandwidth to determine link cost.

 Calculation: Runs Dijkstra's algorithm for local shortest path calculation.

66

You might also like