TCP vs UDP for VoIP
From VoIP.ms Wiki
|
If you have configured an IP Phone or softphone before, you may be familiar with the term “transport”. Are you familiar with it and do you know how does it work?
To understand what a “transport” is, we first need to understand how IPs work. An Internet Protocol (IP) sets the rules that govern the format in which data is exchanged by all systems connected to public or private networks. All devices that connect to a network are assigned an IP Address, with the goal of identifying devices from all over the internet. Each IP address contains location information that makes each device reachable for communication. IP addresses are a string of numeric digits separated by periods and usually expressed in groups of four numbers called octets. But how do IP addresses work and communicate with each other? As with any other coding language, IP works by using well-established guidelines and properly defined rules. If two devices in a network can understand and communicate in the same language, then they are able to establish a successful connection and exchange information with each other. The process, although invisible to the human eye, can be quite complex. First, your device will connect to a network with internet access via an Internet Service Provider, who will assign an IP to your device and handle your devices' requests, either sending them to the proper destination or routing inbound traffic towards your device. These IP addresses assigned to your devices may change at a certain point, and those are called “Dynamic IPs”, while the ones that do not change are called “Static IPs”.
UDP, also known as User Datagram Protocol, is a communication protocol widely employed for multiple purposes, among these we could highlight time-sensitive transmission (video playback) or DNS lookups (DNS stands for Domain Name System, it is basically a directory for the internet, where you could enter https://www.voip.ms in your browser, DNS will translate such name to an IP address and locate the required website information on the proper destination in order to show it to you). The peculiarity of this protocol is that it does not require establishing a connection before data is sent or received, speeding up the process, with the downside of possible packet loss in the process (which could eventually cause vulnerabilities in a specific setup).
The TCP protocol, also known as Transmission Control Protocol, while offering the advantage of being a more secure protocol, has the disadvantage of requiring more bandwidth than a UDP. TCP allows devices using Internet Protocol to remain connected with the purpose of ensuring packet order, therefore guaranteeing the exchange of these packets. Unlike the UDP protocol, TCP requires establishing a handshake with the receiving party for the process to be able to complete successfully. Taking a closer look at the process, basically, the device that initiates the connection asks firsts for the destination device’s availability, then, the receiver returns a response and then the sender acknowledges the response sent by the receiving destination and initiates communication if the receiver is available. This process is known as the “3-way handshake”, it takes place right before any data interchange takes place and it’s in this stage where ports used in the connection are reserved aiming to have a reliable connection between the devices involved. The TCP protocol also has capabilities to identify lost data packets in the exchange process, the idea is to guarantee no data packets will be lost at any given moment. The downside of this whole path TCP protocol takes to send and receive information is that this process takes more time and resources to function.
Conclusion: While both protocols will have you properly connected, UDP should be employed when speed is the priority, considering any possible security issue this protocol may imply, while TCP is the option to give priority to accuracy, due to the fact TCP ensures no packet loss in the process.
______ For more information, visit us at |