17

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 ?

21

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.

8

(not this again)

Layer 2 vs. Layer 3

IP works at layer 3. It is carried over ethernet (layer 2) which uses MACs to identify nodes. Use a different layer 2 (say, ATM) and you won’t have MACs. (Or use a different layer 3, say IPX, and you won’t have IP.)

  • 1
    Feels like a circular answer. "Why use IP if we already have MAC? Because you need IP to use IP." Granted, the initial question is begging the question "What does Layer 3 do for us that layer 2 can't?" or something. – Smithers Dec 2 '14 at 19:41
  • No, it's like asking "why drive a car when I have TV" They're completely different things. Ethernet (L2) uses MACs. IP (L3) uses IP Addresses. IP can be carried over Ethernet, but that's just one of a long list of L2's one could use. – Ricky Beam Dec 2 '14 at 21:07
0

Without IP, you would have broadcast traffic all around the world for each unknown/aged out MAC address in the system (unknown unicast).

Also IP helps you to logically plan your network in an efficient way (for example: using summarization of IP addresses) so that routers can utilize less memory for routing tables and forwarding information.

-3

simply assume that we have 2 connected devices and each one has a network card. now, if there was only one service( not exactly service, anything like an osm software,...) in each device, you are right, no need to IP, but consider there are many services in each device and these services should communicate with each other without any conflict. so in addition to mac address to identify the device, we need something else( we call it IP) for each service.

  • 1
    To differentiate different services on one device, TCP or UDP ports are used. – Gerben May 2 '17 at 9:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.