locked
Tcp Ports used by remoting RRS feed

  • Question

  • Dear All,
    I am using .NET Remoting in 3-tier application. Application server works on a specified port. 8888 for example. Client applications use this port when invoke server methods using remoting. When I start Microsoft Network Monitor and watch for Source And Destination Port numbers I see that the server port is 8888 but the client port is 43874 or 43875 or 43876 or... and so on. So, my question: what is the band of tcp ports that can be used by remoting?
    This is important to know because not all tcp ports are available by default in a network where my program is runing.
    Tuesday, April 14, 2009 10:39 AM

Answers

  • Hi,

    TCP uses ports 1024 through 65535 for client (the side that establishes the connection). That's not something that programs control (I don't think .Net Remoting gives you this ability). This is not specific to .Net Remoting, if you connect to a web page using your browser, you will see the same behavior(arbitary client port numbers). The port numbers are made so that the Operating System can find the process/thread that the message should be delivered back to. Therefore it doesn't allow the programs to control the port numbers so that they don't conflict. You only specify the port that you listen to (not the source port in your client).
    When it comes to TCP, firewalls often are configured to look at the destination port (8888 in your case) when the TCP connection is being established. When the packet comes back to the client with an arbitary port number, the firewall allows it to pass if its from an established connection.

    Does this make sense to you?

    Ameen.
    • Proposed as answer by AmeenEt Tuesday, April 14, 2009 6:15 PM
    • Marked as answer by Riquel_DongModerator Thursday, April 30, 2009 7:38 AM
    Tuesday, April 14, 2009 6:13 PM