Subject: [rohc] FN new syntax example

From: "Finking, Robert" <[email-masked]>
Date: Mon, 18 Apr 2005 16:26:23 +0100

Hi All,

Here's my first stab at an alternative syntax as requested by Kris.

First, here are all the categories of encoding I could think of:

"uc_format" : bindings which are associated directly with a particular uncompressed format, but could apply to any co_format.

"co_format" : bindings which are associated directly with a particular compressed format, but could apply to any uc_format.

"invariant" : bindings which always apply across all formats. You only need to specify these if you have multiple uncompressed formats as is the case with IP in the tcp-pf for example - otherwise you can specify these bindings under the sole "uc_format".

"inferred" : bindings for fields/attributes which are calculated entirely from other fields

"co_only" : bindings for fields which are only present in the compressed header, such as CRCs on the compressed packet. These fields have no notion of having a "compressed" and "uncompressed" value - they only have one value.

"default" : fall back bindings to be used if no others are specified for a given field or attribute - purpose: to reduce complexity of other formats.

Second, I observe that the need to use context or not is orthogonal to the above classifications. That is, each of the above bindings may or may not require the use of context. Having written all the above out, I can't see that we have any need to distinguish between fields whose bindings require context and those that don't. I'm happy to hear a good reason though!

Thirdly, I observe that as we currently allow multiple uc_ and co_formats, with "let" statement guards to differentiate them, there is no reason not to do the same thing with any of the other formats - including defaults. It probably seems like I'm trying to add stuff here, but actually I'm trying to simplify it by making the same rules apply everywhere.

Here's an example from the tcp-pf rewritten with new syntax:

sack_var_length_enc (base) ===
{
        uc_format = sack_field;  %[ 32 ]
        {
                let (sack_field:uncomp_length == 32);
        }

        inferred = sack_offset   %[ 32 ]
        {
                let (sack_offset:uncomp_value ==
                     sack_field:uncomp_value - base);
                let (sack_offset:uncomp_length == 32);
        };

        co_format_lsb_15 = discriminator, %[ 1 ]
                           sack_offset,   %[ 15 ]
        {
                discriminator    ::= '0';
                sack_offset      ::= lsb (15, -1);
        };

        co_format_lsb_22 = discriminator, %[ 2 ]
                           sack_offset,   %[ 22 ]
        {
                discriminator    ::= '10';
                sack_offset      ::= lsb (22, -1);
        };

        co_format_lsb_30 = discriminator, %[ 2 ]
                           sack_offset,   %[ 30 ]
        {
                discriminator    ::= '11';
                sack_offset      ::= lsb (30, -1);
        };
};

Here's another one from appendix B of the FN draft:

eg_header  ===
{
  uc_format     =   version_no,    %[ 2 ]
                    type,          %[ 2 ]
                    flow_id,       %[ 4 ]
                    sequence_no,   %[ 4 ]
                    abc_flag_bits, %[ 3 ]
                    reserved_flag; %[ 1 ]

  inferred = scaled_seq_no   %[ 4 ]
  {
    % need modulo maths to calculate scaling correctly,
    % due to 4 bit wrap around
    scaled_seq_no ::= uncompressed_value
      (4, (mod(15 - sequence_no:uncomp_value, 3) * 16
           + sequence_no:uncomp_value) / 3);
  };

  default       =
  {
    version_no          ::=   uncompressed_value(2,1);
    type                ::=   irregular(2);
    flow_id             ::=   static;
    reserved_flag       ::=   uncompressed_value(1,0);
    scaled_seq_no       ::=   lsb(1,-1);
  };

  co_format_irregular   =   discriminator,     %[ 2 ]
                            type,              %[ 2 ]
                            flow_id,           %[ 4 ]
                            scaled_seq_no,     %[ 4 ]
                            abc_flag_bits      %[ 3 ]
  {
    discriminator       ::=   '00';
    flow_id             ::=   irregular(4);  % overrides default
    scaled_seq_no       ::=   irregular(4);  % overrides default
    abc_flag_bits       ::=   irregular(3);
  };

  co_format_flags_set   =   discriminator,     %[ 2 ]
                            type,              %[ 2 ]
                            scaled_seq_no      %[ 1 ]
  {
    discriminator       ::=   '01';
    abc_flag_bits       ::=   uncompressed_value(3,7);
  };

  co_format_flags_static   =   discriminator,     %[ 1 ]
                               type,              %[ 2 ]
                               scaled_seq_no      %[ 1 ]
  {
    discriminator       ::=   '1';
    abc_flag_bits       ::=   static;
  };
};

Thoughts please, particularly on clarity of notation. As regards the inertia in the current tcp-pf I contend that the changes required would be minimal, to the point that I will volunteer to do them if that's seen as the only obstacle (provided somebody agrees to check my updates).

Regards

Raffles

_______________________________________________
Rohc mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/rohc