← Back

Transport & Application Layer Protocols

CTS1305C Cable Run -- Week 3

TCP vs UDP | Ports | HTTP/FTP/SMTP | DNS/DHCP

Press to begin or use navigation below

Slide 2 of 14

TCP vs UDP

Connection-Oriented vs Connectionless

TCP (Transmission Control Protocol)

  • Connection-oriented -- establishes session before sending data
  • Reliable delivery with acknowledgments
  • Sequencing ensures packets arrive in order
  • Error detection and retransmission
  • Used by: HTTP, FTP, SMTP, SSH

UDP (User Datagram Protocol)

  • Connectionless -- fire and forget
  • No acknowledgments or guaranteed delivery
  • Lower overhead, faster transmission
  • No sequencing or flow control
  • Used by: DNS, DHCP, SNMP, VoIP, streaming
TCP -- Reliable SYN -> SYN-ACK -> ACK -> Data -> ACK Every packet acknowledged Retransmit on loss Best for: files, email, web pages UDP -- Fast Data -> Data -> Data (no handshake) No acknowledgments Lost packets are not retransmitted Best for: voice, video, DNS lookups
Slide 3 of 14

TCP Three-Way Handshake

Establishing a Reliable Connection

Client Server 1. SYN 2. SYN-ACK 3. ACK

The Three Steps

  • SYN -- Client sends a synchronization request with an initial sequence number
  • SYN-ACK -- Server acknowledges and sends its own sequence number
  • ACK -- Client acknowledges; connection is now established

Connection teardown uses a four-way handshake: FIN, ACK, FIN, ACK.

Slide 4 of 14

Flow Control & Windowing

Preventing Receiver Overload

Flow Control

TCP prevents a fast sender from overwhelming a slow receiver by regulating the rate of data transmission.

  • Receiver advertises a window size -- the number of bytes it can buffer
  • Sender transmits only that many bytes before waiting for an ACK
  • If receiver is busy, it shrinks the window (even to zero)

Congestion Control is different from flow control. Congestion control adapts to network conditions (packet loss, delay). Flow control adapts to receiver capacity.

Sliding Window

  • Window "slides" forward as ACKs are received
  • Allows multiple segments in flight simultaneously
  • Window size adjusts dynamically based on conditions
ACK'd Sent Sent Sent Ready Ready Queued Window Size = 4 segments
Slide 5 of 14

Segmentation & Multiplexing

Breaking Data Into Manageable Pieces

Segmentation

Large data streams are broken into smaller segments at the transport layer.

  • Each segment gets a sequence number for reassembly
  • Segment size limited by MSS (Maximum Segment Size)
  • Allows retransmission of individual segments, not the entire stream
  • Enables interleaving of data from multiple applications

Multiplexing

Multiple applications share a single network connection using port numbers.

  • Source port: ephemeral (49152-65535), assigned by OS
  • Destination port: well-known service port
  • Socket = IP address + port number
  • Allows concurrent web, email, and file transfers on one NIC
Web Browser :443 Email Client :25 FTP Client :21 Transport Layer Multiplexing Single NIC 192.168.1.10
Slide 6 of 14

Well-Known Ports

The Address Book of Network Services

PortProtocolTransportDescription
20/21FTPTCPFile Transfer Protocol (data/control)
22SSHTCPSecure Shell -- encrypted remote access
23TelnetTCPUnencrypted remote access (legacy)
25SMTPTCPSimple Mail Transfer Protocol -- sending email
53DNSTCP/UDPDomain Name System -- name resolution
67/68DHCPUDPDynamic Host Configuration Protocol
80HTTPTCPHypertext Transfer Protocol -- web traffic
110POP3TCPPost Office Protocol -- retrieving email
143IMAPTCPInternet Message Access Protocol -- email sync
161/162SNMPUDPSimple Network Management Protocol
443HTTPSTCPHTTP Secure -- encrypted web traffic
3389RDPTCPRemote Desktop Protocol

Well-known ports: 0-1023 | Registered ports: 1024-49151 | Dynamic/ephemeral: 49152-65535

Slide 7 of 14

HTTP & HTTPS

The Language of the Web

HTTP (Port 80)

  • Request-response model: client requests, server responds
  • Methods: GET, POST, PUT, DELETE, PATCH
  • Status codes: 200 OK, 301 Redirect, 404 Not Found, 500 Server Error
  • Stateless -- each request is independent
  • Plaintext -- data is not encrypted

HTTPS (Port 443)

  • HTTP + TLS encryption
  • Encrypts data in transit between client and server
  • Uses digital certificates to verify server identity
  • TLS handshake negotiates cipher suite before data transfer
  • Required for login pages, banking, e-commerce
Client GET /page HTTP/1.1 TLS Encrypted 200 OK + HTML Server :443 (HTTPS)
Slide 8 of 14

FTP -- File Transfer Protocol

Uploading and Downloading Files

How FTP Works

  • Port 21 -- Control channel (commands, authentication)
  • Port 20 -- Data channel (active mode file transfer)
  • Two modes: Active and Passive
  • Supports anonymous and authenticated access

Security Warning: FTP sends credentials in cleartext. Use SFTP (SSH, port 22) or FTPS (FTP over TLS) for secure transfers.

Active vs Passive Mode

  • Active: Server initiates data connection to client on port 20. Blocked by most firewalls.
  • Passive: Client initiates both connections. Server provides a random high port. Firewall-friendly.
$ ftp server.example.com Connected to server.example.com User: admin Password: ******** ftp> put report.pdf ftp> get backup.tar.gz
Slide 9 of 14

Email Protocols

SMTP, POP3, and IMAP

SMTP

Port 25 / 587

  • Sending email only
  • Relays mail between servers
  • Port 587 with STARTTLS for secure submission
  • Push protocol

POP3

Port 110 / 995 (SSL)

  • Retrieving email
  • Downloads and typically deletes from server
  • Single-device access
  • Simple, low bandwidth

IMAP

Port 143 / 993 (SSL)

  • Syncing email across devices
  • Mail stays on server
  • Folder management supported
  • Multi-device friendly
Sender Outlook/Gmail SMTP Mail Server Stores messages in mailboxes POP3/IMAP Receiver Reads email
Slide 10 of 14

DNS Resolution

Translating Names to IP Addresses

DNS Lookup Process

  • 1. Client checks local DNS cache
  • 2. Query sent to recursive resolver (ISP DNS)
  • 3. Resolver queries root nameserver (.)
  • 4. Root refers to TLD nameserver (.com)
  • 5. TLD refers to authoritative nameserver
  • 6. Authoritative server returns the IP address
  • 7. Resolver caches result and returns to client

DNS Record Types

TypePurpose
AMaps hostname to IPv4 address
AAAAMaps hostname to IPv6 address
CNAMEAlias -- points to another hostname
MXMail exchange server for a domain
PTRReverse lookup -- IP to hostname
NSNameserver for a zone
TXTText records (SPF, DKIM, verification)
Slide 11 of 14

DHCP -- The DORA Process

Automatic IP Address Assignment

Client Server D - Discover O - Offer R - Request A - Acknowledge

DORA Steps (Ports 67/68 UDP)

  • Discover: Client broadcasts "I need an IP address" (255.255.255.255)
  • Offer: Server responds with an available IP, subnet mask, gateway, DNS
  • Request: Client formally requests the offered IP
  • Acknowledge: Server confirms the lease and provides the configuration

DHCP leases expire. Clients must renew at 50% (T1) and 87.5% (T2) of the lease duration.

Slide 12 of 14

Management & Remote Access Protocols

SNMP, SSH, Telnet, RDP

SNMP (Ports 161/162 UDP)

  • Monitors and manages network devices
  • Agents on devices report to a management station
  • GET -- manager polls a device for data
  • SET -- manager changes a device setting
  • TRAP -- device sends unsolicited alert to manager
  • SNMPv3 adds authentication and encryption

SSH (Port 22 TCP)

  • Encrypted remote terminal access
  • Replaces Telnet for secure management
  • Supports key-based authentication
  • Can tunnel other protocols (port forwarding)

Telnet (Port 23 TCP)

  • Unencrypted remote access -- LEGACY
  • Credentials sent in plaintext
  • Should never be used over untrusted networks

RDP (Port 3389 TCP)

  • Remote Desktop Protocol -- graphical remote access
  • Windows-native, supports clipboard/drive sharing
  • Must be secured with NLA and strong passwords
Slide 13 of 14

Protocol Summary Map

Transport & Application Layer at a Glance

OSI Layer 4 -- Transport TCP -- Reliable, Ordered UDP -- Fast, Best-Effort OSI Layer 7 -- Application HTTP/S 80/443 TCP FTP 20/21 TCP SMTP 25 TCP SSH 22 TCP DNS 53 TCP/UDP DHCP 67/68 UDP POP3 110 TCP IMAP 143 TCP SNMP 161/162 UDP RDP 3389 TCP Telnet 23 TCP (legacy)
Slide 14 of 14

Week 3 Summary

Transport & Application Layer Protocols

Transport Layer

  • TCP: reliable, three-way handshake
  • UDP: fast, connectionless
  • Flow control and windowing
  • Segmentation and multiplexing

Application Protocols

  • HTTP/HTTPS for web
  • FTP for file transfer
  • SMTP/POP3/IMAP for email
  • SSH/Telnet/RDP for remote access

Infrastructure

  • DNS: name resolution (port 53)
  • DHCP: DORA process (67/68)
  • SNMP: device monitoring (161/162)
  • Port ranges: well-known, registered, dynamic

Up Next

Application Layer Services & Data Communications -- client-server, QoS, VoIP, and streaming protocols.

Scroll down for more content