Differences: 1. The length of the MAC address is 48 bits (6 bytes); while the IP address is 32 bits. 2. The MAC address is applied to the second layer of OSI, which is the data link layer; the IP address is applied to the third layer of OSI, which is the network layer. 3. The allocation of MAC addresses is based on the manufacturer; the allocation of IP addresses is based on the network topology.
The operating environment of this article: Windows 7 system, Dell G3 computer.
The difference between MAC address and IP address
1. The difference in address length
1 . The length of the MAC address is 48 bits (6 bytes), usually expressed as 12 hexadecimal numbers, and each two hexadecimal numbers are separated by colons, such as: 00:50:29:5A:8H :1E is a MAC address.
2. The IP address is 32 bits, consisting of four 8-bit groups separated by dots. For example, 192.168.0.1 is an IP address. This writing method is called dotted decimal format.
2. Differences in addressing protocol layer
1. The MAC address is applied to the second layer of OSI, which is the data link layer. The data link layer protocol enables data to be passed from one node to another node on the same link (via MAC address).
2. The IP address is applied to the third layer of OSI, which is the network layer. The network layer protocol allows data to be transferred from one network to another (ARP finds the MAC address of the intermediate node based on the destination IP address, and transmits it through the intermediate node, thereby finally reaching the destination network).
3. The allocation basis is different.
1. The allocation of MAC address is based on the manufacturer.
The MAC address is written inside the hardware when it is produced by the network equipment manufacturer. This address has nothing to do with the network, that is, no matter where the hardware with this address (such as a hub, network card, router, etc.) is connected to the network, it will have the same MAC address and is immutable.
2. IP address allocation is based on network topology.
The IP address consists of two parts: the network address and the host address. The number of bits allocated to these two parts varies with the address class (Class A, Class B, Class C, etc.).
If you want to read more related articles, please visit PHP Chinese website! !
Related recommendations: "Programming Video"
The above is the detailed content of What is the difference between mac address and ip address. For more information, please follow other related articles on the PHP Chinese website!