Simple arrangement of routing protocols for the Internet at the network layer

Several basic concepts about routing protocols

The Internet uses hierarchical routing protocols.

Autonomous System AS (Autonomous System)

  • The definition of an autonomous system AS: A group of routers managed by a single technology, and these routers use a routing protocol within the AS and a common metric to determine the route of the packet in the AS, and also use an AS Inter-routing protocols are used to determine the routing of packets between ASs.
  • The current definition of an autonomous system AS emphasizes the following fact: Although an AS uses multiple internal routing protocols and metrics, it is important that an AS exhibits a single and consistent routing strategy to other ASs. Insert picture description here
    Note: Early Internet RFC documents did not use "router" but used the term "gateway". But the term "router" is used in the new RFC document. These two terms should be treated as synonyms.

Interior Gateway Protocol

IGP (Interior Gateway Protocol)

  • A routing protocol used within an autonomous system.
  • Currently, this type of routing protocol is most used, such as RIP and OSPF protocols

Internal gateway protocol: RIP protocol

RIP (Routing Information Protocol) is the first widely used protocol among the interior gateway protocols IGP.

  • RIP is a distributed routing protocol based on distance vector .
  • The RIP protocol requires each router in the network to maintain a record of the distance from itself to each other destination network. The distance from a router to the directly connected network is defined as 1. The distance from a router to a network that is not directly connected is defined as the number of routers passed plus one. The "distance" in the RIP protocol is also called "hopcount", because every time a router passes through, the hop count increases by 1.
  • RIP allows a path to contain up to 15 routers. When the maximum value of "distance" is 16, it is equivalent to unreachable. It can be seen that RIP is only suitable for small Internet.
  • RIP cannot use multiple routes simultaneously between two networks.
  • RIP shortest distance first : RIP chooses a route with the fewest routers (that is, the shortest route), even if there is another route with high speed (low latency) but more routers.

Three characteristics of RIP protocol

  1. Only exchange information with neighboring routers.
  2. The information exchanged is all the information currently known by the router, that is, its own routing table.
  3. Exchange routing information at regular intervals, for example, every 30 seconds. When the network topology changes, the router also promptly advertises routing information after the topology change to neighboring routers.

The establishment and update of the routing table

When the router just started working, it only knew the distance to the directly connected network (this distance is defined as 1). Its routing table is empty. In the future, each router will only exchange and update routing information with a very limited number of neighboring routers. After several updates, all routers will eventually know the shortest distance to any network in the autonomous system and the address of the next-hop router. The convergence process of the RIP protocol is faster. "Convergence" is the process in which all nodes in an autonomous system obtain correct routing information.

Distance vector algorithm (emphasis)

The router receives a RIP packet from the neighboring router (its address is X):

  1. First modify all items in this RIP message: change the address in the "next hop" field to X, and add 1 to the value of all the "distance" fields.
  2. Repeat the following steps for each item in the modified RIP message:
  • If the destination network in the project is not in the routing table, add the item to the routing table.
    otherwise
  • If the router address given in the next hop field is the same, replace the received item with the item in the original routing table.
    otherwise
  • If the distance in the received item is less than the distance in the routing table, update it,
    otherwise, do nothing.
  1. If the updated routing table of the neighboring router is not received in 3 minutes, the neighboring router is regarded as an unreachable router, that is, the distance is set to 16 (indicating unreachable).
  2. return.

Insert picture description here

Advantages and disadvantages of RIP protocol

Advantages: simple to implement and low overhead.
Disadvantages:
1. RIP limits the scale of the network. The maximum distance it can use is 15 (16 means unreachable).
2. The routing information exchanged between routers is the complete routing table in the router, so as the network scale expands, the cost increases.
3. "Bad news spreads slowly", which makes the convergence time of the update process too long.
4.
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here

Internal gateway protocol: OSPF protocol

Open Shortest Path First (OSPF) was developed in 1989 to overcome the shortcomings of RIP. The principle of OSPF is simple, but it is more complicated to implement.

Basic characteristics of OSPF protocol

  1. "Open" means that the OSPF protocol is not controlled by a certain manufacturer, but is published publicly.
  2. "The shortest path first" is because the shortest path algorithm SPF proposed by Dijkstra is used
  3. A distributed link state protocol (link state protocol) is adopted.

Note: OSPF is just the name of a protocol, it does not mean that other routing protocols are not "shortest path first".

Three points

  1. To send information to all routers in this autonomous system, the method used here is flooding.
  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.
    "Link status" means to indicate which routers this router is adjacent to and the "metric" of the link.
  3. Only when the link status changes, the router uses the flooding method to send this information to all routers.

OSPF is divided into two different areas

  • The benefits of dividing areas: The scope of using the flooding method to exchange link state information is limited to each area rather than the entire autonomous system, which reduces the amount of communication on the entire network.
  • The routers in an area only know the complete network topology of the area, but do not know the network topology of other areas.
  • OSPF uses hierarchical area division . The area on the upper level is called the backbone area. The identifier of the backbone area is specified as 0.0.0.0. The role of the backbone area is to connect other areas in the lower layer.
    Insert picture description here
    Insert picture description here

OSPF directly uses IP datagrams to transmit

  • OSPF uses IP datagrams instead of UDP.
  • The datagram formed by OSPF is very short. Doing so can reduce the communication volume of routing information.
  • Another advantage of very short datagrams is that long datagrams do not have to be transmitted in fragments.
  • As long as one fragmented datagram is lost, it cannot be assembled into the original datagram, and the entire datagram must be retransmitted.

Five packet types of OSPF

  • Type 1, Hello packet.
  • Type 2, Database Description grouping.
  • Type 3, link state request (Link State Request) packet.
  • Type 4, link state update (Link State Update) grouping, use the flooding method to update the link state of the entire network.
  • Type 5, Link State Acknowledgment packet.

The difference between the two internal protocols

OSPF does not have the problem of "bad news spreads slowly". According to statistics, its response time to network changes is less than 100 ms.

External Gateway Protocol

External Gateway Protocol EGP (External Gateway Protocol)

  • If the source station and the destination station are in different autonomous systems, when a datagram is transmitted to the border of an autonomous system, a protocol is needed to transfer routing information to another autonomous system. Such a protocol is the external gateway protocol EGP.
  • Currently, BGP-4 is the most used external gateway protocol.

Note: IGP and EGP are the names of protocol categories. However, there is a little confusion when RFC uses the term EGP, because the protocol name of the earliest external gateway protocol also happens to be EGP. Therefore, when you encounter the term EGP, you should find out whether it refers to the old protocol EGP or the category of External Gateway Protocol EGP.

Exterior Gateway Protocol BGP

The scale of the Internet is too large, making routing among autonomous systems very difficult. For routing between autonomous systems, it is very unrealistic to find the best route.

  • When a path passes through several different ASs, it
    is impossible to calculate a meaningful cost for such a path .
  • A more reasonable approach is to exchange "reachability" information between ASs.
  • The routing selection between autonomous systems must consider relevant strategies.
  • Therefore, the Border Gateway Protocol BGP can only seek to find a better route (not to go around in circles) that can reach the destination network, but not to find the best route.

BGP spokesperson

  • The administrator of each autonomous system must select at least one router as the "BGP speaker" (BGP speaker) of the autonomous system.
  • Generally speaking, two BGP speakers are connected through a shared network, and BGP speakers are often BGP border routers, but they may not be BGP border routers.
    Insert picture description here

BGP exchange routing information

  • To exchange routing information between a BGP speaker and BGP speakers in other autonomous systems, it must first establish a TCP connection, and then exchange BGP packets on this connection to establish a BGP session, and use the BGP session to exchange routing information.
  • Using TCP connections can provide reliable services and simplifies routing protocols.
  • Two BGP speakers that exchange routing information using TCP connections become neighbors or peers of each other.

Features of BGP protocol

  • BGP protocol exchanges routing information in the order of magnitude of the number of autonomous systems, which is much less than the number of networks in these autonomous systems.
  • The number of BGP speakers (or border routers) in each autonomous system is very small. This makes the routing selection between autonomous systems not excessively complicated.
  • BGP supports CIDR, so the BGP routing table should also include the destination network prefix, next-hop router, and various autonomous system sequences to reach the destination network.
  • When BGP is just running, BGP neighbors exchange the entire BGP routing table. But in the future, only the changed parts need to be updated when changes occur. This is good for saving network bandwidth and reducing router processing overhead.

BGP-4 uses four types of messages

  1. Open (OPEN) message, used to establish a relationship with another neighboring BGP speaker.
  2. Update (UPDATE) message, used to send information about a certain route, and list multiple routes to be withdrawn.
  3. Keep-alive (KEEPALIVE) messages are used to confirm opening messages and periodically confirm the relationship between neighbors.
  4. NOTIFICATION message, used to send detected errors.

Guess you like

Origin blog.csdn.net/qq1350975694/article/details/106969457