How Port Numbers Work
Every time an applications communicates across a network, it must decide both the source and destination port numbers.
If 10.1.1.1 wants to access 150.1.1.1’s web server, it will use well known port 80. This is written as 150.1.1.1:80
When written in this notation, it is known as a “Socket”.
The Source computer also needs to generate a “Source Port”. This port is created by the OS.
To see the active connections:
Linux: netstat -pant
Windows: netstat -f
Linux: netstat -pant
Windows: netstat -f
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 192.168.1.66:42828 168.144.134.153:80 ESTABLISHED 5454/firefox
Well Known Port Numbers
- 0 – 1023 are “Well Known Port Numbers”
- TCP and UDP Ports can run completely different services!
| TCP 0 – 65535 |
|
|---|---|
| 21 | FTP |
| 22 | SSH |
| 23 | TELNET |
| 25 | SMTP |
| 53 | DNS SERVER |
| 80 | HTTP |
| 110 | POP3 |
| 443 | HTTPS |
| UDP 0 – 65535 |
|
| 53 | DNS CLIENT |
| 69 | TFTP* |
*TFTP: Trivial File Transfer Protocol, can be used to send and receive files to and from Cisco devices.
