Maysam
Maysam

Reputation: 7367

Fundamental principle about data transfer on the internet

Let's assume I open my PC browser in a LAN at my home and type http://foo.com, the browser or another running service find the foo's IP address and send it through ISP to the foo's server. Now the server knows I sent a request and generate a HTML page or something to respond my request. How its respond arrives to browser in a LAN?

Upvotes: 1

Views: 129

Answers (3)

Viral
Viral

Reputation: 373

Its nicely explained at: http://technet.microsoft.com/en-us/library/cc780783(WS.10).aspx

Upvotes: 1

Oliver Charlesworth
Oliver Charlesworth

Reputation: 272517

IP packets contain the IP address of the source (i.e. the sender). So the server knows who initiated the request, and can then send its response to that IP address (no DNS lookup involved).

One common complexity is in a LAN behind a router using NAT (network address translation); this is the case in most residential settings. Although all the clients in the LAN have different local IP addresses, the router modifies all the IP packets so that they all have the same IP address (the router's external address). Therefore all the response traffic all gets sent back to that single IP address. The router is able to distinguish and send the packets back to the correct local client based on TCP/UDP port number.

Upvotes: 2

Robert Goldwein
Robert Goldwein

Reputation: 6011

Browser opens connection to the server and sends the request; server responds through the same connection.

Upvotes: 1

Related Questions