What is the difference between a socket, a connection and a port?
BeginnerConceptNetwork Models, TCP, UDP & Ports
Answer
A socket is an endpoint: an IP plus a port plus protocol, represented as a file descriptor in the process. A listening socket waits on one port; each accepted connection gets its own new socket, but they all share the same local port and are distinguished by the remote IP and port.
That is why one server on port 443 can hold hundreds of thousands of connections. The limits are file descriptors, memory and conntrack, not the number of ports.
More on Network Models, TCP, UDP & Ports
What are the layers of the OSI model, and why does a DevOps engineer care?BeginnerHow does the TCP/IP model map to the OSI model?BeginnerWhat is the difference between TCP and UDP?BeginnerDescribe the TCP three-way handshake.BeginnerHow does TCP close a connection, and what is TIME_WAIT?IntermediateWhat is a port, and what are well-known, registered and ephemeral ranges?Beginner