Course contents

Unit 7: TCP, UDP and PortsLesson 7.2.4 (15 of 23 in this unit)64 of 104 in the Network Fundamentals course

Test: TCP & UDP

Can you explain why an answer is correct before choosing it? Use these scenarios to connect ports, TCP state and byte accounting to real troubleshooting decisions.

Intermediate · 10 min read

Technical definition

TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) are the transport layer protocols that carry data between applications, which are identified by port numbers. TCP sets up a connection and delivers data reliably and in order; UDP sends each datagram on its own without a connection or any confirmation of delivery.

Explain the evidence before choosing an answer

For a port question, name the transport and both endpoints. For a sequence question, write the first byte, the payload length and the next missing byte. For a connection problem, identify whether the evidence concerns a listener, the TCP handshake or the application. Choosing the right option is useful; explaining what the evidence proves is the skill you will use on a real network.

This test has twelve questions on the whole course. Answer each one, then read the explanation. If you get a question wrong, go back to the lesson named in its explanation.

Predict · scenario 1

1. A packet has reached the right PC, which is running a browser, an email app and a chat app. What does the transport layer add that IP alone does not?

Predict · scenario 2

2. Your laptop picks source port 51515 for a new connection to a web server. What kind of port is this?

Predict · scenario 3

3. Two PCs connect to the same server on TCP 443, both from source port 50000. How does the server keep them apart?

Predict · scenario 4

4. You are checking a list of firewall rules. Which service and port pair matches the protocol the service actually uses?

Predict · scenario 5

5. A capture shows a TCP segment with no options. How long is its TCP header?

Predict · scenario 6

6. A client opens a TCP connection to a web server. In what order are the handshake messages sent?

Predict · scenario 7

7. A client sends a SYN, and the server immediately replies with RST. What error does the client application report?

Predict · scenario 8

8. A segment with sequence number 2001 carries 500 bytes and arrives safely. Which acknowledgement number confirms it?

Predict · scenario 9

9. In the classic RFC 5681 fast-retransmit example, a TCP sender resends a missing segment before its retransmission timer runs out. What triggered it?

Predict · scenario 10

10. A fast server sends a file to a slow laptop. Which device sets the window size that stops the server from overwhelming the laptop?

Predict · scenario 11

11. A client finishes a download and closes the connection first. Which side then waits in the TIME_WAIT state?

Predict · scenario 12

12. A company is choosing a transport protocol for its internet phone calls. Why do voice calls normally use UDP instead of TCP?

Technical references

RFC 9293: base TCP header, connection state, sequence space and delivery; RFC 6335: port ranges and assignment; IANA service/port registry; RFC 768: UDP fields; RFC 8085: application responsibilities over UDP; RFC 9000: QUIC over UDP.