TCP Header

TCP Header

Table of Contents

TCP Header

In this section, we will survey the TCP header in packets. As you know TCP is a layer 4 protocol and its header is also have parameters about layer 4. Before TCP header, packet has layer 3 header, it is IP in our example. And before IP header, packet has layer two header, and this is ethernet II in the example below.


You can also check UDP Header and UDP vs TCP Differences lesson. 


You can also check the below capture, for understanding the tcp header fields.


TCP header fields, transmission control protocol fields in Wireshark

The section that we will dive in is the tcp header that I mentine before and this part is shown in a rectangle above. Let’s start with source and the destination por fied in TCP header.



Source & Destination Port Number

As you can see below, the source and the destnation port number field is shown with repeated red lines. Each port field is 16 bits long.


When a host need to send data, it need the ip address and the port number of the remote node. The ip address is a layer 3 parameter, so it is mentined in ip header. But the port fields are layer 4 parameters and they are mentined in TCP header.


IP header has the destination ip address that make the destination unique in the network. And provide reaching the node. But destination port number defines the target service in the destination node. This can be ftp, http or any layer 4 service what else.


TCP header fields, transmission control protocol fields in Wireshark



A real World Example

Let’s explain this parameters with a real world example.


For example you will request a webpage. To do this first of all your pc send a request with the destintion ip address of the remote server of that webpage. Beside your pc send the destination port number that is related to http, port 80.

TCP real world example, transmission control protocol example

When your request reach to the server, it see its own ip address and accept the request. After that it check the destination port number and send the request to the related servcie. Here, this service is http, port 80 service.


This scenarion is the same when you are doing telnet to a destination or usinf ftp services or etc.


What about source port? Until now we have always talked about destination port, what is the aim for using source port? TCP header use source port for identifying the response for the host’s previous request.


TCP real world example, transmission control protocol example

As mentined above, host sends the http request with the source port 1550. The remote server use this source port as its destination port while it sends the response. So the host identify that, the coming response is its previous request’s response.


Let’s continue with the other fields in TCP header…


Lesson tags: tcp, tcp header
Back to: CCNA 200-301 v1.1 > TCP and UDP

Leave a Reply

Your email address will not be published. Required fields are marked *

CCNA 200-301 v1.1