Re: [rohc] Query regarding the LSB encoding in TCP Profile

Raffles <raffles@gluft.com> Fri, 26 March 2010 23:46 UTC

Return-Path: <raffles@gluft.com>
X-Original-To: rohc@core3.amsl.com
Delivered-To: rohc@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id EABD93A6A7B for <rohc@core3.amsl.com>; Fri, 26 Mar 2010 16:46:10 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 2.939
X-Spam-Level: **
X-Spam-Status: No, score=2.939 tagged_above=-999 required=5 tests=[BAYES_50=0.001, DNS_FROM_OPENWHOIS=1.13, HELO_EQ_DE=0.35, HTML_MESSAGE=0.001, MIME_HTML_ONLY=1.457]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zRDIzts3SCky for <rohc@core3.amsl.com>; Fri, 26 Mar 2010 16:46:02 -0700 (PDT)
Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.171]) by core3.amsl.com (Postfix) with ESMTP id 69B9A3A6782 for <rohc@ietf.org>; Fri, 26 Mar 2010 16:46:02 -0700 (PDT)
Received: from [192.168.1.69] (93-97-78-217.zone5.bethere.co.uk [93.97.78.217]) by mrelayeu.kundenserver.de (node=mreu0) with ESMTP (Nemesis) id 0MHtl3-1Nrjn73wHV-004BZ1; Sat, 27 Mar 2010 00:46:21 +0100
Message-ID: <4BAD4748.9030604@gluft.com>
Date: Fri, 26 Mar 2010 23:46:16 +0000
From: Raffles <raffles@gluft.com>
User-Agent: Thunderbird 2.0.0.24 (Windows/20100228)
MIME-Version: 1.0
To: Anil Maguluri <Anil.Maguluri@lntinfotech.com>
References: <C7232BDB534C6241BE85C96D129205D002F41D1A91@BLRINMSMBX01.bglrodc.lntinfotech.com>
In-Reply-To: <C7232BDB534C6241BE85C96D129205D002F41D1A91@BLRINMSMBX01.bglrodc.lntinfotech.com>
Content-Type: text/html; charset="ISO-8859-1"
Content-Transfer-Encoding: 7bit
X-Provags-ID: V01U2FsdGVkX18uSGfceiJq+WXXzl+aDvgyvbgryqOroSbkKlN Lu3gP+zYZC++v6ZMP1RH+OFyrjvABDnKuIKaziakhXzbnY4oGv IxQodmEJ5UFecYWH/JjP2tU6GyMS3Nd
Cc: "rohc@ietf.org" <rohc@ietf.org>, ghyslain.pelletier@ericsson.com, Anil Kumar Maguluri <anilmaguluri@gmail.com>
Subject: Re: [rohc] Query regarding the LSB encoding in TCP Profile
X-BeenThere: rohc@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Robust Header Compression <rohc.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/rohc>, <mailto:rohc-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/rohc>
List-Post: <mailto:rohc@ietf.org>
List-Help: <mailto:rohc-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/rohc>, <mailto:rohc-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 26 Mar 2010 23:46:11 -0000

Hi Anil,

Thanks for the mail. With respect to the 4997 queries, I think the key issue is with understanding LSB encoding so I'll start with your final question and work backwards.

The example given in RFC 4997 section 4.11.5 uses 14 bits which covers 2^14 = 16384 possibilities. Without any offset, this would give a range of 0 to 16383. We wish to allow for an equal amount of deviation each side so we set the offset in the middle, 8192. This gives us a range of (0 - 8192) to (16383 - 8192) i.e. a range of -8192 to 8191 (i.e. by setting the offset to be half the range we have effectively turned this into two's complement).

Going back one question, the use of "p=2^(k-1)-1"* is to calculate offsets such as 8191 in rnd_5. The authors are simply explaining where they got the number 8191 from. Because the range of an lsb encoding is a power of 2 in size it is always an even number. Therefore there is no integer midpoint; you can't split the range exactly into two. You can either pick the integer immediately above the midpoint, or the one just below. With the example in RFC 4996, I chose the conventional two's complement midpoint (p=2^(k-1)), which slightly favours the negative. The RFC 4997 authors chose the other option (p=2^(k-1)-1), which slightly favours the positive. With 8191 as the offset, the range is (0 - 8191) to (16383 - 8191) i.e. a range of -8191 to 8192. It really is arbitrary which you pick.

Going back now to what I think is your very first question (i.e. why 65535 in rnd_1), I must confess I don't understand why this value was selected. It is certainly at odds with the stated design you quoted, since it doesn't satisfy p=2^(k-1) - 1: 65535 != 2^(18-1) -1, 65535 != 2^17 - 1, 65535 != 131071. However, I am not an expert on RFC 4996. I know the authors spent years agonising over the profile so I suspect they just ran out of words to explain this value. The main point is,  the offset specified is the one that should be used.

So, finally, to answer your overall question. My understanding is that you can safely ignore the "p=2^(k-1)-1" when producing an implementation. Despite the fact that it is contained in a normative section, it is only there for explanatory purposes. The important thing in producing an implementation is to get it right, for which section 8.1 can be ignored, but section 8.2 must definitely be adhered to.

I suspect that you already understood a lot of this, but other readers may not, I hope you didn't mind the extra explanations. If on the other hand I have failed to explain clearly, I do apologise. Please feel free to ask further questions.

Regards

Raffles (Robert Finking)

* for the meaning of p and k, see also text on page 42 of RFC 4996:

   When discussing LSB-encoded fields below, "p" equals the
   "offset_param" and "k" equals the "num_lsbs_param" in [RFC4997].  The
   encoding methods used in the compressed base headers are based on the
   following design criteria:



Anil Maguluri wrote:

HI All,

 

Please clarify me the below queries regarding the LSB encoding in TCP Profile.

 

The below statements in RFC 4996 are confusing, please clarify me.

 

Statement-1

In RFC 4996, Page 43, under TCP Sequence Number:

“ Also, for ROHC-TCP to be robust to losses, two additional bits are added to the LSB encoding of the sequence number. This

means that the base headers should contain at least 14 bits of LSB-encoded sequence number when present. According to the

logic above, the LSB offset value is set to be as large as the positive offset, i.e., p = 2^(k-1)-1. “

 

Statement-2

In RFC 4996, Page 81, in the compressed packet formats are represented as below:

// Send LSBs of sequence number

COMPRESSED rnd_1 {

Discriminator    =:= ’101110’ [ 6 ];

seq_number      =:= lsb(18, 65535) [ 18 ];

msn                       =:= lsb(4, 4) [ 4 ];

psh_flag               =:= irregular(1) [ 1 ];

header_crc         =:= crc3(THIS.UVALUE, THIS.ULENGTH) [ 3 ];

ENFORCE((ip_id_behavior.UVALUE == IP_ID_BEHAVIOR_RANDOM) ||

(ip_id_behavior.UVALUE == IP_ID_BEHAVIOR_ZERO));

}

 

As per my understanding, we have to use offset param value (RFC 4997, page 27) as 65535 to compress the seq_number to select

The rnd_1 packet. Is it right? If my understanding is right, then what is the use of p=2^(k-1)-1?

 

Also please explain me the below statement which is present in RFC 4997, page 27.

For example, the TCP sequence number:

tcp_sequence_number =:= lsb(14, 8192);

This takes up 14 bits, and can communicate any value that is between 8192 lower than the value of the field stored in context and 8191

above it.

 

Thanks for your support.

 

Regards,

Anil Kumar Maguluri



This Email may contain confidential or privileged information for the intended recipient (s) If you are not the intended recipient, please do not use or disseminate the information, notify the sender and delete it from your system.

______________________________________________________________________

_______________________________________________ Rohc mailing list Rohc@ietf.org https://www.ietf.org/mailman/listinfo/rohc" rel="nofollow">https://www.ietf.org/mailman/listinfo/rohc

--
Raffles (Robert Finking)
m: 0789 463 9887
e: raffles@gluft.com
w: gluft.com

         O                  O
 OOOOOO  O  O    O OOOOOO OOOOO
 O    O  O  O    O OOOOO    O
 OOOOOO  O  OOOOOO O        O
 OOOOOO
      we  care  about  software

-----------------------------------------------------------------
Gluft Ltd. Registered No.: 6795336      VAT No.: 974 2755 83
The information contained in this e-mail and any attachments is
proprietary to Gluft Ltd and must not be passed to any third
party without permission. This communication is for information
only and shall not create or change any contractual relationship.
Please consider the environment before printing. Thank you.
-----------------------------------------------------------------