- Routing protocols allow routers to learn the best paths to different networks. Routers use routing tables to store this path information.
- Dynamic routing protocols allow routers to automatically share routing information with each other. This allows the routers to adapt to network changes. RIP is an example of a dynamic distance vector routing protocol.
- With RIP, each router sends its full routing table to neighboring routers every 30 seconds. The routers use the hop count as the routing metric to determine the best path. The maximum hop count allowed is 15.
2. Introduction
• The term “routing” refers to taking a packet from one device and
sending it through the network to other device on a different
network.
• Routers don’t really care about hosts------they only care about
networks and the best path to each one of them.
• The logical network address of the destination host is key to get
packets through a routed network.
• It’s the hardware address of the host that’s used to deliver he packet
from a router and ensure it arrives at the correct destination host.
3. Minimum factors a router must know
• Here is an important list of the minimum factors a router must know
to be able to affectively route packets:
• Destination Logical Address
• Neighbor routers from which it can learn about remote networks
• Possible routes to all remote networks
• The best route to each remote network
• How to maintain and verify routing information.
• The router learns about remote networks from neighboring routers or
from an administrator.
• The router then builds a routing table, which is basically a map of the
internetwork, and it describes how to find remote networks.
4. Routing…
• If a network is directly connected, then the router already knows how to get to it.
• But if a network is not directly connected to the router, the router must use one
of two ways to learn how to get to the remote network.
• The static routing method requires someone to hand-type all network locations
into the routing table.
• But when dynamic routing is used, a protocol on one router communicates with
the same protocol running on neighboring routers.
• The routers then update each other about all the networks they know about and place this
information into the routing table.
• If a change occurs in the network, the dynamic routing protocols automatically
inform all routers about the event.
• If static routing is used, the administrator is responsible fro updating all changes
by hand onto all routers.
5. TCP/IP Protocol Suite 5
Figure:1 Autonomous systems
An autonomous system is a set of networks and routers under
the control of a single administrative authority.
Routing within an autonomous system is intradomain routing.
Routing between autonomous systems is interdomain routing.
7. TCP/IP Protocol Suite 7
DISTANCE VECTOR ROUTING
• In distance vector routing, the least cost route between any two nodes is the
route with minimum distance.
• In this protocol each node maintains a vector (table) of minimum distances
to every node
• Routers using distance-vector protocol do not have knowledge of the entire path to
a destination.
• Instead they use two methods:
1. Direction in which router or exit interface a packet should be forwarded.
2. Distance from its destination
• Distance-vector protocols are based on calculating the direction and distance to any
link in a network.
• "Direction" usually means the next hop address and the exit interface.
• "Distance" is a measure of the cost to reach a certain node.
• The least cost route between any two nodes is the route with minimum distance.
• Each node maintains a vector (table) of minimum distance to every node.
• The cost of reaching a destination is calculated using various route metrics.
• RIP uses the hop count of the destination whereas IGRP takes into account other
information such as node delay and available bandwidth.
8. TCP/IP Protocol Suite 8
Figure 14.4 Initialization of tables in distance vector routing
In distance vector routing, each node shares its table with
its immediate neighbor periodically (eg every 30s) and when
there is a change.
10. TCP/IP Protocol Suite 10
Figure.4 Updating in distance vector routing
Step 1: Add cost (2) to table received from neighbor (C).
Step 2: Compare Modified Table with Old Table (row by row).
If Next node entry is different, select the row with the smaller
cost. If tie, keep the old one.
If Next node entry the same, select the new row value (regard-
less of whether new value is smaller or not).
11. TCP/IP Protocol Suite 11
Figure 5 Two-node instability – what can happen with distance vector routing
Both A and B know
where X is.
Link between A and X
fails. A updates its
table immediately.
But before A can tell B,
B sends its info to A!
A, using B’s info, up-
dates its table (error!).
Then A send its table
to B and B updates its
table (more error).
Both routers keep up-
dating tables, event-
ually hitting infinity. In
the meantime, chaos!
12. TCP/IP Protocol Suite 12
Two-node instability – what can happen with distance vector routing
Possible Solutions to two-node instability:
1. Define infinity to be a much smaller value, such as 100.
Then it doesn’t take too long to become stable.
2. Split Horizon – instead of flooding entire table to each
node, only part of its table is sent. More precisely, if node
B thinks that the optimum router to reach X is via A, then
B does not need to advertise this piece of info to A – the
info has already come from A.
3. Split Horizon and Poison Reverse – Normally, the distance
vector protocol uses a timer. If there is no news about a
route, the node deletes the route from its table. So when A
never hears from B about the route to X, it deletes it.
Instead, Node B still advertises the value for X, but if the
source of info is A, it replaces the distance with infinity,
saying “Do not use this value; what I know about this route
comes from you.”
14. TCP/IP Protocol Suite 14
RIP
• The Routing Information Protocol (RIP) is an intra domain routing
protocol used inside an autonomous system.
• It is a very simple protocol based on distance vector routing.
• RIP prevents routing loops by implementing a limit on the number of
hops allowed in a path from the source to a destination.
• The maximum number of hops allowed for RIP is 15.
• This hop limit, however, also limits the size of networks that RIP can
support.
1) RIPv1 is Classful routing protocol and RIPv2 Classless routing protocol.
2) In RIPv1, subnet masks are NOT included in the routing update and In
RIPv2 Subnet masks are included in the routing update.
• RIPv2 supports CIDR supernets, VLSM and discontiguous networks.
15. TCP/IP Protocol Suite 15
Figure 14.8 Example of a domain using RIP
Note the
metric used
here for Cost
is simply the
hop count.
16. • Originally each RIP router transmitted full updates within every 30
seconds to all the routers in the network.
• In the early deployments, routing tables were small enough that the
traffic was not significant.
• As networks grew in size, it became evident that there could be
massive traffic burst in every 30 seconds even if the router had been
initialized at random times.
• RIP uses UDP as transport protocol and assigned a reserved port
number 520
17. RIP Version 1
• Version 1 is the most-deployed version as it is compatible with all RIP-
capable devices.
• The periodic routing updates do not carry subnet information as it
does not support VLSM
• Therefore, any IP address is treated as classful address
• This limitation makes it impossible to have different-sized subnets
inside the same network class.
• In other words, all subnets in a subnet class must have the same size.
• There is also no support for router authentication, making RIP
vulnerable to various attack.
18. RIP Version 2
• Developed in 1993
• Last standardized in 1998
• Ability to carry subnet information
• To maintain backward compatibility, the hop count limit of 15 remained.
• RIPv2 multicasts the entire routing table to all adjacent routers at the address
224.0.0.9
• In RIP, routing updates are exchanged between neighbors approximately every
30 seconds using a RIP response message.
• The response message sent by a router or host contains a list of up to 25
destination subnets within the AS, as well as the sender’s distance to each of
those subnets.
• Response messages are also known as RIP advertisements.
19. Network Layer 4-19
RIP ( Routing Information Protocol)
Consider the portion of an AS shown in Figure.
In this figure, lines connecting the routers denote subnets.
Only selected routers (A, B, C, and D) and subnets (w, x, y, and z) are labeled.
Dotted lines indicate that the AS continues on; thus this autonomous system has many more
routers and links than are shown
Each router maintains a RIP table known as a routing table. A router’s routing table includes both
the router’s distance vector and the router’s forwarding table
D
C
B
A
u v
w
x
y
z
subnet hops
u 1
v 2
w 2
x 3
y 3
z 2
from router A to destination subnets:
20. Network Layer 4-20
RIP: example
destination subnet next router # hops to dest
w A 2
y B 2
z B 7
x -- 1
…. …. ....
routing table in router D
w x y
z
A
C
D B
• The routing table
has three
columns.
• The first column
is for the
destination
subnet,
• The second
column indicates
the identity of
the next router
along the
shortest path to
the destination
subnet,
• And the third
column indicates
the number of
hops to get to the
destination
subnet
21. RIP Example
• Now suppose that 30 seconds later, router D receives from router A the
advertisement.
• Note that this advertisement is nothing other than the routing table
information from router A!
• This information indicates, in particular, that subnet z is only four hops
away from router A.
• Router D, upon receiving this advertisement, merges the advertisement
with the old routing table
• In particular, router D learns that there is now a path through router A to
subnet z that is shorter than the path through router B.
• Thus, router D updates its routing table to account for the shorter shortest
path.
22. Network Layer 4-22
w x y
z
A
C
D B
destination subnet next router # hops to dest
w A 2
y B 2
z B 7
x -- 1
…. …. ....
routing table in router D
A 5
dest next hops
w - 1
x - 1
z C 4
…. … ...
A-to-D advertisement
RIP: example
23. Network Layer 4-23
RIP: link failure, recovery
if no advertisement heard after 180 sec -->
neighbor/link declared dead
routes via neighbor invalidated
new advertisements sent to neighbors
neighbors in turn send out new advertisements (if tables
changed)
poison reverse used to prevent ping-pong loops (infinite
distance = 16 hops)