In world wide web, the devices are communicate with each other using the Internet protocol address (IP address)
The website DNS will have its own IP address and when ever you are connecting to any website it will connect to its IP address with the mentioned ports,. Consider that you are opening the https://classadviser.in website it will connect to the IP address belong to that DNS with the default port 80. Use the ping command to identify the IP of any websites as like below.
C:\>ping classadviser.in
Pinging classadviser.in [103.209.144.198] with 32 bytes of data:
Reply from 103.209.144.198: bytes=32 time=143ms TTL=54
Reply from 103.209.144.198: bytes=32 time=137ms TTL=54
Reply from 103.209.144.198: bytes=32 time=137ms TTL=54
Reply from 103.209.144.198: bytes=32 time=51ms TTL=54
Ping statistics for 103.209.144.198:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 51ms, Maximum = 143ms, Average = 117ms
As you can see the result, the IP address of classadviser.in is 103.209.144.198 returns the databack when the website is accessed. So now you know that every website is having its own IP address and every machine will also have IP assigned over the network.
What is THEN need of different port numbers
With the use of IP address, the user can communicate with others but considering the same if we have to run multiple applications which needs to run independently. Here comes the use port number, its an unique default or user defined number which will run the system or user defined applications. The following are some of the default dedicated port numbers.
Port | Service name | Transport protocol |
---|---|---|
20, 21 | File Transfer Protocol (FTP) | TCP |
22 | Secure Shell (SSH) | TCP and UDP |
23 | Telnet | TCP |
25 | Simple Mail Transfer Protocol (SMTP) | TCP |
50, 51 | IPSec | |
53 | Domain Name System (DNS) | TCP and UDP |
67, 68 | Dynamic Host Configuration Protocol (DHCP) | UDP |
69 | Trivial File Transfer Protocol (TFTP) | UDP |
80 | HyperText Transfer Protocol (HTTP) | TCP |
110 | Post Office Protocol (POP3) | TCP |
119 | Network News Transport Protocol (NNTP) | TCP |
123 | Network Time Protocol (NTP) | UDP |
135-139 | NetBIOS | TCP and UDP |
143 | Internet Message Access Protocol (IMAP4) | TCP and UDP |
161, 162 | Simple Network Management Protocol (SNMP) | TCP and UDP |
389 | Lightweight Directory Access Protocol | TCP and UDP |
443 | HTTP with Secure Sockets Layer (SSL) | TCP and UDP |
989, 990 | FTP over SSL/TLS (implicit mode) | TCP |
3389 | Remote Desktop Protocol | TCP and UDP |
- From 0 to 1023 – well known ports assigned to common protocols and services
- From 1024 to 49151 – registered ports assigned by ICANN to a specific service
- From 49152 to 65 535 – dynamic (private, high) ports range from 49,152 to 65,535. Can be used by any service on an ad hoc basis. Ports are assigned when a session is established, and released when the session ends.
custom port numbers
The user can specify their own port number for running the applications like java, sql, node, php, etc. The custom port helps to communicate with the application from other ports / IP address. Consider you are running a web application on you local machine on the port 5000, then you can access your application in the browser with the address http://localhost:5000. Here localhost is the IP address of the local machine.