This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

3GPP timezone decoding logic

1

Hi Team,

3GPP-MS-TimeZone: 4a00 Timezone: GMT - 6 hours 0 minutes No adjustment Padding: 0000

please let me how hex value 4a was decoded as GMT-6.can you please share the logic of decoding that.

dint find much info in 3gpp docs

Best Regards Anand.R

asked 05 Nov '13, 11:22

AnandRoni's gravatar image

AnandRoni
16223
accept rate: 0%


2 Answers:

2

Hi,

have a look at 3GPP TS 23.040 chapter 9.2.3.11.

answered 05 Nov '13, 14:13

Pascal%20Quantin's gravatar image

Pascal Quantin
5.5k1060
accept rate: 30%

Hi Pascal, I already gone through 23.040 spec,i don't get it clear.

can you give a sample example how timezone parameter h'4A represents GMT -6.

4 A** 7654 3210 (bit order) 0100 1010 (3rd bit is zero so it is negative offset but how come we can determine as GMT-6 with remaining parameters)

Best Regards Anand.R

(05 Nov '13, 19:26) AnandRoni

The timezone is expressed in multiple of 15 mns, as explained in the 3GPP spec. 0x4A & 0x08 = 1 so it is a negative offset (0x4A)>>4 + 10(0x4A&0x7) = 4 + 102 = 24 units of 15 mns 24/4 = 6 hours

(05 Nov '13, 23:14) Pascal Quantin

1

Yeah it's in there (3GPP TS 23.040 under 9.2.3.11 TP-Service-Center-Time-Stamp (TP-SCTS) referenced by 3Gpp-TS-29.060 v8.9.0 7.7.52 MS Time Zone (and others). Looks strange because they are looking at the 1st byte as 2x 4-bit "semi-octets". So if you flip the 2x 4-bit octets, then take the high-order bit as the sign and the lower-order 7x bits as BCD digits it works fine:
  4A = 0100 1010; swap = 1010 0100; sign = 1 (UTC-); 010 0100 (BCD) = 24(Dec) / 4 = UTC-6
  8A = 1000 1010; swap = 1010 1000; sign = 1 (UTC-); 010 1000 (BCD) = 28(Dec) / 4 = UTC-7
  69 = 0110 1001; swap = 1001 0110; sign = 1 (UTC-); 001 0110 (BCD) = 16(Dec) / 4 = UTC-4
Wiki has some text on the BCD/Flipped nature of the whole timestamp field
 http://en.wikipedia.org/wiki/GSM_03.40
The wireshark 3GPP-MS-TimeZone fix has Pascal's algorithm in there too:
 oct = (oct >> 4) + (oct & 0x07) * 10;
 https://bugs.wireshark.org/bugzilla/attachment.cgi?id=11503&action=edit

Paul Bishop

answered 27 May '14, 20:19

Paul%20Bishop's gravatar image

Paul Bishop
262
accept rate: 0%