-2

how do websites know our IP? I checked in HTTP requests, headers and everything is there but no IP why so?

1
  • The protocols in the network stack (Data-Link, Network, and Transport) each have the source and destination addresses for the layer of the protocol in the protocol header. That includes both IPv4 and IPv6 in the Network layer. – Ron Maupin Nov 22 '19 at 14:42
3

You should read up on the TCP/IP (or OSI) model and the concepts of protocol layers. Layers below HTTP are abstracted (hidden) from HTTP, so HTTP doesn't know or care how the data gets there. To HTTP, the computer just sends a stream of data.

Things like missing/corrupted data, Ethernet vs WiFi, etc are all abstracted away so the HTTP protocol can just display funny cat videos without worrying about how the data gets there in the first place.

I don't know how you are observing the HTTP requests, but if you have tcpdump or a protocol analyzer like Wireshark, you can see the whole protocol stack.

Not the answer you're looking for? Browse other questions tagged or ask your own question.