I got a point where I am able to route packets using the sgsnemu to the ggsn, but when I link OpenBTS I get an error.

I have the following setup .
I even tried to setup without the tap0 interface but I get the same reponse even without it.

I enable routing using
sudo iptables -A POSTROUTING -s 192.168.0.0/24 -t nat -o eth1 -j MASQUERADE and set ip_forward to 1

I captured packets using wireshark. I get a packet sent from 192.168.0.1 to 192.168.0.255(broadcast ip of the 192.168.0.0  network) and it finds no destination on this.

Kindly let me know where am I going wrong.

-----------------------------------------------------------------------------------------------------------
./OpenBTS
Welcome to OpenBTS.  Type "help" to see available commands.
1351077029.779221 3045849968: TX: [ BTS -> PCU ] PhConnectInd: ARFCN: 51 TN: 7 TSC: 2

OpenBTS> 1351077066.880720 3045051248: RA=0x7a when=0:255422 age=5 delay=0.625000 RSSI=-5.000000
1351077066.881072 3045051248: TX: [ BTS -> PCU ] PhRaInd: RA: 122 FN: 255422 TA: 1
1351077066.881403 3045849968: RX: [ BTS <- PCU ] AGCH: primitive=UNIT_DATA raw=(063f100f40337a01d80000c8001d002b2b2b2b2b2b2b)
1351077067.148341 3065334640: TX: [ BTS -> PCU ] PhDataInd: Payload Type = RLC data block raw=(0801017d31b50101c001080103f4e10071080308091010)
1351077067.167253 3065334640: TX: [ BTS -> PCU ] PhDataInd: Payload Type = RLC data block raw=(0401037d31b5013254769810fffffffffe001019f3422b)
1351077067.184605 3065334640: TX: [ BTS -> PCU ] PhDataInd: Payload Type = RLC data block raw=(0001043d7d31b5013ff59622c510003e5666bc808f57c6)
1351077067.208620 3065334640: TX: [ BTS -> PCU ] PhDataInd: Payload Type = RLC data block raw=(0801017d31b50101c001080103f4e10071080308091010)
1351077067.225870 3065334640: TX: [ BTS -> PCU ] PhDataInd: Payload Type = RLC data block raw=(0401037d31b5013254769810fffffffffe001019f3422b)
1351077067.244924 3065334640: TX: [ BTS -> PCU ] PhDataInd: Payload Type = RLC data block raw=(0001043d7d31b5013ff59622c510003e5666bc808f57c6)
-----------------------------------------------------------------------------------------------------------
sudo ./osmo-pcu

No config file: 'osmo-pcu.cfg' Using default config.
<0001> pcu_l1_if.cpp:332 BTS available
<0001> pcu_l1_if.cpp:82 Sending activate request: trx=0 ts=7
<0001> pcu_l1_if.cpp:427 PDCH: trx=0 ts=7
<0001> pcu_l1_if.cpp:254 RACH request received: sapi=1 qta=1, ra=122, fn=255422
<0002> gprs_rlcmac.cpp:252 Allocating UL TBF: TFI=0 TRX=0 MS_CLASS=0
<0002> gprs_rlcmac_data.cpp:1108 TX: START TFI: 0 Immediate Assignment Uplink (AGCH)
<0002> gprs_rlcmac_data.cpp:1804 Got IMM.ASS confirm, but rest octets do not start with bit sequence 'HH01' (Packet Downlink Assignment)
<0005> gprs_rlcmac_data.cpp:844 Decoded premier TLLI=0x7d31b501 of UL DATA TBF=0.
<0005> gprs_rlcmac_data.cpp:707 Complete UL frame for TBF=0: len=47
<0008> gprs_rlcmac.cpp:1548 LLC [PCU -> SGSN] TFI: 0 TLLI: 0x7d31b501 len=47
<0002> gprs_rlcmac.cpp:746 Free UL TBF=0 with TLLI=0x7d31b501.
<0001> pcu_l1_if.cpp:254 RACH request received: sapi=1 qta=0, ra=124, fn=258676
<0002> gprs_rlcmac.cpp:252 Allocating UL TBF: TFI=0 TRX=0 MS_CLASS=0
<0002> gprs_rlcmac_data.cpp:1108 TX: START TFI: 0 Immediate Assignment Uplink (AGCH)
<0002> gprs_rlcmac_data.cpp:1804 Got IMM.ASS confirm, but rest octets do not start with bit sequence 'HH01' (Packet Downlink Assignment)
--------------------------------------------------------------------------------------------------------------------
sudo ./osmo-sgsn -c osmo_sgsn.cfg

<0011> gprs_ns.c:171 NSVCI=65534 Creating NS-VC
--------------------------------------------------------------------------------------------------------------------
sudo ggsn -c ../examples/ggsn.conf

cmdline_parser_configfile
listen: 127.0.0.2
conf: ../examples/ggsn.conf
fg: 1
debug: 1
qos: 0x0b921f
apn: internet
net: 192.168.0.0/24
dynip: 192.168.0.0/24
pidfile: /var/run/ggsn.pid
statedir: ./
timelimit: 0
gtpclient: Initialising GTP tunnel
openggsn[6451]: GTP: gtp_newgsn() started
Creating tun interface
Setting tun IP address
Received packet from tun!
Received packet with no destination!!!
---------------------------------------------------------------------------------------------------------------------
ifconfig
eth0      Link encap:Ethernet  HWaddr 90:f6:52:00:e0:a9 
          inet addr:192.168.10.1  Bcast:192.168.10.255  Mask:255.255.255.0
          inet6 addr: fe80::92f6:52ff:fe00:e0a9/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:12285953 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6738263 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:660669706 (660.6 MB)  TX bytes:4024237614 (4.0 GB)
          Interrupt:21 Base address:0xe000

eth1      Link encap:Ethernet  HWaddr 78:ac:c0:b1:ac:f4 
          inet addr:130.237.20.241  Bcast:130.237.20.255  Mask:255.255.255.0
          inet6 addr: fe80::7aac:c0ff:feb1:acf4/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:474972 errors:0 dropped:0 overruns:0 frame:0
          TX packets:36245 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:125013977 (125.0 MB)  TX bytes:5818732 (5.8 MB)
          Memory:fc000000-fc020000

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:2093846 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2093846 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:417616041 (417.6 MB)  TX bytes:417616041 (417.6 MB)

tap0      Link encap:Ethernet  HWaddr 26:15:f7:6f:bd:20 
          inet addr:127.0.0.2  Bcast:127.255.255.255  Mask:255.0.0.0
          inet6 addr: fe80::2415:f7ff:fe6f:bd20/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:392 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 
          inet addr:192.168.0.1  P-t-P:192.168.0.1  Mask:255.255.255.0
          UP POINTOPOINT RUNNING  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:0 (0.0 B)  TX bytes:64 (64.0 B)
-----------------------------------------------------------------------------------------------------------------------
ggsn.conf

fg
debug
pidfile /var/run/ggsn.pid
statedir ./
listen 127.0.0.2
net 192.168.0.0/24
dynip 192.168.0.0/24
----------------------------------------------------------------------------------------------------------------------
somo_sgsn.cfg

line vty
 no login
sgsn
 gtp local-ip 192.168.10.1
 ggsn 0 remote-ip 127.0.0.2
 ggsn 0 gtp-version 1
ns
 timer tns-block 3
 timer tns-block-retries 3
 timer tns-reset 3
 timer tns-reset-retries 3
 timer tns-test 30
 timer tns-alive 3
 timer tns-alive-retries 10
 encapsulation udp local-ip 192.168.10.1
 encapsulation udp local-port 23000
 encapsulation framerelay-gre enabled 0
bssgp
------------------------------------------------------------------------------------------------------------------------


On Tue, Oct 23, 2012 at 3:57 PM, Pavan K <pavan42800@gmail.com> wrote:
Do we have to use a cfg file to link the SGSN to the osmo-pcu? I could not find any sample or example cfg file if I have to link it with the IP. 

-Pavan

On Mon, Oct 1, 2012 at 9:59 AM, Pavan K <pavan42800@gmail.com> wrote:
Could you kindly point me to a resource which can help me setup the correct configuration (A wiki or a write up). I could run the latest branch of OpenBTS from http://wush.net/svn/range/software/public and I followed the same paths for configuration setup for the gprs-exp branch after it compiled successfully. 

So I am not sure where the setup fails. 


On Mon, Oct 1, 2012 at 3:45 AM, Alexander Chemeris <alexander.chemeris@gmail.com> wrote:
I think this backtrace means that one of mandatory configuration files
is not at the right place or don't have right permissions. OpenBTS
crashes at the static initialization area and this means something is
_very_ wrong.

On Tue, Sep 25, 2012 at 11:04 AM, Pavan K <pavan42800@gmail.com> wrote:
> I get the following full trace.
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x00007ffff72d8263 in
> std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)
> () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
> (gdb) bt full
> #0  0x00007ffff72d8263 in
> std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)
> () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
> No symbol table info available.
> #1  0x00000000004c10de in _M_insert (__position=..., __x=<optimized
> out>, this=<optimized out>) at
> /usr/include/c++/4.6/bits/stl_list.h:1516
>         __tmp = 0x78e150
> #2  push_back (__x=<optimized out>, this=0x77f8c0) at
> /usr/include/c++/4.6/bits/stl_list.h:988
> No locals.
> #3  addAlarm (s=<optimized out>) at Logger.cpp:144
>         maxAlarms = <optimized out>
> #4  0x00000000004c17b4 in Log::~Log (this=0x7fffffffe1a0,
> __in_chrg=<optimized out>) at Logger.cpp:156
> No locals.
> #5  0x000000000048f039 in Control::TMSITable::TMSITable
> (this=0x775bb0, wPath=0x78ebc8 "/var/run/OpenBTS/TMSITable.db") at
> TMSITable.cpp:70
>         rc = <optimized out>
> #6  0x000000000041455a in __static_initialization_and_destruction_0
> (__initialize_p=<optimized out>, __priority=<optimized out>) at
> OpenBTS.cpp:76
> No locals.
> #7  _GLOBAL__sub_I_gConfig () at OpenBTS.cpp:390
> No locals.
> #8  0x000000000052279d in __libc_csu_init ()
> No symbol table info available.
> #9  0x00007ffff6a562a0 in __libc_start_main () from
> /lib/x86_64-linux-gnu/libc.so.6
> No symbol table info available.
> #10 0x0000000000416c79 in _start ()
> No symbol table info available.
>
>
> I already tried to see the symbols with an nm on
> /lib/x86_64-linux-gnu/libc.so.6 and it exits saying no symbols
>
> I checked the make file in Openbts to see if they were being stripped
> but I could not get anywhere with that.
>
> I am on Ubuntu 11.10 with g++ 4.6.1
>
> --
> /Pavan
>
> On Tue, Sep 25, 2012 at 3:56 PM, Pavan K <pavan42800@gmail.com> wrote:
>> Max,
>>
>> I run it as sudo coz of the file access in /etc/OpenBTS I have to add them
>> in the usergroup. i will do it. The branch is not working so trying to fix
>> that first.
>>
>> --
>> /Pavan
>>
>> On Tue, Sep 25, 2012 at 2:33 PM, Pavan K <pavan42800@gmail.com> wrote:
>>>
>>> I ran it on gdb and I get the following error
>>>
>>> [Thread debugging using libthread_db enabled]
>>> [New Thread 0x7ffff6818700 (LWP 28985)]
>>> [Thread 0x7ffff6818700 (LWP 28985) exited]
>>>
>>> Program received signal SIGSEGV, Segmentation fault.
>>> 0x00007ffff72d8263 in
>>> std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)
>>> () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
>>>
>>> The fault is from the lib. I will try to debug it more but if you guys
>>> have any idea let me know.
>>>
>>> --
>>> /Pavan
>>>
>>> On Tue, Sep 25, 2012 at 1:55 PM, Pavan K <pavan42800@gmail.com> wrote:
>>> > When I run strace I get the following error on exit
>>> >
>>> > ==========================================
>>> > mprotect(0x7fb9edfdf000, 4096, PROT_READ) = 0
>>> > munmap(0x7fb9edfb1000, 179267)          = 0
>>> > brk(0)                                  = 0x105b000
>>> > brk(0x107c000)                          = 0x107c000
>>> > open("/usr/lib/locale/locale-archive", O_RDONLY) = 3
>>> > fstat(3, {st_mode=S_IFREG|0644, st_size=7224800, ...}) = 0
>>> > mmap(NULL, 7224800, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fb9ecd25000
>>> > close(3)                                = 0
>>> > geteuid()                               = 1000
>>> > write(2, "sudo", 4sudo)                     = 4
>>> > write(2, ": ", 2: )                       = 2
>>> > write(2, "must be setuid root", 19must be setuid root)     = 19
>>> > write(2, "\n", 1
>>> > )                       = 1
>>> > exit_group(1)
>>> > ===============================================================
>>> >
>>> >
>>> > -Pavan
>>> >
>>> > On Tue, Sep 25, 2012 at 11:49 AM, Pavan K <pavan42800@gmail.com> wrote:
>>> >> I could successfully compile the gprs-exp branch (I can update the
>>> >> wiki) but
>>> >> unfortunately when I run sudo ./OpenBTS the app quits without any
>>> >> erros. I
>>> >> tried to follow this fix mentioned at Common Errors but it doesn't
>>> >> help.
>>> >> Also the CLI is missing or the ./OpenBTS if it runs opens up the CLI
>>> >> automatically ?
>>> >>
>>> >> --
>>> >> /Pavan
>>> >>
>>> >>
>>> >> On Mon, Sep 24, 2012 at 1:40 PM, Pavan K <pavan42800@gmail.com> wrote:
>>> >>>
>>> >>> Max,
>>> >>>
>>> >>> I did a git pull and I still get the same errors.
>>> >>>
>>> >>> --
>>> >>> /Pavan
>>> >>>
>>> >>> On Thu, Sep 20, 2012 at 3:49 PM, Pavan K <pavan42800@gmail.com> wrote:
>>> >>>>
>>> >>>> Hello,
>>> >>>>
>>> >>>> I cloned the git repo from https://github.com/chemeris/openbts-p2.8
>>> >>>> and tried to build the gprs-work and gprs-exp branches. This was my
>>> >>>> experience with it --
>>> >>>>
>>> >>>> 1) I installed the PCU from git clone git://git.osmocom.org/osmo-pcu
>>> >>>> and installed it
>>> >>>>
>>> >>>> 2) I followed all the instructions in
>>> >>>> http://openbsc.osmocom.org/trac/wiki/OpenBSC_GPRS  and installed GGSN
>>> >>>> and SGSN
>>> >>>>
>>> >>>> 3) I added the -ldl to Makefile in sqlite3 folder and compiled it
>>> >>>> first as it failed to build the first time
>>> >>>> I did a make clean and
>>> >>>> __________________________________________________________
>>> >>>> When I tried to compile gprs-exp I am stuck with this error forever.
>>> >>>>
>>> >>>> make[2]: Entering directory
>>> >>>> `/home/pavan4/Desktop/git1/openbts-p2.8/GSM'
>>> >>>>   CXX    GSMConfig.lo
>>> >>>>   CXX    GSML1FEC.lo
>>> >>>>   CXX    GSML3Message.lo
>>> >>>>   CXX    GSML3RRElements.lo
>>> >>>>   CXX    GSML3RRMessages.lo
>>> >>>> GSML3RRMessages.cpp:784:6: error: prototype for 'void
>>> >>>> GSM::RLCMACDataBlock::parseBody(const GSM::RLCMACFrame&, size_t&)'
>>> >>>> does not match any in class 'GSM::RLCMACDataBlock'
>>> >>>> GSML3RRMessages.h:946:7: error: candidate is: void
>>> >>>> GSM::RLCMACDataBlock::parseBody(const GSM::RLCMACFrame&, unsigned
>>> >>>> int&)
>>> >>>> GSML3RRMessages.cpp:820:6: error: prototype for 'void
>>> >>>> GSM::RLCMACControlBlock::writeBody(GSM::RLCMACFrame&, size_t&) const'
>>> >>>> does not match any in class 'GSM::RLCMACControlBlock'
>>> >>>> GSML3RRMessages.h:975:7: error: candidate is: void
>>> >>>> GSM::RLCMACControlBlock::writeBody(GSM::RLCMACFrame&, unsigned int&)
>>> >>>> const
>>> >>>> make[2]: *** [GSML3RRMessages.lo] Error 1
>>> >>>> make[2]: Leaving directory
>>> >>>> `/home/pavan4/Desktop/git1/openbts-p2.8/GSM'
>>> >>>> make[1]: *** [all-recursive] Error 1
>>> >>>> make[1]: Leaving directory `/home/pavan4/Desktop/git1/openbts-p2.8'
>>> >>>> make: *** [all] Error 2
>>> >>>> _____________________________________________________________
>>> >>>> When I try to compile the gprs-work branch
>>> >>>>
>>> >>>> I was stuck here
>>> >>>>
>>> >>>> gsm_rlcmac.cpp:4712:3: error: expected primary-expression before ','
>>> >>>> token
>>> >>>> gsm_rlcmac.cpp:4712:3: error: 'Exist_DTM_Support' was not declared in
>>> >>>> this scope
>>> >>>> gsm_rlcmac.cpp:4712:3: error: 'offsetof' was not declared in this
>>> >>>> scope
>>> >>>> gsm_rlcmac.cpp:4713:3: error: expected primary-expression before ','
>>> >>>> token
>>> >>>> gsm_rlcmac.cpp:4713:3: error: 'RAC' was not declared in this scope
>>> >>>> gsm_rlcmac.cpp:4713:3: error: 'offsetof' was not declared in this
>>> >>>> scope
>>> >>>> gsm_rlcmac.cpp:4714:3: error: expected primary-expression before ','
>>> >>>> token
>>> >>>> gsm_rlcmac.cpp:4714:3: error: 'MAX_LAPDm' was not declared in this
>>> >>>> scope
>>> >>>> gsm_rlcmac.cpp:4714:3: error: 'offsetof' was not declared in this
>>> >>>> scope
>>> >>>> gsm_rlcmac.cpp:4716:3: error: expected primary-expression before ','
>>> >>>> token
>>> >>>> gsm_rlcmac.cpp:4716:3: error: 'BandIndicator' was not declared in
>>> >>>> this
>>> >>>> scope
>>> >>>> gsm_rlcmac.cpp:4716:3: error: 'offsetof' was not declared in this
>>> >>>> scope
>>> >>>> make[2]: *** [gsm_rlcmac.lo] Error 1
>>> >>>> make[2]: Leaving directory
>>> >>>> `/home/pavan4/Desktop/git1/openbts-p2.8/GPRS'
>>> >>>> make[1]: *** [all-recursive] Error 1
>>> >>>> make[1]: Leaving directory `/home/pavan4/Desktop/git1/openbts-p2.8'
>>> >>>> make: *** [all] Error 2
>>> >>>>
>>> >>>>
>>> >>>> I thought the commit missed a header in gsm_rlcmac.cpp and added
>>> >>>> <stddef.h> and compiled again. All the scope errors vanished. But
>>> >>>> then
>>> >>>> I got stuck here
>>> >>>>
>>> >>>> csn1.cpp:120:20: warning: 'CSN_DESCR_type' defined but not used
>>> >>>> [-Wunused-variable]
>>> >>>>   CXX    gsm_rlcmac.lo
>>> >>>>   CXX    bssgp.lo
>>> >>>> In file included from bssgp.cpp:24:0:
>>> >>>> bssgp.h:28:29: fatal error: openbsc/gprs_ns.h: No such file or
>>> >>>> directory
>>> >>>> compilation terminated.
>>> >>>> make: *** [bssgp.lo] Error 1
>>> >>>>
>>> >>>> I could see that in my openbsc which I forked from osmocom there were
>>> >>>> indeed no gprs_ns.h and other headers that were required. Instead
>>> >>>> they
>>> >>>> were moved to libosmocore. I tried to edit the Makefile to point them
>>> >>>> to the right library but I made way too many changes and finally gave
>>> >>>> up as tehre were too many dependencies that had mismatched.
>>> >>>>
>>> >>>>
>>> >>>> _______________________________________________________________________________
>>> >>>>
>>> >>>> The master branch built properly with no errors.
>>> >>>>
>>> >>>>
>>> >>>>
>>> >>>> Could you kindly tell me what am I missing?
>>> >>>> --
>>> >>>> /Pavan
>>> >>>
>>> >>>
>>> >>>
>>> >>
>>> >
>>> >
>>> >
>>> > --
>>> > /Pavan
>>
>>
>>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Openbts-discuss mailing list
> Openbts-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbts-discuss



--
Regards,
Alexander Chemeris.
CEO, Fairwaves LLC / ООО УмРадио
http://fairwaves.ru



--
/Pavan



--
/Pavan



--
/Pavan