HolidayBuyer's Guide

Networking & Wireless forum

General discussion

IP address and MAC address

by Slackenerny / September 4, 2008 2:37 AM PDT

I've read from various articles that if a host on a network wants to talk with another host it must have the destination host's MAC address. How come it is not sufficient for the requesting host to just have the destination host's IP address? After all, the IP address itself already uniquely identifies the host on the network, so why is it necessary for the requesting host to know the physical identifier of the destination host to initiate a communication?

Discussion is locked
You are posting a reply to: IP address and MAC address
The posting of advertisements, profanity, or personal attacks is prohibited. Please refer to our CNET Forums policies for details. All submitted content is subject to our Terms of Use.
Track this discussion and email me when there are updates

If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.

You are reporting the following post: IP address and MAC address
This post has been flagged and will be reviewed by our staff. Thank you for helping us maintain CNET's great community.
Sorry, there was a problem flagging this post. Please try again now or at a later time.
If you believe this post is offensive or violates the CNET Forums' Usage policies, you can report it below (this will not automatically remove the post). Once reported, our moderators will be notified and the post will be reviewed.
Collapse -
To answer this
by R. Proffitt Forum moderator / September 4, 2008 2:45 AM PDT

You need to read all about the OSI layers. Head to the google and find primers about that.

Collapse -
Simple Answer
by Darton Fury / September 4, 2008 5:45 AM PDT

Each computer on the network must put data packets inside of "frames" in order to move that data to another system. Frames use MAC addresses, not IP addresses. Lookup ARP, Address Resolution Protocol.

Collapse -
Requirement for MAC address.
by navneetgaur / September 7, 2008 1:10 AM PDT

Hi.
1. It is based on a requirement for a larger network.

2. With in a small network IP address would alone be sufficient.

3. However they would not be able to help if the message / data was to be transferred from one network to another, as from your home PC to the internet.

4. Example:-

Computer 1- IP. 1.1.1.1 (MAC-11) (Lets say, your home PC)

Router IP1 - connected to Computer 1 - 1.1.1.2 (MAC-12)
Router IP2 - connected to Computer 2 - 2.1.1.1 (MAC-21)

(Broadband router - it has two connections, just as a modem does)

Computer 2 - IP. 2.1.1.2 (MAC-22) (Lets say Google.com)

If a message were to be sent to 'google.com' from 'home PC' this is how it would go:-

Step1- At computer1

from ip - 1.1.1.1 (Computers IP)
from mac - 11 (Computers MAC)
to ip - 2.1.1.2 (Googles IP)
to mac - 12 (Connected Routers interface)

Note - data can be transferred to connected interface only. If destination MAC in the above was '22', then the message would have got nowhere as there is no MAC-22 connected to 'computer 1'

Step2 - At the routers first interface the complete rebuild takes place.

from ip - 1.1.1.1 (Computers IP)
from mac - 12 (Routers 1st Interface)
to ip - 2.1.1.2 (Googles IP)
to mac - 21 ( Routers second interface)

Step3 - At routers second interface. The data is transferred to second interface at the router and address are again modified.

from ip - 1.1.1.1
from mac - 21 (Routers second interface)
to ip - 2.1.1.2
to mac - 22 (Googles Interface)

Same process is reversed on sending the data back to 'computer 1'. IP address are required to identify the original originating and destination devices, else the data would be lost in the network.

It would be clearer if you drew the diagram on a page. The essential part to remember is that the information required is:
1. Senders IP and Destination IP
2. Senders MAC and connected MAC.

Take care.

Collapse -
Helpful example!
by Slackenerny / September 7, 2008 2:08 AM PDT

Thanks, navneetgaur. You example helped a lot. So the IP address is for identifying the two ends of the communication link (source and destination) while the MAC address is for getting the data frames onto the correct "physical device" in the middle of the relay process?

Collapse -
Not True
by Darton Fury / September 7, 2008 11:32 AM PDT
In reply to: Helpful example!

ARP is used all the way up to the Gateway, therefore IP alone is not sufficient to send data within your network. You can't build an Ethernet frame without MAC address. Ethernet frames do not even contain an IP address. Size of the network is not an issue either.

Collapse -
MAC address.
by navneetgaur / September 7, 2008 4:44 PM PDT
In reply to: Helpful example!

Yep.

And for Darton Fury.

Roughly data is built and transferred from one computer to another as in stages 1 to 4 and rebuilt 4 to 1.

1. Segment - 'TCP + DATA'
2. Packet - 'IP + TCP + DATA'
3. Frame - 'LH + IP + TCP + DATA + LT'
4. Transmit bits. ( Stuff/Electrical signal transferred over the Ethernet cable)

TCP = TCP information
IP = IP related information (IP addresss)
LH = Link header
LT = Link Trailer
LH and LT refer to data link layer header and trailer (MAC info)

Source of reference - CCNA Intro by Wendell Odom - Cisco press (CCIE no. 1624) page 30.

TCP /IP is a very large concept in itself. Different components play a different role for supporting and maintaining connectivity. ARP is a part of that but not relevant to the question asked.

Take care.
Both of you.

Collapse -
Specifically for Darton Fury
by navneetgaur / September 8, 2008 1:04 AM PDT

Hi.

This post is meant to clarify the concept of ARP:

1. ARP or address resolution protocol is meant to map the IP address to its interface MAC address. Period.

2. For example:

?Computer-1? has an IP address ?1.1.1.1? and MAC address ?11?
?Router intface-1? has an IP address ?1.1.1.2? and MAC address ?12?
?Router intface-2? has an IP address ?2.1.1.1? and MAC address ?21?
?Computer-2? has an IP address ?2.1.1.2? and MAC address ?22?

ARP cache:

IP-1.1.1.1 MAC-11
IP-1.1.1.2 MAC-12
IP-2.1.1.1 MAC-21
IP-2.1.1.2 MAC-22

3. The process of transmitting data from ?Computer-1? to ?Computer-2? all over again:

At Computer-1:-

Stage-1

Source-IP 1.1.1.1
Source-MAC ? 11
Destination-IP ? 2.1.1.2
Destination-MAC - ?

Stage-2

Now the computer will check its interface settings to clear up a question ? Where should I send the ?Data packets? meant for other networks?
The answer is the gateway information set up at the interface.

Note ? ?Data packets?, as they still do not have required MAC information attached, to qualify them as ?Frames?

Next the computer will query the MAC address from the ARP cache or send an ARP request to the gateway IP ? 1.1.1.2 for its MAC address.

Stage-3

Now a frame will be built as follows and forwarded to router interface-1

Source-IP 1.1.1.1
Source-MAC ? 11
Destination-IP ? 2.1.1.2
Destination-MAC ? 12

Stage-4

At the router interface-1, a question needs to be answered.

Where to send the data meant for network 2.0.0.0 ? as the final destination lies in the network 2.0.0.0.

The answer will be in the routers routing table which will inform it that the data should be forwarded to IP-2.1.1.1.

Next question is - what is the MAC address of IP-2.1.1.1?

This is answered using ARP and built into a ?new frame? with the ?original packet?.

Packet has the IP and TCP information with the Data.

Frame has additional MAC information which is stripped and renewed at each passing interface.

And so on.

4. For a small network any protocol based on single address scheme would suffice. But that would limit the size of the network to the address? available within that protocol.

The design of the TCP/IP protocol has been structured so as to support segments of networks and ability to interconnect them with each other using the process known as routing.

If the above requirements were redundant, then, theoretically, a small network would definitely function on IP address alone.
I hope that it is understood, about the preceding statement, that TCP/IP would have to be redesigned to work without MAC address support for such a specific scenario.

Take care.

Collapse -
hmmmm
by Slackenerny / September 8, 2008 2:02 AM PDT

This may sound very dumb but I think I will just exonerate myself for asking this by claiming that I'm a novice.

So routers have actually been programmed to automatically "unwrap" EVERY single data frame that it receives so as to read the IP address "underneath" it (or should I say "above" since the network layer is on top) and then re-encapsulate them and send them away?

So I think the reason for the MAC address (data link layer) being necessary even though the IP addresses themselves are already unique is because when relaying a message from point A to point B to point C, and that point A and point C are actually not in direct contact (viz cannot communicate node to node) and must go through point B so must use the MAC address to make sure the message has gone to the correct middleman/men.

I think I've got it!!

But maybe if we're deploying IPv6, where every networking hardware can be allocated its unique IP address, then having this MAC address may not be really necessary? I mean theoretically we can modify the protocol to something like this:

Source IP address
Destination IP address
IP address on the next relay <-- this plays the role of MAC address

But maybe that'd be too much work.

Collapse -
The end.
by navneetgaur / September 8, 2008 2:10 AM PDT
In reply to: hmmmm

You have understood it correctly. Happy

Collapse -
You can can read about osi model here
by mohitjoshi999 / July 23, 2009 3:12 PM PDT

quite good site for understanding the basics of osi model,foundation of networking.it has good diagrams to help you understand network model.

http://www.network-model.info/

Popular Forums
icon
Computer Newbies 10,686 discussions
icon
Computer Help 54,365 discussions
icon
Laptops 21,181 discussions
icon
Networking & Wireless 16,313 discussions
icon
Phones 17,137 discussions
icon
Security 31,287 discussions
icon
TVs & Home Theaters 22,101 discussions
icon
Windows 7 8,164 discussions
icon
Windows 10 2,657 discussions

HOLIDAY GIFT GUIDE 2017

Cameras that make great holiday gifts

Let them start the new year with a step up in photo and video quality from a phone.