aboutsummaryrefslogtreecommitdiffstats
path: root/tests/tbf
AgeCommit message (Collapse)AuthorFilesLines
2015-07-16tbf: Put the TFI->TBF mapping into the PDCH objectsJacob Erlbeck2-9/+9
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 Erlbeck1-138/+46
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 Erlbeck2-124/+190
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-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-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 Erlbeck1-0/+139
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 Erlbeck2-0/+14
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-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 Erlbeck1-1/+1
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-22tbf: Fix downlink packet lossJacob Erlbeck2-7/+52
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-22tbf/test: Add test for DL LLC packet lossJacob Erlbeck3-0/+132
Currently LLC frames are lost or even reordered when the TBF has be established via the AGCH and the procedure fails for some reason. This test tries to reproduce this behaviour by throwing away the first TBF while calling the handle() method several times. The results of create_dl_acked_block() are checked against expected values (this is currently party disabled because the bug still persists). Ticket: #1759 Sponsored-by: On-Waves ehf
2015-06-22tbf: Include CS into create_new_bsn log messageJacob Erlbeck1-27/+27
This change lets the test suite fail, so it get its own commit. Sponsored-by: On-Waves ehf
2015-06-22l1: Pass all L1 measurements upwardsJacob Erlbeck1-3/+6
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-08tbf: Move the current CS field to GprsMsJacob Erlbeck2-6/+8
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-08tbf: Store MS class in GprsMs objectsJacob Erlbeck1-0/+37
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-05-28tbf: Store the timing advance (TA) value in the GprsMs objectJacob Erlbeck2-44/+26
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 Erlbeck3-0/+242
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 Erlbeck2-11/+10
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-28ms: Use the IMSI to retrieve the MS objectJacob Erlbeck2-7/+9
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 Erlbeck3-0/+131
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 Erlbeck2-35/+70
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 Erlbeck2-6/+1
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-21tbf: Just pass the MS object in reuse_tbfJacob Erlbeck1-8/+0
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 Erlbeck1-1/+1
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-21ms: Support new and old TLLIsJacob Erlbeck2-10/+28
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-20tbf/test: Optionally show talloc reportJacob Erlbeck1-0/+3
To show the talloc report more easily, this commit adds a call to talloc_report_full if the TALLOC_REPORT_FULL environment variable is set (the value is ignored). Since the stderr output is checked by the test suite, this feature is not enabled by default. Sponsored-by: On-Waves ehf
2015-05-20tbf: Add MS object management to TBF codeJacob Erlbeck1-0/+72
This commit adds MS object creation and cleanup to the TBF related code. MS objects are created when a TBF that has been "anonymous" so far gets associated with a TLLI. When a TBF is replaced by another, the old TBF is detached and the new one is attached to the MS. When all TBFs have been detached, the MS object gets deleted. The TBF related code should not call attach_tbf/detach_tbf directly but use set_ms instead to make sure, that the references are updated properly. GprsMs::detach_tbf also calls set_ms(NULL) on the detached TBF object. The MS object is not really used yet, the focus is still on object creation, TBF association, and cleanup. Ticket: #1674 Sponsored-by: On-Waves ehf
2015-05-04tbf/test: Fix old_tbf argument to tbf_alloc_ul_tbfJacob Erlbeck1-1/+1
Currently the ul_tbf is used in its own declaration as an argument to tbf_alloc_ul_tbf, where dl_tbf can be used instead and makes more sense. This commit uses dl_tbf instead of ul_tbf as old_tbf. Addresses: tbf/TbfTest.cpp:71:14: warning: ‘ul_tbf’ may be used uninitialized in this function Sponsored-by: On-Waves ehf
2015-04-09tbf: Send BSSGP LLC discarded on TBI exhaustionJacob Erlbeck1-0/+1
Currently the PCU silently discard LLC frames from the SGSN if a DL TBF cannot be allocated. This commit changes tbf_new_dl_assignment and reuse_tbf to send an LLC discarded message to the SGSN in this case. Ticket: #607 Sponsored-by: On-Waves ehf
2015-04-09tbf/test: Add test for DL TBF exhaustionJacob Erlbeck3-0/+601
This test calls gprs_rlcmac_dl_tbf::handle() with varying TLLI and IMSI until the function fails. Sponsored-by: On-Waves ehf
2015-03-25tbf: Poll MS on idle DL TBFsJacob Erlbeck1-27/+27
If an MS wants to open a new UL TBF, it can either use (P)RACH or request one in a Ack/Nack message for a DL TBF (PACCH). When a TBF becomes idle (LCC queue is empty but the TBF is kept open), there aren't any Ack/Nack requests that can be used by the MS to ask for an UL TBF, therefore it has to use the RACH. This leads to many RACH requests even for a single HTTP transaction, so it takes some time to retrieve even a simple web page. This commit modifies the scheduler to regularly send Ack/Nack requests on idle DL TBFs. It does so by extending the priority based scheduling algorithm to have 5 priority levels (highest priority first): - Control block is pending - High age (100%) threshold reached (-> request Ack/Nack) - Data is waiting or there are pending Nacks - Low age (200ms) threshold reached (-> request Ack/Nack) - Pending Nacks that have been resent already - None of the above (-> send DL dummy control block) The 'age' refers to the time since since the last control block has been sent on the TBF. This high age threshold is set to dl-tbf-idle-time or to 50% of T3190 (whichever is smaller), aiming for at least a poll (and TBF shutdown) after the TBF has expired and to safely prevent expiry of T3190. So if dl-tbf-idle-time > 200ms, there will be a poll every 200ms and a final poll after dl-tbf-idle-time. On high load, the interval between polls can get higher, but the 'high age' poll should be in place. This commit implements the scheduling with respect to GSM 44.060, 9.3.1a ("Delayed release of downlink TBF"). Ticket: #556 Sponsored-by: On-Waves ehf
2015-03-25tbf/test: Add test for delayed releaseJacob Erlbeck3-0/+293
This tests checks the implementation of the delayed release of an downlink TBF. Ticket: #556 Sponsored-by: On-Waves ehf
2015-03-25tbf: Use put_frame in append_data if the TBF has no dataJacob Erlbeck1-18/+12
Currently if append_data() is used when there is no LLC data in the DL TBF, it will either call reuse_tbf() which in turn will call put_frame(), or it will append the LLC message to the queue, even if the queue and the frame buffer are empty. This only happens with the test case so far, but this would change when idle DL TBFs are kept open for some time. It results in empty LLC message being sent to the MS (see log below). This commit changes append_data to check for this case and to eventually use put_frame() instead of appending the LLC data to the queue. Addresses: TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==0) - Sending new block at BSN 0 -- Chunk with length 0 is less than remaining space (20): add length header to to delimit LLC frame Complete DL frame for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=FLOW)len=0 - Dequeue next LLC for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=FLOW) (len=200) Sponsored-by: On-Waves ehf
2015-03-25tbf/test: Fix fn/block_nr in test_tbf_final_ackJacob Erlbeck2-8/+25
Currently fn and block_nr are not incremented correctly. In addition, the comments around the sending of blocks are not accurate either. This commit introduces the send_rlc_block helper function which takes care of the increments, updates the comments to reflect what is really happening, and adds assertion to verify at least some aspects of what is now stated in the comments. Sponsored-by: On-Waves ehf
2015-03-25tbf/test: Put BTS setup and DL TBF creation into helper functionsJacob Erlbeck1-23/+45
Put the generic parts of test_tbf_final_ack into helper functions to reduce the size of the test and to avoid too much code duplication when creating new tests. Sponsored-by: On-Waves ehf
2015-03-06tbf: Reduce m_new_tbf logging messagesJacob Erlbeck1-2/+0
Currently tbf->m_new_tbf may point to itself if no new TBF is assigned. But this leads to additional logging messages, since the code in set_new_tbf and tbf_free assumes, that a real new TBF is assigned and generates log messages accordingly. This commit adds checks to avoid those messages in the above case. Sponsored-by: On-Waves ehf
2015-03-06tbf: Add name() method and put the buf into the tbfJacob Erlbeck1-4/+4
Currently tbf_name() must not be used twice in a printf statement with different TBFs, since the same baffer will be used for each. This commit puts the text buffer into struct gprs_rlcmac_tbf to avoid this problem. Sponsored-by: On-Waves ehf
2015-02-23tbf: Fix dangling m_new_tbf pointerJacob Erlbeck2-6/+19
Currently if a 'new' TBF is freed before the 'old' one (where old_tbf->m_new_tbf == new_tbf), the old_tbf->m_new_tbf is not cleared and can be accessed later on. This can lead to inconsistencies or segmentation faults. This commit adds m_old_tbf which points back from new_tbf to old_pdf. m_new_tbf and m_old_tbf are either both set to NULL or one is the reverse pointer of the other (tbf->m_new_tbf->m_old_tbf == tbf and tbf->m_old_tbf->m_new_tbf == tbf). It extends set_new_tbf and tbf_free to update the pointee accordingly. The TBF test is extended to check this invariant at several places. Sponsored-by: On-Waves ehf
2015-02-23tbf/test: Modify test to create a dangling TBF pointerJacob Erlbeck2-4/+86
When new_tbf is freed before dl_tbf in test_tbf_final_ack, dl_tbf still contains a pointer to it in m_new_tbf. This patch changes the test to accept a test mode parameter and runs it twice which a different order of tbf_free in each run. Consistency checks are added, to check for a danglilng m_new_tbf pointer in both cases. Sponsored-by: On-Waves ehf
2014-09-19tests/tbf: Commit TbfTest.err *with* whitespace "errors"Daniel Willmann1-4/+4
Otherwise the diff and hence the test will fail...
2014-09-19tests/tbf: Use correct function to enqueue llc dataDaniel Willmann2-14/+11
The test called the llc enqueue() function directly which didn't take care of prepending the tv values for the timeout to the data. Now the test uses dl_tbf.append() which takes care of prepending the tv values. With this patch make distcheck on jenkins should no longer fail with "Discarding LLC PDU because lifetime limit reached." messages.
2014-09-10tests/tbf: Test for final ack issueDaniel Willmann2-0/+142
Ticket: SYS#382 Sponsored-by: On-Waves ehf
2014-08-15tbf: Include TBF state in tbf_name outputDaniel Willmann1-3/+3
Sponsored-by: On-Waves ehf