IP vs MAC Address – Why Use IP if We Already Have a MAC Address?

ethernetipv4

I am preparing for ICND1 exams and recently started to learn about different Cisco devices.
I have just come to know how the packet is generated to be transmitted over a network, or outside the network.

For example,
When the packet is generated, it adds source IP address, Destination IP address, Source Mac address, destination mac address, and other data.

Since Switch is a layer 2 device, and it uses MAC addresses to interact with other Hosts within the Network, then why do we use IP addresses within our local networks ?

What if someone do not need to connect to any host or network outside its own network, Why do he still needs to have an IP address, isn't MAC address is enough ?

Best Answer

Since Switch is a layer 2 device, and it uses MAC addresses to interact with other Hosts within the Network, then why do we use IP addresses within our local networks?

Well let's start with what traffic you're sending.

If you use a strictly layer-2 protocol inside your own LAN with no HTTP, SSL, NFS, CIFS, iSCSI, H.323, SIP, DNS, ICMP, databases, or websockets, then your proposal works just fine. In fact, FCoE does not rely on an IP layer... so if that's what you want, knock yourself out :-)

The problem is that you just crippled 95% of the utility of most networks by removing those IP-based services. Networks exist to share information; all operating systems on the planet share information by binding services to, and encapsulating inside IP. That information is usually wrapped inside TCP as well.

  • Rhetorical question: Could a bunch of determined people implement TCP and UDP services directly on top of ethernet in all the major operating systems?
  • Pedantic Answer: Yes, but that's a collosal waste of time and resources for insignificant gain. Let's start with the basics... there is no DNS name-service for ethernet mac-addresses. That means unless you build it, how would you resolve URLs without IP addresses? I doubt that anyone really wants to type http://00c0.9b4a.fb2c/ just so they can avoid 20 extra bytes in each packet. This is just an example of the work required.

What if someone do not need to connect to any host or network outside its own network, Why do he still needs to have an IP address, isn't MAC address is enough?

Technically, yes. In the real world... it's a pretty boring network without IP.

Related Topic