I am bad at memorizing things. So could anyone recommend me some mnemonics, so that I can remember the fields of the header...
Computer Science Educators Stack Exchange is a question and answer site for those involved in the field of teaching Computer Science. It only takes a minute to sign up.Sign up to join this community
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.