Friday, April 2, 2010


Every time an application communicates across a network, it must not only choose the protocols to use (TCP/UDP), they must also generate a port number. Suppose we have two hosts as shown:Client -
Web Server -

When the client wants to access the web-server, it attempts to open the socket A socket refers to an IP address with a specific port. At the same time, the client opens a dynamically generated port number, which I'll say is 13337 in this case. The web-server then replies to the socket This is so that the applications know what service the traffic is destined for.

Well known port numbers are those numbers that are <1023 .="" 1024="" a="" above.="" and="" are="" ffa="" href="http://www.iana.org/assignments/port-numbers" iana="" list="" numbers="" of="" or="" port="" refer="" registered="" s="" see="" to="" website="">here. To see the dynamically generated port number used by your computer at that instant, use netstat after opening a browser window. For netstat to give a FQDN instead of just the hostname, use the -f parameter. Use the -n parameter to return the IP (no name resolution). You'll notice that sessions have incremental port numbers.

The common ports that you should be able to pull off the top of your head are:

TCP/21 - FTP
TCP/22 - SSH
TCP/23 - Telnet
TCP/53 - DNS Server
TCP/110 - POP3
TCP/123 - NTP

UDP/53 - DNS Client
UDP/123 - TCP

No comments :

Post a Comment