CCNA Notes

200-301 Exam Prep

Progress0/67

0% complete

Practice TestsNew
1Networking Devices2Interfaces And Cables3OSI Model and TCP/IP Suite4Intro to the CLI5Ethernet LAN Switching - Part 16Ethernet LAN Switching - Part 27IPv4 Addressing - Part 18IPv4 Addressing - Part 29Switch Interfaces10The IPv4 Header11Routing Fundamentals - Part 111Static Routing - Part 212Life of a Packet13Subnetting - Part 114Subnetting - Part 215Subnetting (VLSM) - Part 316VLANs - Part 117VLANs - Part 218VLANs - Part 319DTP / VTP20Spanning Tree Protocol - Part 121Spanning Tree Protocol - Part 222Rapid Spanning Tree Protocol23Etherchannel24Dynamic Routing25RIP / EIGRP26OSPF - Part 127OSPF - Part 228OSPF - Part 329First Hop Redundancy Protocol30TCP and UDP31IPv6 - Part 132IPv6 - Part 233IPv6 - Part 334Standard Access Control List35Extended Access Control List36CDP and LLDP37NTP - Network Time Protocol38DNS - Domain Name System39DHCP - Dynamic Host Configuration Protocol40SNMP - Simple Network Management Protocol41SYSLOG42SSH - Secure Shell43FTP and TFTP44NAT (Static) - Part 145NAT (Dynamic) - Part 246QoS (Voice VLAN) - Part 147QoS (Quality of Service) - Part 248Security Fundamentals49Port Security50DHCP Snooping51Dynamic ARP Inspection52LAN Architectures53WAN Architectures54Virtualization and Cloud - Part 154Virtualization (Containers) - Part 254Virtualization (VRF) - Part 355Wireless Fundamentals56Wireless Architectures57Wireless Security58Wireless Configuration59Introduction to Network Automation60JSON, XML, and YAML61REST APIs62Software Defined Networking63Ansible, Puppet, and Chef67CCNA Complete Cheatsheet
/TCP and UDP
Topic 303 min read

TCP and UDP

/
Tip: Select text to highlight or pin your reading position

30. TCP and UDP (LAYER 4 PROTOCOLS)

BASICS OF LAYER 4

  • Provides TRANSPARENT transfer of DATA between END HOSTS (Host To Host communication)

imageClick to enlarge

  • Provides (or DOESN’T provide) various SERVICES to APPLICATIONS:
    • Reliable DATA Transfer
    • Error Recovery
    • Data Sequencing
    • Flow Control
  • Provides LAYER 4 ADDRESSING (PORT numbers) - NOT the physical interfaces / ports on network devices
    • IDENTIFY the APPLICATION LAYER protocol
    • Provides SESSION multiplexing

WHAT IS A SESSION ?

  • A SESSION is an EXCHANGE of DATA between TWO or MORE communicating DEVICES

imageClick to enlarge

The FOLLOWING ranges have been designated by IANA (Internet Assigned Numbers Authority)

  • Well-Known Port Numbers : 0 - 1023
  • Registered Port Numbers : 1024 - 49151
  • Ephemeral / Private / Dynamic port numbers : 49152 - 65535

imageClick to enlarge


TCP (TRANSMISSION CONTROL PROTOCOL)

  • A CONNECTION-ORIENTED protocol
    • Before actually SENDING DATA to the DESTINATION HOST, the TWO HOSTS communicate to establish a CONNECTION. Once the CONNECTION is established, DATA exchange begins.

imageClick to enlarge

imageClick to enlarge

Establishing connections

imageClick to enlarge

Terminating connections

imageClick to enlarge

  • TCP provides RELIABLE communication
    • The DESTINATION HOST must acknowledge that it RECEIVED each TCP SEGMENT (Layer 4 PDU)
    • If a SEGMENT isn’t ACKNOWLEDGED, it is sent again

imageClick to enlarge

  • TCP provides SEQUENCING
    • SEQUENCE numbers in the TCP HEADER allow DESTINATION HOSTS to put SEGMENTS in the correct ORDER even if they arrive out of ORDER

imageClick to enlarge

  • TCP provides FLOW CONTROL
    • The DESTINATION HOST can tell the SOURCE HOST to increase / decrease the RATE that DATA is sent

imageClick to enlarge

imageClick to enlarge


UDP (USER DATAGRAM PROTOCOL)

imageClick to enlarge

  • UDP is NOT a CONNECTION-ORIENTED PROTOCOL

    • The SENDING HOST does NOT establish a CONNECTION with the DESTINATION HOST before sending DATA. The DATA is simply SENT
  • UDP DOES NOT provide reliable COMMUNICATION

    • When UDP is used, ACKNOWLEDGEMENTS are NOT SENT for received SEGMENTS
    • If a SEGMENT is LOST, UDP has no mechanism to re-TRASMIT it
    • SEGMENTS are sent “best-effort”
  • UDP DOES NOT provide SEQUENCING

    • There is NO SEQUENCE NUMBER FIELD in the UDP header
    • If SEGMENTS arrive out of order, UDP has no MECHANISM to put them back in ORDER
  • UDP DOES NOT provide FLOW CONTROL

    • UDP has NO MECHANISM like TCP’s WINDOW SIZE to control the flow of DATA
  • UDP DOES provide ERROR CHECKING (via CHECKSUM)


COMPARING TCP AND UDP

Number of Fields in their Headers

imageClick to enlarge

  • TCP provides MORE FEATURES than UDP but at a COST of ADDITIONAL OVERHEAD
  • For applications that require RELIABLE communications (for example, downloading a file), TCP is PREFERRED
  • For applications, like real-time voice and video, UDP is preferred
  • There are SOME applications that use UDP, but provide RELIABILITY, etc. within the APPLICATION itself.
  • Some applications use BOTH TCP and UDP, depending on the situation.

imageClick to enlarge

IMPORTANT PORT NUMBERS

imageClick to enlarge

PreviousFirst Hop Redundancy Protocol
NextIPv6 - Part 1