mmm Long Answer without getting too complicated
Think of TCP and UDP as doing more or less the same thing, the difference is the
Tcp is connection orientated : your computer sends 5 messages to another computer and the computer that receives the message sends your computer a message "ok i got those 5 messages, you can send me the next messages. If it does not get them it asks the sending computer to resend the messages it did not get.
UDP is connectioneles : your computer just sends all its messages and does not care if the computer at the other side receives them.
This does not means that they do not do any erroe checking is is just done on another level in something called (IT term coming up) the OSI MODEL.
hope i was not to technicall
Java supports both TCP and UDP connections. ServerSocket and Socket classes exist for TCP. DatagramSocket exists for UDP.
Application Layer
UDP= User Datagram Protocol is a protocol that is used in transferring data and exchange of message. Without it your computer cannot interacts with other computer in a network.
Connectionless connection ie Computer A does not care if computer B receives the Packet of data or not, Computer A simply sends the packet to computer B.
UDP
The port number is random
. A Explain the overview of UDP messaging.
you can use tcp/ip or udp
The number of ports on a computer depends on the type of computer it is. The type of ports they have--for example USB, headphone, or HDMI--also varies greatly from computer to computer.
The transmission control protocol or TCP is used for connection oriented transmissions of data into a computer. The user datagram protocol or UDP is used to transmit simpler data into a computer.
DNS uses both TCP and UDP, also a lot of online chats use UDP. I think even when you want videos on YouTube UDP is used to deliver video and audio.
DNS primarily uses the User Datagram Protocol (UDP) on port number 53 to serve requests. DNS queries consist of a single UDP request from the client followed by a single UDP reply from the server. When the length of the answer exceeds 512 bytes and both client and server support EDNS, larger UDP packets are used.