Both of OSPF and RIP are the routing protocols.
Concept
RIP is a distributed distance vector based routing protocol.
OSPF is a distributed link-state routing protocol.
Working Principle
We can compare them deeply.
RIP exchanges state only between adjacent routers. The information exchanged by the router is all the information currently known by the router, namely the routing table. Routing information is exchanged at regular intervals.
OSPF sends information to all routers of the local AS. The information sent is the link state of all routers adjacent to the router. That is, the network topology of the router. If the link status changed, the router will use flooding to send information to all routers.
Pros and Cons
In RIP, each router only knows the distance to all routers and the next hop router, and does not know the entire network topology, because of the different locations, each router's routing table is different. In the event of a network failure, to go through it takes a long time for this information to be transmitted to all routers. The so-called "good news spreads quickly, bad news spreads slowly". It also has slow convergence.
In OSPF, since the information exchanged is the link state of neighboring routers, each router can establish a link state database (that is, the topology diagram of the entire network). This database is consistent throughout the entire network. (This is called "synchronization of the link state database"). In OSPF, the link database can be updated quickly, so the OSPF update process converges quickly.
Furthermore, RIP protocol uses transport layer user datagram UDP for transmission, and OSPF directly uses IP datagram for transmission.
Comparison Chart
Features |
RIP |
OSPF |
|
RIP v1 |
RIP v2 |
||
Algorithm |
Bellman-Ford |
Dijkstra |
|
Path Selection |
Hop based |
Shortest Path |
|
Routing |
Classful |
Classless |
Classless |
Transmission |
Broadcast |
Multicast |
Multicast |
Administrative Distance |
120 |
110 |
|
Hop Count Limitation |
15 |
No Limitation |
|
Authentication |
No |
MDS |
MDS |
Protocol |
UDP |
IP |
|
Convergence Time |
RIP > OSPF |