1

TCP header format

I am bad at memorizing things. So could anyone recommend me some mnemonics, so that I can remember the fields of the header...

Thank you.

Abhishek Ghosh
  • 585
  • 2
  • 9
  • 1
    Related -- Recall advice here that it's best to get away from relying on mnemonics: https://matheducators.stackexchange.com/questions/19289/mnemonics-to-correlate-the-definition-of-asymmetric-relation-and-antisymmetri/ – Daniel R. Collins Jan 05 '21 at 04:22
  • 1
    Aside from that: Do you have an instructor who actually said you need to memorize that packet format? That would be mind-boggling. – Daniel R. Collins Jan 05 '21 at 04:24
  • @DanielR.Collins, I had followed the guidance as you said in that math query and since you have made the logic clear to me, I shall not require any mnemonics for that. And yes I even remember that you guided me that many students use mnemonics as a crutch.the thing is that, I am preparing for a competitive exam, and till now computer networks have not been taught in my ug course(it shall be done in a later sem). However in previous year question of the said exam, I found questions, which could be better answered if this format is handy with you. Being a competitive exam, time is a constrain – Abhishek Ghosh Jan 05 '21 at 06:23
  • @DanielR.Collins, I am doing self study, so no instructor said me to memorize that, but it is some thing which I felt that I should do, for the competitive exam... – Abhishek Ghosh Jan 05 '21 at 06:25
  • 1
    Perhaps presenting some of the sample questions would be helpful for people to understand what the point is. – Daniel R. Collins Jan 05 '21 at 06:29
  • https://www.geeksforgeeks.org/transport-layer-gq/ This contains many questions which were asked about the various fields in the TCP header, like URG flag, Header size, acknowledgement number, window size ... And that's why I felt that keeping the TCP header format in memory, would give more confidence while solving such questions... – Abhishek Ghosh Jan 05 '21 at 06:44
  • 2
    Out of 54 questions on that site, I see only 2 that are possibly answered by memorizing the TCP header format. Question 29 would require this plus 3 other packet formats being memorized. Question 51 just requires recognizing some of the names here. I suggest that memorizing the packet format is not a good use of energy (as usual). – Daniel R. Collins Jan 05 '21 at 07:57
  • 1
    @DanielR.Collins ok, once again thanks for the guidance... – Abhishek Ghosh Jan 05 '21 at 08:30
  • 1
    Will you be tested on this? – ctrl-alt-delor Jan 05 '21 at 16:37
  • @ctrl-alt-delor not tested really, it is like an entrance exam, if i get good score, I shall be able to get into better universities for masters – Abhishek Ghosh Jan 05 '21 at 19:04

1 Answers1

1

The first bit is where it is going. An intermediary needs this to forward it. It goes first so that at least in theory it can start forwarding before it has finished receiving. Next is the symmetrical data (where it is from). This is common to most protocols (ethernet mac-addresses, IP addresses, tcp/udp ports, …).

Next the two sequence numbers, in the same order as before: to (the sequence number of this segment), from (the sequence number of the last segment that I got from you).

Next the length of what remains, you need the length before you can start reading the rest (there is no other way to know where the the end is.

Then various flags, the window size and the rest.

Of this I only remember the first two (the two addresses). The rest I look up.

ctrl-alt-delor
  • 10,635
  • 4
  • 24
  • 54