LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   why MAC & IP both are needed ? (https://www.linuxquestions.org/questions/linux-networking-3/why-mac-and-ip-both-are-needed-899917/)

retxed 08-28-2011 10:33 AM

why MAC & IP both are needed ?
 
hello LQ members !

I have a basic fundamental doubt about why both MAC address and IP address are needed ?

can't only one suffice ? if not then why they are both needed ?

tredegar 08-28-2011 10:38 AM

One reason: organising the network into subnets would become impossible if only the MAC was used.

kirukan 08-28-2011 10:50 AM

MAC is layer 2 address, IP is layer 3 address. if it is assignment, you have to find the answer on your own way

anomie 08-28-2011 12:07 PM

@retxed: Right, this question is totally ambiguous. Are you referring to a particular configuration file? Or general understanding?

If the latter, study the OSI model, and pick up a book on IP from your library.

jefro 08-28-2011 02:44 PM

Just they way they did it and I doubt it will change.

salasi 08-28-2011 06:55 PM

Theoretically, one identifies the hardware uniquely, and the other doesn't. So, the one that works before network set up has been completed doesn't need all of networking to be working in order to be there and is what you need while setting up the rest of networking.

Now, when you consider networking that passes through routers, etc, etc, the hardware ident doesn't pass, so the way networking is constructed today does need the two. You could, perhaps, argue that if, thirty years ago, when the networking infrastructure was being architected, it could have been constructed rather differently, using only the hardware address, but it wasn't. Today, there is too much to change.

Oh, and by the way, almost every firewall in the world would fail, and would become an absolute pain to maintain. And, the kind of networking that everyone takes for granted with wireless hotspots, would be another total pain (I can think of use cases in which iptables would become unworkable, but you could argue that we'd have something rather different from iptables, because today's iptables would be unworkable, but maybe something more like ebtables would do it).

Reuti 08-29-2011 06:09 AM

Quote:

Originally Posted by salasi (Post 4455689)
You could, perhaps, argue that if, thirty years ago, when the networking infrastructure was being architected, it could have been constructed rather differently, using only the hardware address, but it wasn't. Today, there is too much to change.

As mentioned by kirukan, it's a matter of layer too. There is/was DECnet, LAT, AppleTalk,... running on the same ethernet hardware - they all don't use a TCP/IP address.

baldy3105 08-29-2011 08:58 AM

This misunderstanding keeps cropping up. MAC addresses are only relevant to Ethernet and Token-Ring type networks. An IP packet must traverse many types of network - Ethernet, ATM, Frame Relay, PPP, ISDN, etc and MAC addresses mean nothing to these technologies. A MAC address serves to get the IP packet from your PC to your router over your ethernet network, but then it is de-encapsulated from its Ethernet frame and encapsulated into a container suitable for the next link in the chain, probably PPP. IP must have its own independant means of addressing endpoints regardless of the physical network type they are connected to. Hence why it is considered to be a higher "layer" than any of these other protocols.

Code:

  <---------------------------L3--------------------------->
      <-----L2------>        <--L2--->      <----L2---->
[hostA]---(ethernet)--[router]--(PPP)--[router]--(ATM)----[hostB]

i.e. How could host hostA communicate with hostB when hostB has no concept of a MAC address?
Answer - they both have IP addresses that are independant of their Layer2 addressing

jefro 08-29-2011 05:29 PM

Edit.

Never mind.


All times are GMT -5. The time now is 01:56 AM.