Understanding Socket Connections in Computer Networking

You only have one IP address, so that alone is not enough to connect multiple requests to the right destination.

The answer is our second piece of related technology: ports.

PortFirst off, we’re talking about software ports here, not hardware ports.

A hardware port is simply a socket that accepts device cables, like the HDMI cable going to your TV or the 3.

5mm headphone jack going into your phone (for those that still have headphone jacks).

A software port is a number that identifies the specific application or service on your computer that’s attempting to access the network.

IP addresses and ports can be compared to a phone number: the IP address is like the area code, which identifies the general area that the phone call should be routed to.

The port is like the rest of the phone number, which will route the call to the specific phone number being requested.

The IP address gets the requested information to the right computer, and the port gets the information to the right application or service running on that computer.

SocketIn a very over-simplified sense, a socket is simply the combination of an IP address and a port.

More formally, a socket is “one endpoint of a two-way communication link between two programs running on the network.

A socket is bound to a port number so that the TCP layer can identify the application that data is destined to be sent to.

”To see this in action simply click the following link, which is the stripped down way to access google.

com: 172.

217.

7.

238:80This introduces the third technology we’re going to explore in this post: TCP, or Transmission Control Protocol.

When you send a large file over the internet, it doesn’t get sent in one big chunk.

Instead it gets chopped up into small manageable bits (called packets) that each find their way to the intended destination.

This way you’re not blocking a connection and waiting until the entire file is sent to it’s destination.

Imagine a train with 100 cars trying to cross a busy intersection.

The entire train would need to cross before a car could make its way through the intersection, and all those cars are now delayed.

If instead you could (somehow) chop that train up and space the cars far enough apart, you could have cars crossing the road in-between each car, and you’ve just reduced congestion significantly.

Packets act in the same way.

Big files are chopped up into manageable packets to reduce congestion.

TCP makes sure that all the packets arrive in their correct destination, and can then be re-ordered into the correct sequence, since the packets might take different routes to the same destination.

TCP also sends an acknowledgment that the packet was received by the receiver, so if a packet gets lost the sender will know because it never received an acknowledgment, and can then send the packet again.

So to put it all back together, a socket is the combination of an IP address and a port, and it acts as an endpoint for receiving or sending information over the internet, which is kept organized by TCP.

These building blocks (in conjunction with various other protocols and technologies) work in the background to make every google search, facebook post, or introductory technical blog post possible.

.. More details

Leave a Reply