WHAT ARE SOCKETS IN NETWORKING ???


Many of us have heard about sockets in Internet or in networking. But have you ever thought what exactly is it and what it has to do with the networks or internet in general?
So today I will be telling you what a Socket is, in a broader view.






Before jumping to the Sockets, we need to learn few thing to understand the Sockets later.

Those are mentioned below:


1. Protocol


2. Address


3. Port
-----------------------
1. Protocol:
Protocols are the set of rules in the internet/network which governs the internal functionality of communication. Two of the famous protocols used in data transmssion are TCP and UDP(google for more info).





2. Address:
The word "Address" is referred to IP address of a host(computer) in the world of networking. That IP address is generally IPv4(IP version 4). This address is used to uniquely identify each hosts(computers) in a network.





3. Port:
You may have heard about the words 'port', 'port number', 'http port' etc. at least ones in your life. But what are they? To understand them, Let's consider a real life analogy.
Let's say a written letter has come to an address of a building consisting of various departments. So how the letter will be reached to the exact department when there is no department name mentioned. This can be confusing as all the departments will have the same address of building but not of 'inside the building'.
So, we need something which can identify different stuff in the same address uniquely.
Now comming out of analogy, I hope you will be able to understand the concept of ports.
There are various services(HTTP, FTP , POP , SMTP , etc) in the server with the same IP address. So, to identify each service uniquely, port number(a specific number for denoting a service) is used. For example, the HTTP port is denoted as the 'port 80'.






----------------------
So, summing up the above three things, protocols define the rules for the data flow, address specifies the system(sender/receiver) and port specifies the specific service in that address.

---------------------

Now, let's come to the point this entire article is all about!


What is a SOCKET ?



Socket denotes the end points of a network( client end and server end).
A Socket consists of the three things explained earlier(protocol , address , port).
When we talk about a socket , we are actually talking about the group of these three things : (transmission protocol , client/server IP address , client/server port number).

A socket pair is referred to both end points collectively: transmission protocol , client's IP , client's port number , server's IP , server's port number.



********************************************************



I hope this article will be informative for you guys. As it took a lot of research and efforts to write, It would be great if I can get some honest reviews and rating on this article. Please do suggest where my writing skills are lacking and let me know where you didn't understand the concept. Kindly don't ignore it if you have read


SHASHANK BARTHWAL


INSTA ID - SHASHANK BARTHWAL

Keep loving ZanTanMan 
and keep sharing .

Your support is invaluable to us .


Comments

R_P said…
Bhai actually m I didn't know what sockets are before going through this, but this gave me a simple and clear brief what sockets actually are...

Popular

TOP 5 MOST RELEVANT PROGRAMMING LANGUAGES TO CONSIDER IN 2018

WHY IS EVERYONE PREFERRING SOFTWARE OVER HARDWARE?