A routing protocol describes the rules that must be followed by a router while it interacts with neighboring routers to learn the path and to maintain the network in the routing tables. The RIP and OSPF are the Interior Gateway Routing protocols which differ in many ways.
The principal difference is that RIP falls in the category of distance vector routing protocol whereas OSPF is the example of link state routing. Another difference is that RIP uses bellman ford algorithm while OSPF uses Dijkstra algorithm.
There are two varieties of routing protocols for internetworks that are IGP and EGP. IGP (Interior gateway routing protocol) is restricted to an autonomous system, which means all routers operates inside an autonomous system.
On the other hand, EGP (exterior gateway routing protocol) works for the two autonomous system means from one autonomous system to another and vice-versa. An autonomous system is a logical boundary that represents a network which works under a single common administration.
The three classes of routing protocols are
- Distance Vector: Distance vector routing protocol finds the best path to a remote network by using the relative distance. Each time when a packet passes through a router is referred as a hop. The best route is the route which has the lowest number of hops to the network. RIP and EIGRP are the examples of the Distance vector routing protocols.
- Link State: It is also known as shortest path first, in which each router creates three separate tables. Each table perform its different functions such as one keeps track of directly attached neighbours, the second one determines the topology of the entire internetwork, and the third one is used for the routing table. OSPF is an example of Link state routing protocol.
- Hybrid: Uses characteristic of distance vector and link state such as EIGRP.
Content: RIP Vs OSPF
|Basis for comparison||RIP||OSPF|
|Stands for||Routing Information Protocol.||Open Shortest Path First|
|Class||Distance vector routing protocol||Link State Routing Protocol|
|Default metric||Hop count||Bandwidth (cost)|
|Update timer||30 seconds||Only when changes occur|
|Hop count limit||15||None|
|Multicast address used||126.96.36.199||188.8.131.52 and 184.108.40.206|
|Protocol and port used||UDP and port 20||IP and port 89|
Definition of RIP
Routing Information Protocol is the straight implementation of distance vector routing for local networks. In every 30 seconds, it delivers an entire routing table to all active interfaces. Hop count is the only metrics to describe the best path to a remote network, but it can be 15 at max. It prevents routing loops, through restricting the number of hop counts permitted in the path.
There are two versions of RIP, RIP version 1 and RIP version 2 the difference between both of the versions are outlined in the following chart.
|Supports variable-length subnet mask (VLSM)||No||Yes|
|Sends the subnet mask along with routing update||No||Yes|
|Communicates with other RIP router through the following address type||Broadcast||Multicast|
|RFC definition||RFC 1058||RFCs 1721, 1722, and 2453|
Convergence is a process of collecting the topological information or updating the information for the other routers through the implemented routing protocol. Convergence occurs when the router is transitioned from either to forwarding or blocking states, and it prevents data forwarding at that instant.
The main issue with convergence is the time it takes to update information in a device. Slow convergence can result in inconsistent routing table and routing loops. Routing loops forms when routing information is not updated or the when the information propagated throughout the network is wrong.
Split horizons and route poisoning is the solution to the routing loop problem. Split horizon enforces a rule which prevents the information form sending back to the source from which it was received. In route poisoning, when any network goes down its router simulates the network as 16 in the table entry (which is unreachable or infinite as only 15 hops are allowed). Ultimately this results in spreading the poisoned route information to all the routes in the segment.
RIP disadvantage is that it is inefficient on large networks or on networks where a large number of routers are instated.
- Update timer defines how frequent a router will send out routing table update, and its default value is 30 seconds.
- Invalid timer specifies the duration for a route till which it could remain in routing table before being considered as invalid if no new updates are aware of this route. The invalid route is not removed from the routing table rather it is marked as metric of 16, and placed in the hold-down state. The default value of the invalid timer is 180 seconds.
- Hold-down timer indicates the duration till which a route is forbidden from receiving updates. RIP will not receive any new updates for routes when it is in the hold-down state; its default value is 180 seconds.
- Flush timer specifies how long a route can be retained in a routing table ahead of getting flushed out when no new updates are received. Its default value is 240 seconds.
Definition of OSPF
Open Shortest Path First is a link state and hierarchical IGP routing algorithm. It is an enhanced version of RIP, which comprises features like multipath routing, least cost routing, and load balancing. Its major metric is the cost to determine the best path.
OSPF involves the type of service routing which means multiple routes can be installed according to the priority or type of service. OSPF offers load balancing in which it distributes overall traffic routes equally. It also allows networks and routers partitioned into subsets and areas which enhance the growth and ease of management.
OSPF enables (Type 0) authentication in all the exchanges between routers which means by default these interchanges over the network are not authenticated. It offers two other authentication methods, simple password authentication and MD5 authentication. It supports subnet specific, host-specific, and classless routes, also, classful network specific routes.
In OSPF the routing is done by sustaining the database with link state information in the routers and route weights computed using link state, IP address etc. The link states are transmitted all through the autonomous system to the routers to update the database. After that, each router builds a shortest path tree as a root node, on the basis of the weights stored in the database.
Key Differences Between RIP and OSPF
- RIP depends on hop counts to determine the best path while OSPF depends on cost (bandwidth) which helps in determining the best path.
- Administrative Distances (AD) measures the probity of received routing information on a router from a neighbor router. An administrative distance can vary from integers 0 to 255, where 0 specifies the most trusted integer, and 255 signifies that no traffic is allowed to pass through this route. The AD value of RIP is 120 whereas it is 110 for OSPF.
- Convergence in the RIP is slow in contrast it is fast in OSPF.
- Summarization allows a single routing table entry to illustrate a collection of IP network numbers. RIP supports auto summarization, as against OSPF supports manual summarization.
- There no hop count limit in OSPF. On the contrary, the RIP is limited to 15 hop counts.
RIP is most commonly used protocol and generates lowest overheads, but it can not be used in larger networks. On the other side, OSPF performs better than RIP in terms of cost of transmission and is suitable for larger networks. OSPF also provides maximum throughput and lowest queuing delay.