Subject: [mobile-ip] Alignment Question

From: "Carlos Barcenilla" <[email-masked]>
Date: Mon, 23 Sep 2002 10:10:44 -0300

Hello.

  I don't know if this is an off-topic here, if so I apologize for the inconvenience.

  I read the MIPv6 draft and all the other IPv6 Specifications.
 
  I understand RFC2460 alignment requirements for options (I mean  the xn+y rule). What I cannot get is how do you derive that numbers for each option.

  Could you give me some advice to learn that?

Thanks!

---

From: Jari Arkko <[email-masked]>
Date: Mon, 23 Sep 2002 16:37:25 +0300

Carlos Barcenilla wrote:

>   I understand RFC2460 alignment requirements for options (I mean  the 
> xn+y rule). What I cannot get is how do you derive that numbers for each 
> option.

The numbers for each option depend on the fields inside the option.
RFC 2460 appendix B also describes some general formatting requirements.
Basically, n-octet fields are to be aligned on n-octet boundary up and
until n=8. For instance, a 4-octet field is aligned on a 4-octet boundary.

Now, if an option starts with a 4-octet field we would put 4n as an
alignment requirement. If the option has three bytes that precede a
4-byte field, then we would put 4n+1 so that when that one byte is
followed by the three first ones in the option, we arrive at a 4-byte
boundary in time for our 4-byte field.

Jari