[HCIA] 06. Static routing

The role of routers: through routers, different broadcast domains can be interconnected; routing can refer to routers, or a verb passed, or a routing entry information.

  • In a typical data communication network, there are often multiple different IP network segments. Data interaction between different IP network segments requires the use of layer 3 devices. These devices have routing capabilities and can realize data network segment forwarding. .
  • Routing is the most basic element in a data communication network. Routing information is the path information that guides message forwarding, and the routing process is the process of message forwarding.

routing

  • A route is path information that guides packet forwarding, through which the path for forwarding an IP packet can be confirmed.
  • A routing device is a network device that forwards packets to a destination network segment according to a route, and the most common routing device is a router.
  • The routing device maintains a routing table, which stores routing information.

  • The gateway and intermediate nodes (routers) select an appropriate path according to the destination address of the received IP message, and forward the message to the next router. Layer 2 addressing of the last hop router in the path forwards the packet to the destination host. This process is called routing forwarding.
  • The entry on which the intermediate node selects the path is called the routing table.
  • Routing entries contain specific outgoing interfaces and next hops, and these two pieces of information guide IP packets to be forwarded to corresponding next-hop devices.

Routing Information Introduction

  • The route contains the following information:
    • Destination network: identify the destination network segment
    • Mask: identifies a network segment together with the destination address
    • Outbound interface: the interface where the data packet leaves the router after being routed
    • Next hop: the next hop address used by the router to forward the data packets to the destination network segment

dislay ip routing-table
  • Routes can be generated through direct routing, static routing and dynamic routing protocols
  • After an interface is double up, three routes will be generated:
    • 192.168.1.0/24 The first item indicates the network address where the interface is located
    • 192.168.1.1/32 The second item indicates the ip address of the interface
    • 192.168.1.255/32 The third item indicates the broadcast address of the network where the interface is located

view routing table

  • Destination/Mask: Indicates the destination network address and netmask of this route. After "logic AND" the destination address and the subnet mask, the address of the network segment where the destination host or router is located can be obtained.
  • Proto (Protocol): The protocol type of the route, that is, the protocol through which the router learns the route.
  • Pre (Preference): Indicates the routing protocol priority of this route. For the same purpose, there may be multiple routes such as different next hops and outgoing interfaces. These different routes may be discovered by different routing protocols, or manually configured static routes. The one with the highest priority (smallest value) will be the current optimal route.
  • Cost: Routing cost. When multiple routes to the same destination have the same priority, the route with the lowest cost will be the current optimal route.
  • NexHop: Indicates the next hop address to the destination network of the router for this router, and this field indicates the next device for data forwarding.
  • Interface: Indicates the outbound interface of this route. Indicates which interface of the router the data is forwarded from.

routing priority

  • Route selection order: longest match principle (mask length) > route priority > cost overhead value
  • Common routing priorities are as follows:

default route

  • The default route is generally used for forwarding according to the default route when all routes cannot be matched.
  • Generally used for stub nodes.

Routing and Forwarding Process

  1. First use the binary of your own ip address and the binary of your own mask to perform an AND operation (the upper number * the lower number) to get a network number
  2. Take the binary of the other party's ip address and the binary of its own mask to perform an AND operation to obtain a network number of the other party
  3. If the two network numbers are the same, it means Layer 2 forwarding, and arp will be sent directly to the other party.
  4. If the two network numbers are different, it is three-layer forwarding, and the data will be sent to the gateway

routing recursion

  • A route must have a directly connected next hop to guide forwarding. However, when a route is generated, the next hop may not be directly connected. Therefore, a directly connected next hop and the corresponding outbound interface need to be calculated. This process is called route recursion.
  • Route recursion is also known as route iteration.

floating route

  • Static routes support manually specifying the priority during configuration. You can configure static routes with the same destination address/mask, different priorities, and different next hops to realize the backup of the forwarding path.
  • The floating route is the backup of the active route, ensuring that a backup route is provided when a link fails. When the next hop of the active route is reachable, the backup route will not appear in the routing table.

Route Summary (CIDR)

  • Use the length of the ip address and mask to identify the network and subnet, instead of dividing according to the traditional ABC and other types of network addresses
  • Multiple consecutive prefixes can be aggregated into a network, which can effectively reduce the number of routing entries

Guess you like

Origin blog.csdn.net/weixin_45988710/article/details/131610595