

If the destination host is within the source host's network, the source host will send an ARP request onto the wire asking "who has that IP address?" and the destination host will reply with its MAC address.Ĭase 2 : (which is generally the case over the Internet) Then the host will compare the destination IP address with its own IP address and subnet mask. The destination IP address will be known to the network application or obtained from a DNS server in case the application knows a domain name only. This is a fair reason why Mac and IP addresses co-exist! :-)īefore understanding that why the server cannot access the MAC address of its client, lets understand how a data packet traverse in a network. In short, IP will give us the inter-network and Data Link Layer(where MAC addresses come into picture) will take care of communication at micro level (i.e. Network layer provides us with the flexibility of routing without distinction between underlying layers(Data Link Layer) or I should say underlying L1 technology. Networks need not be of the same type around the world (viz. Still if you want the MAC address of the source host at the receiving host think to sent it as a payload? Having said that, your application looks something like a Web Server, which tells me that it need not be on the same network.

You can achieve what you want only if both the server & client reside on the same local network (both hosts are connected by some L1 media). And all of the internet would have used only MAC addresses :-) If MAC addresses could remain throughout the journey of a packet which means there was no need of Internet Protocol addresses to be invented. To my knowledge routing tables should understand machine address. Intermediate routers/host understands only MAC addresses. The idea of inter-network is basically based on hop-to-hop delivery. It's source & destination IP address which remain. Here is a snippet from Wikipedia about the TCP/IP data line layer: when to packet go through a proxy (like the client router), the proxy's address is added to the packet too. If I understand it correctly, the client sends a packet that contains it's MAC address. 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?

This is because that each packet that goes in a certain path, should also be returned in similar path. From what I know, all the MAC addresses that the packet gone through are in the packet.
