How do networking ports work? Can I configure the ports that client and server use?

Posted by joedotnot on Super User See other posts from Super User or by joedotnot
Published on 2011-03-20T15:26:53Z Indexed on 2011/03/20 16:12 UTC
Read the original article Hit count: 191

Filed under:
|
|

Let's say i have a "server" program listening on address 1.2.3.4:69 (i.e. remote port 69)

When i connect from a "client" program to it, typically i would specify the IP address + port of the target or server system;

But what port would the client be using ? And how does the server know which port to connect back to the client on?

I understand this question is very general, but just wanting to get a general feel for how things work.

Then extending this to a specific protocol, say FTP (typical port 21), can I change it such that the server uses port 69, but the client uses port 100?

And similarly, for Remote Desktop in WinXP (typical port 3389), i know how to change the server port to be something other than 3389, but how does one change what port the client uses (if at all possible)?

© Super User or respective owner

Related posts about networking

Related posts about port