How are IP addresses associated with hardware?
Clearly, there must be some way to associate an IP address to a computer, right? There is. Every hardware device that connects to the Internet has a unique identifier known as a MAC address.
What is a MAC address?
No, we are not talking about a MAC computer from Apple, Inc.
A MAC (Media Access Control) address is the physical hardware identifier for the actual network card itself; whereas, an IP address is a logical network address. A MAC address is permanently programmed into the hardware device by the manufacturer; therefore, a MAC address cannot be changed. An IP address can be changed.
This is a picture of a wireless Network Interface Controller (NIC) card from a laptop computer.
Think of it like this: Your house is physically located at: 123 Main Street, Somewhere, USA. But you send and receive calls through a telephone operator using your home phone number. The person calling does not know where your physical home address is. The nice thing is that you can change your home phone number at any time and still send/receive calls through the operator.
Remember: a MAC address is a physical address. An IP address is a logical address.
This is a picture of an Ethernet Network Interface Card (NIC) for a desktop computer.
How many MAC addresses does a Computer have?
Each Network Interface Controller (NIC) has its own MAC address. If you have a network card in your desktop computer, it has a MAC address. If you have a wireless network card in your laptop, that also has a MAC address. If you connect to the Internet with a smart phone, your smart phone also has a MAC address.
If you have a laptop that can connect wirelessly, or with a network cable, your laptop will have two MAC addresses (one for each network interface controller). For Example:
Wireless MAC address: 01:23:45:67:89:AB
Wired Ethernet MAC address: 01:23:45:67:89:CE
In the previous image, I have one Etherent controller, and one wireless controller. Each network controller has its own MAC address. If the computer has two Ethernet ports, it will have a MAC address for each Ethernet port. If it has dual-band wireless capability, it will have a MAC address for each wireless band. If your computer has two Ethernet ports and dual-band wireless, it will have four MAC addresses. I think you get the idea.
How do MAC addresses work?
When you router wants to send data packets to your computer with IP address ‘X’, the router needs to know what your computers MAC address is. So, the router sends an ARP broadcast request on the LAN. ARP means Address Resolution Protocol. Your router is basically trying to resolve (find) the physical address of which computer this IP address belongs to. So, the router sends a broadcast that says “hey everyone, if you have IP address X, please tell me what your MAC address is.” One of your computers will respond “Hello, I have IP address X and my MAC address is XYZ, please forward the data to my MAC address.”
The IP address is what is first used to find the right network. Once the request reaches the correct network using the IP address, ARP is what converts an IP address to a MAC address and delivers the data packet to the right computer.
TIP: ARP may sound similar to a Network Address Translation (NAT), but you need to understand that NAT is used for addressing and locating networks; whereas, ARP is used to deliver the actual data to the physical device.
Once again, let’s use the address and telephone number example to break this down into a digestible example:
- The telephone operator is, let’s say, your NAT server (router).
- You have a private home phone number (your private IP address).
- You have a physical home address located at 123 Main St, Somewhere, USA (let’s say this is your computers MAC address).
- The operator (router) receives a call for you and forwards the call (using the ARP protocol) to your home phone number (your private IP address).
- The person trying to reach you is trying to deliver a package to your home address (in this case, the package is a data packet).
- But since you don’t want them knowing where your home is located, you tell the operator (the router), that you’re expecting a package and that when it arrives, to send it to your physical Address (the MAC address).
From a technical viewpoint, it looks more like this:
The laptop says “who has IP address 192.168.1.1”? (which is the routers IP address). “Please tell 192.168.1.2” (tell me, the laptop, because I’m trying to send/receive data).
The router responds, “I have IP address 192.168.1.1 and I see that you’re calling from 192.168.1.2 so I’ll forward all data packets to your physical MAC address 01:23:45:67:89:AB.”
How to find my MAC address
Step 1. Click the ‘Start’ menu
Step 2. Open the command prompt window
Navigate to: Accessories > Command Prompt
Right-click and choose ‘Run as Administrator’.
Step 3. Type ‘ipconfig /all’ into the command prompt
Step 4. Locate the Network Interface Controller (NIC) and look for “Physical Address.”
What are the components of a MAC address?
A MAC address is 48 bits long and is commonly written as a sequence of 12 digit hexadecimal digits. The first six hexadecimal digits identify the manufacturer. The last six digits represent the serial number of the device. Consequently, every MAC address is unique.
The first six digits are known as the Organizational Unique Identifier (OUI) which is assigned by the IEEE Standards Association. Therefore, if you have a device and you are unsure who manufactured it, you can perform a search online using the Associations website:
http://standards.ieee.org/develop/regauth/oui/public.html
Ok, let’s recap:
• IP addresses are logical addresses used to find networks
• MAC addresses are physical hardware identifiers programmed into a device
• MAC addresses are communicated within the boundaries of a single network such as your LAN