Home Backend Development PHP Tutorial What is a MAC address - the basics

What is a MAC address - the basics

Jul 25, 2016 am 09:00 AM

The Mac address is the address used on the media access layer. In layman's terms, it is the physical address of the network card. Today's Mac addresses generally use 6 bytes and 48 bits (in the early days, there were 2 bytes and 16 bit Mac addresses).

 As for the MAC address, since we don’t have direct contact with it, everyone may not be very familiar with it. In the OSI (Open System Interconnection, Open System Interconnection) 7-layer network protocol (physical layer, data link layer, network layer, transport layer, session layer, presentation layer, application layer) reference model, the second layer is the data link Road layer (Data Link). It contains two sub-layers. The upper layer is Logical Link Control (LLC), and the lower layer is the MAC (Media Access Control) layer we mentioned earlier, which is the media access control layer. The so-called media refers to the various physical environments through which signals are transmitted. Commonly used network media include cables (such as twisted pairs, coaxial cables, optical fibers), microwaves, lasers, infrared, etc. The media are sometimes also called physical media. The MAC address is also called the physical address, hardware address or link address. It 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 network card, hub, router, etc.) is connected to the network, it will have the same MAC address. The MAC address generally cannot be changed and cannot be changed by the user. Set it yourself.

 The first 24 digits of the MAC address are the manufacturer's address applied to IEEE by the manufacturer. The last 24 digits are determined by the manufacturer. (You don’t need to apply for the early 2-byte ones)

  1: What is the connection and difference between IP address and Mac address? I believe everyone is familiar with the IP address, which refers to the 32-bit address assigned to the host using the TCP/IP protocol. An IP address consists 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. An IP address consists of two parts: a network address and a host address. The number of bits allocated to these two parts varies depending on the address class (Class A, Class B, Class C, etc.). Network addresses are used for routing, while host addresses are used to find an individual host within a network or subnet. An IP address makes it possible to route data from a source address to a destination address.

  Nowadays, many computers are connected to the Internet by first setting up a local area network and then through a switch. Then each user is assigned a fixed IP address, which is managed uniformly by the management center. In order to facilitate management, it is necessary to use the Mac address to identify the user, prevent confusion, and clarify responsibilities (such as cyber crimes). In addition, there is a difference between IP address and Mac address, although they have a one-to-one correspondence in the LAN. The IP address is specified according to the current IPv4 standard and is not restricted by hardware. It is an address that is easy to remember, but the Mac address is the physical address of the network card, which is somewhat related to the hardware and is more difficult to remember.

 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: 08:00:20:0A:8C :6D is a MAC address. The first 6 hexadecimal digits 08:00:20 represent the network hardware manufacturer's number. It is assigned by IEEE (Institute of Electrical and Electronics Engineers, Institute of Electrical and Electronics Engineers), and the last 3 digits represent the network hardware manufacturer's number. The hexadecimal number 0A:8C:6D represents the serial number of a certain network product (such as a network card) manufactured by the manufacturer. Each network manufacturer must ensure that every Ethernet device it makes has the same first three bytes and different last three bytes. This ensures that every Ethernet device in the world has a unique MAC address.

Since every Ethernet device has a unique MAC address when it leaves the factory, why do we need to assign an IP address to each host? In other words, why is each host assigned a unique IP address, and why is it necessary to embed a unique MAC address in the production of network equipment (such as network cards, hubs, routers, etc.)?

The main reasons are as follows: (1) IP addresses are assigned based on the topology of the network, not who created the network settings. It is not feasible to base an efficient routing solution on the basis of the equipment manufacturer rather than the topological location of the network. (2) Equipment is easier to move and repair when there is an additional layer of addressing. For example, if an Ethernet card breaks, it can be replaced without obtaining a new IP address. If an IP host moves from one network to another, it can be given a new IP address without the need for a new network card. (3) Whether it is a communication between computers in a local area network or a wide area network, the final performance is to transmit the data packet from the initial node on some form of link, from one node to another node, and finally to the destination. node. The movement of data packets between these nodes is completed by ARP (Address Resolution Protocol) which is responsible for mapping IP addresses to MAC addresses.



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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Two Point Museum: All Exhibits And Where To Find Them
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Working with Flash Session Data in Laravel Working with Flash Session Data in Laravel Mar 12, 2025 pm 05:08 PM

Laravel simplifies handling temporary session data using its intuitive flash methods. This is perfect for displaying brief messages, alerts, or notifications within your application. Data persists only for the subsequent request by default: $request-

cURL in PHP: How to Use the PHP cURL Extension in REST APIs cURL in PHP: How to Use the PHP cURL Extension in REST APIs Mar 14, 2025 am 11:42 AM

The PHP Client URL (cURL) extension is a powerful tool for developers, enabling seamless interaction with remote servers and REST APIs. By leveraging libcurl, a well-respected multi-protocol file transfer library, PHP cURL facilitates efficient execution of various network protocols, including HTTP, HTTPS, and FTP. This extension offers granular control over HTTP requests, supports multiple concurrent operations, and provides built-in security features.

Simplified HTTP Response Mocking in Laravel Tests Simplified HTTP Response Mocking in Laravel Tests Mar 12, 2025 pm 05:09 PM

Laravel provides concise HTTP response simulation syntax, simplifying HTTP interaction testing. This approach significantly reduces code redundancy while making your test simulation more intuitive. The basic implementation provides a variety of response type shortcuts: use Illuminate\Support\Facades\Http; Http::fake([ 'google.com' => 'Hello World', 'github.com' => ['foo' => 'bar'], 'forge.laravel.com' =>

12 Best PHP Chat Scripts on CodeCanyon 12 Best PHP Chat Scripts on CodeCanyon Mar 13, 2025 pm 12:08 PM

Do you want to provide real-time, instant solutions to your customers' most pressing problems? Live chat lets you have real-time conversations with customers and resolve their problems instantly. It allows you to provide faster service to your custom

Explain the concept of late static binding in PHP. Explain the concept of late static binding in PHP. Mar 21, 2025 pm 01:33 PM

Article discusses late static binding (LSB) in PHP, introduced in PHP 5.3, allowing runtime resolution of static method calls for more flexible inheritance.Main issue: LSB vs. traditional polymorphism; LSB's practical applications and potential perfo

PHP Logging: Best Practices for PHP Log Analysis PHP Logging: Best Practices for PHP Log Analysis Mar 10, 2025 pm 02:32 PM

PHP logging is essential for monitoring and debugging web applications, as well as capturing critical events, errors, and runtime behavior. It provides valuable insights into system performance, helps identify issues, and supports faster troubleshoot

Discover File Downloads in Laravel with Storage::download Discover File Downloads in Laravel with Storage::download Mar 06, 2025 am 02:22 AM

The Storage::download method of the Laravel framework provides a concise API for safely handling file downloads while managing abstractions of file storage. Here is an example of using Storage::download() in the example controller:

HTTP Method Verification in Laravel HTTP Method Verification in Laravel Mar 05, 2025 pm 04:14 PM

Laravel simplifies HTTP verb handling in incoming requests, streamlining diverse operation management within your applications. The method() and isMethod() methods efficiently identify and validate request types. This feature is crucial for building

See all articles