Home > Common Problem > body text

What addresses are used to distinguish different devices in Ethernet?

青灯夜游
Release: 2022-07-25 14:20:39
Original
11957 people have browsed it

In Ethernet, different devices are distinguished based on the "MAC" address. Each device in the network has a unique network identifier. This address is called a MAC address or network card address. It is an address used to confirm the location of the network device. It is written inside the hardware when it is produced by the network equipment manufacturer. The MAC address is used to uniquely identify a network card in the network. If a device has one or more network cards, each network card needs and will have a unique MAC address.

What addresses are used to distinguish different devices in Ethernet?

The operating environment of this tutorial: Windows 7 system, Dell G3 computer.

In Ethernet, different devices are distinguished based on the "MAC" address.

MAC address (English: Media Access Control Address), literally translated as media access control address, also known as LAN Address, MAC address, Ethernet Address Or physical address (Physical Address), which is an address used to confirm the location of a network device. In the OSI model, the third network layer is responsible for IP addresses, and the second data link layer is responsible for MAC addresses. The MAC address is used to uniquely identify a network card in the network. If a device has one or more network cards, each network card needs and will have a unique MAC address.

The MAC address is also called the physical address and hardware address. It is burned into the EPROM (a flash memory chip that can usually be erased by a program) on the network interface card when it is produced by the network equipment manufacturer. IP addresses and MAC addresses are both represented in binary in computers. IP addresses are 32 bits, while MAC addresses are 48 bits.

The length of the MAC address is 48 bits (6 bytes), usually expressed as 12 hexadecimal numbers, such as: 00-16-EA-AE-3C-40 is a MAC address, where the first 3 bytes, the hexadecimal number 00-16-EA represents the network hardware manufacturer's number, which is assigned by IEEE (Institute of Electrical and Electronics Engineers), and then 3 bytes, the hexadecimal number AE-3C-40 represents The serial number of a network product (such as a network card) made by this manufacturer. As long as your MAC address is not changed, the MAC address is unique in the world. Figuratively speaking, the MAC address is like the ID number on the ID card, which is unique.

The structure of MAC

Each device in the network has a unique network identifier. This address is called the MAC address or network card address. When produced by the network equipment manufacturer Written inside the hardware. The MAC address is 48 bits (6 bytes), usually expressed as 12 hexadecimal numbers, separated by colons between each two hexadecimal numbers, such as 08:00:20:0A:8C:6D It's just a MAC address. As shown in the figure below, the first 3 bytes represent OUI (Organizationally Unique Identifier), which is a code assigned by the IEEE registration management agency to different manufacturers to distinguish different manufacturers. The last 3 bytes are allocated by the manufacturer.

The lower second bit (LSb) of the highest byte (MSB) of the MAC address indicates whether the MAC address is global or local, that is, the U/L (Universal/Local) bit. If it is 0, it means yes global address. All OUI bits are 0.

The lower first bit (LSb) of the highest byte (MSB) of the MAC address indicates whether the MAC address is unicast or multicast. 0 means unicast.

The role of MAC

The IP address is based on logic, is more flexible, is not limited by hardware, and is easy to remember. The MAC address is consistent with the hardware to a certain extent, is based on physics, and can identify specific network nodes. Both addresses have their own advantages, and different addresses are used depending on different conditions.

Most of the ways to access the Internet are to organize hosts together through a LAN, and then connect them to the Internet through devices such as switches or routers. This raises the question of how to distinguish specific users and prevent IP addresses from being stolen. Since the IP address is only a logical identifier and can be modified by anyone, it cannot be used to specifically identify a user. The MAC address is not the case. It is fixed in the network card. Theoretically, unless the hardware, namely the network card, is stolen, it generally cannot be impersonated. Based on this characteristic of the MAC address, the LAN adopts the method of using the MAC address to identify specific users.

In the specific communication process, the MAC address and IP address are matched one-to-one through the exchange table inside the switch. When there is a data packet sent to a host in the local LAN, the switch first receives the data packet, then maps the IP address in the data packet to a MAC address according to the corresponding relationship in the switching table, and then forwards the data packet to the corresponding The MAC address of the host goes up. In this way, even if a host steals the IP address, it will not be able to receive the data packet because it does not have a corresponding MAC address. The sending process is similar to the receiving process.

So, whether it is a local area network or a wide area network, when computers communicate with each other, the final performance is that the data packet starts from an initial node on some form of link and is passed from one node to another. A node is finally transmitted to the destination node. The transmission of data packets between these nodes is completed by ARP (Address Resolution Protocol) which is responsible for mapping IP addresses to MAC addresses.

ID card is used to prove a person’s identity. The ID card is not very useful on weekdays, but at certain critical moments, an ID card is necessary to explain everything about a person. Then, the binding of IP address and MAC address is like the relationship between a person and his ID card in daily life. Because the IP address can be arbitrary, but the MAC address is the only one that shows the identity of the IP address. For example, to prevent IP addresses from being stolen, usually switch port binding (the port's MAC table uses static entries) can prevent theft of modified MAC addresses when each switch port is connected to only one host. The layer device can also provide binding of switch ports, IP addresses, and MAC addresses.

For more related knowledge, please visit the FAQ column!

The above is the detailed content of What addresses are used to distinguish different devices in Ethernet?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template