How do networking ports work? Can I configure the ports that client and server use?
- by joedotnot
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)?