So what is the gateway? A gateway is essentially a network that leads to its IP address. For example, if Network A and Network B exist, the IP address range of Network A is "192.168.1.1 ~ 192. 168.1.254 ", The subnet mask is 255.255.255.0, And the IP address range of Network B is" 192.168.2.1 ~ 192.168.2.254 ", and the subnet mask is 255.255.255.0. In the absence of a vro, the two networks cannot communicate with each other, even if the two networks are connected to the same vswitch (or hub, the TCP/IP protocol also determines that hosts in the two networks are in different networks based on the subnet mask (255.255.255.0. To complete the communication between the two networks, you must use the gateway. If the host in Network A finds that the host where the data packet is located is not in the local network, it forwards the data packet to its own gateway, and then the gateway forwards the data packet to the Gateway in Network B, the gateway of the Local Network B is then forwarded to a host of the Local Network B. The same is true for the process in which Network B forwards data packets to Network.
In network technology, port has two meanings: first, physical port, for example, ADSL modem, Hub, switch, router is used to connect her network equipment interface, such as RJ-45 port, SC port and so on. The second is the logical sense of the local port, usually refers to the port in the TCP/IP protocol, the port number range from 0 to 65535, for example, used to browse the Web site port 80, it is used for FTP service port 21 and so on. Here we will introduce the logical sense of the local port.
So what is the port in the TCP/IP protocol? If the IP address is compared to a house, the port is used to access the house. There are only a few real houses, but one IP Address can have as many as 65536! The port is marked by the port number. The port number has only an integer and ranges from 0 to 65535.
What is the port used? We know that a host with an IP address can provide many services, such as web services, FTP services, and SMTP services. These services can be completed with one IP address. How does a host identify different network services? Obviously, you cannot rely only on IP addresses because the relationship between IP addresses and the network service locations is one-to-many. In fact, "ip address + port number" is used to distinguish service locations.
It is important to note that ports are not mapped one by one. For example, when your local computer serves as a client to access a WWW server, the WWW server uses port 80 to communicate with your local computer, but your local computer can use port 3457.