Computer network—3 network layers (routing protocol, routing table generation)

table of Contents

Internet routing protocol

1. Several basic concepts about routing protocols

1.1 About the "best route"

2.2 The Internet has two major types of routing protocols (internal gateway protocol, external gateway protocol)

2.3 Self-made system and internal network protocol, external gateway protocol

Two, routing protocol

2.1 Interior Gateway Protocol RIP (distance vector algorithm)

    1) RIP (Routing Information Protocol) 

    2) Definition of "distance":

    3) Three characteristics of RIP protocol:

    4) The establishment of the routing table:

    5) Distance vector algorithm:

    6) Information exchange and routing table update between routers:

    7) Update of routing table: ( calculation problem!!! )

2.2 Internal Gateway Protocol OSPF (Link State Algorithm)

2.3 Exterior Gateway Protocol BGP


Internet routing protocol

1. Several basic concepts about routing protocols

1.1 About the "best route"

There is no absolute optimal routing algorithm. The so-called " best " can only be a more reasonable choice relative to a certain specific requirement. The actual routing algorithm should be as close as possible to the ideal algorithm.

2.2 The Internet has two major types of routing protocols

1) 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 .

2) External Gateway Protocol EGP (External Gateway Protocol)

   If the source station and the destination station are in different autonomous systems, when the datagram is transmitted to the boundary of an autonomous system, a protocol needs to be used 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 .

2.3 Self-made system and internal network protocol, external gateway protocol

Routing between autonomous systems is also called interdomain routing, and routing within autonomous systems is called intradomain routing .

 

Two, routing protocol

3 elements of routing protocol: who to exchange with, what to exchange, and when to exchange

  • RIP: According to fixed time interval , only exchange its own routing table with neighboring routers.
  • OSPF: The router will only send information when the link status changes .

RIP periodically exchanges routing table information with neighboring sites, while OSPF uses the flooding method to broadcast link state information only when the network topology changes.

 

2.1 Internal Gateway Protocol RIP

1) Routing Information Protocol RIP (Routing Information Protocol) 

  • RIP is a distributed routing protocol based on distance vector .
  • The RIP protocol requires every router in the network to maintain a record of the distance from itself to every other destination network.

2) Definition of "distance":

  • The distance from a router to the directly connected network is defined as 1.
  • The distance from a router to an indirectly connected network is defined as the number of routers traversed plus one.
  • The "distance" in the RIP protocol is also called " hop count ", because the hop count increases by 1.
  • The "distance" here actually refers to the " shortest distance ".
  • RIP believes that a good route is that the number of routers it passes is small, that is, " short distance ".
  • RIP allows a path up to only contain 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-scale Internet.
  • RIP cannot use multiple routes between two networks at the same time . RIP chooses a route with the fewest routers (that is, the shortest route), even if there is another set of high-speed (low-latency) routes but more routers.

3) Three characteristics of RIP protocol:

  • 1) Only exchange information with neighboring routers.
  • 2) The information exchanged is all the information currently known by this 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 the routing information after the topology change to the neighboring routers.

4) The establishment 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.
  • 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.

5) Distance vector algorithm:

  • The router receives a RIP packet from the neighboring router (its address is X):
  • 1) First modify all items in this RIP message: change all the addresses in the "next hop" field to X, and add 1 to 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 project receives distance less than the distance routing table , then perform the update ,
  •                     Otherwise, do nothing
  • 3) If the updated routing table of the neighboring router is not received in 3 minutes, the neighboring router is recorded as an unreachable router, that is, the distance is set to 16 (indicating unreachable).
  • 4) Return.

6) Information exchange and routing table update between routers:

The RIP protocol allows all routers in the Internet to continuously exchange routing information with their neighboring routers, and constantly update their routing tables, so that the route from each router to each destination network is the shortest (that is, the number of hops is the least).

Features of the RIP protocol: Good news spreads quickly, but bad news spreads slowly.

A problem with RIP: When the network fails, it takes a relatively long time (for example, several minutes) to transmit this information to all routers.

 

7) Update of routing table: (calculation problem)

How to calculate? Follow the steps of the distance vector algorithm:

  • All items: change the address in the "next hop" field to X, and add 1 to the "distance"
  • Perform the following steps for each item:
    • The destination network is not in the routing table, add
    • The next hop router is the same, replace
    • The distance is less than the distance in the routing table, update

   

    

 

2.2 Internal Gateway Protocol OSPF (Link State Algorithm)

1) OSPF (Open Shortest Path First) was developed in 1989 to overcome the shortcomings of RIP .

2) Basic features of OSPF protocol

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

3) 3 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. 
 

2.3 Exterior Gateway Protocol BGP

 

Guess you like

Origin blog.csdn.net/weixin_39450145/article/details/112672553