🌐

Understanding TCP and UDP in Networking

May 9, 2025

CCNA Cisco NetAcad Introduction to Networks: Transport Layer

Overview

  • Focus on Module 14: Transport Layer
  • Key Topics:
    • Transport layer protocols (TCP and UDP)
    • Port numbers
    • TCP communication process
    • Reliability and flow control
    • UDP communication process

Transport Layer Responsibilities

  • Logical communication between applications on different hosts
  • Provides end-to-end communication between hosts
  • Sandwiched between application layer and internet layer (TCP/IP model)
    • Responsible for data transmission via TCP and UDP

Transport Layer Functions

  • Track conversations
  • Segment and reassemble data
  • Add header information
  • Manage multiple conversations using segmentation and multiplexing
  • Specify delivery and manage reliability requirements

TCP Protocol

  • Provides reliability and flow control
  • Basic Operations:
    • Number and track segments
    • Acknowledge received data
    • Retransmit unacknowledged data
    • Sequence out-of-order data
    • Efficient data rate management

TCP Features

  • Connection-oriented protocol
  • Ensures reliable delivery, same order delivery, and flow control
  • Stateful protocol with features like source port, destination port, sequence number, and acknowledgment number
  • Applications using TCP: FTP, SMTP, SSH, HTTP, HTTPS

TCP Header Fields (Important for Exams)

  • Source Port: 16-bit
  • Destination Port: 16-bit
  • Sequence Number: 32-bit
  • Acknowledgment Number: 32-bit
  • Window Size: 16-bit
  • Checksum: 16-bit

UDP Protocol

  • Connectionless with minimal overhead
  • Used for fast, low-overhead applications
  • Best effort delivery, no guaranteed delivery or order
  • Applications using UDP: VoIP, DNS, video streaming

UDP Header

  • Simpler than TCP: Source Port, Destination Port, Length, Checksum

Port Numbers

  • TCP and UDP use port numbers to manage multiple conversations
  • IANA assigns port numbers
  • Well-known ports: 0-1023
  • Registered ports: 1024-49151
  • Private/Dynamic ports: 49152-65535
  • Key Port Numbers (for Exams):
    • FTP: 20/21, HTTP: 80, HTTPS: 443, SSH: 22, SMTP: 25

TCP Communications

TCP Connection Establishment

  • Utilize a three-way handshake (SYN, SYN-ACK, ACK)
  • Ensures destination device is present and ready

TCP Session Termination

  • Uses FIN and ACK flags to close connections

TCP Reliability and Flow Control

  • Sequence numbers ensure ordered data delivery
  • Sliding windows and MSS manage flow control

UDP Communication

  • Low overhead, fast data transport
  • No sequence tracking or retransmission of lost data

Important Concepts

  • Socket: Combination of source/destination IP and port
  • Selective Acknowledgement (SACK) for handling segment losses

Resources

  • Packet Tracer Lab: TCP and UDP Communications

Conclusion

  • Understand and prepare for exams by familiarizing with TCP/UDP functions, port numbers, and connection processes.