Table of content

Description

RIP (Routing Information Protocol) - a dynamic routing protocol based on the Bellman-Ford algorithm. The protocol has the following features:

RIP operation algorithm

Let's look at the example routing information distribution over a network using RIP. The example includes the following scheme (Figure 1):

RIP must be configured on all routers. WAN-1 is the external network, i.e. the route to this network must be added to the RIP domain as external.

Figure 1 - Network scheme to explain RIP operation principles

In this example, routing information distribution from router R1 will be described, routes from other devices will be distributed in the same way.

The RIP operation algorithm in the described scheme is following:

  1. Start RIP.
  2. Routing information distribution.
  3. Adding routes to RIB.
  4. Adding routes to FIB.
  5. Timers control.
  6. Network changes control.

Start RIP

At this stage, the RIP must be enabled on the routers and must be defined the list of interfaces that will participate in the RIP operation.

The list definition is done using the "network A.B.C.D/M" command. All network interfaces which IP addresses belong to the specified range participate the RIP. This means that routing information will be distributed from these interfaces, and information about the networks associated with these interfaces will be transmitted to other routers.

If an interface participates the RIP, but routing information should not be distributed over that interface, then the interface can be configured as passive.

Let's assume that the commands "network 10.10.13.0/30" and "network 10.10.12.0/30" have been executed on router R1. In this case, the router will assume that RIP is running on eth2 and eth3.

Routing information distribution

The routing information distribution about the networks connected to router R1 is performed in the following sequence:

Figure 2a - R1 routing information distribution

Figure 2b - Routing information distribution by routers R2 and R3

Adding routes to RIB

After exchanging service messages, the routers add the received routes to the RIB. In this case, some routes are filtered out. To filter the routing information, devices are guided by the following principles:

Let's assume that router R4 received a service message from router R2 earlier than from R3. Then, in accordance with the described principles, routes add the following routing information to the RIB:

R2 router
Destination networkMetricGateway
10.10.12.0/301-
10.10.24.0/301-
10.10.13.0/30210.10.12.1
192.168.1.0/24210.10.12.1



R3 router
Destination networkMetricGateway
10.10.13.0/301-
10.10.34.0/301-
10.10.12.0/30210.10.13.1
192.168.1.0/24210.10.13.1
R4 router
Destination networkMetricGateway
10.10.24.0/301-
10.10.34.0/301-
10.10.12.0/30210.10.24.1
10.10.13.0/30210.10.34.1
192.168.1.0/24310.10.24.1

Adding routes to FIB

Routes export from RIB to FIB is go along with the analysis of distance values assigned to the route source. Distance value 120 is assigned to RIP, so some routes added to the RIB at the previous step will be filtered out. For example, all routes with metric 1 will be discarded because these are routes to directly connected networks and have 0 distance value.

Timers control

The routing information distribution described above is cyclically repeated. The repetition period is equal to the update timer value. By default the update timer is 30 seconds. Thus, all routing information on the network is distributed every 30 seconds.

Note, routers do not establish neighbor relations and do not synchronize the routing information exchange time, therefore, the time for sending service messages by routers is distributed in the 30 seconds interval, it helps to avoid service traffic bursts in the network.

After the route obtained via RIP is placed in the RIB, the timeout timer is started, by default its value is 180 seconds. If the router does not receive a route update within 180 seconds, the route will be marked as unavailable, i.e. the metric value of such a route is set to 16. The router cannot use this route for data transmission.

RIP service data exchange is not guaranteed, so the timeout timer value must be greater than the update timer. Otherwise, there may be false operation and determining routes as unavailable.

After adding a route to the RIB, in addition to the timeout timer, the garbage timer is also started with the default value 240 seconds. If the router does not receive a route update within 240 seconds, then such a route will be removed from the routing table.

Updating the routing information resets the timeout timer and garbage timer to their original values.

Network changes control

RIP is a dynamic routing protocol and must adapt to changes in the network. There are three scenarios of the changes:

New link has been added

Let's add a new link between router R1 and WAN-2 to the example scheme (Figure 3a). In this case, the WAN-2 network will be external for RIP, it means that the route to this network will be distributed similarly to the route to the WAN-1 network: router R1 will announce this network with metric 1, R2 and R3 will increment the metric value and transmit route to R4. АIn case of new routers included to the RIP domain the algorithm will be similar.

Figure 3a - The example of service messages sending when a new link has been added

Link is out of order

Let's assume that the link between routers R1and R3 fails (Figure 3b):

Рисунок 3б - Пример рассылки служебных сообщений при выходе из строя канала связи

Время, в течение которого распространяется обновлённая информация зависит от размеров сети и зависит от значения update timer. Учитывая, что максимальный размер сети - 16 хопов, а update timer по умолчанию равен 30 секундам, то в худшем сценарии время распространения информации о недоступности канала связи будет равно 15*30 = 450 секунд.

Выход из строя маршрутизатора

Дополним схему двумя коммутаторами SW1 и SW2 (рис. 3в) и рассмотрим сценарий выхода из строя маршрутизатора R1.

При выходе из строя маршрутизатора R1, он не успевает отправить обновление маршрутной информации о своей недоступности маршрутизаторам R2 и R3. Кроме того, R2 и R3 не узнают о недоступности R1, поскольку они непосредственно подключены к коммутаторам SW1 и SW2, которые не поддерживают работу протокола RIP. В этом случае, маршрутизаторы сети будут считать R1 доступным на протяжении timeout timer и будут использовать маршруты, связанные с R1. В частности, в таблице маршрутизации всех маршрутизаторов будут активны маршруты к сетям 10.10.12.0/30, 10.10.13.0/30 и 192.168.1.0/24.

Рисунок 3в - Пример рассылки сообщений при выходе из строя маршрутизатора R1

Возникновение ложных маршрутов

Упростим рассматриваемую схему, оставив два маршрутизатора R1 и R3 (рис. 4а). Будем считать, что маршрутизаторы обменялись маршрутной информацией и таблицы маршрутизации устройств находятся в актуальном состоянии.

Рисунок 4а - Схема сети для сценария возникновения ложных маршрутов

Маршрутизатор R1
Сеть назначенияМетрикаШлюз
10.10.13.0/301-
192.168.1.0/241-
Маршрутизатор R3
Сеть назначенияМетрикаШлюз
10.10.13.0/301-
192.168.1.0/24210.10.13.1

Пусть канал связи между маршрутизатором R1 и внешней сетью WAN-1 вышел из строя (рис. 4б). Маршрутизатор R1 устанавливает для такого маршрута метрику равную 16, однако не формирует служебное сообщение с обновлённой маршрутной информацией, т.к. значение update timer равно 25 секунд. В то же время update timer на маршрутизаторе R3 равен 3 секундам.

Рисунок 4б - Возникновение неисправности с каналом связи R1 - WAN-1

Маршрутизатор R1
Сеть назначенияМетрикаШлюз
10.10.13.0/301-
192.168.1.0/2416-
Маршрутизатор R3
Сеть назначенияМетрикаШлюз
10.10.13.0/301-
192.168.1.0/24210.10.13.1

Через 3 секунды после выхода из строя канала связи R1 - WAN-1 истекает время update timer маршрутизатора R3, поэтому R3 отправляет обновление маршрутной информации маршрутизатору R1 (рис. 4в). Это обновление содержит информацию о сетях 10.10.13.0/30 и 192.168.1.0/24. Маршрутизатор R1 добавляет в RIB маршрут к сети 192.168.1.0/24, т.к. его метрика лучше чем у маршрута, который уже добавлен в RIB.

Образовалась петля маршрутизации, каждый из маршрутизаторов, передавая трафик в сеть 192.168.1.0/24, ссылается на другой маршрутизатор. Таким образом трафик будет передаваться маршрутизаторами друг другу до истечения значения TTL. Помимо образования петли маршрутизации стоит обратить внимание на то, что оба маршрута являются ложными, т.к. связь с сетью 192.168.1.0/24 потеряна.

Рисунок 4в - Отправка служебного сообщения с маршрутной информацией маршрутизатором R3

Маршрутизатор R1
Сеть назначенияМетрикаШлюз
10.10.13.0/301-
192.168.1.0/24310.10.13.2
Маршрутизатор R3
Сеть назначенияМетрикаШлюз
10.10.13.0/301-
192.168.1.0/24210.10.13.1

Использование ложного маршрута будет продолжаться до истечения timeout timer на маршрутизаторе R3, после чего R3 установит для этого маршрута значение метрики равной 16. В следующей рассылке маршрутной информации маршрутизатор R1 передаст маршрутизатору R3 сведения о маршрутах к сетям 10.10.13.0/30 и 192.168.1.0/24 (рис. 4г). Поскольку метрика маршрута к сети 192.168.1.0/24 будет равна 3, что меньше 16, то маршрутизатор R3 добавит ложный маршрут в RIB, инкрементируя значение метрики.

Обмен ложным маршрутом будет продолжаться до того момента, пока значение метрики не достигнет недопустимого значения 16. При настройках по умолчанию это произойдёт через 36 минут после неисправности канала связи между R1 и WAN-1.

Рисунок 4г - Отправка служебного сообщения с маршрутной информацией маршрутизатором R1

Маршрутизатор R1
Сеть назначенияМетрикаШлюз
10.10.13.0/301-
192.168.1.0/24310.10.13.2
Маршрутизатор R3
Сеть назначенияМетрикаШлюз
10.10.13.0/301-
192.168.1.0/24410.10.13.1

Для того, чтобы избежать возникновения ложных маршрутов в протоколе RIP используются следующие механизмы:

Перечисленные механизмы позволяют адаптировать протокол RIP для современных сетей, т.к. существование ложных маршрутов на протяжении 36 минут или время схождения протокола, равное 450 секундам, является недопустимым для многих сервисов.

Особенности протокола RIP

К особенностям протокола RIP можно отнести следующие пункты:

Дополнительные материалы

Прочее

  1. RFC 1058
  2. RFC 2454
  3. RFC 2080
  4. Команда ARDA
  5. Команда ARIP
  6. Команда RIP