Socket is known as the one end-point of a two-way communication link between two programs running on the IP based network, they are also used for the communication between processes within the same machine. It is an interface between the application process and transport layer, these sockets are created and utilized with a set of function calls which are also known as application programming interface (API). In the process of two-way communication the application process can send/receive messages to/from another application process. Following are the parameters that form the of sockets
- Protocol (TCP, UDP or Raw IP)
- Local IP address
- Remote IP address (useful for TCP sockets which are connection oriented)
- Remote port number (useful for TCP sockets which are connection oriented)
Using these parameters a server will assign a specific port number to listen the incoming connections from the clients. When the client sends a request to server a dedicated connection is established between the client and server, during this connection process client will be assigned a local port number to which the socket is bonded and in the same manner server will get a local port to which it starts communicating with client and releases the old port for future client requests. Once the connection is established data transfer can be done simultaneously providing a bi-directional mechanism.
Mainly there are two types of IP based Internet sockets based on their type of connection they are:
1) Stream Sockets: These are known as stream sockets due to the reliable connection oriented sockets by using the TCP connection which guarantees the complete transfer of data in a sequence without any lost of packets.
2) Datagram Sockets:-These are known as the datagram sockets due to the unreliable connectionless usage of UDP protocol, in which the data is transferred in the form of data packets known as “datagram’s”. UDP is connectionless and hence is unreliable.
This Project Paper is written & submitted by Deepak V.