< Section 4 | Home | Section 6 >
11% Complete
The Transport Layer Header, TCP and UDP
https://www.udemy.com/cisco-icnd1/learn/lecture/8589334#overview
Transport Layer
- The Transport layer provides transparent transfer of data between hosts and is responsible for end-to-end recovery and flow control
- Flow control is the process of adjusting the flow of data from the send to ensure that the receiving host can handle it.
- If this is enabled and the receiving host cannot keep up with the sender, there is a mechanism in place telling the sender to slow down.
Session Multiplexing
- Session multiplexing is the process by which a host is able to support multiple sessions simultaneously and manage the individual traffic streams over a single link.
Port Numbers
- The Layer 4 destination port number is used to identify the upper layer protocol (i.e. which application the data is for).
- HTTP uses Port 80
- SMTP uses Port 25
- The sender also adds a source port number to the Layer 4 header
- The combination of source and destination port numbers can be used to track sessions
Side Note: Stateful firewalls work by allowing data from the network back into the network from an outside host by validating the initial traffic was initiated from within the network.
TCP
- TCP (Transport Control Protocol) and UDP (User Datagram Protocol) are the most common layer 4 protocols.
- TCP is connection oriented. Once a connection is established, data can be send bidirectionally over that connection.
- TCP carries out sequencing to ensure segments are processed in the correct order and none are missing.
- TCP is reliable. The receiving host sends acknowledgments back to the sender. Lost segments are resent.
- TCP performs flow control.
- A type of speed control / throttle
TCP Three-Way Handshake
- SYN (Syncronize) > SYN-ACK (Sync Acknowledgement) > ACK
TCP Header Encapsulation Overview
TCP Header
- Source and Destination Ports
- Sequence number
- Ack number
- Size of Header
- Code bits and Window are used for Flow Control
- Checksum for data integrity
- Urgent (Optional)
- Options (Optional, duh!)
- Data
UDP – User Datagram Protocol
- The User Datagram Protocol sends traffice ‘best effort’
- UDP is not connection oriented. There is no handshake connection setup between the hosts
- UDP does not carry out sequencing to ensure segments are processed in the correct order or that none are missing.
- UDP is NOT RELIABLE. The receiving host does not acknowledge if the data was ever received.
- UDP does not perform flow control
- If error detection and recovery is required, it is up to the upper layers to provide it.
UDP Header
TCP vs UDP
- Application developers will typically choose to use TCP for traffic which requires reliability.
- Real-time applications such as voice and video can’t aford the extra overhead of TCP so they use UDP.
- i.e. latency sensitive data
- Some applications can use both TCP and UDP.
Common Applications and Ports
- TCP
- FTP: 21
- SSH: 22
- Telnet: 23
- HTTP: 80
- HTTPS: 443
- UDP
- TFTP: 69
- SNMP: 161
- TCP & UDP
- DNS: 53





