Network Fundamentals // Lesson 06

TCP, UDP
& ports.

Layer 4 is where network conversations begin to look like application sessions. In this lesson you'll compare TCP and UDP, understand port numbers, learn the TCP three-way handshake and recognise common services and ports expected at CCNA level.

📖 Beginner ⏱ About 15 minutes ✓ Quiz included CCNA 200-301
01 // Transport layer

Layer 4 identifies conversations

IP addresses identify hosts, but a host may be running many applications at the same time. The transport layer uses port numbers to identify which application or service should receive traffic.

Easy mental model: IP address = which host.
Port number = which application on that host.
02 // Compare

TCP vs UDP

TCP

Transmission Control Protocol

TCP is connection-oriented and includes mechanisms designed to provide reliable, ordered delivery.

  • Connection-oriented
  • Uses acknowledgements
  • Supports retransmission
  • Maintains sequence information
  • Provides flow control
  • Higher overhead than UDP
UDP

User Datagram Protocol

UDP is connectionless and has a much smaller transport-layer overhead.

  • Connectionless
  • No transport-layer acknowledgement
  • No retransmission mechanism in UDP itself
  • No sequencing mechanism for reliable delivery
  • Lower overhead
  • Useful when speed or simplicity matters
UDP does not mean "unreliable application". It means UDP itself does not provide TCP-style reliability. An application can implement its own recovery mechanisms if required.
03 // TCP connection

The TCP three-way handshake

Before exchanging application data, TCP establishes a connection using a three-step handshake.

💻
Client

Wants to establish a TCP session

SYN →
Client requests a connection
← SYN-ACK
Server acknowledges and synchronises
ACK →
Client acknowledges
🖥️
Server

Accepts the TCP connection

Remember it as: SYN → SYN-ACK → ACK.
04 // Ports

Source and destination ports

Both TCP and UDP use 16-bit port numbers, allowing values from 0 to 65535.

A server commonly listens on a well-known service port, while a client normally uses a temporary or ephemeral source port.

Client
192.168.10.50:53124

Temporary client source port

→
Web Server
203.0.113.10:443

HTTPS service listening on TCP 443

A network conversation can be identified using the source and destination IP addresses, transport protocol and source/destination port numbers.
05 // Common services

Ports worth knowing for CCNA

You don't need to memorise every registered port on the Internet, but these common services are worth recognising.

Port Protocol Service Purpose
20/21 TCP FTP File transfer
22 TCP SSH Secure remote access
23 TCP Telnet Unencrypted remote terminal access
25 TCP SMTP Email transfer
53 UDP/TCP DNS Name resolution
67/68 UDP DHCP IPv4 address configuration
69 UDP TFTP Simple file transfer
80 TCP HTTP Web traffic
110 TCP POP3 Email retrieval
123 UDP NTP Time synchronisation
143 TCP IMAP Email retrieval
161/162 UDP SNMP Network monitoring and traps
443 TCP HTTPS Encrypted web traffic
06 // Reliability

How TCP keeps track of data

Sequence Numbers

TCP tracks byte order so received data can be reconstructed in the correct sequence.

Acknowledgements

The receiver acknowledges successfully received data.

Retransmission

Missing data can be sent again when TCP detects that delivery has not been acknowledged as expected.

Flow Control

TCP uses windowing mechanisms to help avoid overwhelming a receiver.

Connection State

TCP maintains state about an established conversation.

Ordered Delivery

Data can be delivered to the application in the intended order.

07 // Choosing transport

Why would an application choose UDP?

TCP's reliability features are useful, but they introduce additional state and overhead. Some applications value low delay or simple request/response exchanges more than built-in retransmission.

TCP-friendly examples

Applications where reliable, ordered delivery is important often use TCP.

  • HTTPS
  • SSH
  • Email protocols
  • Traditional FTP

UDP-friendly examples

Applications using simple transactions or real-time traffic may use UDP.

  • DNS queries
  • DHCP
  • NTP
  • Many voice/video applications
08 // Check your knowledge

Quick quiz

1. Which transport protocol is connection-oriented?

TCP is connection-oriented and establishes a session before normal application data exchange.

2. Which sequence correctly represents the TCP three-way handshake?

TCP connection establishment uses SYN, followed by SYN-ACK, followed by ACK.

3. Which port is normally associated with HTTPS?

HTTPS commonly uses TCP port 443.

4. Which protocol commonly uses UDP ports 67 and 68?

DHCPv4 commonly uses UDP ports 67 and 68.

5. What is the purpose of a port number?

TCP and UDP port numbers allow a host to distinguish between different application conversations and services.

6. Which statement about UDP is correct?

UDP is connectionless and deliberately provides fewer transport services than TCP, resulting in lower overhead.

7. Which service commonly uses UDP port 123?

Network Time Protocol commonly uses UDP port 123.
Score: 0 / 7
Lesson complete

Next: Wireless Fundamentals

Next we'll leave the cable behind and look at SSIDs, wireless access points, RF, 2.4 GHz and 5 GHz channels, interference and how a Wi-Fi client actually joins a network.