TCP/IP Sockets and Socket Pairs: Process and Connection Identification
(Page 1 of 2)
The preceding topics have illustrated the key difference between addressing at the level of the Internet Protocol, and addressing as it is seen by application processes. To summarize, at layer three, an IP address is all that is really important for properly transmitting data between IP devices. In contrast, application protocols must be concerned with the port assigned to each instance of the application, so they can properly use TCP or UDP.
What this all means is that the overall identification of an application process actually uses the combination of the IP address of the host it runs onor the network interface over which it is talking, to be more preciseand the port number which has been assigned to it. This combined address is called a socket. Sockets are specified using the following notation:
<IP Address>:<Port Number>
So, for example, if we have a Web site running on IP address 184.108.40.206, the socket corresponding to the HTTP server for that site would be 220.127.116.11:80.
You will also sometimes see a socket specified using a host name instead of an IP address, like this:
<Host Name>:<Port Number>
To use this descriptor, the name must first be resolved to an IP address using DNS. For example, you might find a Web site URL like this: http://www.thisisagreatsite.com:8080. This tells the Web browser to first resolve the name www.thisisagreatsite.com to an IP address using DNS, and then send a request to that address using the non-standard server port 8080, which is occasionally used instead of port 80 since it resembles it. (See the discussion of application layer addressing using URLs for much more.)
The socket is a very fundamental concept to the operation of TCP/IP application software. In fact, it is the basis for an important TCP/IP application program interface (API) with the same name: sockets. A version of this API for Windows is called Windows Sockets or WinSock, which you may have heard of before. These APIs allow application programs to easily use TCP/IP to communicate.
Home - Table Of Contents - Contact Us
The TCP/IP Guide (http://www.TCPIPGuide.com)
Version 3.0 - Version Date: September 20, 2005
© Copyright 2001-2005 Charles M. Kozierok. All Rights Reserved.
Not responsible for any loss resulting from the use of this site.