Routing Original Work: working at the protocol network layer, responsible for transmitting data packets from a link (in the datagram Network) allocate the destination address to an appropriate output Link (called switching forwarding in the network). Also, select a suitable route (not necessarily the shortest, but also consider many factors! Such as policy) transfers data packets from the source address to the destination address. This service also has a term called routing. This is also the two main services provided by the TCP/IP network layer. Previously, each device on the network should have its own unique IP address. However, as more and more devices access the network and the number of valid IPv4 addresses is limited, the lack of IP addresses becomes increasingly prominent. So NAT technology came into being. Nat, full name: network address transimssion, network address ing. So how does he save valid IP addresses? Different from the traditional routing technology, the subnet connected to it is transparent to external networks. This transparency refers to the external network, this route shares the same IP address with this subnet. Everyone knows that the IP address that uniquely identifies a host on the network is its IP address, just as everyone has different ID card numbers in society. First, a subnet shares an IP address with a route, which can save a lot. Then the problem arises. Previously, we could add a destination IP address to the IP address package to address the destination host. Now, when multiple hosts share one IP address, it is obvious that the IP address cannot be used to address a single host. How can this problem be solved? This is enough for IP data packets. Previously, because a host can run with multiple processes at the same time, of course, there may also be multiple processes waiting for network packets, so for an IP packet, he does not need to know that it should be uploaded to that host, you also need to know the process that is uploaded to the host. In the IP packet, one of the processes is the port number ). The difference between a NAT route and a conceptual route is that it uses the port number to address hosts and processes in the subnet, that is, the port number not only addresses processes in the host, it is also used to address hosts! How did he do it? First, a host in the subnet sends an IP packet with its source IP address 1 (this IP address is valid only in this subnet) and Port Number 1 when requesting data from the external network, during Nat, it replaces source IP address 1 with its own IP address 2 (the IP address can be addressed by the external network, which is the IP address of the route and the IP address of the subnet to the external network ), allocate an available port number 2 at the same time. At the same time, the correspondence between host source IP address 1 and port number 1 and port number 2 is recorded in table. When he receives a packet from an external network, he finds the real destination host and port number of the packet based on table A to distribute the packet. Although Nat uses port number to address hosts, It has been strongly opposed by some associations, but the fact is that it can solve the real problems well, so humans cannot stop their development... After that, a conceptual route can have multiple IP addresses, because the IP address corresponds to an interface instead of a node and can be understood as a different subnet. Most of what we see in daily use is Nat routing, so an IP address assigned by the ISP is configured. (I am a beginner. Thank you for your advice)