IP Address and MAC Address

As you know that the data you generate using various applications gets encapsulated at multiple layers before it is transferred over a network.
L4: Transport(TCP/UDP/SCTP)
L3: Network(IP/AppleTalk/IPX)
L2: Data link(Ethernet, Token Ring, PPP)

The framed packet is then converted into electrical signal(copper media) or light photons (fiber optic media) or radio wave(wireless media) and transmitted across the medium. At the destination, the received frame is stripped off header-by-header at the corresponding layer to deliver the data to the right application.

There are two addresses that are used to identify and deliver the packet to the destination.
1. Logical or Layer-3 address
2. Physical or Layer-2 address

IPv4_dotted_decimal_notationThe logical address is essential to identify the network of the destination host. It’s similar to your distant friend’s home address you write on the post card which directs the postal personnel to go toward. The IP is the ubiquitous Layer-3 protocol and the IP address plays the role of identifying the host logically.
IPv4 is the widely deployed IP version (for now) whose address is depicted as a dot separated 4 decimal numbers each in the range 0 to 255.
Eg., etc.

Every IP address also has an associated mask address. What it does is it separates the network part from the host part in the IP address. For example, the IP address has a default mask address The mask is logically ANDed with the IP address to get the network address.
( AND ( =
The network address is what actually gets stored in the router’s routing table and the packets are routed accordingly.

The IP address is a logical one, meaning it’s a tool for us(and routers) to locate and think about the nodes in the network. Similar to the destination address on the post card. But there has to someone who physically picks up your post card from the mail box to put it into city’s mailbox, next into neighboring city’s mailbox, so on until it reaches the mailbox of your friend’s city. And each of these hops require a local, immediate physical address of the mailbox for a postman to put the letter into it on your behalf. That address is called physical or layer-2 or data-link address in Networking parlance.

MAC_address_fieldThe MAC(Media Address Control) is the widely used layer-2 addressing scheme. It’s a colon separated 6 byte address in hexadecimal digits. The first 3 bytes identifies the manufacture of the NIC card, known as OUI (Organizationally Unique Identifier). The next 3 bytes identifies the NIC card of a particular vendor. This MAC address is what makes the packet to get physically delivered to the destination. MAC address space is flat, meaning every host must have a unique MAC address (not strictly speaking, I’ll write about it.) within the same physical network segment. MAC address changes from hop to hop as the packet gets routed toward its destination(IP address). Meaning the intermediate routers(postmen) must know(memorize) the next-hop router’s MAC address. That router in turn its next-hop interface’s MAC address, so on and so forth till the destination’s default router.

The astonishing fact is that all these things happen within milli seconds!

Points to remember:

  1. IP connects multiple heterogeneous networks by abstracting out the physical technologies implemented. Hence the global network called Internet.
  2. IP address identifies the hosts in the network of networks.
  3. IP address provides a way to reach every host in the network. Immediate or far-away.
  4. Routers use IP address(specifically network address) to make routing decisions.
  5. Mask draws a line between the network and host part in the IP address.
  6. [IP address] Logical AND [Mask] = Network Address
  7. IP address is hierarchical. Same IP addresses can be used in different networks and still reach the hosts.
  8. MAC address is the actual physical address of host which must be unique throughout the network.
  9. MAC address gets switched every hop whereas IP address will never change.
  10. IP address is analogous to your cell phone number which changes as you change your SIM card. MAC address is your phone’s IMEI number which will never change.



About Deepak Devanand

Seeker of knowledge
This entry was posted in IP Addressing and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s