0% found this document useful (0 votes)
29 views

Ch6 - Part1

RIP is an intradomain routing protocol that uses distance vector routing. It uses hop count as its metric and defines infinity as 16 hops. RIP routers periodically share their routing tables with neighbors to update paths, and send updates in response to requests from other routers. The periodic timer controls how often updates are sent, while the expiration timer determines how long routes are kept before being removed from the table.

Uploaded by

Ibrahem Ahmad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

Ch6 - Part1

RIP is an intradomain routing protocol that uses distance vector routing. It uses hop count as its metric and defines infinity as 16 hops. RIP routers periodically share their routing tables with neighbors to update paths, and send updates in response to requests from other routers. The periodic timer controls how often updates are sent, while the expiration timer determines how long routes are kept before being removed from the table.

Uploaded by

Ibrahem Ahmad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

Unicast Routing Protocols

(RIP, OSPF, and BGP)

Chapter 7

Eng. Ahmad Elsamak


Routing Protocols

 An internet is a combination of networks connected by


routers
A metric is a cost assigned for passing through a
network.
the total metric of a particular route is equal to the sum of the
metrics of networks that comprise the route.
the router chooses the route with the shortest (smallest)
metric
Static and Dynamic tables
A static table: is one with manual entries.
A dynamic table: is one that is updated automatically when there is
a change somewhere in the internet.
 Routing Protocol: is combination of rules and procedures
lets routers in internet inform each other of route changes.
2
Routing Protocols

Because an internet can be so large, one routing


protocol cannot handle the task of updating routing
tables of all routers.

 So, an internet is divided into autonomous systems.

Autonomous System (AS): is group of networks and


routers under authority of single administration.

Intradomain routing: is routing inside AS


Handled by interior routing protocol

Interdomain routing: is routing between AS’s


Handled by exterior routing protocol
3
Autonomous Systems

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

 Distance Vector Routing


each router periodically shares its knowledge about the entire
internet with neighbors
the operational principles of this algorithm
1. Sharing knowledge about the entire autonomous system
2. Sharing only with neighbors
3. Sharing at regular intervals (ex, every 30 seconds) and when there is
a change

6
Bellman-Ford Algorithm

1. The shortest distance and the cost between a node


and itself is initialized to 0

2. The shortest distance between a node and any other


node is set to infinity. The cost between a node and
any other node should be given(can be infinity if the
nodes are not connected).

3. The algorithm repeat until there is no more change in


the shortest distance vector

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

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).

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

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
16
the meantime, chaos!
Solutions to 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)

 Intradomain routing protocol


 Based on distance vector routing
 Uses hop count as metric (cost)
 Infinite distance defined as 16 hops

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.

 Response (Update) Message


 A response message is sent in answer to a request

 Solicited response: sent only in answer to request


 Unsolicited response: sent periodically (every 30 sec)

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.

The message is prepared with the combination of split horizon and


poison reverse strategy in mind. Router R1 has obtained information
about networks 195.2.4.0, 195.2.5.0, and 195.2.6.0 from router R2.
When R1 sends an update message to R2, it replaces the actual
value if the hop counts for these three networks with 16 (infinity) to
prevent any confusion for R2. The figure also shows the table
extracted from the message. Router R2 uses the source address of
the IP datagram carrying the RIP message from R1 (130.10.02) as
the next hop address. Router R2 also increments each hop count by
1 because the values in the message are relative to R1, not R2

23
Update Message – Example

Update message
from R1 to R2:

24
RIP Timers

 Periodic timer: How frequent to send update message


 Expiration timer: How long to wait for update message
 Garbage collection timer: How long to wait before
purging route from table

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

Garbage Collection Timer


When the information about a route becomes invalid, the router does not
immediately purge that route from its table. Instead, it continues to advertise the
route with a metric value of 16. At the same time, a timer called the garbage
collection timer is set to 120 s for that route. When the count reaches zero, the route
is purged from the table. This timer allows neighbours to become aware of the
invalidity of a route prior to purging.

27
RIP Version 2

• RIP version 2 was designed to overcome some of the shortcomings of version 1.


• The designers of version 2 have not augmented the length of the message for each entry.
• They have only replaced those fields in version 1 that were filled with 0s for the TCP/IP
protocol with some new fields.
• Message Format
• Figure slide 29 shows the format of a RIP version 2 message. The new fields of this
message are as follows:
• ❑ Route tag. This field carries information such as the autonomous system number. It can
be used to enable RIP to receive information from an interdomain routing protocol.
• ❑ Subnet mask. This is a 4-byte field that carries the subnet mask (or prefix). This means
that RIP2 supports classless addressing and CIDR.
• ❑ Next-hop address. This field shows the address of the next hop. This is particularly
useful if two autonomous systems share a network (a backbone, for example). Then the
message can define the router, in the same autonomous system or another autonomous
system, to which the packet next goes.

28
RIP Version 2

 Message Format

Route tag: AS number

 Uses all-router multicast address to send RIP Messages


 Supports classless addressing

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

RIP messages encapsulated in UDP datagrams

 UDP uses well-known port (520) for RIP

IP datagram
UDP datagram
IP UDP
RIP message
header header
20 bytes 8bytes

32

You might also like