Network Layer
-
Interior Gateway Protocols
Dr. Alexios Louridas
What are we going to see?

- Routers = {A,B,C,D,E,F}
- Links = {(A,B),(A,D),(B,C),(D,E),(D,C),(C,F),(E,F)}
- Cost of Link (example) = c(A,B) = 5
- Cost can be related to bandwidth, throughput, congestion, delay...
- Cost of Path (A,B,C,F) (example)= c(A,B)+c(B,C)+c(C,F)
Network Graphs
What is the least-cost path between A and F?
Routing algorithms are responsible to answer the question

Dynamic Routing Protocol Overview
Routing within autonomous systems (group of networks under a single administration) are referred as interior gateway protocols, whereas routing between autonomous systems are referred as exterior gateway protocols.
RIP protocol was updated to RIPv2 to accommodate growth in the network environment
RIPv2 does not scale to current larger network implementations
Routing Protocols developed to meet the need of larger networks include:
Open Shortest Path First (OSPF)
Intermediate System-to-Intermediate System (IS-IS).
Enhanced IGRP (EIGRP)
Border Gateway Protocol (BGP) is used between Internet service providers (ISPs)
The Bellman-Ford algorithm’s primary principle is that it starts with a single source and calculates the distance to each node. The distance is initially unknown and assumed to be infinite, but as time goes on, the algorithm relaxes those paths by identifying a few shorter paths. Hence it is said that Bellman-Ford is based on “Principle of Relaxation“.
Bellman-Ford equation
cost from neighbour v to destination y
cost to neighbour v
minimum taken over all neighbours v of x

Distance Vector Routing
In Distance Vector Routing, each router periodically shares its knowledge about the entire internet with its neighbours.
-
Sharing knowledge about the entire autonomous system. Each router shares its knowledge about the entire AS with its neighbours. At the outset, a router's knowledge may be sparse. How much it knows , however, is unimportant; it sends whatever it has.
-
Sharing only with neighbours. Each router shares its knowledge about the entire AS with its neighbours. At the outset, a router's knowledge may be sparse. How much it knows , however, is unimportant; it sends whatever it has.
- Sharing at regular intervals. Each router shares its knowledge to its neighbours at fixed intervals, for example, every 30 seconds.
-
Each node constructs a one-dimensional array (a vector) containing the "distances" (costs) to all other nodes and distributes that vector to its immediate neighbours.
-
The starting assumption for distance-vector routing is that each node knows the cost of the link to each of its directly connected neighbours.
-
These costs may be provided when the router is configured by a network manager. A link that is down is assigned an infinite cost.
RIP (Routing Information Protocol)

| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| A | 0 | 1 | 1 | Inf | 1 | 1 | Inf |
| B | 1 | 0 | 1 | Inf | Inf | Inf | Inf |
| C | 1 | 1 | 0 | 1 | Inf | Inf | Inf |
| D | Inf | Inf | 1 | 0 | Inf | Inf | 1 |
| E | 1 | Inf | Inf | Inf | 0 | Inf | Inf |
| F | 1 | Inf | Inf | Inf | Inf | 0 | 1 |
| G | Inf | Inf | Inf | 1 | Inf | 1 | 0 |
Initial Distances Stored at Each Node
-
Add one hop to the hop count for each advertised destination.
-
Repeat the following steps for each advertised destination:
-
If (destination not in the routing table)
-
Add the advertised information to the table.
-
-
Else
-
If (next-hop field is the same)
-
Replace entry in the table with the advertised one.
-
-
Else
-
If (advertised hop count smaller than one in the table)
-
Replace entry in the routing table.
-
-
-
-
-
Return
RIP Updating Algorithm
-
Routers send their advertisements every 30 seconds;
-
A router also sends an update message whenever an update from another router causes it to change its routing table.
-
One point of interest is that it supports multiple address families, not just IP. RIP version 2 (RIPv2) also introduced the subnet masks, whereas RIP version 1 worked with the old classful addresses of IP.
-
All link costs are equal to 1, just as in our example. Thus, it always tries to find the minimum hop route. Valid distances are 1 through 15, with 16 representing infinity. This also limits RIP to running on fairly small networks—those with no paths longer than 15 hops.
RIP (Routing Information Protocol)

| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| A | 0 | 1 | 1 | 2 | 1 | 1 | 2 |
| B | 1 | 0 | 1 | 2 | 2 | 2 | 3 |
| C | 1 | 1 | 0 | 1 | 2 | 2 | 2 |
| D | 2 | 2 | 1 | 0 | 3 | 2 | 1 |
| E | 1 | 2 | 2 | 3 | 0 | 2 | 3 |
| F | 1 | 2 | 2 | 2 | 2 | 0 | 1 |
| G | 2 | 3 | 2 | 1 | 3 | 1 | 0 |
Final Distances Stored at Each Node
Two-Node Loop Instability
Distant Vector (DV) Tables can be wrong

Before Failure
| D | HC | NR |
|---|---|---|
| X | 1 | A |
| D | HC | NR |
|---|---|---|
| X | 2 | A |

AftEr Failure
| D | HC | NR |
|---|---|---|
| X | Inf |
| D | HC | NR |
|---|---|---|
| X | 2 | A |

AftEr A received Update from B
| D | HC | NR |
|---|---|---|
| X | 3 | B |
| D | HC | NR |
|---|---|---|
| X | 2 | A |

AftEr B Receives update from A
| D | HC | NR |
|---|---|---|
| X | 3 | B |
| D | HC | NR |
|---|---|---|
| X | 4 | A |

Finally
| D | HC | NR |
|---|---|---|
| X | Inf |
| D | HC | NR |
|---|---|---|
| X | Inf |
Three-Node Loop Instability

Before Failure
| D | HC | NR |
|---|---|---|
| X | 1 | A |
| D | HC | NR |
|---|---|---|
| X | 2 | A |
| D | HC | NR |
|---|---|---|
| X | 2 | A |

After A send the route to B and C, but the packet to C is lost
| D | HC | NR |
|---|---|---|
| X | Inf |
| D | HC | NR |
|---|---|---|
| X | Inf |
| D | HC | NR |
|---|---|---|
| X | 2 | A |

After C send the route to B
| D | HC | NR |
|---|---|---|
| X | Inf |
| D | HC | NR |
|---|---|---|
| X | 3 | C |
| D | HC | NR |
|---|---|---|
| X | 2 | A |

After B sends the route to A
| D | HC | NR |
|---|---|---|
| X | 4 | B |
| D | HC | NR |
|---|---|---|
| X | 3 | C |
| D | HC | NR |
|---|---|---|
| X | 2 | A |
Solution - Split Horizon
- The split horizon rule prevents routers from advertising a route back to the same neighbour from which they received it.
- Specifically, if a router learns a route from a neighbour, it does not advertise that route back to the same neighbour.
- This avoids loops caused by using the same route in both directions.
-
When a route fails, distance vector protocols spread the news about the route failure by poisoning the route.
-
Route poisoning involves advertising the failed route with a special metric value called Infinity (e.g., RIP defines infinity as 16).
-
Routers consider routes advertised with an infinite metric as failed and avoid using them.
-
This prevents routers from endlessly updating each other with incorrect information.
solution - Route Poisoning


Solution - Holddown Timers
-
Holddown timers prevent rapid route changes due to transient issues.
-
When a router detects a route failure, it starts a timer.
-
During this time, the router ignores any updates related to the failed route unless it receives an update from the router of that downed link.
-
After the timer expires, the router can update its routing table.
-
RIPv2 has some Link State characteristics
-
RIPv2 supports classless routing
-
RIPv2 supports Authentication
Main differences


-
RIP has a limit of 15 hops. A network that spans more than 15 hops (15 routers) is considered unreachable.
-
RIP cannot handle Variable Length Subnet Masks (VLSM). Given the shortage of IP addresses and the flexibility VLSM gives in the efficient assignment of IP addresses, this is considered a major flaw.
-
Periodic broadcasts of the full routing table consume a large amount of bandwidth. This is a major problem with large networks especially on slow links and WAN clouds.
-
RIP converge is slower than OSPF. In large networks convergence gets to be in the order of minutes.
-
RIP routers go through a period of a hold-down and garbage collection and slowly time-out information that has not been received recently. This is inappropriate in large environments and could cause routing inconsistencies.
-
RIP has no concept of network delays and link costs. Routing decisions are based on hop counts. The path with the lowest hop count to the destination is always preferred even if the longer path has a better aggregate link bandwidth and less delays.
-
RIP networks are flat networks. There is no concept of areas or boundaries. With the introduction of classless routing and the intelligent use of aggregation and summarization, RIP networks have fallen behind.
RIP Limitations
OSPF
- With OSPF, there is no limitation on the hop count.
- OSPF uses IP multicast to send link-state updates. This ensures less process resource consumption on routers that do not listen to OSPF packets. Updates are only sent in case routing changes occur instead of periodically. This ensures efficient bandwidth.
- OSPF has better convergence than RIP. This is because routing changes are propagated instantaneously and not periodically.
- OSPF allows for better load balancing.
- OSPF allows for a logical definition of networks where routers can be divided into areas. This limits the explosion of link state updates over the whole network. This also provides a mechanism to aggregate routes and decrease the unnecessary propagation of subnet information.
- OSPF allows for routing authentication through different methods of password authentication.
- OSPF allows for the transfer and tagging of external routes injected into an Autonomous System. This keeps track of external routes injected by exterior protocols such as BGP.

Reliable Flooding
Flooding of link-state packets.
(a) LSP arrives at node X;
(b) X floods LSP to A and C;
(c) A and C flood LSP to B (but not X);
(d) flooding is complete
| Step | Confirmed | Tentative | Comments |
|---|---|---|---|
| 1 | (D,0,--) | Since D is the only new member of the confirmed list, look at its LSP. | |
| 2 | (D,0,--) | (B,11,B) (C,2,C) | D's LSP says we can reach B through B at cost 11, which is better than anything else on either list, so put it on Tentative list; same for C. |
| 3 | (D,0,--) (C,2,C) | (B,11,B) | Put lowest-cost member of Tentative (C) onto Confirmed list. Next, examine LSP of newly confirmed member (C). |
| 4 | (D,0,--) (C,2,C) | (B,5,C) (A,12,C) | Cost to reach B through C is 5, so replace (B,11,B). C's LSP tells us that we can reach A at cost 12. |
| 5 | (D,0,--) (C,2,C) (B,5,C) | (A,12,C) | Move lowest-cost member of Tentative (B) to Confirmed, then look at its LSP. |
| 6 | (D,0,--) (C,2,C) (B,5,C) | (A,10,C) | Since we can reach A at cost 5 through B, replace the Tentative entry. |
| 7 | (D,0,--) (C,2,C) (B,5,C) (A,10,C) | Move lowest-cost member of Tentative (A) to Confirmed, and we are all done. |

Example of Building a route table for Link State Routing
Authentication of Routing Messages
Open Shortest Path First Protocol (OSPF)
Additional Hierarchy
Load Balancing
Multiple Cost Metrics
Send information from one node to many other nodes, and the entire network can thus be impacted by bad information from one node. For this reason authenticating routing messages has become very important.
OSPF introduces another layer of hierarchy into routing by allowing a domain to be partitioned into areas. A router within a domain only needs to know how to get to the right area reducing the amount of information in the routing table.
Allows multiple routes to the same place to be assigned the same cost and will cause traffic to be distributed evenly over those routes, thus making better use of the available network throughput.
For each link, multiple cost metrics for different Types of Services (ToS) (e.g., satellite link cost (more delay involved) set low for best effort ToS; high for real-time ToS)
Router# show ip rip database
// Displays all the routes known by RIP
// even routes that are not currently in
// the routing table
Router# show ip protocols
// Displays detailed information about
// dynamic routing processes currently running
// on the router
Router# show ip route 172.16.3.0
// Displays detailed information about the route 172.16.3.0Rip Configuration
Rip Configuration

Router# show ip route 172.16.3.0
// Displays detailed information about the route 172.16.3.0
Enabling RIP
The network network address router configuration mode command:
- Enables RIP on all interfaces that belong to a specific network
- Advertises the network in RIP routing updates sent to other routers every 30 seconds.
Rip Configuration

R1(config)#router rip
R1(config-router)#network 192.168.10.0
R1(config-router)#network 192.168.20.0-
Do a simple design of 4 routers with two Hosts connected at each end. Find a suitable topology
-
Do another network with 16 nodes to prove that RIP fails at 16 hops
Tasks
Network Layer - Routing
By Alexios Louridas
Network Layer - Routing
- 114