TCP VS Udp
TCP VS Udp
Q. Can you explain the difference between UDP and TCP internet protocol (IP) traffic and its usage with an example? A. Transmission Control Protocol (TCP) and User Datagram Protocol (UDP)is a transportation protocol that is one of the core protocols of the Internet protocol suite. Both TCP and UDP work at transport layer TCP/IP model and both have very different usage.
TCP UDP Reliability: TCP is connectionReliability: UDP is connectionless oriented protocol. When a file or protocol. When you a send a data or message send it will get delivered message, you don't know if it'll get unless connections fails. If connection there, it could get lost on the way. lost, the server will request the lost There may be corruption while part. There is no corruption while transferring a message. transferring a message. Ordered: If you send two messages Ordered: If you send two messages along a connection, one after the out, you don't know what order they'll other, you know the first message will arrive in i.e. no ordered get there first. You don't have to worry about data arriving in the wrong order. Heavyweight: - when the low level Lightweight: No ordering of messages, parts of the TCP "stream" arrive in the no tracking connections, etc. It's just wrong order, resend requests have to fire and forget! This means it's a lot be sent, and all the out of sequence quicker, and the network card / OS parts have to be put back together, so have to do very little work to translate requires a bit of work to piece the data back from the packets. together. Streaming: Data is read as a "stream," Datagrams: Packets are sent with nothing distinguishing where one individually and are guaranteed to be packet ends and another begins. There whole if they arrive. One packet per may be multiple packets per read call. one read call. Examples: World Wide Web (Apache Examples: Domain Name System TCP port 80), e-mail (SMTP TCP (DNS UDP port 53), streaming media port 25 Postfix MTA), File Transfer applications such as IPTV or movies, Protocol (FTP port 21) and Secure Voice over IP (VoIP), Trivial File Shell (OpenSSH port 22) etc. Transfer Protocol (TFTP) and online multiplayer games etc