Module5 Part1

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 26

Networks and

communication
Module 5
Routing protocols (Part 1)
Outline
• Routing
• Routing Protocols
• Classification of Routing Protocols
• Distance Vector Routing
• Example

2
Routing -Introduction
• What is Routing in Networks?
– A Routing is a process of selecting path along which the data
can be transferred from source to the destination in a
network or between or across multiple networks.
– Routing is performed by a special device known as a router.
Networking device that forwards the packet based on the
information available in the packet header and forwarding
table.
– Router works at the network layer in the OSI model and
internet layer in TCP/IP model.
– Routing algorithms (Software)- Used for routing the packets. 3
Routing -Introduction
• Routing protocols - use the metric to determine the
best path for the packet delivery. The metric is the
standard of measurement such as hop count,
bandwidth, delay, current load on the path, etc. used
by the routing algorithm to determine the optimal
path to the destination.
• The routing algorithm initializes and maintains the
routing table for the process of path determination.
4
Types of routing
• Static routing table- It is created, maintained, and
updated by a network administrator, manually.
• Default Routing- It is a technique in which a router is
configured to send all the packets to the same hop
device, and it doesn't matter whether it belongs to a
particular network or not. A Packet is transmitted to the
device for which it is configured in default routing.
• A dynamic routing table is created, maintained, and
updated by a routing protocol running on the router.
5
Routing Protocols
The purpose of any routing protocol is
– to dynamically communicate information about
all network paths used to reach a destination
– to select the best path to reach a destination
network.

6
Classification of Routing Protocol

7
Distance Vector Routing
• Completely decentralized
• No node has complete information about the
costs of all network links
• Gradual calculation of path by exchanging
information with neighbors

8
Specifics
• Each node constructs a one-dimensional array (Vector)
containing the “distances” or “costs” to all other nodes (as it
relates to its knowledge) and distributes it to its immediate
neighbors.
• Key thing -- each node knows the cost of links to its
neighbors.
• If no link exists between two nodes, the cost of a direct link
between the nodes is “infinity”.
9
An Example
B A B C D E
E
A

D
A 0 1 1 1 ∞
C
B 1 0 ∞ 1 1
C 1 ∞ 0 1 ∞
• Internal Information at each
node -----> D 1 1 1 0 1
E ∞ 1 ∞ 1 0
10
Routing Tables

B
E
Cost Next
Hop
A

D
B 1 B
C
C 1 C
D 1 D
• With this information,
E ∞ -
routing table at A is -->
11
Evolution of the table.
– Each node sends a message to
neighbors with a list of
distances (From Node A to Cost Next
others). Hop
– B --> A with E at distance 1.
B
B 1 B
C 1 C
E
A

D D 1 D
C E 2 B
12
Final Distance Matrix

B A B C D E
E
A 0 1 1 1 2
A

D B 1 0 2 1 1
C C 1 2 0 1 2
D 1 1 1 0 1
E 2 1 2 1 0
13
Convergence
• In the absence of topological changes -- few exchanges
between neighbors before complete routing table is
formed.
• This table is consistent.
• Convergence is achieved.
• Notice -- no centralized authority

14
Routing updates
• When are routing updates sent ?
1. Periodic updates
– Even if nothing has changed, send periodically. Main reason
is to let other nodes know that the sender is alive.
– Refresh information that might be needed if some of the
routes were to become unavailable.
2. Triggered updates
– When a node receives an update from one of its neighbors
which may lead to a change in its routing tables (could be
due to change in link cost).
Note: typically order of periodicity is seconds to several minutes.
15
Link/Node Failures
• Nodes that first notice send new lists of distances to
neighbors.
• How do they detect failures ?
– Route updates don’t arrive
– Probing with test packets.

16
Example
– Let link from B to E fail.
– B sets new distance to E to ∞;
sends update to A and D .
– A was initially routing to E via B.
So it now sets link cost to E to ∞. B
E
– Next update from D; A learns that A

D has 1 hop path to E. D

– A now can reach E in 2 hops via C


D.
– A sends an update to B. Thus, B
now, can reach E via D in 2 hops. 17
Count to Infinity
– For eg:
• A discovers that link to E is lost.
– If before A’s message (saying that
link cost to E is ∞) is received, if B or • The process continues and thus,
the system does not stabilize.
C advertise that they can reach E in
two hops, then A can be confused. • This is the count to infinity
problem.
– Another possibility, B gets A’s
B
update followed by C’s update which
says that E is reachable in 2 hops. A
C

– So B tells A this, and A thinks it can


now reach E via B in 3 hops. E

– This information reaches C who now


thinks that it can reach E in 4 hops
via A.
18
Split Horizon
– One solution would be to approximate ∞ to say 10 hops.
– With Split Horizon, when a node sends a routing table update to its
neighbors, it “does not” send those routes it learned from “a particular”
neighbor, back to that neighbor.
• For example, B had E, 2, A. When it sends a route update to A, it
does not include this.
– With split horizon with poison reverse, this update is reported but the
link weight is set to ∞.
– For example B sends (E, ∞) to A.

19
Does this work ?
• Typically, in static networks where link failures/node failures are rare,
this may be enough.
• Speed of convergence is why, link state routing may be preferable -- it
takes a while before routes converge.

20
Purging routing entries
• Each routing entry has a time-to-live (or TTL)
field.
• A counter -- initially set to MaxTTL.
• This is then decremented and if TTL = 0, then,
time to purge the entry.

21
Routing Information Protocol (RIP)

• Built based on distance vector routing.


• In the Internet, goal of routers is to learn how
to forward packets to various networks.

22
An Example of RIP
– Routers advertise the cost
of reaching networks. 1 4

– In this example, C’s update


to A would indicate that C A B
2 5
can reach Networks 2 and 3
with cost 0, Networks 5 and C D
6 with cost 1 and Network 4 3 6
with cost 2.

23
Other RIP Details
• Routing tables are exchanged every 30 seconds
using the RIP advertisement.
• If a router does not hear from its neighbor
once every 180 seconds, the neighbor is
deemed unreachable.
• The router that detects this will modify its
routing table and propagate the information.

24
RIP implementation
• RIP packets are sent using UDP.
• Typically, there is a routing daemon
(routed) that is an application layer
process that provides access to routing
tables.
• Allows for the access of the tables.

25
Thank You

26

You might also like