Home >Common Problem >The difference between physical (mac) address and IP address
The difference between MAC address and IP address is as follows:
1. Difference in address length
1. MAC The length of the 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 It's just 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.).
The above is the detailed content of The difference between physical (mac) address and IP address. For more information, please follow other related articles on the PHP Chinese website!