aboutsummaryrefslogtreecommitdiffstats
path: root/tests
AgeCommit message (Collapse)AuthorFilesLines
2015-08-21tbf: Move pending LLC frames when merging MS objectsJacob Erlbeck2-2/+2
Currently the pending LLC packets are lost in some cases when MS objects are merged, for instance after a RACH when there were 2 MS object for the same MS (they get merged, when the TLLI is known for both objects). This patch modifies GprsMs::merge_old_ms to move all pending LLC packets (if there are any) to the current MS object. Sponsored-by: On-Waves ehf
2015-08-21llc: Add move_and_merge method to llc_queueJacob Erlbeck3-0/+58
This methods takes all LLC frames from the old LLC queue and moves them into the current. If both queues are ordered chronologically (recv_time), the resulting queue is also ordered. Sponsored-by: On-Waves ehf
2015-08-21tbf: Do not kill DL TBF on Packet Resource RequestJacob Erlbeck2-11/+9
Currently all active TBF of an MS are killed if a Packet Resource Request is received from the MS. In general this happens after a RACH request. This does not happen after a resource request that has been included into a Downlink Ack/Nack. Sometimes an UL TBF is requested by an MS via RACH while a DL TBF is running for instance to send a TCP Ack. This can happen, if a former request via PACCH did not work. This commit removes the killing of the DL TBF from gprs_rlcmac_pdch::rcv_resource_request(). Sponsored-by: On-Waves ehf
2015-08-21tbf/test: Add tests for RACH while DL TBFs are activeJacob Erlbeck3-0/+639
This adds tests for - RA update with RACH for the RAUpdateComplete message - RACH for UL while DL is active (LLC queue not empty) Sponsored-by: On-Waves ehf
2015-08-21tbf/test: Fix existing testsJacob Erlbeck2-11/+114
This commit fixes several issues: - Set MS class in request - Set IMSI in establish_ul_tbf_two_phase - Fake assigment acknowledgement in establish_ul_tbf_two_phase - Fix TFI bit offset to 1 (was 2) Sponsored-by: On-Waves ehf
2015-08-21tbf/test: Move UL TBF establishment into separate functionsJacob Erlbeck2-56/+95
Currently the functions test_tbf_single_phase and test_tbf_two_phase do the test logging, BTS intialisation, and the complete message sequencing on their own. Therefore they cannot be used to test more complex sequences like TBF reestablishment. This commit moves the code that does the actual messaging into own functions. The frame number handling is generalised which also fixes a block number wrapping error on the way. Sponsored-by: On-Waves ehf
2015-08-18ms: Move MS information merging to GprsMSJacob Erlbeck1-3/+2
Currently the merging of the meta information (MS class, IMSI) takes place in gprs_rlcmac_tbf::merge_and_clear_ms(). This makes it difficult to merge the internal state and does not directly relate to TBFs anyway. This commit moves this into a new method GprsMs::merge_old_ms. Sponsored-by: On-Waves ehf
2015-08-17ns: Add logging supportJacob Erlbeck1-0/+1
Currently there is not support for Network Service (NS) logging. This commit adds the missing definitions and sets the default level to INFO. Further configuration can now be done with the 'logging level ns' VTY command. Sponsored-by: On-Waves ehf
2015-08-17tbf: Clean old MS objects if they have the same TLLIJacob Erlbeck2-15/+21
Currently if an MS retries to access the PCU by using RACH and if there is already an entry for that MS, a duplicated MS object referring to the same TLLI is created. This is caused by blindly setting the TLLI without querying the MS storage to avoid inconsitencies. This leads to several entries in the MS storage that are assigned to the same TLLI. If that happens, 'show ms all' can display multiple entries with the same TLLI (note that an MS object can belong to several TLLIs, so there might be an intersection that is not visible in the list) or 'show tbf all' can show entries with MS_CLASS == 0 in some cases. This commit changes update_ms() to merge and clean up old entries that belong to the given TLLI if they exist. Some data (like the MS class) is copied to the new MS object. Note that TBF belonging to the old MS object are deleted immediately if they have not registered a timer. Sponsored-by: On-Waves ehf
2015-08-13tbf: Always start T3193 when changing state to GPRS_RLCMAC_WAIT_RELEASEJacob Erlbeck2-1/+8
Currently when receiving a PACKET DL ACK/NACK message with the Final Ack Indicator bit set, the TBF's state is set to GPRS_RLCMAC_WAIT_RELEASE but T3193 is only started when the LLC queue is empty. Otherwise the reuse_tbf() method is called to establish a new DL TBF. In that case, the timer is not started. This will leave the current TBF without a timer so it is potentially not released later on. This is recognisable by sticky entries in the output of the 'show tbf all' command and possibly allocation failures if there are too many of them. This commit changes the code to always start T3193 to make sure, that a timer is always active when the the state is set to GPRS_RLCMAC_WAIT_RELEASE. Note that TS 44.060, 9.3.2.6 requests to release the 'old' TBF immediately in some cases, which is not implemented by this change. This will lead to a longer reservation period of the TFI only, which is safer than reassigning it too early. Sponsored-by: On-Waves ehf
2015-07-21llc: Add CoDel AQM implementationJacob Erlbeck4-2/+191
This commit adds an implementation of the CoDel algorithm based on the reference pseudocode presented in http://queue.acm.org/appendices/codel.html. Instead of abstracting the queue itself, the implementation provides a time stamp based automaton which is invoked after a package has been dequeued. Note that the modifications of the algorithm shown in https://tools.ietf.org/html/draft-ietf-aqm-codel-01 are not yet applied. Sponsored-by: On-Waves ehf
2015-07-16alloc: Make alloc_algorithm_dynamic statefulJacob Erlbeck3-893/+423
Currently there is no persistent state being used in alloc_algorithm_dynamic. So algorithm B is even used in persistent high usage scenarios. If there are many active TBFs, multislot assigments are not fair, because MS of a "higher" multislot class get higher troughputs. On the other hand, as long as all PDCH are busy no bandwidth will be wasted even if all MS use algorithm A. This commit modifies alloc_algorithm_dynamic to disable algorithm B when that call fails. It then keeps it disabled until there is a single PDCH which is idle (it is considered idle, if there is at most one active DL TBF assigned to it). Sponsored-by: On-Waves ehf
2015-07-16alloc/test: Fix trx_no assertionJacob Erlbeck1-1/+2
Currently the value of trx_no2 is used in the assertion, even if the call to tfi_find_free has failed. This commit fixes the asserted expression to only compare the trx_no values if the function call has succeeded. Sponsored-by: On-Waves ehf
2015-07-16alloc/test: Free the TBF if the recursion has failedJacob Erlbeck1-0/+4
Currently if both an uplink and a downlink TBF are to be allocated by alloc_tbfs() and the second allocation fails, the first TBF is not freed. This commit changes the recursive function to free the TBF if the ms variable has been changed to NULL. Sponsored-by: On-Waves ehf
2015-07-16alloc/test: Use lower case for slots with TFI shortageJacob Erlbeck1-16/+39
Indicate those slots with lower case letters that do not have a spare TFI for the other direction if such a TBF has not been attached to the MS object yet. Sponsored-by: On-Waves ehf
2015-07-16alloc: Use a separate usage computation for algo AJacob Erlbeck1-56/+56
Currently algorithm A can select an TBF even when there is no free TBF in the reverse direction. While this does not necessarily lead to an allocation failure, the probabily is higher. In addition, the current slot reservations are not taken into account. This commit changes the selection algorithm to prefer slots where TFI are available in both directions and which are less reserved. Sponsored-by: On-Waves ehf
2015-07-16alloc/test: Show expectation before failureJacob Erlbeck1-1/+10
To simplify debugging, show the actuals value before the assertion fails in some cases. Sponsored-by: On-Waves ehf
2015-07-16alloc: Add 'dynamic' allocation algorithmJacob Erlbeck3-0/+1703
The idea behind this meta algorithm is to automatically select one of the other algorithms based on the system state. Basically algorithm B will be selected if the PDCH usage is low to improve throughput and latency. Algorithm A will be selected to support more concurrent MS. This commit adds a first simple state-less version of this algorithm that always tries B first and only if that fails A is tried afterwards. The following VTY command is added to the 'pcu' node: - alloc-algorithm dynamic Ticket: #1934 Sponsored-by: On-Waves ehf
2015-07-16alloc: Refactor alloc algorithms to only apply changes on successJacob Erlbeck1-7/+7
Currently these algorithms modify other objects (MS, TBF, PDCH) even if the allocation will fail later on. To implement an algorithm that dynamically tries another algorithm on failure (e.g. A after B), the first (failing) algorithm should not change or damage anything. This commit refactors algorithm A and B to delay the actual allocation until it is known that the allocation will not fail. Ticket: #1934 Sponsored-by: On-Waves ehf
2015-07-16alloc/test: Add test for interleaved TBF chainsJacob Erlbeck3-0/+1104
MS iniated TCP connections generally result in a sequence of short time UL and longer lasting DL TBFs, being interleaved between several MS. This scenario is not covered by the existing tests. This commit adds a test, that allocates as man as possible TBFs several times with different test modes without clearing the BTS (and thus the TBF list) in between. The number of allocated DL TBFs in each round is expected to be constant. Sponsored-by: On-Waves ehf
2015-07-16alloc/test: Put TBF allocation loop into alloc_many_tbfsJacob Erlbeck1-22/+43
Currently all TBFs are deleted after the allocation loop finishes. This make it difficult to interleave the TBF allocation like it happens with real MS. This commit refactors the allocation loop into alloc_many_tbfs and adds support for TLLIs, which are derived from the counter value and used to retrieve an old MS object if alloc_many_tbfs is called a second time. Note that this does not make a difference for the existing tests. Sponsored-by: On-Waves ehf
2015-07-16tbf: Put the TFI->TBF mapping into the PDCH objectsJacob Erlbeck3-19/+13
Currently the TBFs are registered in a TFI indexed array within the TRX objects. TBFs can be searched globally by TFI and TRX number. This conflicts with the use of the same TFI for different TBF on different PDCH. This use case requires the specification of the PDCH as additional search dimension. This commit moves the TFI index TBF arrays into the PDCH objects. The related methods are updated accordingly. Ticket: #1793 Sponsored-by: On-Waves ehf
2015-07-16alloc: Allocate TFI per slot (algorithm A)Jacob Erlbeck4-281/+454
Currently the TFI are managed per TRX, thus only a maximum of 32 TBF per direction and per TRX are possible simultaneously. This commit modifies algorithm_a() to allow the sharing of TFI between different PDCH. Since algorithm A only assigns a single slot to each TBF, the TFI of each PDCH can be assigned independently. This increases the maximum to 32 TBF per direction and per PDCH concerning the TFI allocation. Ticket: #1793 Sponsored-by: On-Waves ehf
2015-07-16tbf: Move TFI selection into alloc_algorithmJacob Erlbeck4-177/+248
Currently the TFI and the TRX have to be determined before the actual TBF allocation function is called, passing TFI and TRX number as parameters. This does fit to TFI reuse for different slots, since this were tightly coupled with the slot selection. This commit just moves the TFI selection into the alloc_algorithm functions. The tfi parameter is removed from the the TFI alloc functions. The trx parameter is changed into use_trx to optionally limit the trx selection (same semantics like in tfi_find_free). Sponsored-by: On-Waves ehf
2015-07-16pdch: Manage TFIs per directionJacob Erlbeck2-10/+2
Currently a single bit set is used to maintain a set of used TFI without distinguishing between uplink and downlink. Since the namespaces of UL and DL TFI are separate, this implementation is not correct. This commit changes gprs_rlcmac_pdch to use a separate bit set for each direction. It also replace the corresponding conditional fprintf statement in check_tfi_usage (AllocTest.cpp) by an equivalent OSMO_ASSERT. Sponsored-by: On-Waves ehf
2015-07-16alloc/test: Check for TFI conflictsJacob Erlbeck2-1/+110
This commit adds the check_tfi_usage function that checks the TFI usage. It iterates through all TBFs, records on which PDCH it uses which TFI and check for conflicts. It also checks the bits returned by pdch->assigned_tfi(). The latter suffers from an bug in that method (no separation of uplink and downlink), so a conditional fprintf is used instead of an assertion. The method tfi_find_free is checked for conflicts after allocations. Sponsored-by: On-Waves ehf
2015-07-16alloc: Fix MS_B/MS_C interpretationJacob Erlbeck1-209/+209
Currently the handling of MS_B and MS_C is not compliant with TS 45.002, annex B.1. These values may only interpreted as 0, if frequency hopping is not enabled and if there is no change from Rx to Tx or vice-versa. This commit sets Ttb/Trb to 1 if the table entry is MS_B/MS_C, since only combined down/up access modes are supported. Sponsored-by: On-Waves ehf
2015-07-16alloc: Do not use masking for multislot class type 2 MSJacob Erlbeck1-35/+35
Currently the masks are computed equally for each class type. This does not make much sense for class type 2 MS, since those are capable to work in full duplex mode. This commit sets the masks to 0xff for class type 2 MS. Sponsored-by: On-Waves ehf
2015-07-16alloc: Select applicable Tta/TraJacob Erlbeck1-4/+4
According to TS 45.002, 6.4.2.2 the choice whether Tta or Tra has to be applied, depends on the medium access mode (currently always dynamic) and the number of UL/DL slots. Currently either value can be used which might result in combinations not covered by the spec. This commit changes find_multi_slots() to skip non-compliant combinations. Note that this code will have to be extended, if other medium access modes are implemented. Sponsored-by: On-Waves ehf
2015-07-07alloc: Use least reserved PDCH for algo AJacob Erlbeck3-33/+58
Currently the slot selection of algorithm A is based on the current slot usage by active TBF. Especially in the Dl after UL case which reflects the commen use case "MS initiates TCP connection", the resulting distribution is not optimal with respect to PDCH usage. This commit changes the implementation to use the slot reservation information instead. Sponsored-by: On-Waves ehf
2015-07-07alloc/test: Delete first TBF after the second is allocatedJacob Erlbeck3-100/+77
Currently when using the test modes TEST_MODE_DL_AFTER_UL or TEST_MODE_UL_AFTER_DL, the first TBF is deleted before the second is allocated. The far more interesting case were to keep the first TBF a little bit longer until the second TBF has been created and delete then. This comes closer the the situation observed with real MS, where the first TBF takes some time (timeout or waiting for Ack) before it gets deleted and thus detached from the MS object. This commit delays the call to tbf_free accordingly. The effect can be observed in the results of the algo A tests, where the uniform distribution of the allocated PDCH is lost. Sponsored-by: On-Waves ehf
2015-07-07tbf: Keep a set of used TFI and USF per PDCHJacob Erlbeck1-53/+53
Currently is is rather expensive to get TFI and USF usage per PDCH, because the TBFs need to be scanned to get that information. This commit adds corresponding bit sets which get updated by the attach_tbf/detach_tbf methods of the gprs_rlcmac_pdch class. Sponsored-by: On-Waves ehf
2015-07-07alloc: Skip common TS without free USF when ratingJacob Erlbeck3-33/+63
Currently the search of the "best" slot combination is done separately from the UL slot selection, which can lead to an allocation failure due to USF exhaustion even if another combination had been possible. This commit reduces the probability for this event by skipping UL slots without free USF while calculation the capacity. Note that the implementation is rather inefficient which will be fixed by the following commits. Sponsored-by: On-Waves ehf
2015-07-07alloc: Only reserve 1 UL slot with algorithm BJacob Erlbeck3-73/+61
Since currently the algorithm B will only allocate a single UL slot and will have to stick to it (first common TS), the other possible UL slots will not be allocated while the reservation is kept. This commit adds code to update the reserved set of UL slots to only reserve the single common TS when the UL TBF is allocated. Interestingly this leads to fewer allocated TBF in some cases due to USF exhaustion. This will be improved by the following commit "alloc: Skip common TS without free USF". Sponsored-by: On-Waves ehf
2015-07-07alloc: Only use common UL slots when calculating the capacityJacob Erlbeck3-54/+65
Currently al possible UL slots are included in the capacity calculation which is the base of the slot selection. Nevertheless UL-only slots will never be used, since only one uplink slot (which must be a common slot) will be used. This patch changes the code to only include common slots in the capacity sum. Note that this might not be optimal if algorithm B supported multiple uplink slots. Sponsored-by: On-Waves ehf
2015-07-07alloc: Replace Algorithm B implementationJacob Erlbeck3-186/+285
The current implementation always starts the downlink slot allocation with the first possible slot, depending on which channels are enabled and which multislot class is offered by the MS. So in configurations with many (>4) PDCH, some PDCH are not really used. The new implementation introduced by this commit differs as follows: - The reservation mechanism provided by GprsMs is used to avoid incompatibilities is used in the same way like algo A does. This basically means, that the allocation is done once when the first TBF is requested and then used until all TBF have been released. - All combinations of Rx and Tx slots are checked for compatibility with the multiscot class. Basically the combination with the most usable PDCH and the least number of reservations is used. - Only one UL slots is provided. - Tta and Tra are checked. Sponsored-by: On-Waves ehf
2015-07-03tbf: Remove call to update() in reuse_tbfJacob Erlbeck1-24/+0
Since both TBF are based on the same reservation which means that they should be compatible with respect to the slot usage, and since the new TBF has not been forced to single slot usage, an update of the allocation is not necessary now. This commit removes the call to update() from within reuse_tbf(). Sponsored-by: On-Waves ehf
2015-07-03tbf: Set ms in call to tbf_alloc_dl_tbfJacob Erlbeck1-10/+0
The call to tbf_alloc_dl_tbf misses the pointer to the GprsMs object which is already known in that case (tbf_reuse). This leads to a full reallocation of the PDCH slots, which is possibly incompatible with the old set of slots. This can result in hanging TCP connections and TCP connection failures. This commit replaces the old NULL value by the actual GprsMs object. Since the set_ms() is also done within the tbf_alloc_dl_tbf method, that call is removed. Sponsored-by: On-Waves ehf
2015-07-03alloc: Base algo A on reserved PDCHsJacob Erlbeck1-1/+1
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: Load balancing for algo AJacob Erlbeck4-91/+330
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-03ms: Add tbf() method to get the TBF based on the directionJacob Erlbeck3-0/+17
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-03tbf: Maintain the number of TBF per PDCHJacob Erlbeck1-0/+57
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-07-03tbf/test: Add assertionsJacob Erlbeck1-0/+2
These assertions check for the TBF allocation result before the tbf object is dereferenced the first time. Sponsored-by: On-Waves ehf
2015-07-03alloc/test: Use LOGL_DEBUG environment variableJacob Erlbeck1-0/+2
When this environment variable is set, the logging level is set to LOGL_DEBUG to help debugging without putting everything into AllocTest.err. Sponsored-by: On-Waves ehf
2015-07-03alloc/test: Enhance test_alloc_aJacob Erlbeck3-5/+20
This commit adds: - an assertion to check that count is valid, - an assertion the verify that tbf_alloc did not fail - a slots parameter to specify the enabled slots - additional test invocations with more slots enabled Sponsored-by: On-Waves ehf
2015-07-03alloc/test: Add test for successive allocationJacob Erlbeck3-0/+467
This test allocates as many as possible UL/DL TBF pairs, shows their PDCH usage, and checks how many of them has been created successfully. Sponsored-by: On-Waves ehf
2015-06-29tbf: Always create an MS object on TBF allocationJacob Erlbeck1-121/+131
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 Erlbeck2-9/+9
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 Erlbeck1-3/+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-29llc/test: Use a portable way to set timeval variablesJacob Erlbeck1-8/+12
Using complex initialiser lists doesn't seem to work well with Debian Squeeze. This commit changes the initialisation to use separate assignments instead. Fixes: Jenkins #601, #602 Addresses: CXX LlcTest.o ../../tests/llc/LlcTest.cpp: In function 'void test_llc_meta()': ../../tests/llc/LlcTest.cpp:137: error: expected primary-expression before '.' token ../../tests/llc/LlcTest.cpp:137: warning: extended initializer lists only available with -std=c++0x or -std=gnu++0x Sponsored-by: On-Waves ehf