Neels Hofmeyr | 5c7dcf9 | 2015-12-07 10:58:00 +0100 | [diff] [blame] | 1 | Here is a simple setup to test GTPHub operations. The IP addresses picked will |
| 2 | work well only on a system that creates local addresses (127.0.0.123) on the |
| 3 | fly (like linux) -- you may pick of course different IP addresses. |
| 4 | |
| 5 | Overview of the example setup: |
| 6 | |
| 7 | sgsnemu gtphub ggsn |
| 8 | 127.0.0.1 <--> 127.0.0.3 127.0.0.4 <--> 127.0.0.2 |
| 9 | |
| 10 | Prerequisites: openggsn. |
| 11 | |
| 12 | Have a local directory where you store config files and from which you launch |
| 13 | the GSNs and the hub (they will store restart counter files in that dir). |
| 14 | In it, have these config files: |
| 15 | |
| 16 | ggsn.conf: |
| 17 | |
| 18 | # GGSN local address |
| 19 | listen 127.0.0.2 |
| 20 | |
| 21 | # End User Addresses are picked from this range |
| 22 | net 10.23.42.0/24 |
| 23 | |
| 24 | pcodns1 8.8.8.8 |
| 25 | |
| 26 | logfile /tmp/foo |
| 27 | |
| 28 | gtphub.conf: |
| 29 | |
| 30 | gtphub |
| 31 | bind-to-sgsns 127.0.0.3 |
| 32 | bind-to-ggsns 127.0.0.4 |
| 33 | ggsn-proxy 127.0.0.2 |
| 34 | end |
| 35 | |
| 36 | |
| 37 | ( |
| 38 | You may omit the ggsn-proxy if GRX ares is working, or if you add the GRX |
| 39 | address and GGSN IP address to /etc/hosts something like: |
| 40 | |
| 41 | 127.0.0.2 internet.mnc070.mcc901.gprs |
| 42 | |
| 43 | ) |
| 44 | |
| 45 | |
| 46 | Once the config files are in place, start the programs, in separate terminals. |
| 47 | GGSN and SGSN need to be started with root priviliges to be able to create tun |
| 48 | interfaces. GTPHub may run as unprivileged user. |
| 49 | |
| 50 | The LD_LIBRARY_PATH below may be needed if OpenGGSN installed to /usr/local. |
| 51 | |
| 52 | |
| 53 | 1. GGSN: |
| 54 | |
| 55 | sudo -s |
| 56 | cd <your-test-dir> |
| 57 | LD_LIBRARY_PATH=/usr/local/lib /usr/local/bin/ggsn -f -c ./ggsn.conf |
| 58 | |
| 59 | 2. GTPHub: |
| 60 | |
| 61 | cd <your-test-dir> |
| 62 | path/to/openbsc/openbsc/src/gprs/osmo-gtphub -c gtphub.conf #-e 1 #for DEBUG level |
| 63 | |
Neels Hofmeyr | 5d5c31a | 2015-12-07 11:07:22 +0100 | [diff] [blame] | 64 | 3. SGSN tests: |
Neels Hofmeyr | 5c7dcf9 | 2015-12-07 10:58:00 +0100 | [diff] [blame] | 65 | |
| 66 | sudo -s |
| 67 | cd <your-test-dir> |
Neels Hofmeyr | 5d5c31a | 2015-12-07 11:07:22 +0100 | [diff] [blame] | 68 | /usr/local/bin/sgsnemu --createif -l 127.0.0.1 -r 127.0.0.3 --imsi 420001214365100 --contexts=3 |
| 69 | |
| 70 | Add more SGSNs using different IMSIs and local ports (if the same IMSI is used, |
| 71 | the GGSN will reuse TEIs and tunnels will be discarded automatically): |
| 72 | |
| 73 | /usr/local/bin/sgsnemu --createif -l 127.0.0.11 -r 127.0.0.3 --imsi 420001214365300 --contexts=3 |
Neels Hofmeyr | 5c7dcf9 | 2015-12-07 10:58:00 +0100 | [diff] [blame] | 74 | |
| 75 | This shows the basic setup of GTPHub. Testing internet traffic via sgsnemu |
| 76 | still needs some effort to announce a mobile subscriber or the like (I have |
| 77 | used a real BTS, osmo-sgsn and a testing SIM in a web phone, instead). |
| 78 | |
Neels Hofmeyr | 5d5c31a | 2015-12-07 11:07:22 +0100 | [diff] [blame] | 79 | The core capability of GTPHub is to manage more than two GSNs, e.g. an SGSN |
| 80 | contacting various GGSNs over the single GTPHub link. You would configure the |
| 81 | SGSN to use one fixed GGSN (sending to gtphub) and gtphub will resolve the |
| 82 | GGSNs once it has received the messages. So the SGSN may be behind NAT (add |
| 83 | "sgsn-use-sender" to gtphub.conf) and communicate to various GGSNs over a |
| 84 | single link to gtphub. |
| 85 | |
Neels Hofmeyr | 5c7dcf9 | 2015-12-07 10:58:00 +0100 | [diff] [blame] | 86 | I hope this helps to get you going. |
| 87 | Any suggestions/patches are welcome! |
| 88 | |
| 89 | ~Neels |
| 90 | |