Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why can't the server get the client MAC address, like the client IP?

From what I know, all the MAC addresses that the packet gone through are in the packet. This is because that each packet that goes in a certain path, should also be returned in similar path. So, if the router of the server know about the mac address of the client (all of them), why the server page (like aspx) cannot have this information?

Please, give an explanation. (don't just tell me that I'm wrong).

If I understand it correctly, the client sends a packet that contains it's MAC address. when to packet go through a proxy (like the client router), the proxy's address is added to the packet too. and so on.

Here is a snippet from Wikipedia about the TCP/IP data line layer:
http://en.wikipedia.org/wiki/TCP/IP_model#Data_Link_Layer

The Data Link Layer is used to move packets between the Internet Layer interfaces of two different hosts on the same link. The processes of transmitting and receiving packets on a given link can be controlled both in the software device driver for the network card, as well as on firmware or specialized chipsets. These will perform data link functions such as adding a packet header to prepare it for transmission, then actually transmit the frame over a physical medium. The TCP/IP model includes specifications of translating the network addressing methods used in the Internet Protocol to data link addressing, such as Media Access Control (MAC), however all other aspects below that level are implicitly assumed to exist in the Link Layer, but are not explicitly defined.

like image 206
stacker Avatar asked May 18 '10 05:05

stacker


3 Answers

Actually, the MAC-address stored in the packet is changed on every hop of a packet's journey.

MAC is shorthand for Media Access Control, with media refering to the local communication media. While source and destination IP-Addresses remain the same throughout the journey (and are used for long-distance routing decisions), the source and destination MAC-Addresses just indicate the next hop.

Because of this, the MAC-Address stored in packets received by your server should be the MAC address of your point of presence-router, or of the equipment of your provider.

You might want to have a look at the OSI Layer model and encapsulation.

like image 138
sum1stolemyname Avatar answered Oct 22 '22 22:10

sum1stolemyname


You have the relationship between the IP stack and the physical stack reversed. The MAC address is in the part that wraps the IP information, not the other way around. So when I send something from my computer, say, to yours, the physical segment in my LAN (Ethernet in this case) wraps around the IP stuff and includes my MAC. The router then extracts the IP information and passes that onward and upward (in this case again by Ethernet) to my DSL modem using its own MAC in the process. The DSL modem unwraps the IP stuff and sends that up the phone line using whatever protocol it uses (don't know and don't care at that point) out to ... well, you get the idea. Each physical link hop wraps and unwraps the IP information using whatever extra information the underlying physical layer involved attaches for local transmission.

like image 30
JUST MY correct OPINION Avatar answered Oct 22 '22 23:10

JUST MY correct OPINION


In IPv6, one might actually get the computer's MAC address from the IPv6 address, if encoded into the 64 bits of the host address.

See also How to avoid exposing my MAC address when using IPv6? on Super User.

like image 39
Arjan Avatar answered Oct 22 '22 22:10

Arjan