Project

General

Profile

OpenBSC GPRS » History » Version 5

tnt, 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
 * A compiled GGSN from OpenGGSN ( http://sourceforge.net/projects/ggsn/ )
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 1 tnt
12
== Setup ==
13
14 3 tnt
First a little picture to illustrate the different elements and their interactions :
15
16 1 tnt
[[Image(gprs.png)]]
17
18
=== OpenBSC configuration ===
19
20 3 tnt
The first step is to configure OpenBSC for gprs support. Add this to the `network/bts` node in `openbsc.cfg`:
21 1 tnt
{{{
22 3 tnt
gprs mode gprs
23
gprs routing area 0
24
gprs cell bvci 2
25
gprs nsei 101
26
gprs nsvc 0 nsvci 101
27
gprs nsvc 0 local udp port 23000
28
gprs nsvc 0 remote udp port 23000
29
gprs nsvc 0 remote ip 192.168.0.128
30 1 tnt
}}}
31
32 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.
33
34
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 :
35 2 tnt
{{{
36 3 tnt
phys_chan_config PDCH
37 2 tnt
}}}
38
39 1 tnt
40
=== Osmocom SGSN configuration ===
41 2 tnt
42 4 tnt
Here's a sample SGSN configuration file `osmo-sgsn.cfg` with some explanations :
43
44 2 tnt
{{{
45
!
46
! Osmocom SGSN configuration
47
!
48
!
49
line vty
50
 no login
51
!
52
sgsn
53
 gtp local-ip 192.168.1.128
54
 ggsn 0 remote-ip 192.168.1.129
55
 ggsn 0 gtp-version 1
56
!
57
ns
58
 timer tns-block 3
59
 timer tns-block-retries 3
60
 timer tns-reset 3
61
 timer tns-reset-retries 3
62
 timer tns-test 30
63
 timer tns-alive 3
64
 timer tns-alive-retries 10
65
 encapsulation udp local-ip 192.168.0.128
66
 encapsulation udp local-port 23000
67
 encapsulation framerelay-gre enabled 0
68
!
69
bssgp
70
!
71
}}}
72 1 tnt
73 4 tnt
 * The `gtp local-ip` entry is the local IP the SGSN will bind to.
74
 * The `ggsn 0 remote-ip` entry if the remote IP of the GGSN. The SGSN will connect to it.
75
 * 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.
76
 * The `encapsulation` settings must be the same IP/port than you've setup in `openbsc.cfg`
77
78 2 tnt
=== OpenGGSN configuration ===
79
80 4 tnt
The ggsn.conf file is pretty well documented. What is mostly of interest here is :
81
82
 * The configuration of the GTP link. (Must match the `ggsn 0 remote-ip` entry in `osmo-sgsn.cfg`)
83
84 2 tnt
{{{
85
# TAG: listen
86
# Specifies the local IP address to listen to
87
listen 192.168.1.129
88
}}}
89
90 4 tnt
 * The configuration given to phones, IP pool & DNS.
91
92 2 tnt
{{{
93
# TAG: dynip
94
# Dynamic IP address pool.
95
# Used for allocation of dynamic IP address when address is not given
96
# by HLR.
97
# If this option is not given then the net option is used as a substitute.
98
dynip 192.168.254.0/24
99
100
# TAG: pcodns1/pcodns2
101
# Protocol configuration option domain name system server 1 & 2.
102
pcodns1 208.67.222.222
103
pcodns2 208.67.220.220
104
}}}
105
106
=== Network configuration ===
107
108
You will also need to configure some networking rules to allow connectivity from `tun0`. Look up linux networking/nat howtos on google.
109
The basic setup for testing only in a safe environment would be :
110
111
{{{
112
bash# echo 1 > /proc/sys/net/ipv4/ip_forward
113
bash# iptables -A POSTROUTING -s 192.168.254.0/24 -t nat -o eth0 -j MASQUERADE
114
}}} 
115
116
(replace `eth0` by the interface providing your machine connectivity)
117
118
== Running ==
119 1 tnt
120 4 tnt
Just start the three processes :
121
 * `ggsn`
122
 * `osmo-sgsn`
123
 * `bsc_hack`
124
125
You can access vty from 
126
 * OpenBSC on port 4242 See [wiki:bsc_hack_VTY]
127 5 tnt
 * SGSN on port 4245. See [wiki:osmo-sgsn_VTY]
Add picture from clipboard (Maximum size: 48.8 MB)