Subject: Re: [ipfix-protocol] PROTO-14: padding.

From: Benoit Claise <[email-masked]>
Date: Thu, 08 Jul 2004 11:12:37 +0200

Hi Sebastian,

Actually this sentence is not part of the proposed text. It was just a 
comment.
I wanted to express the fact:
   - Template FlowSet always have "4-byte aligned" boundaries."
   - Template FlowSet are only sent once with SCTP, TCP
So I think we don't care too much about the alignment for the Template 
FlowSeet

However, I could understand the need for some text clarification. I see 
three solutions

_Solution 1_

We don't write down anything for padding & Template FlowSet. Basically 
what I proposed initially. However, I can understand the discrepancy 
between the Template FlowSet and the other FlowSets.

_Solution 2_

 8.3   Template FlowSet Format

       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  
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+  
      |       FlowSet ID = 0          |          Length               |  
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+  
      |       Template ID 1           |         Field Count           |  
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+  
      |        Field Type 1           |         Field Length 1        |  
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+  
      |        Field Type 2           |         Field Length 2        |  
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+  
      |             ...               |              ...              | 
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |        Field Type N           |         Field Length N        | 
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |       Template ID 2           |         Field Count           | 
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
      |        Field Type 1           |         Field Length 1        | 
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
      |        Field Type 2           |         Field Length 2        | 
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+  
      |             ...               |              ...              | 
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+  
      |        Field Type M           |         Field Length M        | 
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+  
      |             ...               |              ...              |  
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+  
      |        Template ID K          |         Field Count           |  
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+  
      |             ...               |              ...              |  
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
      |                           Padding                             |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+  

   Padding
          The Exporting Process MAY insert some padding bytes,
           so that the subsequent FlowSet starts at an aligned boundary.
           Padding MUST be composed of zero (0) bits.
           The padding length MUST be shorter
           than a Template definition with a Field Count value of one.
           It is important to note that the Length field includes the 
padding bits.

_Solution 3

_Adding a 4 bytes padding field in the packet format could be considered 
as confusing (see solution 2), as currently, the alignement is always 4 
bytes.
So we could add some generic text about padding in the "template flowset 
section", without adding the Padding field in the packet format.

What's your feedback?

Regards, Benoit.

> Hi Benoit,
>
> shouldn't it always read "... starts at a _4-byte_ aligned boundary"?
>
> Cheers,
>
> Sebastian
>
> Benoit Claise wrote:
>
>> Dear all,
>>
>>  >From the IPFIX protocol specification:
>>
>>     14. PROTO-14: Why do we need padding? Should we shift it to MAY?
>>            limit the size of the padding? Yes
>>            solution:
>>            - padding shorter than actual Record Length
>>            - fill with 0
>>            - only at end of flowset
>>            - applies to all flowsets
>>            - padding is OPTIONAL (MAY) , not RECOMMENDED (SHOULD)
>>
>>
>>  >From the Seoul meeting minutes:
>>
>>     - Padding: currently a should for the exporting process, and a 
>> must for
>>      the collector.  Proposal to have a MAY for the exporting process
>>
>> In the current IPFIX protocol draft version 3, the same definition is 
>> applied to the following section:
>>     8.4   Data FlowSet Format
>>     8.5.1   Options Template FlowSet Format     8.5.2   Options Data 
>> Record Format
>>
>>    Padding
>>            The Exporting Process SHOULD insert some padding bytes so
>>            that the subsequent FlowSet starts at a 4-byte aligned
>>            boundary. It is important to note that the Length field
>>            includes the padding bits.
>>
>> The proposal is to change it to:
>>
>>     8.4   Data FlowSet Format
>>    Padding
>>            The Exporting Process MAY insert some padding bytes,
>>            so that the subsequent FlowSet starts at an aligned boundary.
>>            Padding MUST be composed of zero (0) bits.
>>            The padding length MUST be shorter than one Flow Data Record.
>>           It is important to note that the Length field includes the 
>> padding bits.
>>
>>     8.5.1   Options Template FlowSet Format    Padding
>>           The Exporting Process MAY insert some padding bytes,
>>            so that the subsequent FlowSet starts at an aligned boundary.
>>            Padding MUST be composed of zero (0) bits.
>>            The padding length MUST be shorter
>>            than one Options Template Record. It is important to note 
>> that the
>>           Length field includes the padding bits.
>>
>>     8.5.2   Options Data Record Format
>>    Padding
>>           The Exporting Process MAY insert some padding bytes,
>>            so that the subsequent FlowSet starts at an aligned boundary.
>>            Padding MUST be composed of zero (0) bits.
>>            The padding length MUST be shorter
>>            than one Options Data Record. It is important to note that 
>> the
>>           Length field includes the padding bits.
>>
>>  I think we are OK with Template FlowSet, as it will always have  
>> "4-byte aligned" boundaries.
>>
>> Feedback?
>>
>> Regards, Benoit.
>>
>

---

From: Sebastian Zander <[email-masked]>
Date: Fri, 09 Jul 2004 11:45:05 +1000

Hi Benoit,

answer below

Benoit Claise wrote:

> Solution 1
> Solution 2
> Solution 3
> Adding a 4 bytes padding field in the packet format could be considered 

I find solution 1 confusing because if there is a strong intention to 
allow arbitrary padding for templates (other than 4-byte aligments) than 
is should be possible for all templates. So IMO solution 2+3: having
the field and a statement clarifying that it is already 4-byte aligned. 
Maybe the field name could be changed from Padding to Optional Padding 
to make clear that it is optional (for all templates)? The size is not 4 
bytes but variable which should be indicated to avoid confusion (same 
for the other templates).

Cheers,

Sebastian

-- 
Sebastian Zander
http://caia.swin.edu.au

--
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: Fri, 09 Jul 2004 09:17:05 +0200

Hi Sebastian,

> Hi Benoit,
>
> answer below
>
> Benoit Claise wrote:
>
>> Hi Sebastian,
>>
>> Actually this sentence is not part of the proposed text. It was just 
>> a comment.
>> So I think we don't care too much about the alignment for the 
>> Template FlowSeet
>>
>> However, I could understand the need for some text clarification. I 
>> see three solutions
>>
>> Solution 1
>>
>> We don't write down anything for padding & Template FlowSet. 
>> Basically what I proposed initially. However, I can understand the 
>> discrepancy between the Template FlowSet and the other FlowSets.
>>
>> Solution 2
>>
>>       |             ...               |              ...              
>> |       
>>       |             ...               |              ...              
>> |       
>>       |             ...               |              ...              
>> |        
>>       |             ...               |              ...              
>> |        
>> Adding a 4 bytes padding field in the packet format could be 
>> considered as confusing (see solution 2), as currently, the 
>> alignement is always 4 bytes.
>> So we could add some generic text about padding in the "template 
>> flowset section", without adding the Padding field in the packet format.
>>
>> What's your feedback?
>
>
> allow arbitrary padding for templates (other than 4-byte aligments) 
> than is should be possible for all templates. So IMO solution 2+3: having
> the field and a statement clarifying that it is already 4-byte 
> aligned. Maybe the field name could be changed from Padding to 
> Optional Padding to make clear that it is optional (for all 
> templates)? The size is not 4 bytes but variable which should be 
> indicated to avoid confusion (same for the other templates).

Can you please propose the text and packet format you would like to see.

Regards, Benoit.

>>>> In the current IPFIX protocol draft version 3, the same definition 
>>>> is applied to the following section:
>>>>     8.4   Data FlowSet Format
>>>>     8.5.1   Options Template FlowSet Format     8.5.2   Options 
>>>> Data Record Format
>>>>
>>>>    Padding
>>>>           It is important to note that the Length field includes 
>>>> the padding bits.
>>>>
>>>>            than one Options Template Record. It is important to 
>>>> note that the
>>>>            than one Options Data Record. It is important to note 
>>>> that the

---

From: Sebastian Zander <[email-masked]>
Date: Mon, 12 Jul 2004 10:22:12 +1000

Hi Benoit,

here is my proposal for the header format (change formats for other 
templates as well) and the Template Flowset Padding paragraph.

        0                   1                   2                   3
       |                            Padding (opt)                      |
       |                              ...			      |

Padding
<your text>
Because Template Flowsets are always 4-byte aligned by definition 
padding is only needed in case of other alignments e.g. on 8-byte 
boundaries.

Cheers,

Sebastian

-- 
Sebastian Zander
http://caia.swin.edu.au