A socket is a software interface between the transport layer and the application layer. The transport layer offers a set of services to the application layer. The socket provides the abstraction to access these services.
Socket is a logical component. It’s basically a data structure that stores information about host and port.
The computer can handle multiple connections because it uses a multiplexer to handle all incoming data. Among all the info that comes inside the network traffic, there is always a port specified.
Did you ever noticed that every process/service runs on a specific port? And two process CAN’T occupy the same port? Well the reason behind this, is that ports are how the network interface routes the packages to the service.
So the communication is “serial”. In another words, doesn’t matter what is the protocol, the data, the host or the port, all data will come within the same path, as showed on the image below:

The trick here is the multiplexing. The multiplexer is what give us the impression that all data is coming in parallel. The illusion goes unnoticed because the traffic ingestion and the multiplexing is so fast that we can’t notice it happening.

A host on the internet can have many Internet applications installed on it. All these applications will depend on the transport layer to deliver messages to other hosts. The transport layer at the sender side will receive messages from different applications, break the message into segments and pass them on to the underlying network layer. This job of the transport layer is known as *Multiplexing. De-multiplexing *occurs at the receiver’s side. The transport layer gathers the segments from the network layer, retrieve the port number from the segments and passes the segments to the appropriate application process (as shown in the right hand side of Figure
![[Untitled 517.png|https://www.cs.uct.ac.za/mit_notes/networks/htmls/chp03.html]]
https://medium.com/fantageek/understanding-socket-and-port-in-tcp-2213dc2e9b0c
https://lwn.net/Articles/657999/
https://www.cs.uct.ac.za/mit_notes/networks/htmls/chp03.html