Project

General

Profile

OsmoPCU Debugging » History » Version 2

laforge, 07/28/2017 01:27 PM

1 2 laforge
{{>toc}}
2
3 1 laforge
h1. OsmoPCU Debugging
4
5
In order to debug issues with [[OsmoPCU]], it is important to have protocol traces from all related interfaces.
6
7
Fundamentally, this includes
8
# the Gb interface (NS-over-IP from PCU to SGSN, showing NS/BSSGP/LLC and higher layer protocols)
9
#* this one is easy, you just have to capture the UDP traffic on the ip/port as specified in your configuration for this NS-VC (from [[OsmoBSC:]] or [[OsmoNITB:]]
10
# the Um interface (RLC/MAC between MS and PCU)
11
#* Um frames transmitted/received via OsmoPCU (on PACCH, PTCCH, PDTCH)
12
#* Um frames transmitted/received via OsmoBTS on behalf of OsmoPCU (on PCH and AGCH)
13
14
The instructions below will help you to set this up
15
16 2 laforge
h2. Required configuration
17 1 laforge
18
h3. NS-over-IP traffic
19
20 2 laforge
Simply set up @tcpdump@ to capture the UDP port you're using for the NS-VC.  If you're using port 23000 (which is the default), the capture filter would include @udp port 23000@.
21 1 laforge
22
h3. Um frames of OsmoPCU via GSMTAP
23
24
You must call the specific [[OsmoPCU:]] binary for your BTS hardware with the @-i@ option to enable GSMTAP and specify a remote IP address where to send it to[1].
25
The IP address could be the localhost/loopback device, in case you want to capture packets locally.
26
27
For example, on a sysmoBTS device the normal command to start osmo-bts (by the systemd service) is:
28
29
 /usr/bin/osmo-pcu -c /etc/osmocom/osmo-pcu.cfg
30
31
but we now need to start it as
32
33
 /usr/bin/osmo-pcu -c /etc/osmocom/osmo-pcu.cfg -i 127.0.0.1
34
35 2 laforge
In [[OsmoPCU:]] versions later than "July 21, 2017":http://git.osmocom.org/osmo-pcu/commit/?id=717cdf540558b95f31e4c8ea58d0fc9e06429228 you have to specify which categories of PCU blocks you want to log via GSMTAP.  Older versions will log all blocks, which includes all dummy blocks that make reading the capture files harder:
36 1 laforge
37 2 laforge
The osmo-pcu.cfg file will have to include a section like this:
38
<pre>
39
pcu
40
 ...
41
 gsmtap-category dl-ctrl
42
 gsmtap-category dl-data-gprs
43
 gsmtap-category dl-data-egprs
44
 gsmtap-category ul-ctrl
45
 gsmtap-category ul-data-gprs
46
 gsmtap-category ul-data-egprs
47
 ...
48
</pre>
49
50
The above will log all uplink and downlink control and traffic blocks.  Depending on your needs, a sub-set may be sufficient.
51
52 1 laforge
h3. Um frames of OsmoBTS via GSMTAP
53
54
You must call the specific [[OsmoBTS:]] binary for your BTS hardware with the @-i@ option to enable GSMTAP and specify a remote IP address where to send it to.
55
The IP address could be the localhost/loopback device, in case you want to capture packets locally.
56
57
For example, on a sysmoBTS device the normal command to start osmo-bts (by the systemd service) is:
58
59
 /usr/bin/osmo-bts-sysmo -s -c /etc/osmocom/osmo-bts.cfg -M
60
61
but we now need to start it as
62
63
 /usr/bin/osmo-bts-sysmo -s -c /etc/osmocom/osmo-bts.cfg -M -i 127.0.0.1
64
65
In osmo-bts.cfg you need to enable the following gsmtap SAPIs:
66
<pre>
67
bts 0
68
 ...
69
 gsmtap-sapi ccch
70
 gsmtap-sapi rach
71
 gsmtap-sapi agch
72
 gsmtap-sapi pch
73
 ...
74
</pre>
75 2 laforge
76
fn1. As of this writing, OsmoPCU actually will send GSMTAP automatically by default to 127.0.0.1 but this is scheduled to change.  Explicitly specifying the GSMTAP via the command-line argument as described here will work with both older and future versions of [[OsmoPCU:]]
77
78
h2. Capturing
79
80
h3. Manually on the BTS itself:
81
82
You can use tcpdump to write a pcap file that includes all related traffic using e.g.
83
84
 tcpdump -ni any -s0 -w/tmp/my_gprs.pcap udp port 23000 or udp port 4729 or tcp port 3002 or tcp port 3003 or tcp port 5000
85
86
where
87
* @udp port 23000@ refers to the Gb traffic (your port number might be different)
88
* @udp port 4729@ refers to the GSMTAP traffic generated by both [[OsmoPCU:]] as well as [[OsmoBTS:]]
89
* @tcp port 3002 or tcp port 3003@ refers to the Abis/IP traffic between [[OsmoBTS:]] and [[OsmoBTS:]] or [[OsmoNITB:]]
90
* @tcp port 5000@ refers to the A/SCCPlite traffic between [[OsmoBSC:]] and the MSC (your port number might be different.
91
92
h3. Using @osmo-pcap-client@
93
94
FIXME
Add picture from clipboard (Maximum size: 48.8 MB)