Show Menu
Cheatography

Decode TCP and UDP Cheat Sheet by

In this cheat sheet, TCP and UDP headers will be reviewed.

Transport Layer

Number of Layer
4th Layer of OSI Model
Role
Transport Data
Protocols
UDP - TCP
PDU (Protocol Data Unit)
Segment
Address
Port Number

UDP Features

Type of Connection
Connec­tio­nless (Does Not Need Connection Setup)
Applic­ation
Time-S­ens­itive Connec­tions
Number of Fields in Header
Four Field Header

TCP Features

Type of Connection
Connec­tio­n-O­riented (Needs Connection Setup)
Applic­ation
Reliable Connec­tions
Number of Fields in Header
Eleven Field Header

Commands

Active UDP Connec­tions
netstat -anp udp
Active TCP Connec­tions
netstat -anp tcp

UDP Header Fields

Source Port 16-bit
Port on The Receiver's Side
Destin­ation Port 16-bit
Port on The Sender's Side
Length 16-bit
The Number of Bytes in The UDP Header And Any Data Follows
Checksum 16-bit
Calculated Value for Ensuring Data Integrity

TCP Ports

Source Port 16-bit
The Port on The Sender Side
Destin­ation Port 16-bit
The Port on The Receiver Side
Stream
A Commun­ication Between Two Endpoints
TCP Segment Length
The Value of The TCP Payload (The Data That Follows The TCP Header)
 

Sequencing and Acknow­ledging in TCP

Sequence Number 32-bit
The Byte Number of The First Byte of Data
Next Sequence Number
Current Sequence Number Plus The TCP Segment Length
Acknow­led­gment Number 32-bit
The Sequence Number of The Next Byte The Receiver Expects to Receive
Offset
Indicates The Length of The TCP Header

Flags in TCP

Reserved
3-bit
For Future Use
Nonce
1-bit
Experi­mental Use
CWR
1-bit
Respond to Indica­tions of Network Congestion with Congestion Avoidance
ECE
1-bit
Notify The Endpoints of Any Network Congestion to Avoid Dropping Packets
URG
1-bit
Indicates a Packet That Should Have Priority
ACK
1-bit
Acknow­ledging The Data Was Received
PSH
1-bit
Informing Data Should Be Sent Immedi­ately
RST
1-bit
Aborting The TCP Connection
SYN
1-bit
Synchr­onizing The Sequence Numbers
FIN
1-bit
closing The Connection

Dissecting Window Size

Window Size 16-bit
Controls The Flow of Data
Scaling Factor
A Value For Expanding Window Size
Window Size Scaling Factor
2 ^ (Scaling Factor) if Scaling Factor >= 0
Calculated Window Size
Window Size * Window Size Scaling Factor

Additional Header Values in TCP

Checksum
A Calculated Value For Error Detection
Urgent Pointer
Points to The Sequence Number of Urgent Data
Options
Extra Options Like Timestamps And No-ope­ration
       
 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Network+ | 03.TCP/IP Model Cheat Sheet