4. Network layer (7) Network layer equipment

Table of contents

7.1 Router composition and functions

7.2 Routing table and route forwarding


7.1 Router composition and functions

A router is a dedicated computer with multiple input/output ports. Its task is to connect different networks (which can be heterogeneous) and complete routing forwarding. Routers are necessary when interconnecting multiple logical networks (that is, multiple broadcast domains).

The three basic ways to implement a switching fabric are: switching through memory → switching through the bus → switching through the interconnection network, and the achievable router forwarding rates increase in sequence. 

A router is a network layer device that implements the functions of the physical layer, data link layer, and network layer. The layer 3 protocols of each network connected to the router can be different. Can isolate collision domain and broadcast domain.

A switch (or bridge) is a data link layer device that implements the functions of the physical layer and data link layer. The Layer 2 protocols can be different for each network segment connected to the switch. Can isolate collision domains but not broadcast domains.

A hub (or repeater) is a physical layer device that implements the functions of the physical layer. However, the physical layer of each network segment connected to the repeater must be the same . This is because the repeater is not a store-and-forward device, but a cut-through device. Neither collision domains nor broadcast domains can be isolated.

Normally, a network segment is a collision domain, a LAN is a broadcast domain, and an Internet is formed by routers connecting multiple LANs or WANs.

7.2 Routing table and route forwarding

Routers mainly have two functions: one is routing and the other is packet forwarding.

  • Routing selection refers to the interaction based on routing protocols based on complex distributed algorithms, and dynamically changing the selected route based on the topological changes of the entire network or a certain part of the network obtained from adjacent routers.
  • Packet forwarding means that the router forwards the user's IP datagram out of the appropriate port according to the forwarding table.
  • Store and forward : The router first receives the entire packet, then checks the packet for errors. If an error occurs, the packet is discarded; otherwise, the correct packet is stored. Finally, the correct packet is forwarded to the appropriate port according to the routing protocol. (Layer 2 switches and routers both have store-and-forward functions, but repeaters and hubs do not)

Routing tables are derived based on routing algorithms, while forwarding tables are derived from routing tables. Routing tables need to be optimized for calculations of network topology changes, while forwarding tables should be structured to optimize the lookup process. When discussing the principles of routing, routing tables and forwarding tables are often not distinguished, but the term routing table is used in general.

 

When indirect delivery is required, the host can set a default (default) gateway in order to know which router it should deliver the IP datagram to for forwarding .

 The routing table for the 408 test is in the following format :

  • Default route : The destination network 0.0.0.0/0 in the default route entrywhere 0.0.0.0 represents any network, and the network prefix "/0" (the corresponding address mask is 0.0.0.0) is the shortest network prefix.
  • The routing table follows the principle of "longest prefix match" when looking up the forwarding table to forward IP datagrams, so the default routing entry has the lowest matching priority.
  • Routing tables are always implemented in software ; forwarding tables can be implemented in software or special hardware.
  • Forwarding is when the router forwards the IP datagram out of the appropriate interface according to the forwarding table. Forwarding only involves one router . Routing involves many routers, and the routing table is the result of the collaborative work of many routers.

 

 

 

 

 

Guess you like

Origin blog.csdn.net/weixin_74059671/article/details/128390467