Understanding TCP and UDP in Networking

Oct 9, 2024

CCNA Cisco Netacad Introduction to Networks: Module 14 - Transport Layer

Overview

  • Focus on transport layer within network communication.
  • Compare operations of transport layer protocols: TCP, UDP.
  • Key topics: Data transportation, TCP/UDP overview, port numbers, TCP communication process, reliability, flow control, UDP communication process.

Transportation of Data

Role of the Transport Layer

  • Responsible for logical communication between applications on different hosts.
  • Provides end-to-end communication host-to-host.
  • Integral in both OSI (between session and network layers) and TCP/IP models (between application and internet layers).

Transport Layer Responsibilities

  • Tracking Conversations: Manage multiple communication sessions.
  • Segmenting and Reassembly: Splits data into segments; reassembles on arrival.
  • Header Information: Adds header data for tracking and managing sessions.
  • Reliability: Manages delivery reliability and flow.

Transport Layer Protocols

Transmission Control Protocol (TCP)

  • Provides reliability through acknowledgments, sequence data, and retransmission.
  • Manages flow control to prevent overload.
  • Key features: connection-oriented, reliable delivery, same-order delivery, flow control.
  • TCP Header Fields: Include source port, destination port, sequence number, acknowledgment number, window size, and checksum.
  • Applications using TCP: FTP, SMTP, SSH, HTTP.

User Datagram Protocol (UDP)

  • Connectionless protocol with minimal overhead.
  • Suitable for applications where speed is critical over reliability (e.g., VoIP, DNS).
  • UDP Header Fields: Source port, destination port, length, and checksum.
  • Applications using UDP: DNS, DHCP, SNMP, live video.

Port Numbers

  • Well-known ports: 0-1023 (e.g., HTTP, HTTPS).
  • Registered ports: 1024-49151 for specific applications.
  • Dynamic/private ports: 49152-65535 assigned dynamically.

Importance of Port Numbers

  • Manage multiple conversations simultaneously.
  • Socket concept: Combination of source/destination IP and port.

TCP Communication Process

Connection Establishment

  • 3-way Handshake: Sync, Sync/ACK, ACK to establish connection.
  • Important for ensuring devices are ready for communication.

Session Termination

  • FIN/ACK Process: Used to close communication sessions.

Reliability and Flow Control

  • Mechanisms to ensure all data is received accurately and in order.
  • Uses sequence numbers and acknowledgments.
  • Congestion avoidance mechanisms included.

UDP Communication Process

  • Low overhead with no connection establishment, making it faster but less reliable.
  • Reassembles data in received order without tracking sequence numbers.

Summary

  • Transport layer links application layer to network transmission responsibilities.
  • TCP and UDP have distinct functionalities tailored to different application needs.
  • Understanding port numbers and managing multiple connections is key.
  • TCP offers reliability and order; UDP offers speed and simplicity.

Additional Notes

  • Netstat Command: Useful for verifying established TCP connections on a device.
  • Selective Acknowledgment (SAC): Modern feature for acknowledging segments in TCP.

Next Steps

  • Engage with packet tracer labs via Cisco Netacad for practical understanding.
  • Familiarize with well-known port numbers for exams/quizzes.