Category: 

What Is a UDP Socket?

Article Details
  • Written By: Eugene P.
  • Edited By: A. Joseph
  • Last Modified Date: 21 November 2014
  • Copyright Protected:
    2003-2014
    Conjecture Corporation
  • Print this Article
Free Widgets for your Site/Blog
The Queen of England legally owns about one-sixth of all of the land on Earth.  more...

December 20 ,  1860 :  South Carolina seceded from the US.  more...

A user datagram protocol‭ (‬UDP‭) ‬socket is a type of computer protocol that is used to transmit and receive information through a network.‭ ‬UDP sockets are known for their connectionless nature,‭ ‬meaning that they do not have to contact another server before attempting to send data.‭ ‬This is distinctly different from transmission control protocol‭ (‬TCP‭) ‬sockets that must maintain a line of communications to another socket at all times.‭ ‬Many Internet applications regularly use a UDP socket for communication because they allow large numbers of users to access online servers without the need for continual communications.

The three types of computer sockets are UDP,‭ ‬TCP and raw.‭ ‬Raw sockets are most frequently used to help locate or direct network traffic.‭ ‬TCP sockets are used when it is important that all information reach the destination socket in the order that it was sent in.‭ UDP sockets are used when information needs to‭ ‬be‭ ‬retrieved from a server in small batches through the use of individual packets called datagrams.

One of the disadvantages of using a UDP socket is what is called packet loss.‭ ‬There is no pre-established connection between the two sockets,‭ ‬so there is a chance that a datagram will not make it to the destination socket.‭ ‬The destination computer has no idea that the packet is coming and will not request that it be resent,‭ ‬so the data is completely lost.

Ad

Systems that use a UDP socket framework often opt for packet loss over the transmission problems that a TCP connection might cause.‭ ‬An example is a critical real-time system in which it is more important to keep data flowing into and out of the system as opposed to potentially having the entire system pause because of a slow TCP connection.‭ ‬Alternately,‭ ‬TCP connections are used in situations where any data loss could compromise system integrity.

Creating a UDP socket is very easy.‭ ‬Considering that there does not need to be a dedicated computer process to constantly maintain the port to which the socket is connected,‭ ‬it requires very little overhead.‭ ‬Sending and receiving datagrams through a UDP socket is equally easy because of the minimal size and low complexity of‭ ‬the packet structure.

Many vital online services employ UDP sockets for communications.‭ ‬The domain name system‭ (‬DNS‭)‬,‭ ‬which converts simple Internet addresses that people can read and understand into a long series of numbers,‭ ‬uses UDP sockets because only one request per user is usually required at any time.‭ ‬Streaming media services also use UDP, because the loss of a single packet does not interrupt the entire stream in most cases.

Ad

More from Wisegeek

You might also Like

Discuss this Article

Post your comments

Post Anonymously

Login

username
password
forgot password?

Register

username
password
confirm
email