RangeNetworks / OpenBTS-UMTS

3G UMTS Data Radio Access Network Node
GNU Affero General Public License v3.0
297 stars 196 forks source link

unable to make calls, unable to connect to Internet. #19

Open peterm2109 opened 6 years ago

peterm2109 commented 6 years ago

I have OpenBTS-UMTS installed on ubuntu 16.04 LTS, and I use the USRP N210. I have managed to connect some MS and register successfully

OpenBTS> ALERT 140612512192256 11:59:24.4 URRC.cpp:615:findUeByAsnId: no match ptmsi=0x1002 raimatch=0 findHandlebyPTmsi-urnti=0x0 59:24.4 UL_CCCH_MessageType_PR_rrcConnectionRequest (new UE) UE#1 URNTI=9014 stIdleMode rbid=0 newState: 1 1 59:24.4 DL_CCCH RRC_Connection_Setup_Message message size=60 UE#1 URNTI=9014 stIdleMode rbid=0 newState: 2 1 ALERT 140612512192256 11:59:25.3 URLC.cpp:1755:rlcWriteLowSide: stateChange: before 0 0 after 0 0 59:27.2 UL_DCCH_MessageType_PR_rrcConnectionSetupComplete UE#1 URNTI=9014 stCELL_FACH rbid=2 59:29.5 UL_DCCH_MessageType_PR_initialDirectTransfer UE#1 URNTI=9014 stCELL_FACH rbid=3 59:29.5 UL GMM Msg: AttachRequest UE#1 URNTI=9014 stCELL_FACH 59:29.5 DL_DCCH IdentityRequest message size=6 UE#1 URNTI=9014 stCELL_FACH rbid=3 59:31.7 UL_DCCH_MessageType_PR_uplinkDirectTransfer UE#1 URNTI=9014 stCELL_FACH rbid=3 59:31.7 UL GMM Msg: IdentityResponse UE#1 URNTI=9014 stCELL_FACH PDP of 0 is 0, gmm = a4003a30, si = a4003720 PDP of 5 is 0, gmm = a4003a30, si = a4003720 59:31.7 DL_DCCH AuthenticationAndCipheringReq message size=25 UE#1 URNTI=9014 stCELL_FACH rbid=3 PDP of 0 is 0 59:34.5 UL_DCCH_MessageType_PR_uplinkDirectTransfer UE#1 URNTI=9014 stCELL_FACH rbid=3 59:34.5 UL GMM Msg: AuthenticationAndCipheringResp UE#1 URNTI=9014 stCELL_FACH imsi=001010000000026 PDP of 0 is 0 PDP of 0 is 0 59:34.6 DL_DCCH RRC Security Mode Command message size=15 UE#1 URNTI=9014 stCELL_FACH rbid=2 59:37.4 UL_DCCH_MessageType_PR_securityModeComplete UE#1 URNTI=9014 stCELL_FACH rbid=2 59:37.4 DL_DCCH AttachAccept message size=26 UE#1 URNTI=9014 stCELL_FACH rbid=3 59:39.5 UL_DCCH_MessageType_PR_uplinkDirectTransfer UE#1 URNTI=9014 stCELL_FACH rbid=3 59:39.5 UL GMM Msg: AttachComplete UE#1 URNTI=9014 stCELL_FACH imsi=001010000000026

but I can not make calls between the MS nor connect them to the internet. Even cell phones get to connect the 3G data with the USRP, but the MS never receives the IP number. OpenBTS> sgsn list GMM Context: imsi=001010000000026 ptmsi=0x73001 tlli=0xc0073001 state=GmmRegisteredNormal age=622 idle=10 UE#1 URNTI=9014 stCELL_FACH IPs=none

I have noticed in some examples that I have seen on the internet, that when the MS is connected it puts the following:

configDchPS: UL SF=4 RF=1x9600=9600 pb=16 turbo=1 maxprecoded=3180 tb=8x380=3040 coded=9132 configDchPS: DL SF=8 RF=1x9120=9120 pb=16 turbo=1 maxprecoded=3020 tb=8x340=2720 coded=8172 PDU sizes: 42 42 PDU sizes: 42 42 PDU sizes: 42 42

On the other hand, when I connect with my MS, it says the following:

configDchPS: UL SF=64 RF=1x600=600 pb=16 turbo=1 maxprecoded=180 tb=0x180=0 coded=0 configDchPS: DL SF=128 RF=1x420=420 pb=16 turbo=1 maxprecoded=120 tb=1x116=116 coded=360 PDU sizes: 42 14 PDU sizes: 42 14 PDU sizes: 42 14

I have installed OpenBTS-UMTS on several computers, I have used several USRPs and the problem is the same.

my question is: Is there any way within the code to force the values to be equal to those in the example?: configDchPS: UL SF=4 RF=1x9600=9600 pb=16 turbo=1 maxprecoded=3180 tb=8x380=3040 coded=9132 configDchPS: DL SF=8 RF=1x9120=9120 pb=16 turbo=1 maxprecoded=3020 tb=8x340=2720 coded=8172 PDU sizes: 42 42 PDU sizes: 42 42 PDU sizes: 42 42

regards

Peter

sksharma1501 commented 6 years ago

I struggled with issue this for past few days. Finally after a lot of debugging, I got it working!

There are several bugs in the code, causing it to pick the throughput value only from the following path in function rrcAllocateRabForPdp():

    if (ops == 0) {
        // It is either a mistake or 'best-effort'.
        // For best-effort, default to 60K which is SF=16, or 480 kbit/s.
        ops = gConfig.getNum("UMTS.Best.Effort.BytesPerSec");
    }

So to get SF4 working, you need to set "UMTS.Best.Effort.BytesPerSec" in the config database >=120000. Besides that you need other essential bugfixes below:

diff --git a/UMTS/UMTSPhCh.cpp b/UMTS/UMTSPhCh.cpp
index 796aa7c..f94e531 100644
--- a/UMTS/UMTSPhCh.cpp
+++ b/UMTS/UMTSPhCh.cpp
@@ -789,7 +789,9 @@ bool ChannelTree::isTierFreeDownward(Tier tier,unsigned startcode, unsigned widt
                        if (badcode ) { *badcode = code; }
                        return false;                           // in use.
                }
-               if (!isTierFreeDownward(tier+1,2*startcode,2*width,checkOnlyReserved,badtier,badcode)) {return false;}// something underneath is in use.
+// @SKS@Bugfix: wrong to use startcode, and wrong to increase width recursively
+//             if (!isTierFreeDownward(tier+1,2*startcode,2*width,checkOnlyReserved,badtier,badcode)) {return false;}// something underneath is in use.
+               if (!isTierFreeDownward(tier+1,2*code,2,checkOnlyReserved,badtier,badcode)) {return false;}// something underneath is in use.
        }
        return true;            // entire specified sub-tree is free.
 }
@@ -802,6 +804,7 @@ DCHFEC *ChannelTree::chChooseByTier(Tier tier)
        unsigned sf = tier2sf(tier);
        // For a channel to be free the sub-tree below and all channels above that chcode must be unused.
        for (unsigned chcode = 0; chcode < sf; chcode++) {
+//             printf("\nTier: %d, sf: %d, chcode: %d", tier, sf, chcode);
                // Harvind (3-11-13) upward search should only check reserved codes, don't care if upward codes are "also reserved"
                if (isTierFreeDownward(tier,chcode,1,false,0,0) && isTierFreeUpward(tier,chcode,true,0,0)) {
                        DCHFEC *result = mTree[tier][chcode].mDch;
@@ -919,7 +922,7 @@ std::ostream& operator<<(std::ostream& os, const ChannelTree&tree)
                        bool active = cte->mDch->phChAllocated();
                        bool reserved = cte->mReserved;
                        bool alsoReserved = cte->mAlsoReserved;
-                       if (active || reserved) {
+                       if (active || reserved || alsoReserved) {
                                os << "PhCh(sf=" <<sf<< ",ch=" <<chcode<< ")=";
                                if (reserved) os <<"reserved";
                                if (alsoReserved) os <<" alsoReserved";
diff --git a/UMTS/UMTSPhCh.h b/UMTS/UMTSPhCh.h
index 05c9259..00e0b6d 100644
--- a/UMTS/UMTSPhCh.h
+++ b/UMTS/UMTSPhCh.h
@@ -235,7 +235,9 @@ struct ChannelTreeElt
        DCHFEC *mDch;   // The DPDCH, although we could put the other PhChs in here too. (SCCPCH, PCCPCH, etc)
        bool available(bool checkOnlyReserved);
        bool active(void);
-       ChannelTreeElt() : mReserved(0), mDch(0) {}
+       // @SKS@ Bugfix: wrong not to initialize mAlsoReserved
+//     ChannelTreeElt() : mReserved(0), mReserved(0), mDch(0) {}
+       ChannelTreeElt() : mReserved(0), mAlsoReserved(0), mDch(0) {}
 };