1.5 TCP and UDP Flashcards
Compare and Contrast TCP andUDP. (14 cards)
Define:
TCP
(Transmission Control Protocol)
A connection-oriented protocol ensuring reliable data transmission.
TCP establishes a connection, ensuring data integrity and successful delivery through error detection, acknowledgment, and retransmission.
List the features of TCP.
- Connection-oriented
- Reliable data transfer
- Ordered data delivery
- Error checking and correction
- Flow and congestion control
These features make TCP suitable for applications requiring reliable data delivery, such as web browsing and file transfers.
Define:
UDP
(User Datagram Protocol)
A connectionless protocol with no delivery, order, or error guarantees.
UDP sends data without a connection, not ensuring order or delivery, making it suitable for speed-critical applications with acceptable data loss.
List the features of UDP.
- Connectionless
- Unreliable transfer
- Faster speeds
- No error checking
- No flow control
UDP is suitable for applications that prioritize speed, such as DNS queries or live video calls, where reliability can be compromised.
In which OSI model layer do the protocols TCP and UDP operate?
Transport layer
Both TCP and UDP are found in the transport layer of the OSI model, where TCP is utilized for connection-oriented communication and UDP for connectionless communication.
True or False:
TCP is faster than UDP.
False
TCP has higher overhead due to connection setup, error checking, and retransmissions, whereas UDP’s simplicity and minimal overhead allow for faster communication.
What is the main difference in how TCP and UDP handle packet delivery?
- TCP: Uses a handshake and acknowledgment for packet delivery.
- UDP: Sends packets without connection or acknowledgment.
TCP’s connection-oriented nature ensures reliability, while UDP’s connectionless approach minimizes overhead for speed.
Identify three applications that benefit from using UDP.
- Online gaming
- Video conferencing
- VoIP
UDP is preferable for applications where speed is critical and some data loss is acceptable, such as in online gaming, video conferencing, and voice over IP (VoIP).
Why is UDP preferred for online gaming?
It is faster due to no acknowledgment or error checking.
Online gaming requires low latency, and slight packet loss is tolerable, whereas TCP’s overhead would introduce unacceptable delays.
What is the three-way handshake in TCP?
A method to establish a reliable connection between sender and receiver.
The handshake involves SYN, SYN-ACK, and ACK steps to ensure both devices are ready for data transmission, ensuring reliability and no data loss.
Fill in the blank:
TCP ensures data integrity through ____-________ ________.
error-recovery features
TCP includes error-checking and recovery mechanisms to ensure all packets are delivered correctly.
How does TCP recognize lost data?
By using sequence numbers and acknowledgments.
If a segment is not received, the recipient requests the sender to resend it.
Why is UDP preferred for DNS queries?
It is faster, and DNS queries require minimal data.
DNS requests are typically small, and speed is more important than reliability. Since DNS operates over short-lived connections, the lack of error-checking in UDP speeds up the query process.
True or False:
UDP requires more bandwidth than TCP.
False
UDP requires less bandwidth because it does not include connection setup, acknowledgments, or error recovery, whereas TCP’s overhead consumes more bandwidth.