Post

Networking/CCNA Part 4: A Guide to MAC & IP Addressing

A Guide to MAC & IP Addressing

Networking/CCNA Part 4: A Guide to MAC & IP Addressing

Cisco

Understanding Network Addressing: MAC vs. IP

In modern networking, data packets find their way to the correct destination using a layered addressing system. This post breaks down the fundamental differences between hardware-based MAC Addressing and software-based IP Addressing.


1. MAC Addressing (Layer 2)

A Media Access Control (MAC) address is the permanent, physical identity of your network hardware. Unlike an IP address, which changes depending on where you connect, the MAC address is “burned into” the device at the factory. It operates at Layer 2 (Data Link Layer).

The Many Names of MAC

In professional networking, you might see a MAC address referred to by any of these 11 names:

  1. Media Access Control
  2. Layer 2 Address
  3. Physical Address
  4. Hardware Address
  5. Data Link Layer Address
  6. 48-bit Address
  7. Fixed Address
  8. Burn-In Address (BIA)
  9. NIC Address
  10. Manufacturer Address
  11. Ethernet Address

Structure of a MAC Address

A MAC address is 48 bits long, represented by 12 hexadecimal characters (0-9 and A-F).

  • Vendor Code (OUI): The first 24 bits (6 hex digits). This is unique to the manufacturer.
  • Serial Number: The last 24 bits. This is dynamic and assigned by the vendor.

Manufacturer Limits: A vendor can create $2^{24}$ (16,777,216) unique LAN cards with one Vendor ID. Once they reach this limit, they must request a new unique ID from IANA (Internet Assigned Numbers Authority).

Example: 8c:16:45:f5:e2:a2

  • Hex to Binary: Remember that one hexadecimal digit equals 4 binary bits. Therefore, 6 hex digits ($6 \times 4$) = 24 bits.

2. IP Addressing (Layer 3)

The Internet Protocol (IP) address identifies the “where.” It is a 32-bit logical address that allows data to be routed across different networks.

Binary and Decimal Representation

While humans use Dotted Decimal (e.g., 200.100.150.100), computers process this in Binary. An IPv4 address consists of four octets (8 bits each).

How to Calculate an IP Octet

To convert binary to decimal, we use a positional value table:

Bit Position12345678
Power$2^7$$2^6$$2^5$$2^4$$2^3$$2^2$$2^1$$2^0$
Value1286432168421

Calculation Example (Decimal 200): To get the decimal value 200, we look at which bits need to be “High” (1):

  • $128$ (on) + $64$ (on) + $8$ (on) = 200
  • The binary for this octet is: 11001000

Range Limits:

  • All bits low (0): 00000000 = 0
  • All bits high (1): 11111111 = $128+64+32+16+8+4+2+1 =$ 255

3. Classification of IP Addressing

To help with routing, IP addresses are split into Network and Host portions. You can identify the class of an address by its Leading Bit Pattern.

ClassRangeUsageLeading BitsNet/Host SplitDefault Mask
A1 – 126Data Comm08-bit / 24-bit255.0.0.0
B128 – 191Data Comm1016-bit / 16-bit255.255.0.0
C192 – 223Data Comm11024-bit / 8-bit255.255.255.0
D224 – 239Multicast1110N/AN/A
E240 – 255Research1111N/AN/A

Pro Tip: If you see an address starting with 127, it is reserved for Loopback testing (your own machine) and is not used for standard network communication.


This post is licensed under CC BY 4.0 by the author.