Subject: [IPFIX] Errata 1737

From: Paul Aitken <[email-masked]>
Date: Tue, 16 Aug 2011 11:56:37 +0100

Dear IPFIX experts,

RFC 5102, section "5.8.5. ipv4Options", provides the following table:

           Type   Option
       Bit Value  Name    Reference
       ---+-----+-------+------------------------------------
        0     0   EOOL    End of Options List, RFC 791
        1     1   NOP     No Operation, RFC 791
        2   130   SEC     Security, RFC 1108
        3   131   LSR     Loose Source Route, RFC 791
        4    68   TS      Time Stamp, RFC 791
        5   133   E-SEC   Extended Security, RFC 1108
        6   134   CIPSO   Commercial Security
        7     7   RR      Record Route, RFC 791
        8   136   SID     Stream ID, RFC 791
        9   137   SSR     Strict Source Route, RFC 791
       10    10   ZSU     Experimental Measurement
       11    11   MTUP    (obsoleted) MTU Probe, RFC 1191
       12    12   MTUR    (obsoleted) MTU Reply, RFC 1191
       13   205   FINN    Experimental Flow Control
       14   142   VISA    Experimental Access Control
       15    15   ENCODE
       16   144   IMITD   IMI Traffic Descriptor
       17   145   EIP     Extended Internet Protocol, RFC 1385
       18    82   TR      Traceroute, RFC 3193
       19   147   ADDEXT  Address Extension
       20   148   RTRALT  Router Alert, RFC 2113
       21   149   SDB     Selective Directed Broadcast
       22   150   NSAPA   NSAP Address
       23   151   DPS     Dynamic Packet State
       24   152   UMP     Upstream Multicast Pkt.
       25    25   QS      Quick-Start
       30    30   EXP     RFC3692-style Experiment
       30    94   EXP     RFC3692-style Experiment
       30   158   EXP     RFC3692-style Experiment
       30   222   EXP     RFC3692-style Experiment
       ...  ...   ...     Further options numbers
                          may be assigned by IANA

This is taken from the list of IPv4 option numbers assigned by IANA at 
http://www.iana.org/assignments/ip-parameters.

The intention was to encode each option in the corresponding bit per the 
table, so EOOL would be 2^0, NOP would be 2^1, SEC would be 2^2 etc.
So from a programming point of view, the bits should be:

            7      6      5      4      3      2      1      0
        +------+------+------+------+------+------+------+------+
    ... |  RR  |CIPSO |E-SEC |  TS  | LSR  | SEC  | NOP  | EOOL |
        +------+------+------+------+------+------+------+------+

Unfortunately RFCs number the bits in the opposite order, so what we 
drew in RFC 5102 was:

            0      1      2      3      4      5      6      7
        +------+------+------+------+------+------+------+------+
        | EOOL | NOP  | SEC  | LSR  |  TS  |E-SEC |CIPSO |  RR  | ...
        +------+------+------+------+------+------+------+------+

- which puts EOOL at 2^32, NOP at 2^31, etc. This is exactly the 
opposite of what was intended. The text is right, but the figure is 
backwards. Per the errata, "The diagram is back to front."

Also note that if you're using reduced size encoding, EOOL could now be 
at any 8-bit boundary.

I tried to correct this in Errata 1737: 
http://www.rfc-editor.org/errata_search.php?eid=1737

Unfortunately I only flipped the bits around inside the bytes without 
flipping the bytes around too.

So if we list the bits from the errata in one long row, it's clear that 
everything is in the wrong place:

            0      1      2      3      4      5      6      7      8      9     10     11     12     13     14     15     16     17     18     19     20     21     22     23     24     25     26     27     28     29     30     31
        +------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+
        |  RR  |CIPSO |E-SEC |  TS  | LSR  | SEC  | NOP  | EOOL |ENCODE| VISA | FINN | MTUR | MTUP | ZSU  | SSR  | SID  | DPS  |NSAPA | SDB  |RTRALT|ADDEXT|  TR  | EIP  |IMITD |      |  EXP |   to be assigned by IANA  |  QS  | UMP  |
        +------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+

bit:       7      6      5      4      3      2      1      0     15     14     13     12     11     10      9      8     23     22     21     20     19     18     17     16     31     30                                 25     24

What the errata should say is:

            0      1      2      3      4      5      6      7
        +------+------+------+------+------+------+------+------+
        |      |  EXP |   to be assigned by IANA  |  QS  | UMP  | ...
        +------+------+------+------+------+------+------+------+

            8      9     10     11     12     13     14     15
        +------+------+------+------+------+------+------+------+
    ... | DPS  |NSAPA | SDB  |RTRALT|ADDEXT|  TR  | EIP  |IMITD | ...
        +------+------+------+------+------+------+------+------+

           16     17     18     19     20     21     22     23
        +------+------+------+------+------+------+------+------+
    ... |ENCODE| VISA | FINN | MTUR | MTUP | ZSU  | SSR  | SID  | ...
        +------+------+------+------+------+------+------+------+

           24     25     26     27     28     29     30     31
        +------+------+------+------+------+------+------+------+
    ... |  RR  |CIPSO |E-SEC |  TS  | LSR  | SEC  | NOP  | EOOL |
        +------+------+------+------+------+------+------+------+

Now EOOL is 2^0 as intended, NOP is 2^1 etc.

Note that the network bit numbering in the figure is exactly the reverse 
of the "Bit" value in the table - so it might be better to rename "Bit" 
as "position".

P.