Transport Layer of TCP/IP. Transmission Control Protocol (TCP) basics and network sockets explained. How TCP connection get established, error recovered and terminated.
User Datagram Protocol and its comparison to TCP. Quality of Service (QoS).
Networking Fundamentals: Transport Protocols (TCP and UDP)
1. Andriy Berestovskyy
2017
Networking Fundamentals
Transport Protocols
( ц ) А н д р
і й Б е р е с
т о в с ь к и
й
networking hour
TCP
UDP
NAT
IPsec
IPv4
IPv6
internet
protocolsAH
ESP
authentication
authorization
accounting
encapsulation
security
BGP
OSPF
ICMP
ACLSNAT
tunnel
PPPoE
GRE
ARP
discovery
NDP
OSI
broadcast
multicast
IGMP
PIM
MAC
DHCP
DNS
fragmentation
semihalf
berestovskyy
4. Transmission Control Protocol
● Connection Oriented
● Ordered Delivery
● Error Recovery
● Flow Control
● Multiplexing
4
How?
Other L4
protocols?
5. Source/Destination Port — for multiplexing
Seq — seq number of the first data byte
Ack — next seq number sender is expecting
Data offset — size of header in 32-bit words, usually 5
Flags — Flags (ACK, PSH, RST, SYN, FIN, etc…)
Window Size —size of the receive window
Checksum — TCP header, data and pseudo-header
Urgent Pointer — offset to last urgent byte
Options — usually empty
TCP Header
5
Source Port Destination Port
Sequence Number
Acknowledgement Number
Off
TCP Checksum
Data
...
[Options …]
0 32
Protected by
TCP Checksum
DataOffset
Flags Window Size
Urgent Pointer
Pseudo
header?
Examples?
Ver IHL DSCP Total LengthE
ID Fl Fragment Offset
TTL Proto = TCP IP Header Checksum
Source Address
Destination Address
[Options …]
0 32
IHL
Protected by IP
Header Checksum
8. Network socket — internal endpoint for sending or receiving data
at a single node in a computer network
— Wikipedia
8
9. Well-Known* Port Numbers
9
20
Port Proto Service
* See /etc/services for more
TCP File Transfer Protocol data connectionftp-data
Unix Name
21 TCP File Transfer protocol control connectionftp
22 TCP Secure shellssh
25 TCP Simple Mail Transfer Protocolsmtp
53 UDP Domain Name System requestdomain
69 UDP Dynamic Host Configuration Protocolbootps
69 UDP Trivial File Transfer Protocoltftp
80 TCP World Wide Webhttp
15. Source/Destination Port — for multiplexing
Length —length of UDP header and data
Checksum — header, data and pseudo-header
UDP Header
15
Source Port Destination Port
Length
Data
...
0 32
Protected by
UDP Checksum
8B
UDP Checksum
Pseudo
header?
Ver IHL DSCP Total LengthE
ID Fl Fragment Offset
TTL Proto = UDP IP Header Checksum
Source Address
Destination Address
[Options …]
0 32
IHL
Protected by IP
Header Checksum
16. TCP vs UDP
16
UDP TCP
Header size
Feature
Data unit
Connection oriented
Reliable transport
Preserve message boundary
Ordered delivery
Data checksum
Flow control
17. TCP vs UDP
17
8
UDP TCP
20-60Header size
Feature
Datagram SegmentData unit
No YesConnection oriented
No YesReliable transport
Yes NoPreserve message boundary
No YesOrdered delivery
Optional YesData checksum
No YesFlow control Flow
control?
18. Quality of Service (QoS) — measurement of the overall
performance of a service seen by the users of the network
— Wikipedia
18
19. Bandwidth
— number of bits available per time in a communication channel
End-to-end delay
— time for a packet to be transmitted across a network
Jitter
— deviation in end-to-end delays
Packet loss
— rate of packets lost / packets sent
Quality of Service Characteristics
19
End-to-end?
22. Example Services Requirements
22
Medium
Bandwidth Delay
MediumWeb browsing
Service
Low LowVoice calling
Medium LowVideoconference
Low LowGaming
Jitter Loss
Medium
Low
Low
Low
Medium
Low
Low
Low
High HighPeer-to-peer downloading High High
How?