top | item 8750065

(no title)

larrywallace | 11 years ago

Yes, I am connected to the store's wifi. Once I am on their network, how do they actually grab it? What headers names do they inspect for, etc. I'd like to actually know the implementation details and code sample. I looked everywhere on Stackeroverflow and can't find anyone who has done this.

discuss

order

Rondom|11 years ago

Since you are connected to their network they know your MAC.

What they will likely do is take your IP and look to which MAC their DHCP-Server has assigned that IP to. There are other possibilities though, but they are more complicated (using ARP-cache or requests, doing a raw packet dump at the webserver).

If you want learn more, I think you could read a bit about the different layers first, and then read about how ethernet, IP/ARP and DHCP work. There are likely no "headers" (I assume you mean HTTP-headers) they inspect.

grubles|11 years ago

A MAC address is part of their network once you attempt to connect to their wifi. The MAC address identifies your physical network adapter to the router. Once your network adapter is known by the router, the router can assign your adapter an Internet Protocol (IP) address.

Note: the above is a 10,000 foot observation of what happens.

More in-depth: https://en.wikipedia.org/wiki/MAC_address