Tutorial Socket Programming : InterProcess Communication and Protocols

The InterProcess communication is based on socket pairs, one belonging to a communication process. InterProcess communication can be achieved by transmitting some data in a message between a socket in one process to the another socket in another process and vice versa.

Lets look at the protocols used for IPC -  TCP and UDP or the difference between TCP and UDP.

TCP is connection-oriented protocol. Connection must be established between two sockets for transferring the data. When we send the  message, it will get delivered unless connections fails. If connection lost in between, the server request the lost part which avoids corruption of data. So  TCP being reliable,  when connection gets established it takes time also when connection lost it again sends the lost packets which again takes time.

While UDP is connectionless protocol. there is no guarantee that the data we sent which will get received at other end. So this protocol is unreliable.

TCP : Data sending and receiving order is maintained but order is not considered in UDP.

UDP has restriction of 64 KB for the datagrams we send, in TCP there no such limit.


                                                                           

So considering above points TCP is used mainly in World Wide Web www(Apache TCP port 80), e-mail (SMTP TCP port 25 Postfix MTA), File Transfer Protocol  FTP (port 21) and Secure Shell Remote Logins (Port 22)

UDP  ( a less complex protocol and which has fewer overheads compared to TCP ) is used mainly in Domain Name System (DNS UDP port 53), streaming media applications such as IPTV or movies, Voice over IP (VoIP), Trivial File Transfer Protocol (TFTP ) and other distributed client server applications.
Share on Google Plus

About Pranav

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment