aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2015-06-22l1: Store measurement values sent by the MSJacob Erlbeck4-3/+140
This commit extends the pcu_l1_meas structure by MS side measurement values which are transmitted by PACKET DOWNLINK ACK/NACK and PACKET RESOURCE REQUEST messages. The encoded values are remapped to dB respectively % values. The values are stored in the corresponding MS object (if there is one). Note that the values are store as (rounded) integers, so some different encodings are mapped to the same decoded value. Sponsored-by: On-Waves ehf
2015-06-22ms: Add UL CS selection based on L1 link qualityJacob Erlbeck4-8/+95
Currently the UL CS values are set to the corresponding DL CS value, eventually limited by a maximum value. This approach does not reflect the general situation of the RF link between ME and BTS, which is rather asymmetric e.g. due to a lower degree of TX efficiency of the built-in antenna. This means, that UL and DL CS control should be decoupled for better results. This commit adds automatic UL CS selection based on the link quality measurement parameter. Each coding scheme is mapped to a link quality range. If the link quality value leaves that range, the current UL CS value is increased/decreased accordingly. This value will be copied when the next PACKET_UPLINK_ACK_NACK or PACKET_UPLINK_ASSIGMENT is sent to the MS. The following VTY command will be added to the config-pcu node: - cs link-quality-ranges cs1 <0-35> cs2 <0-35> <0-35> cs3 <0-35> <0-35> cs4 <0-35> which sets the ranges for the four coding schemes. For instance the example below reflects the current default values: cs link-quality-ranges cs1 6 cs2 5 8 cs3 7 13 cs4 12 set the following ranges, where the overlapping is used to configure a hysteresis: CS1: -inf .. 6 CS2: 5 .. 8 CS3: 7 .. 13 CS4: 12 .. inf Sponsored-by: On-Waves ehf
2015-06-22ms: Store the L1 measurement values in the MS objectsJacob Erlbeck4-0/+34
This commits adds the GprsMs::update_l1_meas() and GprsMs::l1_meas() methods to store and access the measurement values. The internal state is updated depending on which values are actually set. In addition, these values are shown in the output of the 'show ms imsi|tlli' command. Sponsored-by: On-Waves ehf
2015-06-22l1: Pass all L1 measurements upwardsJacob Erlbeck8-18/+76
Currently only the RSSI value is passed to the upper layers. Other values like TA and BER which are needed for TA update respectively CS selection are not propagated. This commit introduces and passes a struct that contains a set of measurement values. Sponsored-by: On-Waves ehf
2015-06-22build: Add -lrt to AM_LDFLAGSJacob Erlbeck2-0/+2
This is needed to link programs using clock_gettime and related functions when compiling with older glibc versions. This should fix the Jenkins build. Nevertheless fixing this in configure.ac were probably nicer. Sponsored-by: On-Waves ehf
2015-06-11ms: Fix timer start condition (Coverity)Jacob Erlbeck1-1/+1
Currently the timer can be started even if m_ul_tbf is attached. Replace m_dl_tbf by m_ul_tbf to only start the timer if _both_ TBF are detached. Fixes: Coverity CID 1304683 Sponsored-by: On-Waves ehf
2015-06-11ms: Add missing initialiser for m_delay (Coverity)Jacob Erlbeck1-1/+2
Set m_delay to 0 in the constructor to disable the timer feature by default. Fixes: Coverity CID 1304682 Sponsored-by: On-Waves ehf
2015-06-11tbf: Check for NULL in name() (Coverity)Jacob Erlbeck1-0/+3
The gprs_rlcmac_tbf::name() method is generally used to generate log messages. To avoid the need for an explicit NULL check for the tbf and to get a consistent text if it is NULL, this commit adds a NULL check to the method itself so that it can be called with this == NULL. Fixes: Coverity CID 1304680, 1304681 Sponsored-by: On-Waves ehf
2015-06-11bssgp: Calculate the avg_delay_ms in 32bit only (Coverity)Jacob Erlbeck1-1/+1
Currently the delay_sum is stored in 64 to avoid overflow errors. But only the result of tv_sec * 1000 is casted to 64 bit, resulting in an overflow if the accumulated queue delay reached 25 days (which will not happen in practice, unless there are >200k LLC messages with a max of 10s delay each in the queue). If that were the case, the only impact would be a wrong number in a log message and in the BSSGP FLOW CONTROL message. This commit changes the calculations so that they are done in 32 bit only, rather than to do the calculation in 64 bit properly. Fixes: Coverity CID 1298705 Sponsored-by: On-Waves ehf
2015-06-11llc: Fix LLC UI frame detection (Coverity)Jacob Erlbeck1-2/+2
Currently the wrong nibble is masked out, so the conditional expression always yields true. Therefore gprs_llc::is_user_data_frame() always returns true. As a consequence, the low watermark feature of gprs_rlcmac_dl_tbf::llc_dequeue() is not being used in fact. This commit fixes the mask value. Fixes: Coverity CID 1292834, 1292835 Sponsored-by: On-Waves ehf
2015-06-11bssgp: Handle btcx == NULL in gprs_bssgp_pcu_rx_sign (Coverity)Jacob Erlbeck1-2/+4
Currently it is assumed, that btcx is non-NULL. The btcx is only used to obtain the BVCI in some log messages. This commit changes that by using -1 as shown BVCI value. Fixes: Coverity CID 1040961 Sponsored-by: On-Waves ehf
2015-06-08vty: Add command to show detailed MS infoJacob Erlbeck3-0/+81
This commit extends the "show ms" command to display an extended set of information for a single MS. The following VTY commands are added: - show ms tlli TLLI - show ms imsi IMSI Sponsored-by: On-Waves ehf
2015-06-08ms: Add support for maximum CS valuesJacob Erlbeck4-6/+62
Currently the CS values can be increased to CS4 even when the "cs" configuration command has been used with a lower value. The "cs" command just sets the initial coding scheme, so other means are needed to limit the selection. One approach is to use the CS flags passed in SI, but these are currently ignored. To make it possible to limit the CS selection by configuring the PCU, this commit adds the following VTY commands to config-pcu: - cs max <1-4> Limit DL and UL CS to the given value - cs max <1-4> <1-4> Limit DL and UL CS separately (DL first) - no cs max Don't limit Ticket: #1674 Sponsored-by: On-Waves ehf
2015-06-08ms: Add blocking period for CS upgradeJacob Erlbeck2-6/+32
Currently the CS level is immediately increased if the error rate drops below the lower threshold. Since the measurement values are not damped, this behaviour leads to a quick return to higher CS values even under bad radio conditions. Since with GPRS RLC/MAC blocks cannot be resent with another coding scheme, increasing the CS value should be done carefully. This commit adds a blocking period that only allows higher CS values if all error rate measurements were below the LOW threshold for a certain amount of time (currently fixed to 1s). Ticket: #1674 Sponsored-by: On-Waves ehf
2015-06-08tbf: Ignore lost+recv == 1Jacob Erlbeck1-1/+1
Currently the CS level gets changed quickly if single RLC/MAC blocks are sent (e.g. LLC dummy commands), since the rate is either 0% or 100%. This commit ignores measurements which are based on a single block only. Sponsored-by: On-Waves ehf
2015-06-08tbf: Add adaptive coding scheme configurationJacob Erlbeck1-2/+52
This commit adds the following VTY commands to config-pcu: - cs threshold <0-100> <0-100> Enables adaptive CS selection - no cs threshold Disables it The "cs threshold LOW HIGH" command sets the water marks (cs_adj_lower_limit and cs_adj_upper_limit) used to decide about switching coding schemes. Ticket: #1739 Sponsored-by: On-Waves ehf
2015-06-08tbf: Add debugging output to analyse_errors()Jacob Erlbeck1-6/+22
To help with the debugging, optimisation, and understanding of this method, this commit adds an info string containing a flag character per RLC/MAC data block in the current window. Note that the blocks are shown in reversed order (highest BSN first) in comparison to other logging output. Sponsored-by: On-Waves ehf
2015-06-08tbf: Add adaptive DL CS adjustmentJacob Erlbeck7-0/+101
To cope with transmission failures due to bad radio conditions, a different coding scheme with more redundance can be used. This commit adds an implemenation that is based on the Ack/Nack ratio per PACKET DOWNLINK ACK/NACK message received from the MS. Basically the CS level is decreased, if the block error rate goes above cs_adj_upper_limit (default 33%), and it is increased, if the rate drops below cs_adj_lower_limit (default 10%). Only blocks that have been encoded with the current CS are taken into account. Note that this approach doesn't measure the MS->BTS conditions and that the measurement values reported by the MS are not taken into account. Ticket: #1739 Sponsored-by: On-Waves ehf
2015-06-08vty: Add 'show ms all' commandJacob Erlbeck4-0/+34
This command lists the entries of the ms_store by a line per MS. Beside TLLI and IMSI, some measurement and state information is shown. A ms_list() getter method is added to GprsMsStorage to obtain a list of the MsGprs objects. The following VTY command is added to the 'enable' node: - show ms all Sponsored-by: On-Waves ehf
2015-06-08vty: Add a file for C++ functionsJacob Erlbeck4-1/+74
Currently the pcu_vty.c doesn't compile with C++. Thus C++ object cannot be access directly there. This commit adds a helper C++ file that exports all functions with C calling conventions and naming to work around that limitation until the transition of pcu_vty.c is completed. Sponsored-by: On-Waves ehf
2015-06-08tbf: Move the current CS field to GprsMsJacob Erlbeck8-17/+59
Currently the current CS value is stored in the cs field of gprs_rlcmac_tbf and initialised when it is used the first time. This commit adds separate fields for UL and DL CS values to the GprsMs class and provides corresponding getter methods for GprsMs and gprs_rlcmac_tbf. Ticket: #1739 Sponsored-by: On-Waves ehf
2015-06-08ms: Add back pointer to BTSJacob Erlbeck6-12/+21
Since more functionality will be moved to the GprsMs class, a pointer to the current BTS object is added to allow access to configuration data and other methods. Sponsored-by: On-Waves ehf
2015-06-08tbf: Store MS class in GprsMs objectsJacob Erlbeck9-16/+96
The ms_class value is a property of the MS and thus belongs to the GprsMs class. Nevertheless the MS object is created after the TLLI gets known, so the value still has to be stored in the TBF initially. This commit add the ms_class value to the GprsMs class and introduces TBF accessor functions which either access that object or, if that is not available, the value stored locally. Ticket: #1674 Sponsored-by: On-Waves ehf
2015-06-08tbf: Move the LLC queue to GprsMsJacob Erlbeck5-19/+31
Currently the enqueued DL LLC messages which have not yet passed to RLC/MAC encoding are eventually copied from one TBF to the next one (see gprs_rlcmac_dl_tbf::reuse_tbf). Since the enqueued LLC messages are related to a specific MS, they should be stored at that layer. This commit moves the gprs_llc_queue object to GprsMs and changes the TBF's accessor methods accordingly. The LLC copying code is removed from gprs_rlcmac_dl_tbf::reuse_tbf(). Sponsored-by: On-Waves ehf
2015-06-08tbf: Make the ms() getter method constJacob Erlbeck1-2/+2
Currently this method cannot be used in other const methods. This commit adds the missing const keyword. Sponsored-by: On-Waves ehf
2015-06-08llc: Add missing declarations to llc.hJacob Erlbeck1-0/+4
Currently llc.h relies on the structs BTS, timeval, and msgb being declared before the file is included. This commit adds forward declaration for these structs, because they will only be used for pointer types. Sponsored-by: On-Waves ehf
2015-06-08llc: Separate LLC queue handling from gprs_llcJacob Erlbeck5-54/+91
Currently the gprs_llc class handles both LLC queueing and the partition into smaller pieces for RLC/MAC encapsulation. This hinders the separation of TBF and MS related data, since LLC queueing belongs to the MS related code while the RLC/MAC encoding/decoding belongs to the TBF layer. This commits takes the LLC queueing related methods and members and puts them into a new class gprs_llc_queue. It puts the queueing object into gprs_rlcmac_tbf and adds accessor functions. The implementation in tbf.cpp and tbf_dl.cpp is adapted accordingly. Ticket: #1674 Sponsored-by: On-Waves ehf
2015-06-08l1: Fix warning by logging acc_delayJacob Erlbeck1-0/+6
The acc_delay value is computed but not used, resulting in a warning. This commit adds a logging message it case the function is executed to make the warning disappear. It also adds a CPP warning to remind of the incomplete implementation. Addresses: sysmo_l1_if.c:226:10: error: variable ‘acc_delay’ set but not used [-Werror=unused-but-set-variable] Sponsored-by: On-Waves ehf
2015-06-05pcu: Set ms_idle_sec to 60sJacob Erlbeck1-0/+1
Since the timing advance storage has been removed, the TA values are lost, when the last TBF of a single MS is freed. The TA storage has at least saved the last 30 TA values. So now in more cases a wrong TA value can be transmitted to an MS. Note that this also could have happened before the removal of the storage, especially if more than 30 MS were in use. This commit changes the default value of ms_idle_sec to 60s which is higher than default value for T3314 (44s, see TS 24.008, 11.2.2), after which the SGSN will have to start paging anyway. In that case, a RACH request will be triggered, that will trigger an update of the TA value in the PCU. Sponsored-by: On-Waves ehf
2015-05-28tbf: Set MS timeoutJacob Erlbeck3-1/+31
This commit sets the MS timeout when the MS object is created. The value is taken from the ms_idle_sec field in gprs_rlcmac_bts which can be changed by the VTY commands shown below. The following VTY commands are added to the config-pcu node: - ms-idle-time <1-7200> Set the timeout in seconds - no ms-idle-time Disable the timeout Another timer that is related is T3314 (Ready Timer, default 44s, GSM 24.008, 11.2.2) which requires the SGSN to use paging after its expiry. Longer timeouts can help if adaptive coding scheme selection is used (not yet implemented). On the other hand, measurement values (TA, signal quality) can get invalid after some time, especially with a moving MS. So a value slightly above T3314 is probably a good value to start with. Sponsored-by: On-Waves ehf
2015-05-28ms: Add timerJacob Erlbeck5-6/+153
Currently the MS object is immediately idle when all TBFs are detached and if no guard is being used. Since the plan is to use the MS objects to pass information from one TBF to the next one even across the gap of some seconds of inactivity, a mechanism is needed to keep the MS objects around for some time. This commit extends the GprsMs class by a timer that keeps the MS objects in non-idle state for some time after all TBFs have been detached. The set_timeout method must be used with a non-zero value to activate this feature. Sponsored-by: On-Waves ehf
2015-05-28tbf: Remove TimingAdvance storageJacob Erlbeck6-195/+7
Currently the TA storage stores up to 30 TLLI->TA mappings, if more entries are created the oldest one is dropped. In theory this can lead to missing TA information if many MS are present. This commit removes the TimingAdvance class completely, since the TA value is now stored in the GprsMs objects. Note that the GprsMs objects are currently not kept after the TBFs have detached from them, so the TA values are now kept for a shorter time than before. Ticket: #1674 Sponsored-by: On-Waves ehf
2015-05-28tbf: Store the timing advance (TA) value in the GprsMs objectJacob Erlbeck9-86/+93
The TA value rather relates to an MS and not to a single TBF. So all TBFs share the same TA value. Currently the TA value is stored per TBF and eventually copied from an old TBF to a new one. It is in general only passed with an RACH request when the TLLI and thus the MS is not yet known. This commit adds a TA member to the GprsMs class and uses that one when the TBF is associated to an MS object. Since the TBF is not always associated with an MS object (after RACH or when it has been replaced by another TBF), the TA value is still stored in each TBF and that value is used as long as no MS object is being associated. Sponsored-by: On-Waves ehf
2015-05-28tbf/test: Add tests for single and two phase accessJacob Erlbeck4-2/+246
These tests cover the message exchange from receiving from the first RACH request to the first data block when establishing an uplink TBF. This will be used to check, whether TA and other values are passed to an MS object correctly. In addition, the RX RACH log message in rcv_rach is extended to contain the single block fn. Sponsored-by: On-Waves ehf
2015-05-28tbf: Remove TBF chaining (m_new_tbf and m_old_tbf)Jacob Erlbeck5-96/+25
Currently a new TBF is chained to an existing older one, either of the other direction (active or releasing) or of the same direction (releasing). This does not work properly work if and uplink and a downlink TBF are being established at the same time while an old TBF is being released. In that case, one of them is thrown away and the pending procedure is cancelled. The chaining is no longer necessary since the GprsMs objects have been introduced which keep track of the active TBFs. This commit removes the TBF members m_new_tbf and m_old_tbf and the related methods and code paths. Note that a new TBF can replace an older TBF entry of the same direction within an MS object when it is associated with an MS (e.g. by TLLI or because it is assigned via another, already associated TBF). In that case, the old TBF is no longer associated with an MS object. Ticket: #1674 Sponsored-by: On-Waves ehf
2015-05-28tbf/test: Attach TLLI and MS objects to TBFsJacob Erlbeck2-74/+97
Currently the DL TBF's TLLI are not set. This will have to change in the future, when the m_new_tbf chaining is replaced by the usage of MS object to group TBFs. This commit just calls update_ms() on newly created TBFs. This changes many of the lines written to stderr due to the TLLI change, but doesn't change other aspects or messages beside creating and destroying MS objects. Sponsored-by: On-Waves ehf
2015-05-28tbf: Remove IMSI handling from trigger_dl_assJacob Erlbeck4-12/+7
Currently the BTS::trigger_dl_ass() method assigns the IMSI to the MS object. This should be (and is already) done earlier where the MS object is retrieved/created. This commit removes the corresponding code along with the 'imsi' parameter from trigger_dl_ass. Sponsored-by: On-Waves ehf
2015-05-28ms: Use the IMSI to retrieve the MS objectJacob Erlbeck5-18/+50
This commit extends get_ms() to really compare the IMSI if it has been given. Matching by TLLI has a higher precedence than matching by IMSI. Ticket: #1674 Sponsored-by: On-Waves ehf
2015-05-28tbf: Move IMSI to MS objectJacob Erlbeck8-14/+207
Currently the IMSI is stored in the TBFs. Since it directly refers to an MS, it should rather be stored in an MS object. This patch move the m_imsi field from gprs_rlcmac_tbf to GprsMs, changes gprs_rlcmac_tbf::imsi() to get the IMSI from the associated MS object, and adds getter and setter to GprsMs. Before changing the IMSI of the associated MS object, assign_imsi() checks if there is already another MS object with the same IMSI and eventually resets the IMSI of that one. So using update_ms() and assign_imsi() ensures that there are not two MS object entries is the storage with the same TLLI or the same IMSI. Ticket: #1674 Sponsored-by: On-Waves ehf
2015-05-27tbf/test: Fix IMSI creationJacob Erlbeck2-65/+65
Currently the generated IMSI contains blanks due to a missing '0' flag in the corresponding snprintf statement. In addition, the buffer is effectively limited to 15 bytes which is shorter than the generated character sequence, such that the last character of the IMSI is removed. This patch fixes both issues. Since snprintf itself will add a terminating \0 character, the whole buffer can be passed to snprintf. Sponsored-by: On-Waves ehf
2015-05-27tbf: Always call set_tlli/confirm_tlli in update_msJacob Erlbeck8-52/+107
Currently the m_tlli member in GprsMs is set by the constructor, circumventing the TLLI confirmation mechanism. This commit replaces the get_or_create_ms() method by a create_ms() method which takes the TLLI and the direction (UL or DL) as parameters to select either set_tlli() or confirm_tlli(). The MS object is instantiated with TLLI = 0, and therefore GprsMs::tlli() is extended to return the DL TLLI if both of the other TLLI are not set. Note that create_ms() will not check whether an MS object with a matching TLLI is already stored in the list, so it should only be called after a corresponding get_ms() in general. Sponsored-by: On-Waves ehf
2015-05-27tbf: Remove the TLLI from the TBFsJacob Erlbeck8-100/+19
Currently the TLLI is stored in each TBF. Since each MS is now represented by a GprsMs object which takes care of TLLI updating, and each TBF that has been associated with an TLLI also contains a reference to a GprsMs object, per TBF TLLI handling is no longer needed. Keeping all TBF m_tlli members up to date is complex and doesn't currently work correctly in all circumstances. This commit removes m_tlli and related members from the TBF class and the tbf_by_tlli functions from the BTS class. Ticket: #1674 Sponsored-by: On-Waves ehf
2015-05-22write_queue: Check the result of osmo_wqueue_enqueue and freeHolger Hans Peter Freyther2-3/+12
The write_queue is designed to have a maximum amount of pending messages and will refuse to take new messages when it has been reached. The caller can decide if it wants to flush the queue and add the message again, create a log. But in all cases the ownership of the msgb has not been transferred. Fix the potential memory leak in the failure situation.
2015-05-22misc: Update the email address to point to the current MLHolger Hans Peter Freyther1-1/+1
We have unified all PS related communication to the osmocom-net-gprs mailinglist, update configure.ac to point there.
2015-05-22llist: Reduce the external dependencies of this testHolger Hans Peter Freyther1-3/+0
Debian is using the classic bfd linker and when passing libosmogb as link dependency it always wants/needs to resolve the bssgp_prim_cb symbol (which is to be provided by the application). Only keep the libosmocore dependency. Fixes: lib/libosmogb.so: undefined reference to `bssgp_prim_cb' collect2: error: ld returned 1 exit status Makefile:511: recipe for target 'llist/LListTest' failed
2015-05-21tbf: Just pass the MS object in reuse_tbfJacob Erlbeck2-9/+1
Currently the MS will be searched based on the TLLI in resue_tbf(). Since the MS object is already known in the TBF when the TLLI is set, it can just be passed to the new TBF. This commit removes the call to update_ms() and just adds new_tbf->set_ms(ms()) which will also work as expected if ms() == NULL. Sponsored-by: On-Waves ehf
2015-05-21tbf: Explicitly pass the direction to update_ms()Jacob Erlbeck6-14/+15
The type of the TBF update_ms() is being called on does not always reflect whether the TLLI has been signaled by the MS or the SGSN. This commit adds an additional parameter to tell the method, in which direction the TLLI has been passed. Sponsored-by: On-Waves ehf
2015-05-21tbf: Get the TLLI from the MS objectJacob Erlbeck2-5/+5
Since the synchronisation of the TBF's concerning the TLLIs has been removed in 'Support new and old TLLI's', gprs_rlcmac_tbf::tlli() can return the old TLLI which is probably different to ms()->tlli() in that case. This can lead to a wrong TLLI being used in BSSGP messages. This commit modifies the TBF's tlli() method to get the current TLLI from the MS object. Sponsored-by: On-Waves ehf
2015-05-21ms: Support new and old TLLIsJacob Erlbeck12-46/+235
According to the specification (GSM 04.08/24.008, 4.7.1.5) after a new P-TMSI has been assigned, the old P-TMSI must be kept basically until it has been used by both sides. Since the TLLI will be derived from the P-TMSI, the old TLLI must also be kept until the new TLLI has been used by both MS and SGSN. This commit modifies the TLLI handling of GprsMs accordingly. set_tlli() is only used with TLLIs derived from MS messages, confirm_tlli() is used with TLLIs derived from messages received from the SGSN. tlli() returns the value set by the MS. check_tlli() matches each of the TLLI used by either MS or SGSN as well as the old TLLI until it has been confirmed. Sponsored-by: On-Waves ehf
2015-05-20ms: Integrate the MS storageJacob Erlbeck5-16/+67
Use the MS storage to find a MS object for a given TLLI instead of searching the TBF lists. The TBFs are then taken from the MS object, if one has been found. If all TBF might be temporarily detached from the MS object, a GprsMs::Guard is added to prevent the deletion of the object, in case another TBF gets attached later on in the scope. Ticket: #1674 Sponsored-by: On-Waves ehf