Basic Concept of Networking: Client-Server Model, Protocols, Services, and PORT numbers.

Basic Concept of Networking: Client-Server Model, Protocols, Services, and PORT numbers.

Why 2 or more computers need to communicate with each other ?

  • To share information with each other. Do you remember those days when you used to copy files from your friends laptop into yours using Pendrive. But do you know, instead of using a Pendrive as a mediator you can directly copy files from friends to your laptop using Ethernet cable or Internet(via FTP services). Using Ethernet cables, it allows only 2 laptops to connect directly. Whereas Internet allows unlimited numbers of computers to connect.
  • Similarly, when you have build your first website, you have called your friend in your home to show your running website on your laptop. But instead you have deployed your same website on any server having public IP's, then using that Server IP your friend could easily see your website from anywhere in the world.
  • Computers need to be connected through internet so that computers(or machines or nodes or instance) can communicate with each other. And only by communicating one computer can ask for service from the other computers. The computer which ask for service is known as Client. And the computer which provides service is known as Server.
  • The main motive behind communication is to get service from Server. Communication takes place between two of them: Client and Server. So, Client-Server Models becomes important to understand when it comes to communication. Later on we will understand it.

What type of communication?

  • The communication depends on the types of the Service a Client want from Server. For example: To see web pages, to transfer files, to connect to remote server. To differentiate between different type of services, different types of protocols are used. Each protocols signifies to one type of service only. Example of Protocols are: HTTPS, FTP, SSH,? TCP, etc.
  • These services runs on some instances/nodes/machine/laptop known as Server. The service is nothing but a program running on server. When a client makes a request to the server, then that program is being executed on the server side which uses server resources(RAM, PROCESSOR and DISK) and it's output is returned to the client via internet.
  • Is it possible to run more than one service in one server. Yes. But how will server know which service is client looking for. The server knows from the protocol and PORT number.
  • Therefore, it is necessary to have communication b/w you(client ) and Google/Facebook/Amazon server instances for sharing information, to get services.
  • To communicate with Server, client requires IP Address of the server. And in previous blog we we came to about how to retrieve IP Address from domain name. Normally these IP's are not given directly provided to the user but instead Domain name is provided. For example, google domain is www.google.com and it's IP Address is 8.8.8.8. DNS helps in retrieving IP Address from domain name. Since, these servers are assigned with Public IP's, so it is pingable/reachable from anywhere in the world. Once the client get IP Address of Server it can easily connect to them.
  • Communication is based on Client-Server model. Where one node/instance acts as a Client and another Node acts as a Server. Client sends request for the service and Server response in form of providing service.?
  • Client —> The one which request for the service. Ex: Any browser such as chrome, firefox, curl, etc.
  • You may be thinking that the user who is accessing the service is a client. But actually he/she is the end-user, not client. Client is your browser (chrome or firefox or brave) who takes requests on behalf of you in structured manner. Then it formats in such language to which the server understands.?
  • Server —> The one who serves the request and provide service. On server, service program runs. And server response for each and every request made by the client.?
  • Client-Server are relative terms.
  • Networking helps in exchanging information b/w Client and Server.

What are Protocols and different types of Protocols ?

  • NOTE: Also note that whenever? there is any kind of interaction between client and server they always communicate in common language. Technically, it is known as protocol. Protocols include syntax of those languages. Some of the popular protocols are HTTPS, SSH,? TCP, UDP, FTP, SMTP, NFS, DNS, DHCP, ARP, etc. In simple terms, client means one who asks for a particular type of service. Depending on the type of service different protocols were made.? And a server is one who provides the type of service. Client makes a request and the Server responds to that request. In the real world there are many such examples of client-server models. You(client) went to the petrol pump(server) and asked to fill up the petrol. So, the service provided by a petrol pump is by providing you with a fuel known as petrol.? You can not demand from a petrol pump guy to provide you service as a milk. If you do so, he/she will not respond to you(machines don’t respond but human beings? will consider you as mad). Similarly, in the computer world for different types of services different protocols were made. Example:??

No alt text provided for this image


  • For file transferring FTP protocol was introduced.?
  • To get an IP Address from a domain name DNS protocol was made.?
  • To serve the web pages HTTP protocol was made.?
  • To deal with security related stuff TLS protocol was made.?
  • To get a storage NFS protocol was made.?
  • To run nodes from anywhere in the world SSH was made.?
  • To get an MAC Address ARP protocol was made.
  • In all above cases, one will be a client and the other will be a server. When you search for google web pages then you act as a HTTP client and Google Server as a HTTP Server.

PORT Number: How multiple service running on same server is differentiated ?

Let's understand with the help of example. In a hotel there are lots of rooms. These rooms are differentiated from each other by room numbers. Similarly, in a computer many services/programs are running. For example: Web Server program, File Transfer program, SSH programs, etc. Similarly like rooms these programs running on your laptop are differentiated by standard numbers. And these standard numbers is known as PORT numbers. For example: PORT numbers on which SSH programs run is: 22, PORT numbers on which Web Server programs run is: 80, Similarly, PORT numbers on which FTP programs run is: 20 or 21. So, if a user want service then it requires IP Address and PORT number. So to get HTTPS service, complete url will be https://<IP Address>:80, to get SSH service the complete URL will be: <IP Address>:22.

Normally there are tons of programs run in your OS or run in the Server, but not all programs are capable of providing service. Only few programs are only made to provide services. Like, VS Code, browsers , compiler are also program but these are not built to provide service. Hence, no standard PORT number are given to them. Few Programs which are capable or made to provide services are provided with standard PORT numbers.

That's all from this blog. Hope you liked it. Do let me know for any doubt or any suggestion. Thanks for reading it.

要查看或添加评论,请登录

Vivek Kumar Sahu的更多文章

社区洞察