Port Num Questions
Port Num Questions
Q. What is a port?
A port is piece of software which is used as docking point in your machine, where remote
application can communicate. This is analogy to the physical ports for entering in to a country
from different sea ports.
Q. What is a socket?
Port numbers can vary from 0 to 65535, so total we can get 65536 ports
This is because limitation in TCP/IP stack where the port number field is just 16bit size. So we
get only 2^16(2 to the power of 16) ports which are equal to 65536 available ports
Default port is a designated port for particular well-known service such as web server, mail
server, ftp server etc. By default FTP uses 21 port, DNS uses 53 and Apache uses 80 port.
Yes, we can change. In Apache and DNS we can change this using listen configuration entry in
httpd.conf and named.conf. Squid have port entry in its squid.conf file to mention port number.
Do not confuse this one with port numbers. TCP and UDP have their own numbers in TCP/IP
stack.
Q. Is there any way I can see all the port information in Linux?
22 – SSH(For secure remote administration which uses SSL to encrypt the transmission)
67 – Bootp
68 – DHCP
69 – TFTP(Trivial file transfer protocol uses udp protocol for connection less transmission of
data)
80 – HTTP/WWW(apache)
88 – Kerberos
123 – NTP(Network time protocol used for time syncing uses UDP protocol)
137 – NetBIOS(nmbd)
139 – SMB-Samba(smbd)
143 – IMAP
873 – rsync
989 – FTPS-data
990 – FTPS
993 – IMAPS
1194 – openVPN
1812 – RADIUS
995 – POP3s
3306 – MySql
3690 – SVN
6000-6063-X11
A port number is part of the addressing information used to identify the senders and receivers
of messages. Port numbers are most commonly used with TCP/IP connections. Home network
routers and computer software work with ports and sometimes allow you to configure port
number settings. These port numbers allow different applications on the same computer to share
network resources simultaneously.
Port numbers have a range of 0…65535 (although often 0 has special meaning). In the original
BSD TCP implementation, only root can bind to ports 1…1023, and dynamically assigned ports
were assigned from the range 1024…5000; the others were available for unprivileged static
assignment. These days 1024…5000 is often not enough dynamic ports, and IANA has now
officially designated the range 49152..65535 for dynamic port assignment. However even that is
not enough dynamic ports for some busy servers, so the range is usually configurable (by an
administrator). On modern Linux and Solaris systems (often used as servers), the default
dynamic range now starts at 32768. Mac OS X and Windows Vista default to 49152..65535.
65535
Used by specific service upon applications such as Oracle database listener (1521), MySql
(3306), Microsoft Terminal server (3389) etc.
Q.What are the Dynamic and/or Private Ports. (Range: 49152 to 65535 )
These ports can’t be registered by IANA. This is used for custom or temporary purposes and for
automatic allocation of short-lived (or ephemeral ) ports which is used internally by
application/processes. You can see these ports by running ‘netstat’ command under “Local
address” column.
Q.What do you mean by default port? Default port is a designated port for particular well-
known server.
Stopping sshd: [ OK ]
Starting sshd: [ OK ]
22-SSH (For secure remote administration which uses SSL to encrypt the transmission)
25-SMTP (Mail Transfer Agent for e-mail server such as SEND mail)
53- DNS (Special service which uses both TCP and UDP)
68-DHCP
69-TFTP (Trivial file transfer protocol uses udp protocol for connection less transmission of
data)
80 -HTTP/WWW (apache)
88-Kerberos
123-NTP (Network time protocol used for time syncing uses UDP protocol)
137-NetBIOS (nmbd)
139,138,445-SMB-Samba (smbd)
143-IMAP
995-POP3s
3260-ISCSI
3128-squid proxy
631-Printers (cups)
*If protocol is not mention then the above port are solely for TCP. Some service use UDP as
mention in above list.