IHL vs shift 6 vs accurate location in upper layers
jsl6uy js16uy <[email protected]>
| Newsgroups | org.kernel.vger.lartc |
|---|---|
| Message-ID | <CAAGD8_RLTrcCNpH3JMviPjWEQ5JHeEj=PM_DGHazHmxx+ejxpA@mail.gmail.com> |
Hello all hope all is well I looked around and have tried to get this sorted on multiple occasions, but just can't get it how does dividing by 64/2^6, ~ shift 6, ultimately get you to something like the proper location for a src port in layer 4? I get, after reading again and again and looking at ip packet header diagrams, offset at 0 and the mask used to extract the IHL from the 16bit word. But then comes 'ol shift 6 ... right-shifting by 6 eliminates the offset of the field and at the same time converts the value into byte unit ....and I am lost again IHL # 32 bit words I guess dividing by 64 bits will get you bytes multiples 8 and then I have nothing googling around verified binary math and this is dividing by 64, but that's where it ends, anything else is people just using it. I figure I must be missing the deal. Would like to understand it to fully use thanks and regards