IP, MAC and port number - to confirm the three elements of the network communication identity information

In the vast ocean of the Internet to find a computer that is not easy, there are three elements must be in place, they are the IP address, MAC address and port number.

IP addresses

IP address is the abbreviation for Internet Protocol Address, translated as "Internet protocol address."

Currently, most software uses IPv4 addresses, but IPv6 also being accepted, especially in the education network, has been widely used.

A computer can have a unique IP address, a local area network can also have a unique IP address (outside if only one computer). For now widely used IPv4 address, its resources are very limited, a computer an IP address is unrealistic, often only a local area network has an IP address.

When communicating over the Internet, they must know each other's IP address. In fact, have been included in the packet IP address and sends the packet to the router after router will find the other side of the ground location based on IP address, complete a transfer of data. Routers have a very efficient and intelligent algorithms, you will quickly find the target computer.

MAC address

The reality is, a local area network can often have a separate IP; in other words, IP addresses can only target a local area network, you can not navigate to a specific computer. This is how to do it? Such communication is also not ah.

In fact, the only really identifies a computer's MAC address, MAC address of each card is unique in the world. The computer ships, MAC address has been written to the card dead inside (of course, by some "Kit Kat kinky technology" also can be modified). LAN router / switch records the MAC address of each computer.

MAC address is the Media Access Control Address acronym, literally translated as "MAC address", also known as local area network address (LAN Address), Ethernet address (Ethernet Address) or physical address (Physical Address).

Packet included in addition to the other IP address, the MAC address will be included when the packet arrives after the LAN router / switch would find the corresponding MAC address of the computer in accordance with the data packet, then the data packet transmitted to it, this completes the transfer of data.

The port number

With the IP address and MAC address, although you can find the target computer, but still can not communicate. A computer can simultaneously provide multiple network services, such as Web services (Web site), FTP service (file transfer service), SMTP service (mail service), etc., only the IP address and MAC address, although the computer correctly receives a packet but do not you want to know which network the program packets to be processed, the communication failure.

In order to distinguish between different network programs, the computer assigns a unique program for each network port number (Port Number), for example, Web service port number is 80, the port number 21 is the FTP service, the port number of the SMTP service 25 .

Port (Port) is a virtual, logical concept. Port may be understood as a door, the data flow in and out through the door, each door has a different number is the port number. As shown below:

Guess you like

Origin blog.csdn.net/Qsir/article/details/93738294
Recommended