TCP vs UDP
- 38Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
- spaceFlip card
- KI knew it
- DI didn't know it
- ←Previous card
- →Next card
What is the primary function of Layer 4 (Transport Layer) in the OSI model?
To provide transparent transfer of data between end hosts, encapsulating data with a Layer 4 header and using lower layers to deliver data unchanged.
Or swipe the card
38 cards
What is the primary function of Layer 4 (Transport Layer) in the OSI model?
To provide transparent transfer of data between end hosts, encapsulating data with a Layer 4 header and using lower layers to deliver data unchanged.
List four services that TCP provides to applications but UDP does not.
Reliable data transfer, error recovery, data sequencing, and flow control.
What are Layer 4 addresses called?
Port numbers (or Layer 4 port numbers).
What are two functions of port numbers at Layer 4?
Identifying the Application Layer protocol being used and providing session multiplexing (tracking multiple communication sessions).
What are the three port number ranges designated by IANA?
Well-known (0-1023), Registered (1024-49151), and Ephemeral (49152-65535).
When a host randomly selects a source port number, which range should it choose from?
The ephemeral port range (49152-65535).
What does it mean that TCP is connection-oriented?
TCP requires a connection to be established between the two hosts before any data is sent, using the three-way handshake.
How does TCP provide reliable communication?
The destination host must acknowledge each received TCP segment; if no acknowledgment is received, the sender retransmits the segment.
How does TCP provide data sequencing?
TCP includes sequence numbers in the header, allowing the destination host to reorder segments if they arrive out of order.
How does TCP provide flow control?
The destination host uses the Window Size field in the TCP header to tell the source host how much data it can send before receiving an acknowledgment, adjusting the rate dynamically.
List the TCP header fields that you should know for the CCNA.
Source port (16 bits), Destination port (16 bits), Sequence Number, Acknowledgment Number, Flags (ACK, SYN, FIN), and Window Size.
Describe the TCP three-way handshake.
- Client sends a SYN segment. 2. Server replies with SYN-ACK. 3. Client sends an ACK. The connection is then established.
Describe the TCP connection termination process (four-way handshake).
- Client sends a FIN. 2. Server responds with an ACK. 3. Server sends its own FIN. 4. Client responds with an ACK. The connection is then closed.
What is forward acknowledgment in TCP?
The acknowledgment number indicates the next expected sequence number, not the last received sequence number.
What happens if a TCP sender does not receive an acknowledgment for a segment?
After a timeout, the sender retransmits the unacknowledged segment.
What is the purpose of the TCP sliding window?
It dynamically adjusts the window size to control flow, increasing until a segment is lost, then decreasing, and slowly increasing again.
What does it mean that UDP is connectionless?
UDP does not establish a connection before sending data; data is simply sent to the destination without prior communication.
Does UDP provide reliable communication?
No. UDP does not use acknowledgments or retransmissions; it provides best-effort delivery.
Does UDP provide sequencing?
No. UDP has no sequence number field; if segments arrive out of order, the receiver cannot reorder them.
Does UDP provide flow control?
No. UDP has no mechanism like TCP's window size to control the rate of data flow.
What are the fields in the UDP header?
Source port (16 bits), Destination port (16 bits), Length (16 bits), and Checksum (16 bits).
Which services are provided by both TCP and UDP?
Layer 4 addressing (port numbers) and session multiplexing.
For which types of applications is TCP preferred over UDP?
Applications requiring reliable communications, such as file downloads (FTP) and email (SMTP).
For which types of applications is UDP preferred over TCP?
Real-time, delay-sensitive applications like voice over IP (VoIP), video conferencing (Zoom, Skype), and streaming.
Give an example of an application that uses both TCP and UDP.
DNS (Domain Name System) typically uses UDP but can use TCP in certain situations.
What well-known port numbers are used by FTP?
TCP ports 20 and 21.
What well-known port number is used by SSH?
TCP port 22.
What well-known port number is used by Telnet?
TCP port 23.
What well-known port number is used by SMTP?
TCP port 25.
What well-known port number is used by HTTP?
TCP port 80.
What well-known port number is used by POP3?
TCP port 110.
What well-known port number is used by HTTPS?
TCP port 443.
What well-known port numbers are used by DHCP?
UDP ports 67 and 68.
What well-known port number is used by TFTP?
UDP port 69.
What well-known port numbers are used by SNMP?
UDP ports 161 and 162.
What well-known port number is used by Syslog?
UDP port 514.
What is the size of the TCP header in bytes? (Not required for CCNA, but good to know)
The TCP header is typically 20 bytes (without options).
What is the size of the UDP header in bytes?
8 bytes.

Ask anything
We've read this whole study set, so questions about it get the best answers.