-   Linux - Server (
-   -   need to know ports on client and server side (

aliabbass 10-13-2011 08:09 AM

need to know ports on client and server side
Hi I need to know about the ports on the client computer. I am precisely talking about the ports viewed from tcptrack and can anybody explain why the client ports are in the range of 10000.The server ports are most of the time 80,443,25,110.

lithos 10-13-2011 08:25 AM

because the clients make a connection to the server (e.g. 80) and then the server 'moves' to a higher dynamic ports to operate with client only, thus no-one other is using the same data connection

fukawi1 10-13-2011 08:26 AM

The short answer is, source ports (what your seeing in tcptrack) are random unused ports.
In the case of web browsing for example, they are destined for port 80, but come from any port, this is how you can have multiple simultaneous connections to different servers, on the same destination port. Where if they all came back to you on the same port, things the client program (that sends the original requests), would get confused..

At least, that is how I understand it.

16pide 10-13-2011 09:31 AM

let's take the example of http server operating on port 80 on the server.
the server needs to stay on port 80 because this is the door the clients knock on to request http data.
all the clients talk to it from different IP addresses and different source ports. So the server can keep track of who is who.
The clients open a free port on the laptop before using it to talk to the server. they use this port to send the request to port 80 on the server, then listen on that port for an answer originating from port 80 of the server.

non root users cannot create sockets on ports with low numbers (I believe 1200 is the threshold, but not sure). This prevents a non root user from opening a socket on port 80 which would prevent the administrator from launching a http server that would need to own that port.

All times are GMT -5. The time now is 08:48 PM.