Why are IP addresses and Mac addresses created? As many of you know, IP addresses and Mac addresses are created to help others find you

A Mac address is a bit like an ID number, and an IP address is like a house number. It is difficult to find a different grain of sand in the vast sea with just an ID number, but if you first find a specific beach, the sand is divided into small grids, it is easy to find the different grain of sand by ID.

A MAC address (physical address or hardware address) is the actual source address of a network device. It is written into the BIOS of a network device by the manufacturer.

Network device vendors are not allowed to use Mac addresses at will. They need to apply to the IEEE for Mac addresses. Of course, vendors need to pay for Mac addresses.

Mac addresses are usually represented as 12 hexadecimal numbers, two of which are separated by colons. The first six hexadecimal numbers represent the number of the network hardware manufacturer and are assigned by the IEEE. The next three hexadecimal numbers are assigned by the network product manufacturer. This ensures that every network device in the world has a unique MAC address. For example, if a computer’s network card is broken, the MAC address will change when a new network card is replaced.

IP addresses are designed for topology purposes. They assign a logical address to each network and each host on the Internet to mask physical address differences. For network devices such as routers and computers, IP addresses can be changed as long as the IP addresses do not duplicate.

The Evolution of the Internet

In the early Days of Ethernet, there were only hubs and no switches, so packets sent could be monitored by all the machines in the Ethernet. Therefore, packets had to carry source and destination MAC addresses, and each machine only needed to receive packets that matched its OWN MAC address.

Data transmission on the LAN is not routed and forwarded by IP addresses at the network layer. To send data on the LAN, you need to know the MAC address of the device. For example, when our computer sends data to other computers on other Lans, it first obtains the MAC address corresponding to the destination IP address through ARP (Address resolution Protocol) on the LAN.

Step1: the source host first sends an ARP broadcast request to the LAN. As long as the destination MAC address is FF:FF:FF:FF:FF:FF.

Step2: the device that receives ARP requests checks whether the destination IP address is consistent with its own IP address. If the destination IP address is inconsistent, the device ignores the current ARP request. If the destination IP address is consistent, the device sends an ARP response to the source host.

Step3: after receiving the ARP response, the source host updates the local cache table and continues to send data to the destination host.

In a LAN, if a hub is used to connect different network devices, the same MAC address will not cause too many problems, because all the data frames in the LAN connected by the hub will be broadcast to all the hosts in the LAN, and if different network devices are connected through the switch, it will be affected. The switch needs to learn the Mac addresses of different devices on the LAN and forward data frames to specific hosts.

Therefore, the Mac address can be used repeatedly, but the same Mac address cannot be used in the same LAN. The network transmission across lans requires IP protocol at the network layer. Therefore, the same Mac address on different Lans does not have similar problems.

Mac addresses may duplicate

According to the IEEE protocol, each network device is delivered with a globally unique Mac address, and the used Mac address will not be reused. But it does not mean that the Mac address will not be repeated, many friends have changed the Mac address, some directly through the system to change.

Some network devices allow you to manually change MAC addresses in the admin background.

All of the above are virtual overwrites of the original Mac address, and does not change the Mac address branded when the device was born. The Mac address can also be modified by writing to the hardware. In essence, the Mac address is a string of binary numbers stored in a storage area of the BIOS.