Sie sind auf Seite 1von 34

Routing Protocols RIP, OSPF, BGP

By:Prof. Neha M. Srivastava

Introduction
An internet is a combination of networks connected by routers. When a datagram goes from a source to a destination, it will probably pass through many routers until it reaches the router attached to the destination n/w. A router receives a packet from a n/w and passes it to another n/w. A router is usually attached to several n/ws. When it receives a packet, to which n/w should it pass the packet? The decision is based on optimization: which of the available pathway is optimum pathway? A metric is cost assigned for passing through a n/w.
2 T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - Prof. Neha M. Srivastava

Introduction - continued
The total metric of a particular route is equal to the sum of the metrics of n/ws that comprise the route. A router chooses the route with the shortest (smallest) metric. The metric assigned to each n/w depends on the type of protocol. A simple protocol RIP Routing Information Protocol treat each n/w as equal. The cost of passing through the n/w is same; it is one hop count. So if a packet passes through 10 n/w to reach the destination, the total cost is 10 hop counts. Another protocol such as OSPF Open Shortest Path First, allow the administrator to assign a cost for passing through a n/w based on the type of service required.
3 T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - Prof. Neha M. Srivastava

Introduction - continued
A route through a n/w can have different costs (metrics). E.g., if maximum throughput is desired type of service, a satellite link has a lower metric than a fiber-optic line. On the other hand, if minimum delay is desired type of service, a fiberoptic line has a lower metric than a satellite line. OSPF allows each router to have several routing tables based on the required type of service. Other protocols define the metric totally differently. In BGP Border Gateway Protocol, the criterion is policy, which can be set by the administrator. The policy defines what path should be chosen.

4 T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols

- Prof. Neha M. Srivastava

Routing Table
Whatever the metric, a router should have a routing table to consult when a packet is ready to be forwarded. The routing table specifies the optimum path for the packet. However, the table can be either static or dynamic. A static table is one that is not changed frequently. A dynamic table on the other hand, is one that is updated automatically when there is a change somewhere in the internet. Today, an internet needs dynamic routing tables, the tables need to be updated as soon as there is a change in the internet. For e.g., they need to be updated when a route is down, and they need to be updated whenever a better route has been created.
5 T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - Prof. Neha M. Srivastava

Routing Protocols
Routing protocols have been created in response to the demand for dynamic routing tables. A routing protocol is a combination of rules and procedures that lets routers in the internet inform each other of changes. It allows routers to share whatever they know about the internet or their neighborhood. The sharing of information allows a router in San Francisco to know about a failure of a n/w in Texas. The routing protocols also include procedures for combining information received from other routers.
6 T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - Prof. Neha M. Srivastava

Interior and Exterior Routing


Today, an internet can be so large that one routing protocol cannot handle the task of updating routing tables of all routers. For this reason, an internet is divided into autonomous systems. An autonomous system (AS) is a group of n/ws and routers under the authority of a single administrator. Routing inside an autonomous system is referred to as interior routing. Routing between autonomous system is referred to as exterior routing. Each autonomous system can choose an interior routing protocol to handle routing inside the autonomous system. However, only one exterior routing protocol is usually chosen to handle routing between autonomous system.
7 T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - Prof. Neha M. Srivastava

Interior and Exterior Routing continued

Fig: Popular routing protocols Fig: Autonomous System RIP and OSPF can be used to update routing tables inside an autonomous system. BGP can be used to update routing tables for routers that join the autonomous system together. In the fig., above routers R1, R2, R3 and R4 use an interior and an exterior routing protocol. The other routers use only interior routing protocols. The solid thin lines show the communication between routers that use interior routing protocol. The broken thick lines show the communication between the routers that use an exterior routing protocol.
8 T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - Prof. Neha M. Srivastava

RIP Routing Information Protocol


RIP is an interior routing protocol used inside an autonomous system. It is a very simple protocol based on distance vector routing, which uses the Bellman-Ford algorithm for calculating the routing tables. Distance Vector Routing: In distance vector routing, each router periodically shares its knowledge about the entire Internet with its neighbors. The three keys to understand how this algorithm works is as follows: Sharing knowledge about the entire autonomous system: Each router shares its knowledge about the entire AS with its neighbors. At the outset, a routers knowledge may be sparse. How much it knows, however, is unimportant., it sends whatever it has. Sharing only with neighbors: Each router sends its knowledge only to neighbors. It sends whatever knowledge it has through all of its interfaces. Sharing at regular intervals: Each router sends its knowledge to its neighbors at fixed intervals, for e.g. , every 30 sec.
T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - Prof. Neha M. Srivastava

1.

2.

3.

Routing Table
Every router keeps a routing table that has one entry for each destination network of which the router is aware. The entry consists of the destination network address, the shortest distance to reach the destination in hop count, and the next hop (next router) to which the packet should be delivered to reach its final destination. The hop count is the number of networks a packet encounters to reach its final destination. The table may contain other information such as the subnet mask (or prefix), or the time this entry was last updated. Table shows an example of a routing table.
Destination 163.5.0.0 197.5.13.0 Hop Count 7 5 4 6 Next Router 172.6.23.4 176.3.6.17 200.5.1.6 131.4.7.19
- Prof. Neha M. Srivastava

Other information

Table: A distance vector routing table.


10

189.45.0.0 115.0.0.0

T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols

RIP Updating Algorithm


The routing table is updated upon receipt of a RIP response message. The following shows the updating algorithm used by RIP. Receive: a response RIP message 1. Add one hop to the hop count for each advertised destination. 2. Repeat the following steps for each advertised destination: 1. If (destination not in the routing table) 1. Add the advertised information to the table. 2. Else 1. If (next-hop field is the same) 1. Replace entry in the table with the advertised one. 2. Else 1. If (advertised hop count smaller than one in the table) 1. Replace entry in the routing table. 3. Return.
11 T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - Prof. Neha M. Srivastava

Example of updating a routing table

12

T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols

- Prof. Neha M. Srivastava

Example of updating a routing table


In the fig., a router receives a RIP message from router C. The message lists destination networks and their corresponding hop counts. The first step according to the updating algorithm is to increase the hop count by one. Next, this updated RIP packet and the old routing table are compared. The result is a routing table with an up-to-date hop count for each destination. For Net1 there is no new information, so the Net1 entry remains the same. For Net2, information in the table and in the message identify the same next hop (router C).
13 T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - Prof. Neha M. Srivastava

Example of updating a routing table


Although the value of the hop count in the table (2) is less than the one in the message (5), the algorithm selects the one received in the message because the original value has come from router C.
This value is now invalid because router C is advertising a new value. Net3 is added as a new destination. For Net6, the RIP packet contains a lower hop count and this shows up on the new routing table. Both Net8 and Net9 retain their original values since the corresponding hop counts in the message are not an improvement.
14 T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - Prof. Neha M. Srivastava

Initializing the Routing Table


When a router is added to a network, it initializes a routing table for itself using its configuration file. The table contains only the directly attached networks and the hop counts, which are initialized to 1. The next-hop field, which identifies the next router is empty. Fig. , shows the initial routing tables in a small AS.

Fig: Initial routing tables in a small autonomous system


15 T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - Prof. Neha M. Srivastava

Updating the Routing Table


Each routing table is updated upon receipt of RIP messages using the RIP updating algorithm. Fig., shows the previous AS with final routing tables.

Fig: Final routing tables for the previous fig.


16 T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - Prof. Neha M. Srivastava

RIP Message Format


Fig: RIP message format

Command: 8-bit field specifies the type of message: request (1) or response (2). Version: 8-bit field defines the version. Version 1 or version 2. Family: 16-bit field defines the family of the protocol used. For TCP/IP the value is 2. Address: It 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: 32-bit field defines the hop count from the advertising router to the destination network. *Note: The part of message is repeated for each destination network, which is referred as an entry.
17 T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - Prof. Neha M. Srivastava

Requests and Responses


RIP uses two types of messages: 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. A request can ask about specific entries or all entries. Response: A response can be either solicited or unsolicited. A solicited response is sent only in answer to a request. It contains information about the destination specified in the corresponding request. An unsolicited response, on the other hand, is sent periodically, every 30 sec, and contains information about the entire routing table. This periodic response is sometimes called update packet.
18 T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - Prof. Neha M. Srivastava

Request Messages

Fig: Request Messages


19 T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - Prof. Neha M. Srivastava

Timers in RIP
RIP uses 3 timers to support its operation, Periodic timer (25-35 s), Expiration timer (180 s) and Garbage collection timer (120 s). The periodic timer controls the sending of messages, expiration timer governs the validity of a route and Garbage collection timer advertises the failure of a route. 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 use a random number between 25 and 35s. 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 set randomly to a number between 25 and 35. It count downs, when zero is reached, the update message is sent, and the timer is randomly set once again.
- Prof. Neha M. Srivastava

1)

20 T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols

Timers in RIP
2)

Expiration Timer: The expiration timer governs the validity of a route. When the router receive update information for a route, the expiration timer is set to 180s for that particular route. Every time a new update for the route is received, the timer is reset. In normal situations, this occurs every 30s. However, if there is a problem on an internet and no update is received within the allocated 180s, 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.

21 T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols

- Prof. Neha M. Srivastava

Timers in RIP
3)

Garbage Collection Timer: When the information about the 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 garbage collection timers is set to 120 s for that route. When the count reaches zero, the route is purged from the table. This timer allows the neighbor to become aware of the invalidity of a route prior to purging.

22

T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols

- Prof. Neha M. Srivastava

Problem
A routing table has 20 entries. It does not receive information about five routes for 200 s. how many timers are running at this time? Solution: Total 21 timers are running at this time. Periodic timer=1 Expiration timer =20-5=15 Garbage Collection timer=5

23

T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols

- Prof. Neha M. Srivastava

Problems of RIP
1)

Slow Convergence:One of the problems with RIP is slow convergence, which means that a change somewhere in the internet propagates very slowly through the rest of the internet. Fig: Slow Convergence

For e.g., suppose there is a change in Net1 in the fig. Router R1 updates itself immediately. However, since each router sends its periodic update every 30 s, this means an average of 15 s (range of 0 to 30 s) before a change reaches R2. It also takes another 15 s before R3 receives the change, and so on. When the information finally reaches router Rn, 15 x n s have passed. If n is 20, then this is 300 s. In this 300 s an ATM n/w can send more than one billion bits. If this change affects these bits, one billion bits are lost.
24

T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols

- Prof. Neha M. Srivastava

Problems of RIP
Fig: Hop Count

One method to deal with RIP shortcomings is to limit the hop count to 15. This prevents data packets from wandering around forever, clogging the internet. An AS using RIP is limited to diameter of 15; the number 16 therefore, is considered infinity and designates an unreachable n/w.

2)

Instability:A much more important problem with RIP is instability, which means that an internet running RIP can be unstable. When this happens a packet could go from one router to another in a loop. Limiting the number of hops to 15 will improve stability but will not eliminate all of the problems.

25 T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols

- Prof. Neha M. Srivastava

Instability
To understand the problem, assume that the connection to Net1 in fig., is nonfunctioning. Router A shows a cost of 1 for this n/w in its routing table. Router B, which can access Net1 only through router A, shows a cost of 2. When access to Net1 fails, router A immediately responds & changes the Net1 cost column to 16 (infinity). However, it may have to wait up to 30 s before it can send its update with this new information. In the mean time, it could happen that Router B sends its own update message to A.
26 T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - Prof. Neha M. Srivastava

Instability
Router A now has two entries for Net1; one form its own table the cost is 16 & from router B the cost is 2. A is fooled into thinking that there is a backdoor access to Net1 through B. Router A then changes the cost column for Net1 to 3 (2 + 1) & this update gets sent to B. Router Bs 2 cost values for Net1 are now 3 (from A) and 2 (from itself). Router B knows that Net1 is accessible only through router A so it disregards its own lower cost & changes its cost to 4 (3 + 1). This back-and-forth updating continues until both routers reach a cost of 16. At this point, the routers realize there is no access to the n/w Net1.
27 T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - Prof. Neha M. Srivastava

Remedies for instability


RIP instability can result in packets circulating among routers. Some Remedies to improve the stability are proposed however, non of them are 100% effective. Triggered Update Normally if there are no changes on the n/w, routers send updates every 30 seconds. However, if a router receives a change from one of its neighbors, it sends updates immediately and does not wait until the periodic timer expires, this process is known as triggered update. Helps reduce loop instability but does not help when a router fails. Split Horizons It utilizes selectivity in sending of routing messages; a router must distinguish between its interfaces. A router receiving an update from one of its neighbors will not send the same information back out that interface.
T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - Prof. Neha M. Srivastava

1)

2)

28

Remedies for instability


Fig: Split Horizon

If an interface has passed information to help update a router, this updated information must not be sent back; it is already known and thus is not needed. Fig., illustrates the concept. Here, router B has received information about Net1 & Net2 through its left interface; this information is updated & passes on through the right interface but not to the left. Similarly, information received by router B about Net3 is updated and passed on only through the left interface of B. Split horizons can definitely improve stability. Assume that Net1 is inaccessible to router A, router B receives its information about Net1 from A; it does not send information about Net1 to router A. Router A, therefore, has but one entry for the Net1 cost (16), & is not fooled into thinking that there is some back-door access to Net1. Router A sends its routing table to B & both will then end up with a cost of 16 for Net1.
29 T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - Prof. Neha M. Srivastava

Remedies for instability


3)

Poison Reverse Similar to split horizon. This time a router will send update information coming in one interface back out this interface. However, it will also set the hop count to 16 for network information received through that interface. That way the original router sending that information will not update its table. Here, router B received information about Net1 & Net2 through its left interface, so it sends information out about these n/w with a metric of 16. Likewise, information about Net3 comes from right interface, & the cost of Net3 in the update message going right is 16.

Fig: Poison Reverse


30 T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - Prof. Neha M. Srivastava

Remedies for instability


Stability is improved using poison reverse. Assume that Net1 is inaccessible to router A. Router B receives its information about Net1 from A. In each update, B sends its routing table to A with a cost of 16 for Net1. This has no effect on A if Net1 is accessible because router A will not select Bs entry for Net1. However, if Net1 does goes down, both cost values are 16 & instability is thereby avoided.
31 T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - Prof. Neha M. Srivastava

RIP version 2
Designed for overcoming some of the shortcomings of version 1. Designers of version 2 have not augmented the length of the message for each entry. They have replaced fields in version 1 that were filled with 0s for the TCP/IP protocols with some new fields. Message Format The new fields Route Tag : carrying information such as the autonomous system number. It can be used to enable RIP to receive information from an exterior routing protocol. Subnet mask : A 4-byte field, carrying the subnet mask. This means RIP version 2 supports CIDR. Next-hop address : showing the next hop. Useful when two AS shares a network backbone. Then the message can define the router (in the same AS or other AS)to which the packet should go next.

32

T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols

- Prof. Neha M. Srivastava

RIP version 2
Authentication added to protect the message against unauthorized advertisement. Value of FFFF16 is entered in the family field. Multicasting Using the multicast address 224.0.0.9 to multicast RIP messages only to RIP routers in the network. Encapsulation encapsulated in UDP user datagram. not included a field that indicates the length of the message. using well-known port assigned to RIP in UDP is port 520.
33 T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - Prof. Neha M. Srivastava

Thank You

34

T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols

- Prof. Neha M. Srivastava

Das könnte Ihnen auch gefallen