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

vb.net lte-rrc.bcch.dl.sch dissector HELP

0

Hi all, I would like to create a tool in vb.net in order to decode only in LTE all BCCH:SCH:SystemInformation that there are during PS call in a trace or to extract a single IE like referenceSignalPower. Is it possible? How can I link to wireshark dissector? Example in vb.net: import ....? thank in advanced gio

asked 01 Aug '16, 08:13

giodep's gravatar image

giodep
6113
accept rate: 0%


2 Answers:

1

You can follow the explanations found in this thread. For LTE RRC BCCH DL-SCH messages, the dissector string will be "lte-rrc.bcch.dl.sch"

answered 01 Aug '16, 10:02

Pascal%20Quantin's gravatar image

Pascal Quantin
5.5k1060
accept rate: 30%

thanks for your reply. I read your comment of thread on Jan 15 but link https://code.wireshark.org/review/gitweb?p=wireshark.git;a=blob;f=asn1/lte-rrc/EUTRA-RRC-Definitions.asn;hb=refs/heads/master is not anymore valid. Can you help me?

(02 Aug '16, 00:58) giodep

The new link is now https://code.wireshark.org/review/gitweb?p=wireshark.git;a=blob;f=epan/dissectors/asn1/lte-rrc/EUTRA-RRC-Definitions.asn;hb=refs/heads/master

But you do not care about it: it's jsut the ASN.1 extract of 3GPP 36.331 specification, while you already know you want to dissect LTE RRC DL-SCH messages.

(02 Aug '16, 07:57) Pascal Quantin

0

The Wireshark dissection engine isn't built to be usable outside Wireshark although it has been managed by some folks. There's a lot of setup required before the dissection function can be called.

You might be better off using tshark to dissect the packets and output the fields you require which can then be processed by your application.

answered 01 Aug '16, 08:38

grahamb's gravatar image

grahamb ♦
19.8k330206
accept rate: 22%

thanks for your reply. How can I decode several HEX messagelike this one 00010327638DDAA40526D0739019000080481755A2A82F6235F5060C using wireshark command prompt? Protol is always same BCCH:SCH

(01 Aug '16, 09:00) giodep

Presumably that's output from some tool or utility, and it would have to massaged into a form (pcap) that's a valid input for Wireshark. There's text2pcap (part of the Wireshark suite) that converts hex to pcap files, but the hex must still have all the right encapsulation to allow Wireshark to dissect it, which is where my knowledge of LTE stops unfortunately.

(01 Aug '16, 09:34) grahamb ♦

hi grahamb, yes you are right. This output of NQDI (SwissQual tool) and my goal is to use text2pcap+tshark in order to visualize output with my tool as I have so many hex messages like one reported before. Anymore I tried to convert to pcap HEX string reported above without success. Any Suggestion?

(02 Aug '16, 00:28) giodep
1

My suggestion is:

  • in GUI Wireshark, in Edit->Preferences->Protocols->DLT_USER->Encapsulations Table [Edit], add a mapping between any DLT value (User 0 to User 15) not used yet and Payload Protocol value lte-rrc.bcch.dl.sch, then press OK, OK. This will save the rule into preferences file so tshark will be able to use it without a command line option
  • take your hex stream and put a space between each pair of digits
  • put a 000000 (six zeroes followed by a space) in front of the result
  • add another line containing just 000000 at the beginning
  • save the result into a file
  • use text2pcap to convert that file into a pcap one (the result will continue exactly one packet), specifying the encapsulation type USERn which you have chosen in the first step
  • use tshark to interpret the pcap file

All that is valid if the following dissection of your example hex string (truncated as a Comment has a limited size) is correct:

BCCH-DL-SCH-Message message: c1 (0) c1: systemInformation (0) systemInformation criticalExtensions: systemInformation-r8 (0) systemInformation-r8 sib-TypeAndInfo: 1 item Item 0 sib-TypeAndInfo item: sib2 (0) sib2 ac-BarringInfo ...0 .... ac-BarringForEmergency: False radioResourceConfigCommon rach-ConfigCommon preambleInfo numberOfRA-Preambles: n40 (9) preamblesGroupAConfig sizeOfRA-PreamblesGroupA: n32 (7) messageSizeGroupA: b144 (1) messagePowerOffsetGroupB: dB10 (4) powerRampingParameters powerRampingStep: dB2 (1) preambleInitialReceivedTargetPower: dBm-96 (12) ra-SupervisionInfo preambleTransMax: n10 (6) ra-ResponseWindowSize: sf10 (7) mac-ContentionResolutionTimer: sf32 (3) maxHARQ-Msg3Tx: 3 bcch-Config modificationPeriodCoeff: n8 (2)

(02 Aug '16, 01:12) sindy

hi Sindy, it's exactly I want to do. But I need still your help :) I created in Preference User0 (DLT=147) with Payload protocol lte-rrc.bcch.dl.sch. Afterwards I created example.txt as follow: 000000 00 01 03 27 63 8D DA A4 05 26 D0 73 90 19 00 00 80 48 17 55 A2 A8 2F 62 35 F5 06 0C 000000 Then I launched command: text2pcap example.txt -l USER0 example.pcap and this is output: Input from: example.txt Output to: example.pcap Output format: PCAP Wrote packet of 28 bytes. Read 1 potential packet, wrote 1 packet (68 bytes).

Then I launched: tshark -r example.pcap but I cannot see wht you posted: C:\Program Files\Wireshark>tshark -r example.pcap 1 0.000000 N/A -> N/A N/A 28 Null/Loopback

What is my error? Can I append more HEX in same file in order to obtain a single pcap file and read more BCCH System Information? Thank in advanced Gio

(03 Aug '16, 00:46) giodep

Did you look at the links I gave? https://ask.wireshark.org/questions/28735/decode-sms-bearer-data-hex-string and https://ask.wireshark.org/questions/24474/user_dlt-option-in-tshark are explaining you how to achieve this with the command-line.

(03 Aug '16, 00:55) Pascal Quantin

Hi Pascal, now I converted example pcap corretly and I can see all IEs with Wireshark. I use your input as follow:

tshark.exe -o "uat:user_dlts:\"User 0 (DLT=147)\",\"lte-rrc.bcch.dl.sch\",\"0\",\"\",\"0\",\"\"" example.pcap

But I obtained error:

Capturing on 'Network wireless 3'
tshark: Invalid capture filter "example.pcap" for interface 'Network wireless 3'.

That string isn't a valid capture filter (syntax error). See the User's Guide for a description of the capture filter syntax. 0 packets captured

Why? Thank in advanced

(03 Aug ‘16, 01:32) giodep

that would be because you haven’t specified a -r before the name of the file, so the file name was interpreted as an (invalid) capture filter and instead tshark started capturing on the first available physical interface which happened to be “Network wireless 3”.

(03 Aug ‘16, 01:38) sindy

Sorry but I’m really a newbie!! with command:

C:\Program Files\Wireshark>tshark.exe -o "uat:user_dlts:"User 0 (DLT=147)","lte-rrc.bcch.dl.sch","0","","0",""" -r example.pcap

Output is: 1 0.000000 -> 28 SystemInformation [ SIB2 ]

But I wolud like to see all IEs

(03 Aug ‘16, 01:45) giodep

This would have been my answer had Pascal not overtaken me ;-)

You need another option, -V (without any parameters) which makes tshark print the complete dissection of each frame instead of the overview “single line per frame” format which is the default one.

(03 Aug ‘16, 01:50) sindy

And to answer your sub-question,

Can I append more HEX in same file in order to obtain a single pcap file and read more BCCH System Information?

Sure you can - you convert each frame exactly the same way as described earlier, one frame per line, and put the 00000 as the very last line.

But I haven’t mentioned this initially as I’ve obtained an impression that you wanted to use text2pcap and tshark in a chain as an external dissector you would call from your application. And with -V, each input frame gets converted to a variable number of lines rather than a single one.

So if it is enough for you to record a test run, convert it to pcap as a whole, and use Wireshark for analysis, creation of a single hex dump file is the best approach; if you want to browse the dissected packets using your own application (losing all the power of Wireshark filters), then a single file per frame is better.

(03 Aug ‘16, 02:00) sindy

using line command

C:\Program Files\Wireshark>tshark.exe -o "uat:user_dlts:"User 0 (DLT=147)","lte-rrc.bcch.dl.sch","0","","0",""" -r -v example.pcap
tshark: "example.pcap" is neither a field nor a protocol name.
(03 Aug ‘16, 02:02) giodep
1

After you read this, please have a look at tshark man page.

The -r option has a parameter which is the file name, so the file name must immediately follow the -r.

The -V option has no parameter so you may put it before the -r or after the file name, but not between the two.

And it is a capital V - the small v has a different meaning.

(03 Aug ‘16, 02:06) sindy

Yes, You are right. I want to save into file txt or xml output obtained by tshark in prompts. So I can select two options: first is to visualize all SIB2 or better extract a single IE like ReferenceSignalPower

(03 Aug ‘16, 02:09) giodep

GREAT!!! Work fine!!! thanks to all!!!

(03 Aug ‘16, 02:14) giodep

Well, if you can go for xml, then the right way is to replace -V with -T pdml (pdml = Packet Details xML). But beware, it almost expands each bit of the frame into a line of text (exaggerating of course, but not too much).

(03 Aug ‘16, 02:15) sindy

while if it is really enough for you to extract a single protocol field (in Wireshark vernacular) or a single IE (in SS7 vernacular) per frame, then -T fields -e field.name instead of the -V is your best choice.

(03 Aug ‘16, 02:17) sindy

Wow, is it possible to extract directly a single IE? I tried to extract referenceSignalPower without success :(

C:\Program Files\Wireshark>tshark.exe -o "uat:user_dlts:"User 0 (DLT=147)","lte-rrc.bcch.dl.sch","0","","0",""" -r example.pcap -T fields -e field.referenceSignalPower
tshark: Some fields aren't valid:
field.referenceSignalPower
(03 Aug ‘16, 02:33) giodep
1

yes, because the complete name of the protocol field is lte-rrc.referenceSignalPower. So use -T fields -e lte-rrc.referenceSignalPower.

In general, whenever you select a field in the packet dissection pane in Wireshark, the field name gets displayed in the left bottom corner of the window, or you can right-click on the field and choose Copy -> Field name to get the full name of the field to the text clipboard.

(03 Aug ‘16, 02:43) sindy

Sorry Sindi, when I use command line -e lte.rrc.t300 output of tshark is 1 but reading from wireshark t300 is ms200 (1) So I’m wondering if it is possible to visualize directly ms200 and not 1. Thanks in advanced gio

(04 Aug ‘16, 02:40) giodep

This is more a question for either the author of the particular dissector or the author of the common output wrappers.

A similar difference between Wireshark and tshark output can be observed now and then for various fields of various protocols. As I am just a power user, not a developer, I am not deep enough into the subject to be able to explain why this happens for some fields and doesn’t for others.

So I’d recommend you to file a bug at Wireshark bugzilla.

The workaround for you is to translate the encoded values into time units yourself (1 = 200 ms, 2 = ?, …)

(04 Aug ‘16, 02:52) sindy
showing 5 of 21 show 16 more comments