DEV Community

Cover image for Networking: TCP Header explained
Anna Villarreal
Anna Villarreal

Posted on

6 1 1 1 1

Networking: TCP Header explained

A TCP header has lots of information.



I have taken the time to create a couple of diagrams for a deeper understanding. I will share them with you here. I have to say that just the simple act of putting this together helped me solidify my understanding of what the heck is going on here. Super interesting stuff.


Lets go inside the Ethernet and find the TCP segment, which lives inside the IP datagram.

nested data

For me a good way to think about this is data "nesting". Works for understanding.


TCP Breakdown

Lets check out the layers in a TCP Segment, which consists of the TCP header and data section. A brief description is included for each.

fun TCP chart

Spoiler alert, The transport layer is super important for the transfer of data. XD

Servers send the data to the requesting client. How? Multiplexing and demultiplexing. Now seriously, WHAT is that?

Multiplexing means the nodes on a network have the ability to direct traffic to a whole bunch of different receiving services. For example, if you have multiple things going on your computer, there is a good chance you are sending traffic to different receiving servers. You are the "client". Demultiplexing sends the data to the proper node (example: your computer) through the receiving service (example: an app or web browser). If you don't get your requested data back from the server, you might have a bad day.


Ports

If you are wondering how the services on your computer get the information from the servers and the information knows where to go, you can thank ports for that. A port is 16-bit number that is used to direct traffic to specific services running on a networked computer. This way the information gets sent to the right place.


Sentry blog image

How to reduce TTFB

In the past few years in the web dev world, we’ve seen a significant push towards rendering our websites on the server. Doing so is better for SEO and performs better on low-powered devices, but one thing we had to sacrifice is TTFB.

In this article, we’ll see how we can identify what makes our TTFB high so we can fix it.

Read more

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay