Unix systems communicate with eachother to provide certain functionalities. It is possible that servers talk with eachother or that workstations talk to servers. To regulate these converstations we need to have protocols. The global thing we agreed on is that servers provide services by means of daemons which listen on ports.
A daemon is a piece of software that is always present in memory. The program runs in the background, atleast that is how it is called. There are agreements about the functionality of most of the daemons and the ports they listen on. E.g. there is an agreement that the mailserver is listening on port 25 and provides the SMTP service. Ofcourse all these agreements can be found on an average GNU/Linux system. The file in which the services are defined is called /etc/services and a piece of that file looks like this:
# Network services, Internet style # # Note that it is presently the policy of IANA to assign a single # well-known port number for both TCP and UDP; hence, most entries # here have two entries even if the protocol doesn't support UDP # operations. # # This list could be found on: # http://www.isi.edu/in-notes/iana/assignments/port-numbers # # 0/tcp Reserved # 0/udp Reserved echo 7/tcp Echo # echo 7/udp Echo # ftp-data 20/tcp # File Transfer [Default Data] ftp-data 20/udp # File Transfer [Default Data] ftp 21/tcp # File Transfer [Control] ftp 21/udp # UDP File Transfer ssh 22/tcp # SSH Remote Login Protocol ssh 22/udp # SSH Remote Login Protocol telnet 23/tcp # Telnet telnet 23/udp # Telnet smtp 25/tcp # SMTP
As one can see above the telnet service uses port 23 and the protocol tcp. The protocol information can be found in /etc/protocols:
# Internet (IP) protocols # # from: @(#)protocols 5.1 (Berkeley) 4/17/89 # Updated for NetBSD based on RFC 1340, Assigned Numbers (July 1992). # ip 0 IP # internet protocol, pseudo protocol number icmp 1 ICMP # internet control message protocol tcp 6 TCP # transmission control protocol udp 17 UDP # user datagram protocol