Difference between Mac and IP addresses


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Difference between Mac and IP addresses
# 1  
Old 07-25-2011
Difference between Mac and IP addresses

If a web search is done on this topic there are many links but no information included in the documents. So my questions are;

Why does a NIC card have it's own permanent ID. Why can't it share the host name? An ID is an ID.

Why does a computer need two ways to ID it.

If the network needs to have data carried with the packets in order for the network to navigate the packet it makes sense but no other reason does.

This must be a mostly misunderstood concept judging from the amount of "what is the differerence between a Mac and IP address" links so thanks for your patients and thanks in advance.Smilie
# 2  
Old 07-25-2011
Because modern networks still use protocols that aren't based on IP, and/or are used before any IP configuration has happened.

As an everyday example, read the description of DHCP. All communication to get the IP configuration information is done through packets on the local network segment using non-routable MAC addresses. Only after that the device gets an IP that a router can transmit to other networks.

Another, even more common example, would be the Address Resolution Protocol (ARP). This uses the MAC address to broadcast the hosts IP to the network segment, so that switches and other hosts can update their network view, or query the network for who has a certain address. This is also used to detect duplicate IPs on the same segment.
# 3  
Old 07-25-2011
Still quite foggy on this one.

When is just a Mac addressed used?

When is just a IP address used?

When are they both used in the same packet?

In some docs. it looks like the Mac address is only used from the network to the host but this is contradicted in other docs.

Why do the layers matter?

Thanks again! Edit: It looks like the term IP address should actually be IP Name because it is really not an address but an indirect way to aquire it.

Last edited by theKbStockpiler; 07-25-2011 at 11:59 PM.. Reason: Add info
# 4  
Old 07-26-2011
The MAC address is used every time you send a packet, and there's no case where just the IP is used. Most traffic you'll see is either using TCP or UDP packets for transport. These are encapsulated in IP packets, which are in turn (on a regular ethernet or WiFI network) encapsulated in Ethernet frames. TCP and UDP know nothing about the network structure, and don't really care, because that's the job of IP. IP in turn doesn't know anything about the data it's transmitting, but only cares about getting it through the network. And Ethernet only cares about getting it through the wire to the next local point without colliding with another frame.

How do these parts play together? Lets say you want to establish a TCP connection between 2 hosts:
-Host AHost B
HostnameHothDagobah
MAC Address00-11-22-33-44-55-66-77-8801-23-45-67-89-ab-cd-ef
IP Address10.1.2.5/16192.168.5.99/24
Gateway10.1.255.254192.168.5.1
I'm assuming here that both hosts already know the IP of the other (either by a static entry or through DNS).

A data packet from Hoth to Dagobah can't be sent directly, since they're on different subnets, so it has to go through the gateway. But IP doesn't allow for multiple destination addresses. If the packet is sent with the gateway IP as destination, it won't be sent out on the other network. And we can't get the MAC address of the other host, since that information isn't routed to us. The solution is that the packet is sent with the IP address of Dagobah, but with the MAC address of the gateway. That way the routing gateway has to look at the packet (it was directed there), sees that the real destination is on the other network, and sends it there.
This User Gave Thanks to pludi For This Post:
 
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk to calculate difference of split and sum the difference

In the awk I am trying to subtract the difference $3-$2 of each matching $4 before the first _ (underscore) and print that value in $13. I think the awk will do that, but added comments. What I am not sure off is how to add a line or lines that will add sum each matching $13 value and put it in... (2 Replies)
Discussion started by: cmccabe
2 Replies

2. Shell Programming and Scripting

Script getting IP's and MAC addresses

Hy over there, Lets make it simple :) Using a bash script, how to grep only the ip address and the mac address and put them in a file:. for example from the dhcp.conf file we got such things: The script will end up with two columns IP's and MAC adresses as it is showed below: ... (9 Replies)
Discussion started by: hermouche
9 Replies

3. Shell Programming and Scripting

Don't see my mac addresses of my devices

I have a problem with a script , i want to see my devices there are up in my network. I want as output the ip addresses of the devices and also the mac address but I only had the ip addresses #!/bin/bash while ] do -mac) Extension=5 shift mac=$1 shift ;; esac... (1 Reply)
Discussion started by: Roggy
1 Replies

4. Shell Programming and Scripting

Need help with IP and MAC addresses

Hi, i am working on a project where i have to write a script to find out MAC addresses of the systems with given IP address. Can anybody tell me which command i can use to find MAC address if you know IP address of the machine. Thanks (5 Replies)
Discussion started by: manmeet
5 Replies

5. UNIX for Dummies Questions & Answers

Help extracting MAC addresses from List

Hello all. I have a large number of text files outputted from various Netstumbler Wireless Scans; from which I need to extract the MAC addresses of the various Access Points. The Text files look like this: # $Creator: Network Stumbler Version 0.4.0 # $Format: wi-scan summary with... (9 Replies)
Discussion started by: dhs23
9 Replies

6. UNIX for Dummies Questions & Answers

Mac addresses of NICs (why are they the same)

I am training to be support on our solaris based network and was wondering why solaris seems to assign the same mac address to all NICs placed in the machine regardless of how many NICs are in there, when i do a ifconfig -a all nics have same MAC. Presumably this is a feature and there is... (1 Reply)
Discussion started by: hcclnoodles
1 Replies

7. UNIX for Dummies Questions & Answers

Any difference between the CLI of Mac OS X and normal UNIX?

Any? (11 Replies)
Discussion started by: edward
11 Replies
Login or Register to Ask a Question