ROHC-FN tutorial: scaled_seq_no compression formula
Klaus Warnke <[email protected]> Thu, 03 Sep 2009 14:14:23 +0200
| Newsgroups | gmane.ietf.rohc |
|---|---|
| Message-ID | <ur5uo6x9c.wl%[email protected]> |
Hello RoHC'ers 2.0, the example B.9. in the RFC 4997 ROHC-FN introduces a scaled_seq_no, but provides no formula for compression. Here is my compression formula, maybe it is helpful for other. scaled_seq_no.UVALUE = (sequence_no.UVALUE + (m*16)) / 3 where m is: m = 0 if (U%3 == 0) m = 2 if (U%3 == 1) m = 1 if (U%3 == 2) Checked with oo calc: U U%3 m M*16 U+m*16 C=(U+m*16)/3 C*3 U=(C*3)%16 - --- - ---- ------ ------------ --- ---------- 0 0 0 0 0 0 0 0 1 1 2 32 33 11 33 1 2 2 1 16 18 6 18 2 3 0 0 0 3 1 3 3 4 1 2 32 36 12 36 4 5 2 1 16 21 7 21 5 6 0 0 0 6 2 6 6 7 1 2 32 39 13 39 7 8 2 1 16 24 8 24 8 9 0 0 0 9 3 9 9 10 1 2 32 42 14 42 10 11 2 1 16 27 9 27 11 12 0 0 0 12 4 12 12 13 1 2 32 45 15 45 13 14 2 1 16 30 10 30 14 15 0 0 0 15 5 15 15 br Klaus