Subject: [rohc] Pebble question

From: "william zheng" <[email-masked]>
Date: Thu, 14 Nov 2002 03:32:32 +0000

Hi, Abbie,

Could you explain me the 'tmp' of RANGE rule description on P.23?

Is it LOCAL ($label, rule) ::= CALL (label, $label, rule) rather than

LOCAL ($label, rule) ::= CALL (label, label, rule) as in 7.2.3?

It could be better to seperate the description about well-known labels from pre-defined rules (maybe a subsection like well-know labels under 4.5. labels ) though the draft may become lengthy.

Thanks.

Best Regards,

William

Help STOP SPAM with the new MSN 8 and get 2 months FREE*
_______________________________________________
Rohc mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/rohc

---

From: "Surtees, Abigail" <[email-masked]>
Date: Thu, 14 Nov 2002 11:11:04 -0000

Hi William,
 
'tmp' is a label, local to the RANGE rule.  It is used to store the value of another field so that the reversibility of the mappings can be checked.  (In the case of RANGE, it could be done without the use of tmp but would mean old_value and new_value would be defined in terms of label which all gets rather confusing so we used an explicit temporary label). 
 
The MAP rule states that:            $label = #old_value ? #new_value.
 
This means that at compression, if the value of the label is equal to old_value then set the value of the label to be new_value, otherwise the rule fails.  The reverse is done at decompression (but the check is trivially true).  It's probably worth looking at an example:
 
RANGE (4,5,6) - considers a 4 bit field and can encode it if it is in the range 5 - 10 inclusive.  (Local labels are initially set to NULL.)
 
consider field_value =  8.  (which is in the range so the rule should succeed.)
Number the MAP rules 1 to 3.
 
MAP 1 says    if tmp == NULL then tmp = field_value
        tmp does = NULL so we have tmp = field_value = 8
 
MAP 2 says     if field_value == tmp then field_value = mod (tmp, k)
        field_value does = tmp so we have field_value = mod (8,6) = 2
 
MAP 3 says    if tmp == mod (mod(field_value-v,k)+v,2^n) then tmp == NULL
                        ; This is checking that the mapping is reversible.  If this rule succeeds then the current
                        ; value of field_value (2) will be sent to the decompressor.  This rule should only succeed    
                        ; if the decompressor will be able to reconstruct the original value
        mod (mod(2-5,6)+5, 2^4) = mod (3+5, 16) = 8 does = tmp so we have tmp = NULL
 
and the rule succeeds.  We finish with tmp = NULL as at the beginning and the compressed value of the field in field_value.
 
At the decompressor we do the reverse -
field_value = 2 (received from compressor) and we work backwards through the maps.
 
MAP 3 says     if tmp == NULL tmp = mod(mod(field_value-v,k)+v,2^n)
        tmp does = NULL so tmp = mod (mod(2-5,6)+5, 2^4) = mod (3+5, 16) = 8
 
MAP 2 says     if field_value == mod (tmp, k) [which it trivially will because we've just done the reverse 
                                                                   mapping] then field_value = tmp
        mod (8,6) = 2 = field_value so field_value = tmp = 8
 
MAP 3 says     if tmp == field_value [trivially does - just assigned] then tmp = NULL
        tmp does = field_value so tmp = NULL.
 
We finish with tmp = NULL as at the beginning and the uncompressed value of the field in field_value.
 
If field_value is not in the correct range then the compressor will find that the mapping is not reversible and will fail.
 
I hope this clarifies the use of 'tmp'.  If you've got further questions, please let me know.
 
In the line 'CALL(#k,$label,rule) ::=   label = k ? NULL'  the # and $ are specifying how the rule should interpret the parameters it gets when the rule is called.  It is defining the rule CALL.
 
In the line LOCAL ($label, rule) ::= CALL (label, label, rule) the rule CALL is being called (like a function).  The rule automatically knows (from it's definition) to interpret the first parameter as an integer and the second as a text string.  Consequently there isn't any need for the '$' in this line.
 
Yes, I think having a list of the well-known labels in its own subsection is a good idea.  We'll remember this when we update the draft.
 
Best regards,
 
Abbie
 
Abbie Surtees 
Engineer 
Internet Applications and Mobility 
Roke Manor Research Ltd 
Tel:   +44 (0) 1794 833131  

Hi, Abbie,

Thanks.

Best Regards,

William

  _____  

Help STOP SPAM with the new MSN 8  <http://g.msn.com/8HMJEN/2016> and get 2 months FREE*