Project

General

Profile

NanoBTS » History » Version 18

laforge, 02/19/2016 10:48 PM
add chapter on multi-TRX and the telnet port

1 18 laforge
[[PageOutline]]
2
3 11 laforge
The ip.access nanoBTS are small BTS with an A-bis over IP interface.  It's about the size of a WiFi access point.
4 1 laforge
5
There are multiple variants of the nanoBTS, most notably
6 18 laforge
 * the nanoBTS 900 for GSM900
7
  * supports FR, EFR, AMR(HR) speech codecs
8 11 laforge
  * supports TCH/F and TCH/H based telephony
9
  * supports GPRS
10 18 laforge
 * the nanoBTS 1800 for GSM1800, plus a GSM1900 variant thereof (almost identical hardware)
11 11 laforge
  * they support EDGE in addition to GPRS
12
13 13 laforge
A more detailed list of known nanoBTS models can be found at [wiki:nanoBTS_Models].
14
15 1 laforge
The A-bis over IP interface is spoken over a  100-base-TX Ethernet as physical layer.  Power over Ethernet (PoE) is used as
16 11 laforge
a power supply to the nanoBTS.
17
18
A-bis RSL and OML are encapsulated by a small additional header; each run in their own TCP session.  Instead of A-bis TRAU frames, the actual TCH speech data is inside RTP/UDP.  Details are indicated below.
19
20 18 laforge
The OpenBSC project has never received any protocol specification or other detailed information about the [wiki:nanoBTS_Internals nanoBTS hardware].  All information here and in the source code was derived by looking at protocol traces of actual nanoBTS installations.
21 11 laforge
22 6 laforge
== Deploying a new nanoBTS ==
23
24
The unconfigured ip.access nanoBTS needs to be configured as follows
25
 * The BTS is configued to automatically obtain an IP address via DHCP
26
 * The BTS is listening on UDP port 3006 for broadcast packets (e.g. should be found by ipaccess-find)
27
  * a typical response by ipaccess-find will be
28 7 laforge
{{{
29 6 laforge
Trying to find ip.access BTS by broadcast UDP...
30 1 laforge
MAC Address='00:01:02:03:04:05'  IP Address='192.168.100.123'  Unit ID='65535/0/0'  Location 1=''  Location 2='BTS_NBT131G'  Equipment Version='165a029_55'  Software Version='168a302_v142b13d0'  Unit Name='nbts-00-02-95-00-4E-B3'  Serial Number='00123456'  
31
}}}
32 11 laforge
 * The BTS is listening on TCP port 3006 for incoming Abis-over-IP connections. This is called ''Secondary OML Link''
33 1 laforge
 * The BTS has an unconfigured Unit ID (65535/0/0) and will refuse to work until a Unit ID has been set
34 11 laforge
 * You can set the Unit ID and Primarly OML IP using ipaccess-config as follows:
35 7 laforge
{{{
36
$ ./ipaccess-config -u 1801/0/0 -o 192.168.100.11 -r 192.168.100.122
37
ipaccess-config (C) 2009 by Harald Welte
38
This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY
39
40
Trying to connect to ip.access BTS ...
41
OML link established
42
setting Unit ID to '1801/0/0'
43
setting primary OML link IP to '192.168.100.11'
44
restarting BTS
45
Thu Apr 30 18:18:48 2009 <0020> abis_nm.c:2016 IPACCESS(0xf0): SET NVATTR ACK
46
Thu Apr 30 18:18:48 2009 <0020> abis_nm.c:2016 IPACCESS(0xf0): SET NVATTR ACK
47
}}}
48 1 laforge
 * Once a Unit ID and the Primary OML link IP address has been set, the BTS will try to connect to the BSC (tcp port 3002)
49
{{{
50
18:22:49.801584 IP 192.168.100.122.48000 > 192.168.100.11.3002: Flags [S], seq 3405259716, win 16000, options [mss 1460], length 0
51
}}}
52
53 18 laforge
=== nanoBTS multi-TRX Setup ===
54
55
The nanoBTS can be operated in so-called ''multi-TRX'' mode, where you can run multiple units as multiple transceivers of one
56
BTS instead of each unit  being a BTS in itself.  The advantage of this is that you save capacity, as every BTS only needs one
57
timeslot for BCCH/CCCH, even if it has multiple transceivers.
58
59
To use this mode, a set of special cables are used to connect the nanoBTS stack:
60
 * The TIB cable (two RJ69 plugs with a slight dent milled away), connecting TIB OUT of one BTS with TIB IN of the other
61
 * A RF cable, connecting the AUX plug of one BTS with the hidden connector between the cooling fins on the back
62
63
You can stack a total of up to four nanoBTS this way.
64
65
To make the units behave as members of an actual stack, you have to set their unit IDs accordingly:
66
 * The Location and BTS part (first and second) have to be identical among all BTS in a stack
67
 * The TRX id needs to be 0 for the first, and 1...3 for the others, respectively
68
 * So e.g. TRX0 = 23/0/0 and TRX1 = 23/0/1
69
70
On the [wiki:OpenBSC] software side, you simply configure a BTS with multiple TRX, similar to a BS-11 dual-TRX setup.
71
72 1 laforge
== A-bis over IP protocol ==
73
74
This is the description of the A-bis over IP protocol as we have reverse engineered it by looking at protocol traces between a commercial BSC and a nanoBTS.  We did not and do not have access to the protocol specification of ip.access.
75 2 laforge
76 1 laforge
=== Common Header ===
77
78 2 laforge
Inside the TCP and UDP packets connection, every message is prefixed by a three-byte header:
79 1 laforge
{{{
80
struct ipaccess_head {
81 12 tnt
        u_int16_t len; /* network byte order */
82 1 laforge
        u_int8_t proto;
83
} __attribute__ ((packed));
84
}}}
85
86
where the first byte is zero, the second byte indicates the length of the message payload following the header, and the third byte indicates the protocol.  The following protocol values have been observed:
87
88
 * 0x00 RSL messages as per GSM 08.58
89
 * 0xfe ip.access specific messages
90
 * 0xff OML messages as per GSM 12.21
91
92
The ip.access specific messages that we have seen are of the following message types (message type is the first byte behind the ipaccess_head):
93
 * 0x00 PING (from BTS to BSC)
94
 * 0x01 PONG (from BSC to BTS), indicates that the link is still alive
95
 * 0x04 Identity Get (from BSC to BTS)
96
 * 0x05 Identity Response (from BTS to BSC)
97
 * 0x06 Identity confirm (both ways, BTS->BSC is a request, BSC->BTS is acknowledgement)
98 2 laforge
99
=== OML Signalling Link ===
100
101
After obtaining an IP address from DHCP, the nanoBTS will attempt to make TCP connections to a IP address and port number pre-configured in the device.  The standard port seems to be 3002.
102
103
==== vendor-specific OML messages ====
104
105
vendor-specific OML messages use a specific format but are closely following the spirit of GSM TS 12.21.
106
107
Look at the ''abis_nm_ipaccess_msg()'' function in ''abis_nm.c'' if you want to know the details.
108
109
=== RSL Signalling Link ===
110
111
There is a vendor-specific OML command 0xe0, which basically corresponds to what the usual ''Connect Terrestrial Signalling'' does.  Instead of connecting te RSL link to a specific TEI on a E1 timeslot, it connects the RSL link to a specified TCP port (and optionally IP address).
112
113
After this command is issued (and acknowledged by 0xe1), the BTS will initiate a TCP connection to the specified TCP port.
114 1 laforge
115 3 laforge
==== vendor-specific RSL messages ====
116
117
There are a couple of vendor-specific RSL messages extending 08.58 to accommodate the IP-based link.
118
119
They all use the GSM 08.85 message discriminator 0x7e
120
121 15 laforge
===== 0x70 Create Connection (CRCX in MGCP terms) =====
122 3 laforge
123
This command binds a given on-air timeslot to a BTS-local RTP port.
124
125
Attributes:
126
 * 0x01 GSM 08.58 Channel Number (same as BIND)
127
128 15 laforge
===== 0x71 Create Connection (CRCX in MGCP terms) ACK =====
129 3 laforge
130
This message (BTS->BSC) acknowledges the BTS-local bind.
131
132
Attributes:
133
 * 0x01 GSM 08.58 Channel Number (same as BIND)
134
 * 0xf8 unknown, maybe something like local RTP instance number, fixed length two bytes.
135
 * 0xf3 local RTP port number, fixed length 2 bytes
136
 * 0xf5 local IP address, fixed length 4 bytes
137
 * 0xfc unknown, fixed length 1 byte, content 0x7f
138
139 15 laforge
===== 0x73 Modify Connection (MDCX in MGCP terms) =====
140 3 laforge
141
This command (BSC->BTS) instructs the BTS to connect a given GSM channel (timeslot) to the remote end
142
143
Attributes:
144
 * 0x01 GSM 08.58 Channel Number (on-air timeslot)
145
 * 0xf8 unknown, maybe something like local RTP instance number, fixed length two bytes.
146
 * 0xf0 remote IP address, fixed length 4 bytes
147
 * 0xf1 remote RTP port number, fixed length 2 bytes
148
 * 0xf4 unknown, fixed length 1 byte, content 0x01
149
 * 0xfc unknown, fixed length 1 byte, content 0x7f
150
151 15 laforge
===== 0x74 Modify Connection (MDCX in MGCP terms) ACK =====
152 3 laforge
153
This message (BTS->BCS) confirms the successful CONNECT operation
154
155
Attributes:
156
 * 0x01 GSM 08.58 Channel Number (on-air timeslot)
157
 * 0xf8 unknown, maybe something like local RTP instance number, fixed length two bytes.
158
159
===== 0x76 DISCONNECT INDICATION =====
160
161
This message (BTS->BSC) indicates a terminated RTP connection
162
163
Attributes:
164
 * 0x01 GSM 08.58 Channel Number (on-air timeslot)
165
 * 0xf8 unknown, maybe something like local RTP instance number, fixed length two bytes.
166
 * 0xf6 unknown, TLV with one byte length, content zero
167
 * 0x1a GSM 08.58 Cause
168
169
170 1 laforge
=== TRAU link ===
171
172
Not yet reverse engineered.
173 4 laforge
174 5 laforge
There are streams of RTP-in-UDP packets to the ''remote IP'' and ''remote port'' that were indicated by the ''CONNECT'' message in RSL.
175
176
There are also regular RTCP packets on the port number plus 1.
177
178
==== RTP ====
179
180
The packets are according to RFC1889 (RTP Version 2), the payload type is set to 127, which is a dynamically allocated payload type.
181
182
They have sequence number and timestamp as well as 31 bytes of payload.  It seems the payload first 4 bits are always 0xC, reducing
183 8 laforge
the actual payload to 30.5 bytes.
184 5 laforge
185 8 laforge
As it seems, the FR and EFR RTP payload format follows the specification in section 4.5.8 and 4.5.9 of RFC3551 (
186
see http://www.ietf.org/rfc/rfc3551.txt)
187 5 laforge
==== RTCP ====
188
189
It seems that about every 3 seconds there is a RTCP packet, containing a source description and sender report.
190
191 4 laforge
== Wireshark dissector ==
192
193 10 laforge
We have developed a dissector for the popular wireshark network protocol analyzer.   The dissector has been merged into
194 14 laforge
the current wireshak development versions.
195 5 laforge
196 1 laforge
Furthermore, there is a patch for adding the ip.access specific RSL extensions to the packet-rsl.c dissector at http://bs11-abis.gnumonks.org/trac/browser/wireshark/rsl-ipaccess.patch
197 10 laforge
198
There's also a A-bis OML dissector plugin available from http://bs11-abis.gnumonks.org/trac/browser/wireshark/abis_oml.patch
199 4 laforge
200
Once the code has stabilized more, we plan to submit this for inclusion into wireshark mainline.
201 16 laforge
202
== Firmware Format ==
203
204
The file format is called "SDP" and it is a container that contain other SDP parts. To my knowledge the separate subparts are for separate functionality (e.g. bootcode) and for the different ProcessingUnits. It appears that only the first SDP header is stripped and that the remain is sent as one part to the BTS.
205
206
The outer SDP header appears to be
207
{{{
208 17 laforge
struct header1 {
209 16 laforge
    char header[4] = " SDP";
210
    char version[4] = { 0x10, 0x02, 0x0, 0x0 };
211
    u_int32_t total_header_length; // (bigendian)
212
    u_int32_t total_file_length;    // (bigendian)
213
    char string[20]; // up to 20 chars for a string;
214
    ... stuff not yet understood, but it appears to list the compatible bts
215 1 laforge
    ... it also includes a date string (viewable in a hex editor)
216 17 laforge
};
217
}}}
218
219
At the end of the total_header_length there is another " SDP" start with a similar header...
220
221
{{{
222
struct header2 {
223 1 laforge
     char header[4] = " SDP";
224
     char version[4] = { 0x10, 0x20, 0x0, 0x0 };
225
     ... not understood yet...
226
};
227
}}}
228 18 laforge
229
== Telnet Debug Port ==
230
231
When you set the NVRAM flag 0x400 (e.g. using {{{ipaccess-config -n 0x400/0x400 BTS_IP}}}), a special telnet console will
232
be activated on TCP port 3210 of the nanoBTS.
233
234
However, there is some kind of shared-secret challenge-response MD5 authentication required - otherwise the BTS will simply
235
disconnect you after a few seconds.
236
237
We have implemented a modified telnet client to add support for this challenge-response mode, and you can obtain it from
238
{{{
239
git clone git://openbsc.gnumonks.org:libtelnet.git
240
}}}
241
242
Simply build this package using normal autotools (it also needs the openssl-devel package for MD5) and type
243
{{{
244
./util/ipaccess-telnet BTS_IP 3210
245
}}}
246
and you are connected to it.
Add picture from clipboard (Maximum size: 48.8 MB)