An interior gateway protocol is a protocol for exchanging routing information between gateways (hosts and routers) within an autonomous network. Routing information can be used with Internet Protocol (IP) or other network protocols to describe how routing is carried out. Interior Gateway Protocol protocols include RIP, OSPF, IS-IS, IGRP, and EIGRP.
1. The internal and external differences of the interior gateway protocol
The Internet is divided into multiple domains or multiple autonomous systems. A domain is a collection of hosts and routers that use the same routing protocol and is managed by a single organization. In other words, a domain might be the Internet administered by a university or other institution. An Interior Gateway Protocol (IGP) selects routes within a domain. The Exterior Gateway Protocol (EGP) provides a method for two adjacent routers on the border of their respective domains to exchange messages and information.
2. Classification of interior gateway protocols
Interior gateway protocols can be divided into two categories: distance vector routing protocols and link state routing protocols.
2.1 Distance vector routing protocol: distance vector refers to the vector of distance and direction to advertise routing information. Distance is defined by a metric such as hop count, and direction is the router or exit interface of the next hop. Distance vector protocols typically use the Bellman-Ford algorithm to determine the best path. Although the Bellman-Ford algorithm can eventually accumulate enough information to maintain a database of reachable networks, routers cannot learn the exact topology of the Internet through this algorithm. A router only understands routing information received from neighboring routers.
The distance vector protocol is suitable for the following scenarios:
2.1.1 The network structure is simple and flat, and no special layered design is required.
2.1.2 Administrators do not have sufficient knowledge to configure and troubleshoot link state protocols.
2.1.3 Certain types of network topologies, such as Hub-and-Spoke networks.
2.1.4 There is no need to pay attention to the convergence time of the network in the worst case.
2.2 Link-state routing protocols: A router configured with a link-state routing protocol can obtain information about all other routers to create a "complete view" (ie, topology) of the network. And select the best path to reach all destination networks in the topology structure (the link state routing protocol triggers the update, that is to say, it updates when there is a change).
Link-state protocols are suitable for the following scenarios:
2.2.1 The network is designed in layers, as is often the case for large networks.
2.2.2 The administrator is very familiar with the link-state routing protocols used in the network.
2.2.3 The network has extremely high requirements on the convergence speed.
3. OSPF
OSPF Open Shortest Path First (Open Shortest Path First) is an interior gateway protocol (Interior Gateway Protocol, IGP for short), which is used to make routing decisions within a single autonomous system (autonomous system, AS). As opposed to RIP, OSPF is a link state routing protocol, while RIP is a distance vector routing protocol. A link is another word for a router interface, so OSPF is also known as an interface state routing protocol.
OSPF establishes a link state database by advertising the status of network interfaces between routers, and generates a shortest path tree. Each OSPF router uses these shortest paths to construct routes. The main feature is the use of distributed link state protocols, rather than distance vector protocols like RIP. Three main points:
3.1 Send information to all routers in the autonomous system.
3.2 The information sent is the link status of all routers adjacent to this router, but this is only part of the information that the router knows.
3.3 Only when the link state changes, the router sends this information to all routers by flooding.
4. RIP
RIP (Routing Information Protocol), routing information protocol, is the most widely used protocol in the interior gateway protocol. It is a distributed protocol based on distance vector algorithm, and its characteristic is that the protocol is simple. Suitable for relatively small autonomous systems, typically less than 15 "hops" in diameter. The characteristics of the RIP protocol are:
4.1 Exchange information only with adjacent routes
4.2 The information exchanged by routers is all the information currently known by this router, that is, its own routing table. That is, the information exchanged is: "The (shortest) distance I have to all the networks in this autonomous system, and the next-hop router I should go through to get to that network."
4.3 Exchange routing information at regular intervals, for example, every 30 seconds. The router then updates the routing table based on the received routing information.