Both TCP and UDP are commonly used protocols to send data between the internet or network connected machines using IP addresses. Machines that support TCP and UDP protocols have TCP and UDP ports respectively. Most machines that are internet capable have both support for TCP and UDP ports and are commonly used to connect between servers, printers, etc..
Once a port is used to binds application, it cannot be used by others. A particular machine can have many ports (+1000). Most major applications register specific ports they would like to reserve with an organization called IANA – this reduces the probability of conflict.
Transmission Control Protocol (TCP)
TCP is one of two main protocols to connect to another machine. This method involves establishing a connection, transfer data packets, followed by the connection being closed/released.
This method of transferring data tends to be quicker and more reliable but puts a higher load on the computer as it has to monitor the connection and the data going across it.
Machines that are internet compatible use a protocol called TCP\IP to communicate. For example, web servers typically bind and listen to TCP port 80 for incoming requests. Once a device is connected, it serves the request, when done disconnect the connection.
User Datagram Protocol (UDP)
UDP is another main protocol used to connect to another machine. Unlike TCP, UDP protocol does not involve establishing a direct connection to the receiving machine, instead, the origin server sends the data as data packets and relies on the devices in between the sending computer and the receiving computer to transfer data.
This method of transmission does not provide any guarantee that the data you send will ever reach its destination. However, it is fast and have low overhead and is therefore used for services that are not that important to work on the first try.