Ask Your Question
0

Wireshark 4.4.2 not able to decode RRC's UE Information Response coarseLocation's degreesLongitude correctly

asked 2024-12-27 09:12:08 +0000

Wireshark 4.4.2 version (latest one) seems to decode degreesLongitude incorrectly. Please find below the parameter and issue details:

Parameter is present inside NR RRC message as shown in below heirarchy:

NR Radio Resource Control (RRC) protocol->UL-DCCH message ->ueInformationResponse-r16->coarseLocationInfo-r17->Ellipsoid-Point->degreesLongitude

Here, as per specification 3gpp 23032 (v18.01.00) section 6.1 -> Coding of Point -> The longitude, expressed in the range -180°, +180°, is coded as a number between -223 and 223-1, coded in 2's complement binary on 24 bits. The relation between the coded number N and the range of longitude X it encodes is the following (X in degrees):

      2^24 * X

N <= ----------- < N+1

         360

Issue:

Here if we want to send a longitude in degrees with a positive value, msb is always set with "1" even though it is a positive number and in case of a negative longitude value, 2's complement is calculated and MSB is always set as "0" even though it should be "1" as it's a negative number.

For e.g. In case of -4.9 degrees, if we calculate value of N using above formula, it should be -233013. 2's complement of -233013 is 1111 1100 0111 0001 1100 1010

i.e. FC 71 CB but in wireshark it is 7C 71 CB i.e. msb is set to 0 instead of 1 as its a negative number

and similarly wrong msb in case of positive number.

edit retag flag offensive close merge delete

Comments

André gravatar imageAndré ( 2024-12-27 18:44:37 +0000 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2024-12-28 02:13:40 +0000

johnthacker gravatar image

The description in TS 23.032 is, as it says, of "a coding method for geographical area descriptions." It is not the encoding method using by TS 37.355 (LTE Positioning Protocol, LPP) and hence TS 38.331 (NR-RRC), as in those cases ASN.1 with Basic Packed Encoding Rules (BASIC-PER), Unaligned Variant as specified in ITU-T Rec. X.691 is used. (See TS 37.355 section 6.)

TS 38.331 mentions that "[coarseLocationInfo] is coded as the Ellipsoid-Point defined in TS 37.355."

TS 37.355 defines the Ellipsoid-Point in terms of ASN.1 with PER encoding, saying

The IE Ellipsoid-Point is used to describe a geographic shape as defined in TS 23.032 [15]

   -- ASN1START
   Ellipsoid-Point ::= SEQUENCE {
   latitudeSign ENUMERATED {north, south},
   degreesLatitude INTEGER (0..8388607), -- 23 bit field
   degreesLongitude INTEGER (-8388608..8388607) -- 24 bit field
   }
   -- ASN1STOP

When encoding an INTEGER according to Unaligned PER, bounds as above are PER-visible, and thus ITU-T X.691 11.5 "Encoding of a constrained whole number" is applied, specifically 11.5.6 (where "lb" is the lower bound of the constraint):

In the case of the UNALIGNED variant the value ("n" – "lb") shall be encoded as a non-negative- binary-integer in a bit-field as specified in 11.3 with the minimum number of bits necessary to represent the range. NOTE – If "range" satisfies the inequality 2m < "range" ≤ 2m + 1, then the number of bits = m + 1.

Yes, that means that in the case above, it's a 24 bit field, but due to the subtraction (and the exact values of the constraints here) it is encoded in offset binary, not 2's complement, hence the MSB is inverted compared to what you expect.

In the example above, that means that -233013 is encoded as -233013 - (-8388608) = 8155595 = 0x7C71CB.

edit flag offensive delete link more

Comments

Thanks a lot @johnthacker for your response. It really helped us!

kavita sharma gravatar imagekavita sharma ( 2024-12-30 12:28:47 +0000 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2024-12-27 09:12:08 +0000

Seen: 57 times

Last updated: Dec 28 '24