Ch6 - Part1
Ch6 - Part1
Chapter 7
4
Routing Protocols
5
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 table of minimum distances to every node
The table at the each node also guides the packet to the desired
node by showing the next-hop routing
6
Bellman-Ford Algorithm
7
Bellman-Ford Algorithm
8
Distance Vector Routing Algorithm
1. In distance vector routing, the cost is normally hop counts. So the cost between any
two neighbors is set to 1.
2. Each router needs to updates its routing table asynchronously, where it has received
some information from its neighbors. In other words, each router executes part of the
whole algorithm in the Bellman-Ford algorithm. Processing is distributive
3. After a router has updated its routing table, it should send the result to its neighbor so
that they can also update their routing table
4. Each router should keep at least three pieces of information for each route:
destination network, the cost, and the next hop. We refer to the whole routing table
as Table, to the row i in the table as Tablei, to the three columns in row i as
Tablei.dest, Tablei.cost, and Tablei.next.
5. We refer to information about each route received from a neighbor as R, which has
only two piece of information : R.dest and R.cost. The next hop is not included in the
received record because it is the source address of the sender.
9
Distance Vector Routing Algorithm
10
Distance Vector Routing Algorithm
11
Distance Vector Routing Algorithm
12
Distance Vector Routing
Example 11.1
Figure shows the initial routing table for an AS. Note that the figure does not mean
that all routing tables have been created at the same time; each router creates its
own routing table when it is booted.
13
Distance Vector Routing
Example 11.2
Now assume router A sends four records to its neighbors, routers B, D, and C.
Figure shows the changes in B’s routing table when it receives these records. We
leave the changes in the routing tables of other neighbors as exercise.
14
Distance Vector Routing
Example 11.3
Figure shows the final routing tables for routers in slide 10
15
Count to Infinity -- Two-Node Instability
Defining Infinity
Define 16 as infinity
Split Horizon
If node B reaches X via A, then B does not
need to advertise to A its (B's) distance to X
Split Horizon and Poison Reverse
If node B reaches X via A, then B will
advertise to A that its (B's) distance to X is
infinity
17
Three-Node Instability-no solutions here
18
Routing Information Protocol (RIP)
19
Example of a domain using RIP
20
RIP Message Format
Command. This 8-bit field specifies the type of message: request (1) or response (2).
Version. This 8-bit field defines the version. In this book we use version 1, but at the end
of this section, we give some new features of version 2.
Family. This 16-bit field defines the family of the protocol used. For TCP/IP the value is 2.
Network address. The address field defines the address of the destination network. RIP
has allocated 14 bytes for this field to be applicable to any protocol. However, IP currently
uses only 4 bytes. The rest of the address is filled with 0s.
Distance. This 32-bit field defines the hop count (cost) from the advertising router to the
destination network.
Note that part of the message is repeated for each destination network. We refer to this as
an entry.
21
Requests and Responses
Request Message
A request message is sent by a router that has just come up or by
a router that has some time-out entries.
22
Update Message – Example
Figure in next slide shows the update message sent from router
R1 to router R2 in Figure slide 17 The message is sent out of
interface 130.10.0.2.
23
Update Message – Example
Update message
from R1 to R2:
24
RIP Timers
25
RIP Timers
Periodic Timer
The periodic timer controls the advertising of regular update messages. Although the
protocol specifies that this timer must be set to 30 s, the working model uses a
random number between 25 and 35 s. This is to prevent any possible synchronization
and therefore overload on an internet if routers update simultaneously.
Each router has one periodic timer that is randomly set to a number between 25 and
35. It counts down; when zero is reached, the update message is sent, and the timer is
randomly set once again.
Expiration Timer
The expiration timer governs the validity of a route. When a router receives update
information for a route, the expiration timer is set to 180 s for that particular route.
Every time a new update for the route is received, the timer is reset. In normal
situations this occurs every 30 s. However, if there is a problem on an internet and no
update is received within the allotted 180 s, the route is considered expired and the
hop count of the route is set to 16, which means the destination is unreachable. Every
route has its own expiration timer.
26
RIP Timers
27
RIP Version 2
28
RIP Version 2
Message Format
29
RIP Version 2
• Classless Addressing
• Probably the most important difference between the two versions of RIP is classful
versus classless addressing. RIPv1 uses classful addressing. The only entry in the
message format is the network address (with a default mask). RIPv2 adds one field
for the subnet mask, which can be used to define a network prefix length. This
means that in this version, we can use classless addressing. A group of networks can
be combined into one prefix and advertised collectively.
• Multicasting
• Version 1 of RIP uses broadcasting to send RIP messages to every neighbour. In this
way, all the routers on the network receive the packets, as well as the hosts. RIP
version 2, on the other hand, uses the all-router multicast address to send the RIP
messages only to RIP routers in the network.
30
RIP Version 2
Supports authentication
• Authentication
• Authentication is added to protect the message against unauthorized advertisement.
No new fields are added to the packet; instead, the first entry of the message is set
aside for authentication information. To indicate that the entry is authentication
information and not routing information, the value of FFFF16 is entered in the family
field (see Figure below). The second field, the authentication type, defines the
protocol used for authentication, and the third field contains the actual authentication
data.
31
Encapsulation
IP datagram
UDP datagram
IP UDP
RIP message
header header
20 bytes 8bytes
32