What is a socket in networking?


socket is one endpoint of a two-way communication link between two programs running on the network. 
socket is a combination of the port number and the IP address, so that the TCP/UDP layer can identify the application that data is destined to be sent to. 


Take an example of an apartment building ( World Famous Analogy)


  1. The street address of the building is the IP Address
  2. The specific apartment number in that building is the port number (port number tells the type of data transmission - TCP or UDP)
  3. The door of the apartment is the Socket (TCP + Socket)



So, the postman (TCP Layer) needs all the values
- Building Address (IP Address)
- Apartment Number (Port Number)
- Door (Socket)

so that the letter in postman's hand (data) can arrive at the correct destination (application).









0 comments:

Post a Comment