Both TCP and UDP are protocols used to send data from one device to anoter within the TCP/IP network. When sending data, they are broken into smaller IP packets and sent over the TCP or UDP transport layer. Applications may choose to use either TCP or UDP to send data to the other end depending on whether the reliability or speed is more important. For reliable delivery, TCP is used while UDP is used for faster delivery. TCP/IP is comprised of 4 layers with each providing a specific protocol functions as shown below: