How Your Computer Communicates With A Remote Computer

  • 11 September 2014

When a computer on your network needs to access a computer on the Internet, your computer sends your router a message containing source and destination address and process information. Before forwarding your message to the remote computer, your router must modify the source information and must create and track the communication session so that replies can be routed back to your computer. Here is an example of normal outbound traffic and the resulting inbound responses:

1. You open Internet Explorer, beginning a browser session on your computer. Invisible to you, your operating system assigns a service number (port number) to every communication process running on your computer.

In this example, let’s say Windows assigns port number 5678 to this browser session.

2. You ask your browser to get a Web page from the Web server at www.example.com. Your computer composes a Web page request message with the following address and port information:

  • The source address is your computer’s IP address.
  • The source port number is 5678, the browser session.
  • The destination address is the IP address of www.example.com, which your computer finds by asking a DNS server.
  • The destination port number is 80, the standard port number for a Web server process.

Your computer then sends this request message to your router.

3. Your router creates an entry in its internal session table describing this communication session between your computer and the Web server at www.example.com. Before sending the Web page request message to www.example.com, your router stores the original information and then modifies the source information in the request message, performing Network Address

Translation (NAT):

  • The source address is replaced with your router’s public IP address. This is necessary because your computer uses a private IP address that is not globally unique and cannot be used on the Internet.
  • The source port number is changed to a number chosen by the router, such as 33333. This is necessary because two computers could independently be using the same session number.

Your router then sends this request message through the Internet to the Web server at www.example.com.

4. The Web server at www.example.com composes a return message with the requested Web page data. The return message contains the following address and port information:

  • The source address is the IP address of www.example.com.
  • The source port number is 80, the standard port number for a Web server process.
  • The destination address is the public IP address of your router.
  • The destination port number is 33333.

The Web server then sends this reply message to your router.

5. Upon receiving the incoming message, your router checks its session table to determine whether there is an active session for port number 33333. Finding an active session, the router then modifies the message, restoring the original address information replaced by NAT. The message now contains the following address and port information:

  • The source address is the IP address of www.example.com.
  • The source port number is 80, the standard port number for a Web server process.
  • The destination address is your computer’s IP address.
  • The destination port number is 5678, the browser session that made the initial request.

Your router then sends this reply message to your computer, which displays the Web page from www.example.com.

6. When you finish your browser session, your router eventually senses a period of inactivity in the communications. Your router then removes the session information from its session table, and incoming traffic is no longer accepted on port number 33333.

Last modified on Wednesday, 17 June 2015 12:39