These are the basic questions.
UDP :: User Datagram Protocol
1) There is no end-to-end connection between the machines (maybe on the local network or somewhere on the Internet).
2) The data received at the end of the receiver is not in the stream, as in TCP, but as a complete block of data.
3) At the transport level, packet inspection is not performed. That is, in the event of any error in the received packet, the receiver will not request a retransmission of the same packet to the sender.
4) Due to the above behavior, sending buffers is not required.
5) Since there is no end-to-end connection. and no handshakes are required, UDP is much faster, but less reliable than TCP. Therefore, it is mainly used in games and DNS, etc.
6) No confirmation is required for sending after returning packages.
TCP :: Transmission Control Protocol
1) End-end A connection is maintained between machines (maybe on a local network or somewhere on the Internet).
2) The data received at the end of the receiver is a stream in TCP. Thus, when we perform network programming for servers, we first analyze the header, and then, depending on the size specified in the header, we get much more bytes from the buffer.
3) Error checking and serial number are completed. Thus, in the event that a packet is received out of order (rarely) or is erroneous than this packet for resending. In addition, many other protocols are involved in flow control (flow control to the end).
4) As the establishment of the connection, the establishment of communication and acknowledgment, TCP should be performed generally slower than UDP. (I don't know how sure I am)
5) Many protocols use TCP as the base transport protocol. HTTP, FTP, TELNET, etc.
6) The communication procedure includes:
Server :: 1) Socket Open 2) Socket binding 3) Listen to Socket 4) Receive socket 5) Socket Send / Recv Client :: 1) Socket Open 2) Socket Connect 3) Socket Send / Recv
There are many other differences as well .. but the above are the most common.