Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Networking (https://www.askmehelpdesk.com/forumdisplay.php?f=76)
-   -   How does a browser receive the correct response back? (https://www.askmehelpdesk.com/showthread.php?t=223308)

  • Jun 4, 2008, 07:30 PM
    baovle
    How does a browser receive the correct response back?
    Hi,

    I have 2 browsers openned and each one access a different web site. When browser #1make a request to a website, how does the response from that website know to go back to browser #1 instead of browser #2? What makes that connection possible that a browser gets what it asks for?

    Thanks,
    Bao
  • Jun 4, 2008, 08:28 PM
    Scleros
    When browser one makes a request a tcp/ip connection is created on a random port number. When browser two makes a request, another connection is created on a different port number. So for example, browser one will have a connection from local port 2300 to web server one port 80 (http) and browser two will have a connection from local port 2301 to web server two port 80. Each connection will be a distinct communication channel for each browser and generally do not remain active for the entire browsing session but are opened/closed per request.
  • Jun 4, 2008, 09:00 PM
    baovle
    So what I see is a tcp/ip connection is a disctinct communication channel made up of the source ip (my machine) + the local port number (browser session), correct?

    My machine has only one NIC (network interface card) so how many local port numbers can it create concurrently and hence how many browser sessions can I have openned at once?
  • Jun 4, 2008, 10:51 PM
    Scleros
    Quote:

    Originally Posted by baovle
    So what I see is a tcp/ip connection is a disctinct communication channel made up of the source ip (my machine) + the local port number (browser session), correct?

    Essentially, your computer sends packets from a source ip/port combination to a server (usually fixed ip/fixed port) and the server replies to the same ip/port. Perhaps thinking of it as a conversation with fixed endpoints, instead of a "channel" is more appropriate.

    Quote:

    Originally Posted by baovle
    ...so how many local port numbers can it create concurrently and hence how many browser sessions can I have openned at once?

    A port is a 16 bit number. 2^16 = 65536 ports numbered 0 - 65535. Ports 0-1023 are reserved by IANA (See http://www.iana.org/assignments/port-numbers). The balance are free for use. I don't recall the specifics of Windows port allocation scheme without researching the resource kits or knowledgebase, it's probably less than 65536-1024 and available memory overhead for maintaining the connection in the tcp/ip stack would come into play at some point too, but the answer is A lot.

    There are also UDP ports. See TCP and UDP Ports Explained.

    You can issue "netstat -a" or "netstat -n" at a command prompt in Windows to see active ports.

    The ip address/port number the server actually replies to will be different from your local machine ip/port too if your router does any NATing and you use private LAN addressing.
  • Jun 4, 2008, 10:57 PM
    Scleros
    For a dateless evening, snuggle up with Microsoft Windows Server 2003 TCP/IP Implementation Details for all the exciting specifics.

  • All times are GMT -7. The time now is 02:27 PM.