Subject: [ipfix] Variable Length with 255 octets length

From: Jan Petranek <[email-masked]>
Date: Mon, 13 Sep 2004 16:46:31 +0200

Hello, 

I just stumbled upon the variable length information element
(as in draft-ietf-ipfix-protocol-05.txt, sect. 11)

It seems, the protocol does not allow for a variable length element with 255 
bytes length:
- Up to 254(!) bytes (<255), the length information is stored in the first 
byte. 
- From 256(!) up to 65535 bytes length, three bytes carry the length 
information, where the first byte will be set to 255. The length is encoded 
in the second and third byte.

Please note the missing encoding for a 255 byte long message. 

I guess this point has not been an issue yet. I suggest to handle a length of 
255 bytes by using the 3-bytes. (The only change to the specification is  
setting the lower limit for the 3-byte encoding from 256 to 255)

My suggestion of the changes are displayed below: 
(changes under the original text, marked with ^^^)

   If the length of the Information Element is greater or equal than 
   256 bytes, the first byte of the Information Element is 255, and the 
   ^^^
   255
   length is carried in the second and third bytes of the Information 
   Element, as shown in Figure M. 
       0                   1                   2                   3 
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
      |      255      |        Length (256 to 65535)       |   IE     | 
                                            ^^^  
                                            255 to
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
      |                      ... continuing as needed                 | 
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
    
      Figure M: Variable Length Information Element  
               (length 256 to 65535) bytes 
                          ^^^

Best regards,

Jan Petranek

--
Help        mailto:[email-masked] and say "help" in message body
Unsubscribe mailto:[email-masked] and say
"unsubscribe ipfix" in message body
Archive     http://ipfix.doit.wisc.edu/archive/

---

From: Benoit Claise <[email-masked]>
Date: Mon, 20 Sep 2004 18:44:55 +0200

Jan,

Thanks. It will be corrected according to your suggestion for the next 
draft version.

Regards, Benoit.