aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2015-07-03alloc: Base algo A on reserved PDCHsJacob Erlbeck1-9/+11
Currently algorithm A bases its time slots selection on the number of TBF actively using the PDCHs. This statistically prefers the first time slots, especially with short living TBFs. So when the first TBF is triggered by an uplink transfer (which generally results in a short-lived TBF) the potentially longer living DL TBF will be bound to the same slot. When another MS then requests an uplink TBF, it will get the same slot (no UL TBF currently active). This commit changes the algorithm to base its selection on reserved slots instead. Sponsored-by: On-Waves ehf
2015-07-03alloc: Ignore slots with differing TSC if multiple slots are requestedJacob Erlbeck1-1/+18
According to TS 45.002, 6.4.2 the training sequence (TSC) must be the same for all slots in a multi-slot set. This commit updates find_possible_pdchs() to only consider slots with the same TSC if more that 1 slot shall be assigned. Note that the first PDCH's TSC will be used as reference, so if two or more groups with a common TSC are configured, only the first will be used. This restriction does not apply to algorithm A, since it will not assign more than one slot and therefore sets the max_slots parameter to 1. Sponsored-by: On-Waves ehf
2015-07-03ms: Get the set of slots currently activeJacob Erlbeck4-0/+66
This commits adds methods to GprsMs and gprs_rlcmac_tbf to retrieve the slots that are actively used. Sponsored-by: On-Waves ehf
2015-07-03ms: Add support for slot reservationJacob Erlbeck4-3/+102
In contrast to the slots currently used by existing TBFs, the reserved slots refer to the time slots that can be used for newly allocated TBFs without causing conflicts (given that the first common TS does not change). They correspond to the potential use of the PDCHs and can be used to achieve a more uniform slot allocation. This commit adds bit set based methods to GprsMs and gprs_rlcmac_trx and a counter to gprs_rlcmac_pdch. The current TRX will also be stored in the MS object. Sponsored-by: On-Waves ehf
2015-07-03alloc: Load balancing for algo AJacob Erlbeck1-13/+107
Currently only the first enabled PDCH will be used. Beside the throughput this will also limit the number of TBFs: - number of UL TBFs <= 7 - number of DL TBFs <= 32 This commit changes the allocation algorithm to use the PDCH with the least number of attached TBFs. This will improve the troughput in both directions and the UL limits: - number of UL TBFs <= min(32, N_PDCH * 7) UL TBFs Ticket: #1794 Sponsored-by: On-Waves ehf
2015-07-03tbf: Add GprsMs* argument to update() and use it in reuse_tbfJacob Erlbeck3-5/+11
Since set_ms() is caled on the new DL TBF, the old DL TBF loses the reference to the MS object. This will lead to a segfault, when update() is called in reuse_tbf(). This commit adds an optional GprsMs* parameter to update() and uses it for the slot allocation. This fixes a TbfTest crash that would otherwise occur after applying the next commit. Sponsored-by: On-Waves ehf
2015-07-03ms: Add tbf() method to get the TBF based on the directionJacob Erlbeck3-0/+16
To avoid the need for a switch or conditional statement when needing a TBF from an MS object in direction independant code, this method contains that case distinction. For additional flexibility, a reverse() function is added to get the opposite direction. Sponsored-by: On-Waves ehf
2015-07-03ms: Add first_common_ts method to GprsMsJacob Erlbeck2-0/+13
This method gets the index (0 based) of first common time slot used by the TBFs attach to it. It expects that all of them have the same notion of this. If no TBF is attached, -1 will be returned. Sponsored-by: On-Waves ehf
2015-07-03tbf: Maintain the number of TBF per PDCHJacob Erlbeck4-8/+49
Currently the PDCH object do not know anything about the TBFs using them. To make the slot allocation load dependant, at least some numbers are required. This commit adds TBF counters (one per direction) and the related methods attach_tbf, detach_tbf, and num_tbfs to gprs_rlcmac_pdch. Sponsored-by: On-Waves ehf
2015-06-29tbf: Add BTS::ms_alloc methodJacob Erlbeck5-14/+30
Currently the code that creates the MS objects with tbf.cpp is duplicated. This commit moves the corresponding code into a new method. Since there is no TLLI available there, the GprsMsStorage::create_ms method has been refactored into two variants: one with TLLI/direction and one without. Sponsored-by: On-Waves ehf
2015-06-29tbf: Always create an MS object on TBF allocationJacob Erlbeck3-31/+32
Currently the MS object are created when the TLLI gets known. Therefore some information (TA, MS class) must be stored in the TBF itself and is copied to the MS object later on. This would get even more complex, if the allocation algorithms were extended based on this scheme. This commit ensures, that an MS object will always be created on TBF allocation, even if the TLLI is not yet known. These 'anonymous' objects are still managed by the MS storage. To avoid dangling entries without a TLLI there (which cannnot be retrieved anyway), the timer in the MS objects is not started after all TBF have been detached, so that they get deleted immediately in that case. Note that an MS object can still be removed (e.g. by replacement) from an existing TBF, so tbf->ms() can be NULL. Ticket: #1794 Sponsored-by: On-Waves ehf
2015-06-29tbf: Pass the MS object around instead of old_tbfJacob Erlbeck7-33/+36
Currently the old TBF (either uplink or downlink) is passed around at TBF allocation mainly to get information about the MS. To implement more complex allocation algorithms, the MS object itself will be needed anyway. This commit replaces the old_tbf arguments by MS object arguments. Sponsored-by: On-Waves ehf
2015-06-29tbf: Remove update_tlli methodJacob Erlbeck3-7/+0
This method does not do anything anymore, it's functionality has been taken over by update_ms. This commit removes gprs_rlcmac_tbf::update_tlli completely. Sponsored-by: On-Waves ehf
2015-06-29vty: Fix documentation for 'no cs downgrade-threshold'Jacob Erlbeck1-1/+1
The NO_STR is missing, this commit adds it. Fixes: Jenkins #603 Sponsored-by: On-Waves ehf
2015-06-29llc: Add missing include directive for struct timevalJacob Erlbeck1-1/+1
While including time.h is sufficient with Ubuntu's current libc6 2.19, the correct (and portable) include file is sys/time.h. This commit modifies the include directive in llc.h accordingly. Fixes: Jenkins #600 Addresses: In file included from gprs_ms.h:28, from gprs_ms.cpp:22: llc.h:68: error: field 'recv_time' has incomplete type llc.h:69: error: field 'expire_time' has incomplete type Sponsored-by: On-Waves ehf
2015-06-22llc: Move storage of timestamps into gprs_llc_queueJacob Erlbeck3-25/+38
Currently the receive and expiry timestamps are prepended to the LLC msgb before it is passed to gprs_llc_queue::enqueue(). Since this meta information should not be counted as LLC octets, the gprs_llc_queue needs to known about this (unless the correction was done in the LLC layer). This commit moves the meta information storage code into gprs_llc_queue. The meta data is now stored in the control block (cb) area of the msgb. Note that the info pointer that is returned from the dequeue method is only valid if that method returns a (non-NULL) msgb. It must not be used after that msgb has been modified or freed. Sponsored-by: On-Waves ehf
2015-06-22llc: Make timeval arguments constJacob Erlbeck4-7/+10
Some struct timeval pointer arguments do not have the const qualifier, albeit the methods do not write to the structures. The next commit will change related pointers to const, so this commit provides the required constness. Sponsored-by: On-Waves ehf
2015-06-22ms: Reduce DL CS level if only a few LLC bytes are leftJacob Erlbeck5-5/+69
If just a few bytes are left to send to the MS, it makes sense to reduce the coding scheme level to increase the throughput. This has been shown by Chen and Goodman in their paper "Theoretical Analysis of GPRS Throughput and Delay". See their throughput over C/I measurement graphs (figures 4 and 5 in the paper) for details. This commit implements a simplified CS downgrade feature for the downlink. The coding scheme will be downgraded if there are only a few octets are left to be send over the TBF (see the downgrade-threshold command below) and the NACK rate is not low (the CS will not get degraded on a high quality RF link). As an exception, CS-3 will be degraded to CS-1, since CS-2 does not improve the throughput in general when a few small packets are sent and the signal fades slowly (see Chen/Goodman). The following VTY command is added to the config-pcu node: - cs downgrade-threshold <1-10000> - cs no downgrade-threshold to set the threshold of the number of remaining bytes to be RLC/MAC encoded. The CS will only be reduced, if the number is below the threshold. The 'no' command disables this feature completely. The default value is 200 octets. Sponsored-by: On-Waves ehf
2015-06-22llc: Keep track of the number of stored LLC octetsJacob Erlbeck2-0/+11
To get the number of LLC octets that are stored in the queue, this commit adds a m_queue_octets member along with a octets() method. This value is updated similarly to m_queue_size on each modifying method call. Sponsored-by: On-Waves ehf
2015-06-22llc: Add missing include directive to llc.hJacob Erlbeck1-0/+4
Currently struct llist_head is used without declaration which accidently did not produce an error so far. This commit adds the missing include directive. Sponsored-by: On-Waves ehf
2015-06-22tbf: Fix downlink packet lossJacob Erlbeck2-66/+70
When the MS is pinged with a longer interval, many packets get lost even if the GprsMs object is kept. If the interval is above the time where the DL TBF is in state FLOW (mainly influenced be the dl-tbf-idle-time command), an new TBF must be requested via AGCH for each ICMP PING message. Currently the LLC frame containing the PING is immediately stored in the TBF and gets lost, if TBF establishment fails for some reason. This commit moves all calls to put_frame() to schedule_next_frame(), where the data is moved from the LLC queue to the frame storage within the TBF object. This method is only called from within create_new_bsn() when the TBF is in the FLOW state and the frame is going to be encoded immediately. At all other places, where put_frame() has been called before, the LLC message is just appended to the LLC queue in the GprsMs object. This change effectively simplifies the related code parts, since date/len information and discard notifications is no longer needed there. Ticket: #1759 Sponsored-by: On-Waves ehf
2015-06-22ms: Store the NACK rate in the MS objectJacob Erlbeck3-1/+14
Currently the NACK/unconfirmed ratio is already passed to the corresponding MS object, but the value is not being stored there. This commit adds a member and a getter method and include the values into the output of the 'show ms' command. Sponsored-by: On-Waves ehf
2015-06-22tbf: Include CS into create_new_bsn log messageJacob Erlbeck1-3/+3
This change lets the test suite fail, so it get its own commit. Sponsored-by: On-Waves ehf
2015-06-22l1: Add debug log messages for I_LEVELJacob Erlbeck1-2/+10
The I_LEVEL values that are obtained now look suspicious. They do not seem to be contained in messages recorded via gsmtab. To help debugging this issue, this commit adds related debug messages that are generated while the encoded values are taken from the RLC/MAC messages. Sponsored-by: On-Waves ehf
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 Erlbeck7-15/+70
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 Erlbeck1-0/+1
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 Erlbeck6-11/+51
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 Erlbeck5-6/+15
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 Erlbeck7-16/+56
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