1. Routing algorithm

  • That is, a routing algorithm that finds a relatively reasonable path.

Hierarchical routing protocol

RIP

  • RIP is a distributed routing protocol based on distance vector and is the protocol standard of the Internet. It has the greatest advantage of simplicity.
  • RIP requires each router on a network to maintain a unique optimal distance from itself to each other’s destination network. (So, if the network is very large, it won’t work.)
  • Distance: indicates the hop count. This parameter specifies the number of routers to pass from the source port to the destination port. A maximum of 15 routers can pass through. A distance of 16 indicates that the network is unreachable.
  • Only applicable to small Internet

1. Exchange information

  • Neighboring routers exchange routing table information to gradually improve their own routing table information.
  • At first, the routing table for all routers only contains routing information for neighboring routers. That is, the next-hop router is a neighboring router with a distance of 1. After several rounds of communication, the shortest distance of any network in the autonomous system and the address of the next-hop router can be known, that is, convergence.
  • Routers exchange information every 30 seconds and then update their routing tables. If the router does not receive notification from the neighbor within 180s, the router determines that the neighbor is lost and updates its routing table.

2. Distance vector algorithm

  • It’s an algorithm for how to improve the routing table.
  • After receiving a routing table from a neighboring router, you need to change the next-hop address to the IP address of the router before writing the routing table to yourself. All distances are +1.
  • If an entry does not exist, it is directly added to the routing table.
  • If it is an existing entry and the next hop address is the same, the entry is directly updated.
  • If it is an existing entry and the next hop address is different, the system compares the distance. If the distance is shorter than the current entry, the system updates it. If the distance is longer than the current entry, the system does not update it.

3. Format of RIP packets

  • RIP is an application-layer protocol
  • It transmits data over UDP.

4. Good news travels fast, but bad news travels slow

  • When a network fails, it can take a long time for all routers to converge.

  • Looking at the figure above, there may be concurrency issues. When the R1 router detects a fault on network 1, it changes the distance from its routing table to the network to 16. However, before the routing table information is transmitted to the adjacent router R2, it receives the routing table information of the adjacent router R2. The routing table information carries the distance to network 1. Router R1 mistakenly thinks that it can reach network 1, and changes the routing table information to network 1 to set the next hop as R2. Repeatedly jump, also did not find each other can not reach network 1, until the distance reached 16.

4. OSPF

5. BGP