home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.protocols.tcp-ip      TCP and IP network protocols.      14,669 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 12,854 of 14,669   
   Barry Margolin to acadian   
   Re: IP TL calculation   
   13 May 09 00:42:39   
   
   1e5091f1   
   From: barmar@alum.mit.edu   
      
   In article   
   <7486c924-f034-4c55-b583-88d7f7054c56@g19g2000vbi.googlegroups.com>,   
    acadian  wrote:   
      
   > On May 11, 9:53 pm, Barry Margolin  wrote:   
   > > In article   
   > > ,   
   > >   
   > >   
   > >   
   > >  acadian  wrote:   
   > > > Greetings-   
   > > >      I am looking at rfc 791, and just do not follow the algorithm   
   > > > they use on page 25 to calculate the TL when a packet is fragmented.   
   > > > I specially do not follow step 9.  Would someone please explain?   
   > > > IF TL =< MTU THEN Submit this datagram to the next step   
   > > >              in datagram processing ELSE IF DF = 1 THEN discard the   
   > > >         datagram ELSE   
   > > >         To produce the first fragment:   
   > > >         (1)  Copy the original internet header;   
   > > >         (2)  OIHL <- IHL; OTL <- TL; OFO <- FO; OMF <- MF;   
   > > >         (3)  NFB <- (MTU-IHL*4)/8;   
   > > >         (4)  Attach the first NFB*8 data octets;   
   > > >         (5)  Correct the header:   
   > > >              MF <- 1;  TL <- (IHL*4)+(NFB*8);   
   > > >              Recompute Checksum;   
   > > >         (6)  Submit this fragment to the next step in   
   > > >              datagram processing;   
   > > >         To produce the second fragment:   
   > > >         (7)  Selectively copy the internet header (some options   
   > > >              are not copied, see option definitions);   
   > > >         (8)  Append the remaining data;   
   > > >         (9)  Correct the header:   
   > > >              IHL <- (((OIHL*4)-(length of options not copied))+3)/4;   
   > >   
   > > Some IP options are copied into all fragments, some are only put in the   
   > > first fragment.  If you don't copy all the options, the header may be   
   > > shorter.  However, IHL counts in 4-octet words, while (length of options   
   > > not copied) is in octets.  Step 9 figures out the new number of words   
   > > based on the decrease in octets.   
   > >   
   > > --   
   > > Barry Margolin, bar...@alum.mit.edu   
   > > Arlington, MA   
   > > *** PLEASE don't copy me on replies, I'll read them in the group ***   
   >   
   > Thanks.  So what happens in step 9 is they take the Old IHL value   
   > multiply it by 4 to get the number of bit, subtract for the options   
   > that are not copied, then add 3 for 'copied flag' and 'option class'   
   > field, and then divide by 4.  Is that correct?   
      
   Not quite.  They add 3 to ensure that the result is rounded up properly.   
      
   Suppose the original IHL was 5, meaning 20 bytes, but 1 byte of options   
   is not copied.  That reduces the header size to 19 bytes.  If you just   
   divided by 4 you would get 4, which is only 16 bytes, which isn't big   
   enough.  So first you add 3 to get 22, divide by 4, and that results in   
   IHL = 5.   
      
   > On a different note, how can I look at some real work values?  Would   
   > you be able to suggest a small model that I can look at the fragmented   
   > values?  I only have a couple of workstations, a hub, and an ISP   
   > facing router.  I guess I need an inexpensive switch so can change the   
   > mtu, and sniff the traffic on two different ports?  rfc 791 has some   
   > examples at the end, but it does not say which options they copied.   
   > The other values match.   
      
   IP options are not used very often.   
      
   --   
   Barry Margolin, barmar@alum.mit.edu   
   Arlington, MA   
   *** PLEASE don't copy me on replies, I'll read them in the group ***   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca