You are on page 1of 35

Routing Information Protocol

(RIP)
NETE0514
Presented by
Dr.Apichan Kanjanavapastit

Intra-and Interdomain Routing
• An internet is divided into autonomous systems. An
autonomous system (AS) is a group of networks and
routers under the authority of a single administration
• Routing inside an autonomous system is referred to as
intradomain routing
• Routing between autonomous system is referred to as
interdomain routing

Popular Routing Protocols




In this chapter, we discuss two intradomain routing protocols:
distance vector and link state
For the interdomain routing protocol, we introduce path vector
Routing Information Protocol (RIP) is the implementation of the
distance vector protocol
Open Shortest Path First (OSPF) is the implementation of the link
state protocol
Border Gateway Protocol (BGP) is the implementation of the path
vector protocol

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 • The table at each node also guides the packets to the desired node by showing the next stop in the route (next-hop routing) .

those directly connected to it .Initialization • At the beginning. each node can know only the distance between itself and its immediate neighbors.

node C does. So if node C shares its routing table with A. . each node shares its routing table with its immediate neighbors periodically and when there is a change.Sharing • The whole idea of distance vector routing is the sharing of information between neighbors • Although node A does not know about node E. node A can also know how to reach node E Note: In distance vector routing.

Updating • When a node receives a 2-column table from a neighbor. Updating takes 3 steps: 1. it needs to update its routing table. The receiving node needs to add the name of the sending node to each row as the 3rd column if the receiving node uses information from any row. The sending node is the next node in the route . The receiving node needs to add the cost between itself and the sending node to each value in the second column 2.

the old one is kept b) If the next-node entry is the same.) 3. Suppose that now there is no path between C and X. For example. The receiving node needs to compare each row of its old table with the corresponding row of the modified version of the received table.Updating (cont. Node A must not ignore this value even though its old entry is smaller. the receiving node chooses the new row. If there is a tie. a) If the next-node entry is different. . node C now advertises this route with a distance of infinity. the receiving node chooses the row with the smaller cost. if node C has previously advertised a route to node X with distance 3.

Updating (cont.) .

A node sends its routing table. This is called a triggered update. A node detects some failure in the neighboring links which results in a distance change to infinity . The change can result from the following.When to Share • • • The table is sent both periodically and when there is a change in the table Periodic Update. in a periodic update. The period depends on the protocol that is using distance vector routing Triggered Update. 1. A node sends its 2-column routing table to its neighbors any time there is a change in its routing table. normally every 30 seconds. A node receive a table from a neighbor resulting in changes in its own table after updating 2.

Initial routing tables in a small  autonomous system .

Final routing tables for the previous figure .

Two-Node Loop Instability • A problem with distance vector routing is instability. which means that a network using this protocol can become unstable .

In this strategy.Solutions to two-node instability • Defining Infinity. Most implementation of the distance vector protocol define the distance between each node to be 1 and define 16 as infinity. the distance vector cannot be used in large systems • Split Horizon. If node B thinks that the optimum route to reach X is via A. instead of flooding the table through each interface. Therefore. it does not need to advertise this piece of information to A. each node sends only part of its table through each interface. .

Solutions to two-node instability (cont.) .

but if the source of information is A. it can replace the distance with infinity as a warning: “Don’t use this value.” .) • Split Horizon and Poison Reverse.Solutions to two-node instability (cont. This strategy is a combination between split horizon and poison reverse where node B can still advertise the value of X. what I know about this route comes from you.

) .Solutions to two-node instability (cont.

Three-Node Instability .

The routers have routing tables. which means the first column defines a network address .Routing Information Protocol (RIP) • • • The Routing Information Protocol (RIP) is an intradomain routing protocol used inside an autonomous system It is a very simple protocol based on distance vector routing RIP implements distance vector directly with some considerations: 1. we are dealing with routers and networks (links). The destination in a routing table is a network. networks don’t 2. In an autonomous.

Routing Information Protocol (RIP) (cont. The metric used by RIP is the number of links that have to be used to reach the destination which is called hop count Infinity is defined as 16 The next node column defines the address of the router to which the packet is to be sent to reach its destination . 4. 5.) 3.

RIP Message Format .

• Network address. • Distance. This 32-bit field defines the hop count from the advertising router to the destination network .) • Command. RIP has allocated 14 bytes for this field to be applicable to any protocol.RIP Message Format (cont. For TCP/IP the value is 2. This 8-bit defines the version. In the textbook. This 8-bit field specifies the type of message: request (1) or response (2) • Version. This 16-bit field defines the family of the protocol used. we use version 1 • Family.

A solicited response is sent only in answer to a request. An unsolicited response is sent periodically. A request can ask about specific entries or all entries • Response.Request and Response • Request. A request message is sent by a router that has just come up or by a router that has some time-out entries. It contains information about the destination specified in the corresponding request. every 30 s or when there is a change in the routing table .

Request Messages .

.Example 1 What is the periodic response sent by router  R1?  Assume  R1  knows  about  the  whole  autonomous system.

0.0.2.  and  144.2.7.  The  periodic  response  (update packet) is shown below.  144.0.9.12.2.Solution R1  can  advertise  three  networks  144. .

0. See Next Slide . The message is sent out of interface 130.8.11 shows the update message sent from router R1 to router R2 in Figure 14.10.Example 2 Figure 14.2.

2. The figure also shows the table extracted from the message. 195. .6.5. it replaces the actual value of the hop counts for these three networks with 16 (infinity) to prevent any confusion for R2.0.2. When R1 sends an update message to R2.10.The message is prepared with the combination of split horizon and poison reverse strategy in mind.4. Router R1 has obtained information about networks 195. and 195. Router R2 uses the source address of the IP datagram carrying the RIP message from R1 (130.0.2.0 from router R2.02) as the next hop address.

The periodic timer controls the sending of messages. and the garbage collection timer advertises the failure of a route . the expiration timer governs the validity of a route.Timer in RIP • RIP uses 3 timers.

Periodic Timer • The periodic timer controls the advertising of regular update messages • The working model uses a random number between 25 and 30 s • This is to prevent any possible synchronization and therefore overload on an internet if routers update simultaneously .

Expiration Timer • The expiration timer governs the validity of a route • When a router receives update information for a route. which means the destination is unreachable . the hop count of the route is set to 16. 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 • If the timer is expired.

the router does not immediately purge that route from its table • Instead.Garbage Collection Timer • When the information about a route becomes invalid. it continues to advertise the route with a metric value of 16 • At the same time. the route is purged from the table . the garbage collection timer is set to 120 s for that route • When the count reaches zero.

It does not receive information about five routes for 200 s.Example 3 A routing table has 20 entries. How many timers are running at this time? Solution The 21 timers are listed below: Periodic timer: 1 Expiration timer: 20 − 5 = 15 Garbage collection timer: 5 .

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 .

8 Message Format 16 COMMAND (1-5) 24 VERSION (2) 31 AS NUMBER FFFF AUTHENTICATION TYPE AUTHENTICATION HEADER FAMILY OF NET 1 MUST BE ZERO ADDRESS OF NET 1 MASK NEXT HOP DISTANCE TO NET 1 ………… • • • Route tag. This means that RIP2 supports classless addressing and CIDR Next-hop address. If the sending router want to specify another router IP address to be the next hop router. 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. This field carries information such as the autonomous system number. .