MAC Addresses and Ports

Introduction to Addressing

Imagine building a toy plane from a parts kit. Each part is labeled—wing, tail, engine—but the labels alone don’t tell you where or how each piece fits. Similarly, the Internet relies on various addressing formats to label and locate devices, services, and data, each serving a specific purpose.

In this lesson, we’ll dive deeper into two fundamental addressing systems:

Ports

A port is a virtual interface, defined by software, that acts as a connection point for specific applications or services. Ports are essential for managing multiple network connections on the same device.

A Little History

In the early days of the Internet, computers were identified by a single number called a socket number. Over time, the "user-specified" part of these numbers became standardized as ports, simplifying how applications communicate. These conventions remain in use today, ensuring interoperability across the web.

Port Ranges

There are 65,536 port numbers available, divided into three main ranges:

Analogy

Think of a port as an apartment number in a large building:

MAC Addresses

A Media Access Control (MAC) address is a permanent, hardware-level identifier for a device's network interface card (NIC). Unlike IP addresses, MAC addresses are unique to the device and cannot be changed without altering the hardware.

Format

MAC addresses are represented as six pairs of hexadecimal digits, separated by colons or hyphens, like this:

A1-B2-C3-D4-E5-F6

Delimiters and case don’t matter, so a1b2c3d4e5f6 is equivalent to the address above.

Uses

MAC addresses are critical for device-to-device communication on local networks. They map network interfaces to one another, forming the foundation of Wi-Fi, Bluetooth, and wired Internet connections.

Frames and MAC Addresses

At the hardware level, data is transmitted in units called frames. Each frame includes:

Permanence and Security

While MAC addresses are "permanent," operating systems can "spoof" them, reporting a different MAC address. This makes MAC filtering an unreliable security measure, though it is sometimes used to restrict access in corporate networks or gaming environments.

Analogy

A MAC address is like the serial number on a product. It’s unique, tied to the hardware, and helps identify the specific item among millions of similar products.

Key Takeaways

With a clear understanding of these addressing systems, you are better equipped to design, debug, and secure networked applications.