Detailed explanation of the basic knowledge of Cisco routing technology
Router <1>
The simplest network can be imagined as a single-wire bus, whereby computers can communicate with each other by sending packets to the bus. But as the number of computers in the network increases, this is not feasible and will cause many problems:
1. Bandwidth resources are exhausted.
2. Every computer wastes a lot of time processing irrelevant broadcast data.
3. The network becomes unmanageable, and any errors may cause the entire network to be paralyzed.
4. Each computer can listen to communications from other computers.
Segmenting the network can solve these problems, but at the same time you must provide a mechanism to enable computers of different network segments to communicate with each other. This usually involves selectively transmitting data between network segments at some ISO network protocol layers. Let's take a look at the location of the network protocol layer and the router.
We can see that the router is located at the network layer. This article assumes that the network layer protocol is IPv4, because this is the most popular protocol, and the concepts involved are similar to other network layer protocols.
1. Routing and bridge
The bridge/switching of routing relative to layer 2 is a high-level concept and does not involve the physical details of the network. In a routable network, each host has the same network layer address format (such as an IP address), whether it is running on Ethernet, token ring, FDDI, or WAN. The network layer address is usually composed of two parts: the network address and the host address.
A bridge can only connect to networks with the same data link layer (or similar) while a router is different. It can connect to any two types of networks as long as the host uses the same network layer protocol.
Router <two>
2. Connect the network layer and the data link layer
Below the network layer is the data link layer, and in order for them to communicate with each other, a "glue" protocol is required. ARP (address resolution protocol) is used to map network layer (layer 3) addresses to data link layer (layer 2) addresses, while RARP (reverse address resolution protocol) is the opposite.
Although the definition of ARP is not related to the network layer protocol, it is usually used to resolve IP addresses; the most common data link layer is Ethernet. Therefore, the following examples of ARP and RARP are based on IP and Ethernet, but be aware that these concepts are the same for other protocols.
1. Address resolution protocol
Network layer addresses are abstract maps defined by network administrators, and they do not care about which data link layer protocol is the lower layer. However, network interfaces can only communicate with each other based on layer 2 addresses, and layer 2 addresses are obtained from layer 3 addresses through ARP.
Not every packet is sent requires an ARP request, and the response is cached in the local ARP table, which reduces the ARP packets in the network. ARP is relatively easy to maintain and is a relatively simple protocol.
2. Introduction
If interface A wants to send data to interface B and A only knows B's IP address, it must first look up B's physical address. It sends an ARP broadcast request B's physical address containing B's IP address. After interface B receives the broadcast, it responds to A's physical address.
Note that although all interfaces receive information, only B responds to the request, which ensures that the response is correct and avoids expired information. It should be noted that when A and B are not in the same network segment, A only sends ARP request to the next hop router, rather than sending it directly to B. After receiving the ARP packet, please note that the sender's pair is stored in the local ARP table of the host receiving the ARP request. Generally, when A wants to communicate with B, B may also need to communicate with A.
3. IP address conflict
The most common problem arising from ARP is the conflict of IP addresses, which is due to the same IP addresses of two different hosts. In any interconnected network, the IP address must be unique. At this time, you will receive two ARP responses, pointing out different hardware addresses respectively. This is a serious error and there is no simple solution.
To avoid such errors, when interface A is initially trialized, it sends an ARP request containing its IP address. If no response is received, A assumes that the IP address is not used. We assume that interface B has used the IP address, then B sends an ARP response, and A can know that the IP address has been used, and it can no longer use the IP address, but returns an error message. This creates another problem. Assume that host C contains a mapping of the IP address, which is mapped to the hardware address of B. After receiving the ARP broadcast from interface A, it updates its ARP table so that it points to the hardware address of A. To resolve this error, B sends another ARP request broadcast, so that host C updates its ARP table again to point to B's hardware address again. At this time, the state of the network returns to the previous state. It is possible that C has sent an IP packet to A that should be sent to B. This is unfortunate, but because the IP provides unguaranteed transmission, no major problems will arise.
4. Manage ARP cache table
The ARP cache table is a list of right, indexed according to the IP address. The table can be managed with the command arp, and its syntax includes:
Add static table entry to the table -- arp -s
Delete table entry from table -- arp -d
Display table entry -- arp -a
Dynamic table entries (tables that are not manually added) in ARP tables are usually automatically deleted after a period of time. The length of this period is determined by a specific TCP/IP implementation.
5. Use of static ARP addresses
Typical use of static ARP addresses is to set up a standalone print server, these devices are usually configured via telnet, but first they require an IP address. There is no obvious way to tell the device this information, as if only its serial port can be used to set it. However, this requires finding a suitable terminal and serial cable, setting baud rate, parity, etc., which is very inconvenient.
Suppose we want to set the IP address P-IP for a print server, and we know its hardware address P-hard, and create a static ARP entry on workstation A to map P-IP to P-hard. In this way, although the print server does not know its IP address, all data pointing to P-IP will be sent to P-hard. We can now telnet to P-IP and configure its IP address, and then delete the static ARP entry.
Sometimes the print server is configured in one subnet and it is used in another subnet in a similar way. Assuming that its IP address is P-IP, we assign a temporary IP address T-IP of this website to it, create a temporary ARP entry on workstation A to map T-IP to P-hard, then telnet to T-IP, and assign the print server with an IP address P-IP. Next, you can put it in another subnet for use, don't forget to delete the static ARP table entry.
6. Agent ARP
You can avoid configuring routing tables on each host by using proxy ARP, which is especially useful when using subnets, but note that not all hosts can understand subnets. The basic idea is that even for hosts not on the subnet, ARP request is sent, and the ARP proxy server (usually the gateway) responds with the gateway's hardware address.
Proxy ARP simplifies host management, but increases network traffic (not very obvious) and may require a larger ARP cache. Each IP address not on this website is created with a table entry mapped to the gateway's hardware address. In the eyes of hosts using proxy ARP, the world is like a large physical network without routers.
Article entry: aaadxmm Editor in charge: aaadxmm