TCP Header

The TCP header contains 10 mandatory fields, and an optional extension field, options. Since the options field is optional, TCP has a variable header size. The header length field (or Data offset) specify the size of the header in 32 bits. The minimum size is 20 bytes and maximum is 60 bytes, which give us up to 40 bytes of options.

 

The TCP header Video explains the different fields.

One of the reasons the source & destination port are assigned  at the beginning of the header is to allow faster switching for application without reading the entire data structure.