Project

General

Profile

OpenBSC GPRS » History » Version 8

Anonymous, 02/19/2016 10:47 PM

1 1 tnt
[[PageOutline]]
2
3
= OpenBSC GPRS/EDGE Setup page =
4
5
== Pre-requisites ==
6
7
 * A nano BTS with GPRS or EDGE support. BS-11 are not supported (yet?)
8 6 tnt
 * A compiled GGSN from OpenGGSN (make sure to use the osmocom version. git://git.osmocom.org/openggsn.git )
9 2 tnt
 * A working and up-to-date OpenBSC (see [wiki:Building_OpenBSC])
10 3 tnt
   * You will need to (re-)build it after having installed OpenGGSN so that the `libgtp` is detected and the SGSN binary `osmo-sgsn` built.
11 8 tnt
 * A custom SIM for your network
12
   * Currently osmo-sgsn refuses all roaming, so you need a SIM that matches your custom MCC/MNC network
13 1 tnt
14
== Setup ==
15
16 3 tnt
First a little picture to illustrate the different elements and their interactions :
17 1 tnt
18 8 tnt
[[Image(gprs.2.png)]]
19 1 tnt
20
=== OpenBSC configuration ===
21
22 3 tnt
The first step is to configure OpenBSC for gprs support. Add this to the `network/bts` node in `openbsc.cfg`:
23 1 tnt
{{{
24 3 tnt
gprs mode gprs
25
gprs routing area 0
26
gprs cell bvci 2
27
gprs nsei 101
28
gprs nsvc 0 nsvci 101
29
gprs nsvc 0 local udp port 23000
30
gprs nsvc 0 remote udp port 23000
31
gprs nsvc 0 remote ip 192.168.0.128
32 1 tnt
}}}
33
34 3 tnt
The `gprs nsvc 0 remote` entries `192.168.0.128:23000` is the IP/port of the machine running the SGSN as seen from the BTS. It will be sent by OpenBSC to the BTS in the configration phase and the BTS will connect back to the SGSN.
35
36
The second step is to allocate some timeslots to packet data. For this, just change the 1 or more `network/bts/trx/timeslot` nodes using :
37 2 tnt
{{{
38 3 tnt
phys_chan_config PDCH
39 2 tnt
}}}
40
41 1 tnt
42
=== Osmocom SGSN configuration ===
43 2 tnt
44 4 tnt
Here's a sample SGSN configuration file `osmo-sgsn.cfg` with some explanations :
45
46 2 tnt
{{{
47
!
48
! Osmocom SGSN configuration
49
!
50
!
51
line vty
52
 no login
53
!
54
sgsn
55
 gtp local-ip 192.168.1.128
56
 ggsn 0 remote-ip 192.168.1.129
57
 ggsn 0 gtp-version 1
58
!
59
ns
60
 timer tns-block 3
61
 timer tns-block-retries 3
62
 timer tns-reset 3
63
 timer tns-reset-retries 3
64
 timer tns-test 30
65
 timer tns-alive 3
66
 timer tns-alive-retries 10
67
 encapsulation udp local-ip 192.168.0.128
68
 encapsulation udp local-port 23000
69
 encapsulation framerelay-gre enabled 0
70
!
71
bssgp
72
!
73
}}}
74 1 tnt
75 4 tnt
 * The `gtp local-ip` entry is the local IP the SGSN will bind to.
76
 * The `ggsn 0 remote-ip` entry if the remote IP of the GGSN. The SGSN will connect to it.
77
 * Those two IPs '''must''' be different even if you're running both processes on the same machine. A solution for that is to put several IP aliases on the same network interface.
78
 * The `encapsulation` settings must be the same IP/port than you've setup in `openbsc.cfg`
79
80 2 tnt
=== OpenGGSN configuration ===
81
82 4 tnt
The ggsn.conf file is pretty well documented. What is mostly of interest here is :
83
84
 * The configuration of the GTP link. (Must match the `ggsn 0 remote-ip` entry in `osmo-sgsn.cfg`)
85
86 2 tnt
{{{
87
# TAG: listen
88
# Specifies the local IP address to listen to
89
listen 192.168.1.129
90
}}}
91
92 4 tnt
 * The configuration given to phones, IP pool & DNS.
93
94 2 tnt
{{{
95
# TAG: dynip
96
# Dynamic IP address pool.
97
# Used for allocation of dynamic IP address when address is not given
98
# by HLR.
99
# If this option is not given then the net option is used as a substitute.
100
dynip 192.168.254.0/24
101
102
# TAG: pcodns1/pcodns2
103
# Protocol configuration option domain name system server 1 & 2.
104
pcodns1 208.67.222.222
105
pcodns2 208.67.220.220
106
}}}
107
108
=== Network configuration ===
109
110
You will also need to configure some networking rules to allow connectivity from `tun0`. Look up linux networking/nat howtos on google.
111
The basic setup for testing only in a safe environment would be :
112
113
{{{
114
bash# echo 1 > /proc/sys/net/ipv4/ip_forward
115
bash# iptables -A POSTROUTING -s 192.168.254.0/24 -t nat -o eth0 -j MASQUERADE
116
}}} 
117
118
(replace `eth0` by the interface providing your machine connectivity)
119
120
== Running ==
121 1 tnt
122 4 tnt
Just start the three processes :
123
 * `ggsn`
124
 * `osmo-sgsn`
125 7 laforge
 * `osmo-nitb`
126 4 tnt
127
You can access vty from 
128 6 tnt
 * OpenBSC on port 4242 See [wiki:osmo-nitb_VTY]
129 5 tnt
 * SGSN on port 4245. See [wiki:osmo-sgsn_VTY]
Add picture from clipboard (Maximum size: 48.8 MB)