🌐

TCP vs UDP

Jul 20, 2024

TCP vs UDP

TCP/IP Model

  • Focus on transport layer
  • Two primary protocols: TCP and UDP

Key Choice for Network Applications

  • Reliable vs Unreliable transmission

Transmission Control Protocol (TCP)

  • Reliable: Can resend and resolve missing or corrupted data
  • Data Sent in Segments: Collects and reorders segments at receiving end
  • Prevents Corrupt Files: Recovers lost segments

Reliable Connection

  1. Acknowledgement Numbers: Ensures data received correctly
  2. Sequence Numbers: Numbers segments for reordering and detection of missing pieces
  3. Checksum: Detects errors by comparing calculations on both ends

Three-Way Handshake

  1. Sender sends SYN (synchronize)
  2. Receiver replies with SYN-ACK (synchronize-acknowledge)
  3. Sender replies with ACK (acknowledge)
  • Opens TCP connection

Sequence Numbers & Acknowledgement

  • Sequence Numbers: Assigns to segments for correct reordering
  • Acknowledgement Numbers: Receiver acknowledges receipt of segments

Checksum

  • Calculation run against data on both ends
  • Detects and discards corrupted segments

TCP Header Fields

  • Port numbers: (covered in another video)
  • Sequence and Acknowledgement numbers
  • Checksum

User Datagram Protocol (UDP)

  • Unreliable: No error handling, sequencing, or reliability
  • Fast Transmission: Sends data quickly without concern for loss
  • Minimal Header Information: Port numbers, length, and checksum
  • Use Case: Live real-time connections (e.g., voice calls, video calls, gaming)

Comparison

  • TCP: Reliable, resource-heavy, adds latency, ideal for web browsing, file transfers
  • UDP: Unreliable, fast, minimal latency, ideal for real-time communication

Conclusion

  • Two methods for two purposes: TCP for reliability, UDP for speed

Further Learning

  • Mention of full CCNA course for more in-depth information

Call to Action

  • Like, comment, subscribe