Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Basic IPv6 Concepts 6.10 Formatting Guidelines for Options This appendix gives some advice on how to lay out the fields when designing new options to be used in the Hop-by-Hop Options header or the Destination Options header, as described in Section 6.4.2. These guide- lines are based on the following assumptions: One desirable feature is that any multioctet fields within the Option Data area of an option be aligned on their natural boundaries, i.e., fields of width n octets should be placed at an integer multiple of n octets from the start of the Hop-by-Hop or Destination Options header, for n = 1, 2, 4, or 8. Another desirable feature is that the Hop-by-Hop or Destination Options header take up as little space as possible, subject to the requirement that the header be an integer multiple of 8 octets long. It may be assumed that, when either of the option-bearing headers are present, they carry a very small num- ber of options, usually only one. These assumptions suggest the following approach to laying out the fields of an option: order the fields from smallest to largest, with no interior padding, then derive the alignment requirement for the entire op- tion based on the alignment requirement of the largest field (up to a maximum alignment of 8 octets). This approach is illustrated in the following examples: Example 1 If an option X required two data fields, one of length 8 octets and one of length 4 octets, it would be laid out as follows: