TCP Header

Bit Number


0

1

2

3

4

5

6

7

8

9
1
0
1
1
1
2
1
3
1
4
1
5
1
6
1
7
1
8
1
9
2
0
2
1
2
2
2
3
2
4
2
5
2
6
2
7
2
8
2
9
3
0
3
1
Source PortDestination Port
Sequence Number
Acknowledgment Number
OffsetReservedFlagsWindow
ChecksumUrgent Pointer
Options (optional)

TCP Header Contents

Common TCP Well-Known Server Ports
 7echo110pop3
  19 chargen 111 sunrpc
  20 ftp-data 119 nntp
  21 ftp-control 139 netbios-ssn
  22 ssh 143 imap
  23 telnet 179 bgp
  25 smtp 389 ldap
  53 domain 443 https (ssl)
  79 finger 445 microsoft-ds
  80 http 1080 socks
Offset
 Number of 32-bit words on TCP header; minimum value = 5
Reserved
 4 bits; set to 0
 ECN bits (used when ECN employed; else 00)
  CWR (1 = sender has cut congestion window in half)
    ECN-Echo (1 = receiver cuts congestion window in half)
Flags (UAPRSF)
 U(1 = Urgent pointer valid)
  A (1 = Acknowledgement field value valid)
  P (1 = Push data)
  R (1 = Rest connection)
  S (1 = Synchronize sequence numbers)
  F (1 = no more data; Finish connection)
Checksum
 Covers pseudoheader and entire TCP segment
Urgent Pointer
 Points to the sequence number of the byte
 following urgent data
Options
 0End of options list3Windows scale
  1 No operation (pad) 4 Selective ACK ok
  2 Maximum segment size 8 Timestamp