What is a MAC address

What is a MAC address

 Currently, the most widely used LAN standard is Ethernet. The Ethernet uses hardware-specific addresses called MAC addresses (Media Access Control) in addition to IP addresses.

 In the first place, the IP address is a logical address, and even if you assign “192.168.1.1” to a certain PC, for convenience, you just set it arbitrarily, and other PCs on the LAN can assign any IP address to that PC. but I don’t know if it was assigned.

Therefore, Ethernet uses IP addresses and MAC addresses for communication.

 A MAC address is a hardware-specific address, also known as a physical address. It is a unique number assigned to NICs and network devices, and does not change even if it is moved to another network.

MAC addresses have the following rules:

1. Consists of 48-bit code.

2. Vendor can be identified from OUI.

 The first 24 bits are the vendor code, “00:00:0C” for Cisco and “00:00:39” for Toshiba, which are managed by IEEE. The remaining 24 bits can be arbitrarily assigned by the vendor as long as they do not overlap.

3. It is written by the vendor at the time of shipment, and in principle the user does not operate it.

4. As a general rule, devices with the same MAC address do not exist.

5. Divide 48bit into 6 blocks by 8bit with “:” and express in hexadecimal.
 For example, “00:00:0C:A6:38:D8”
 * Sometimes separated by “-” or “.”.

 Among bits in an octet, the most significant bit is called MSB (Most Significant Bit) and the least significant bit is called LSB (Least Significant Bit). *When transmitting, each octet is transmitted in order from LSB to
MSB.

MAC address broadcast address

 As with IP addresses, MAC addresses also have reserved numbers. Broadcast address and multicast address. Here, we will explain the broadcast address.

 The address “FF:FF:FF:FF:FF:FF” where all 48 bits are “1” is reserved as a broadcast address.

 A broadcast address of “FF:FF:FF:FF:FF:FF” means, at the data link layer level, all destinations; It will reach your terminal.

This broadcast address is used when you want to communicate with all terminals within the broadcast domain such as ARP.

Broadcast problem

Bridges and switches are devices that divide this collision domain and operate at the data link layer.

 Manage frames to be sent and received in the MAC address table. Therefore, it learns which device is connected to which port, forwards frames only to the port that connects to the destination host, and does not flow unnecessary frames to other ports, thereby dividing the broadcast domain.

However, a broadcast whose destination is all (FF:FF:FF:FF:FF:FF) will be forwarded.

 In the case of unicast, it determines whether the NIC is addressed to itself at the data link layer level, and discards it if it is not addressed to itself. As a result, the data is passed to the network layer, which is the upper layer. As a result, CPU resources are wasted.

 As the size of the broadcast domain increases, the number of terminals receiving the broadcast increases, which becomes a problem. The size of the broadcast domain should be considered as small as possible when constructing the network.

 Also, the IP header has a TTL and a time to live, but the Ethernet header does not have a time to live like TTL. In other words, frames that cannot reach their destination will never disappear. If you accidentally configure your network into a loop configuration, a broadcast storm may occur and bring down your network.

Check MAC address of PC (ipconfig /all)

To find out the MAC address of your Windows PC, use the command below.

Windows 9x system ・・・ winipcfg
Windows NT system ・・・ ipconfig /all

Here, the case of Windows NT series OS such as Windows 8.1 is introduced as an example.

Display the command prompt, enter the “ipconfig /all” command, and press the “Enter key”.

Then you should see something like this:

Among the displayed items, “physical address” is the MAC address.

Will MAC addresses run out?

IPv4 address is 32bit

 2 32  = 4,294,967,296

So there are only about 4.3 billion IP addresses. There is a clear shortage for the world population.

 Therefore, in IPv4, measures are taken to make effective use of fewer IP addresses, such as subnet masks, VLSM, CIDR, private IP addresses, and NAT. Nevertheless, it is predicted that the number of IP addresses will run out in the near future, so preparations are underway to switch to IPv6.

So, do we need to worry about running out of MAC addresses?

 These days, it is not uncommon for one person to own multiple PCs, and home appliances such as home game consoles and TVs also have MAC addresses. It is becoming possible for familiar home appliances to connect to networks.

In other words, the number of devices with MAC addresses is increasing.

A MAC address is 48 bits.

Since 46 bits can be used excluding the I/G bit and U/L bit,

 2 46  = 70,368,744,177,664

About 70 trillion MAC addresses will be available.

 Since IPv4 has about 4.3 billion 32-bit IP addresses, there are about 16,000 times as many MAC addresses as IP addresses. Even if we estimate the world population to be 7 billion and calculate the MAC address that can be obtained per person, we will be able to obtain 10,000 MAC addresses per person.

As for MAC addresses, we don’t need to worry about exhaustion for the time being.

 Even if MAC addresses are exhausted, MAC addresses are data link layer addresses and should not be duplicated within a segment, so it seems that you don’t have to worry too much about the probability. However, if it overlaps, it seems that the MAC address can be rewritten.

So, are MAC addresses enough for vendors who manufacture devices?

The number of addresses each vendor can manage is 24 bits per OUI.

 2 24  = 16,777,216

In other words, it is calculated that only about 16 million addresses can be used per OUI.

At first glance, this number may appear to be sufficient.

 However, taking the example of “Nintendo DS”, which sold explosively all over the world, sales in Japan alone exceeded 20 million units (as of November 2007).

In other words, 16 million MAC addresses is not enough.

Vendors apply for OUI quotas and obtain multiple OUIs.