aboutsummaryrefslogtreecommitdiffstats
path: root/tests
AgeCommit message (Collapse)AuthorFilesLines
2016-07-13Modify DL tbf flow for ARQ-II in EGPRS DL RetxAravind Sirsikar1-0/+3
Modify the DL TBF flow to support ARQ-II EGPRS DL retransmission Change-Id: I7a845c98f2018795f0f62240f228411b0bc030c7
2016-06-17Add test cases for Header type1 in EGPRS ULAravind Sirsikar2-0/+124
Update test suite with test cases for Header type 1 in EGPRS UL Change-Id: I21811bb126dbe151b0708a964d3143bc2fd52389 Reviewed-on: https://gerrit.osmocom.org/272 Tested-by: Jenkins Builder Reviewed-by: Harald Welte <laforge@gnumonks.org>
2016-06-15Add test cases for Header Type 2 in EGPRS ULAravind Sirsikar2-1/+128
Updates the test suite to add test cases for Header type 2 parsing in EGPRS UL. Change-Id: I1dd46010065a6d6da21e8e45af71e6d5f649b0b0 Reviewed-on: https://gerrit.osmocom.org/271 Reviewed-by: Harald Welte <laforge@gnumonks.org> Tested-by: Jenkins Builder Reviewed-by: Holger Freyther <holger@freyther.de>
2016-06-10tbf_dl: correct tbf name in log message for moving a DL TBFAlexander Couzens1-1/+1
It makes no sense to call functions on null pointer object. Use the name of the old tbf. Change-Id: I93b8c07a0b2de40a11e94fd6c212897cbe3b50ef Reviewed-on: https://gerrit.osmocom.org/212 Tested-by: Jenkins Builder Reviewed-by: Holger Freyther <holger@freyther.de>
2016-06-07encoding/rlc_copy_from_aligned_buffer: export written payload bytes via an ↵Alexander Couzens1-26/+81
argument Require to count statistics for rlc_dl_payload_bytes. Change-Id: I0e622acb1f13f7489946baf049de4ba1cde6a1fc Reviewed-on: https://gerrit.osmocom.org/142 Tested-by: Jenkins Builder Reviewed-by: Holger Freyther <holger@freyther.de>
2016-03-30Support puncturing scheme selection for EGPRS DLAravind Sirsikar1-26/+26
Adds support to find the puncturing scheme for retransmission with MCS change, retransmission with no MCS change, transmission case. Puncturing scheme selection for retransmission case with MCS change is aligned with TS 44.060 9.3.2.1. Puncturing scheme selection for retransmission without MCS change, fresh transmission is aligned with TS 44.060 10.4.8a.3.1, 10.4.8a.2.1, 10.4.8a.1.1
2016-03-16Fix issue in encoding CSN_RECURSIVE_ARRAYSaurabh Sharan2-0/+9
The remaining_bits_len is correctly decremented while encoding CSN_RECURSIVE_ARRAY for fixing the bug. Details of the bug is in https://projects.osmocom.org/issues/1641 During introduction of basic EGPRS feature new hex dump message PUASS, from a different working network log was used in Unit test. It exposed the issue of incorrect handling of recursive array encoding in osmo-pcu. Fixes: OS#1641
2016-03-15Add test vectors for EGPRS messagesSaurabh Sharan2-2/+37
This patch is the test suite modification for the fix encoding of padding bits. New test vectors have been added both in downlink and uplink.
2016-03-15Fix encoding of padding bits to start with 0 bitSaurabh Sharan3-21/+21
This patch is for fixing encoding of padding bits according to the 3gpp spec 44.060 section 11, wherein it shall always start with 0 bit followed with spare padding bits. During introduction of basic EGPRS feature new hex dump messages from a different working network log were used in Unit test. These exposed the issue of incorrect handling of padding bits encoding in osmo-pcu. Corrections in the existing test vector of rlcmac is also updated. In testsuite tbf appropriate corrections for the Tbftest.err is also done.
2016-02-22alloc: Fix UBSAN for accessing the array at -16Holger Hans Peter Freyther1-3/+3
This test will check that we exhaust the available TFIs, so the last TFI is -16 and then we try to store to that address. It is surprising that it worked!
2016-02-08edge: Work-around to not use MCS-6 with paddingJacob Erlbeck1-4/+6
Currently single BSN blocks of size 68 (a single unit from MCS-8) are put into a MCS-6 block with padding according to TS 44.060 Annex J. Unfortunately, these packets are ignored by the E71. This might be related to the currently incorrect usage of the puncturing schemes and the RSB bit (the puncturing schemes are not updated and the RBS flag is never set). Avoid downgrading from MCS-8 to MCS-6 if there is no second block available. Send the block twice instead. Sponsored-by: On-Waves ehf
2016-02-08edge: Send a second BSN block in an RLC message if possibleJacob Erlbeck1-139/+91
Currently only one BSN block is encoded in each RLC data message, even if MSC7-9 are used, which transport two independant (except for a max BSN delta of 512) BSN blocks. In that case, the same block is just put twice into the same message. The current create_dl_acked_block(fn, ts) method handles block selection (resend, new BSN, dummy block, ...) and restart handling in one method and is too complex to extend it accordingly. Therefore this commit move the block selection/creation handling into a new method (take_next_bsn) which delivers the next BSN along with a hint, whether it may be combined with another block. In that case, the function can be called a second time (this time with a valid previous BSN, that's the one returned by the first call) to get the second BSN. The real block generation method create_dl_acked_block(fn, ts, index, index2) is then called with both BSNs as indices (the second must be -1, if there is only one BSN). Note that every BSN returned by take_next_bsn should be passed to create_dl_acked_block to avoid state inconsistencies. Sponsored-by: On-Waves ehf
2016-02-08edge: Refactor create_dl_acked_block for multi-block supportJacob Erlbeck1-58/+252
Currently the method is hard-coded to support a single BSN only. MCS-7 to MCS-9 encode 2 data blocks into a single RLC data message. This commit refactors create_dl_acked_block to process any number of blocks internally. Note that this does not extend the parameter list accordingly and just duplicates the BSN if these MCS are being used. Sponsored-by: On-Waves ehf
2016-02-08tbf/tests: Add tests for EGPRS TBF establishmentJacob Erlbeck3-16/+1897
Add a test for EGPRS two phase access based on RA caps. Add a test for DL TBFs where data block are encoded with each MCS. Sponsored-by: On-Waves ehf
2016-02-08rlc: Add with_padding argument to gprs_rlc_data_info_init_dl/ulJacob Erlbeck1-18/+18
The offsets of the data areas change when padding is used (see TS 44.060, 9.3.2.1 and Annex J for details). Extend the parameter lists to pass the with_padding flag and use that information to compute the correct offsets. Sponsored-by: On-Waves ehf
2016-02-08cs: Add GprsCodingScheme::optionalPaddingBitsJacob Erlbeck1-1/+2
Return the amount of optional padding bits, which is 6*8 for MCS-3 and MCS-6 and 0 for all other coding schemes. The padding is needed the encode 68 byte data blocks (MCS-8) with these schemes. See TS 44.060, 9.3.2.1 and Annex J for details. Sponsored-by: On-Waves ehf
2016-02-08cs: Add family related methodsJacob Erlbeck1-0/+13
Add family handling and the related methods family, isFamilyCompatible, isCombinable, decToSingleBlock to GprsCodingScheme. Sponsored-by: On-Waves ehf
2016-02-08tbf: Add state WAIT_ASSIGNJacob Erlbeck2-105/+144
Currently the state on the TBF is set to ASSIGN when it is created and in general changed to FLOW when it is acknowledged by the MS. The moment when the assignment is really transmitted to the MS (which can take some time) is not reflected by the state. A TBF can considered to be valid, when the assignment is received by the MS. Add the state WAIT_ASSIGN that is entered when the assigment has been send to the MS (more precisely: when the corresponding RTS has been processed or the message has been sent to the BTS). The TBF, its PDCH(s), and its TFI can be assumed to be valid, when the TBF has a state of WAIT_ASSIGN or higher (assuming that the TBF starting time has not been set, which is currently only done for SBA, which are not associated with a TBF). Note that due to queuing in the BTS there can still be a invalid time period for immediate assignments, when the request is lingering in the AGCH or PCH queues. Sponsored-by: On-Waves ehf
2016-02-08encoding: Redesign Encoding::write_immediate_assignment APIJacob Erlbeck1-7/+7
The EGPRS support will need more information to encode the IMMEDIATE ASSIGMENT. Instead of adding more parameters pass a pointer to the TBF unless an SBA shall be done (indicated by tbf == NULL). All values that can be derived from the TBF and are not needed for an SBA are removed from the parameter list. Return a negative value on error. Sponsored-by: On-Waves ehf
2016-02-08tbf: Use TLLI as ID if TFI not yet assignedJacob Erlbeck1-0/+3
Currently the old TFI is always used as ID when a PACKET DOWNLINK ASSIGNMENT is generated. This fails if the old TBF has not been fully assigned yet. The MS will then ignore the PDA. This commit changes write_packet_downlink_assignment to accept an additional parameter old_tfi_is_valid and uses the new TBF's TLLI instead of the olf TFI if that parameter is set to false. Sponsored-by: On-Waves ehf
2016-02-08tbf: Add check_polling/set_pollingJacob Erlbeck1-8/+24
Currently the checks for and the actual polling is done in several places by copy & paste of several lines of code. This hinders changes of they polling is handled internally and also is likely source of programming mistakes. Separate this into a check_polling function, that checks whether polling is possible and returns the FN and the RRBP to be used in that case. Otherwise the cause is logged (LOGL_DEBUG) and a negative error value is returned. There are no other side effect beside the logging. If the call is successful, the set_polling method can be used to actually register the polling. Extend the encoder functions' parameters lists by an rrbp parameter. Sponsored-by: On-Waves ehf
2016-02-08tbf: Add and use tbf->poll_tsJacob Erlbeck2-16/+17
Currently tbf->control_ts is used to look up an incoming poll response. Since that may eventually change, poll timeouts could theoretically happen in that case. Store the real poll TS in tbf->poll_ts at all places where tbf->poll_fn is set. Do not use tbf->control_ts to look up outstanding polls. Sponsored-by: On-Waves ehf
2016-02-08tbf: Do not reuse old TBF after RACH requestsJacob Erlbeck2-13/+21
Currently existing TBF can be reused after an MS has sent a RACH request. Since the MS can be or most probably is in packet idle mode in that case, the TBF are no longer usable even if they share the PDCHs and the control TS with the new one. There are occasional freezes where the MS does no longer react to messages sent on the PACCH. This change aborts all pending TBFs if a new TBF is or has been established via RACH. Sponsored-by: On-Waves ehf
2016-02-08tbf: Add abort method for downlink TBFJacob Erlbeck1-51/+58
Currently the is a release() function which takes care of statistics and shutdown of properly finished TBFs, but which cannot be used for aborted TBFs. This commit add an abort() method which handles unacked RLC blocks as lost and doesn't start a release timer. This method will be invoked by tbf_free() for downlink TBF. Sponsored-by: On-Waves ehf
2016-02-08tbf: Refactor calls to write_immediate_assignmentJacob Erlbeck1-0/+44
Make use of variables, log them to LOGL_DEBUG, and reduce code duplication. This should help to narrow down the cause why snd_dl_ass are not answered by the MS sometimes. Sponsored-by: On-Waves ehf
2016-02-08tbf: Low prio for BSSPG values for GPRS/EGPRS MS classJacob Erlbeck1-10/+10
Currently the values in the BSSGP RA Cap IE are eventually use overwrite the 'good' values obtained from the MS earlier. Use the 'good' values when the are present, which is assumed if at least one of ms->ms_class() or ms->egprs_ms_class() is set. Sponsored-by: On-Waves ehf
2016-02-08edge: Make window size configurableJacob Erlbeck3-0/+133
Currently the window size is fixed to 64 even for EGPRS. Support dynamic window sizes depending on the number of PDCH. The WS can be set to b + f * N_PDCH. If the result is not valid according to TS 44.060, Table 9.1.9.2.1, the value will be corrected to use the next lower valid value (or 64). The following VTY commands are added (config-pcu node): window-size <0-1024> set base (b) value and leave f unchanged window-size <0-1024> <0-256> set base (b) and factor (f) Sponsored-by: On-Waves ehf
2016-02-08edge: Disable GPRS/EGPRS mixed modeJacob Erlbeck3-0/+38
Currently the plain 'egprs' command enables EGPRS but doesn't prevent phones from being served in GPRS mode if they do not support EGPRS. This involves complex frame allocation implementations in dynamic mode, especially if 8PSK is being used. This is due to the inability of non-EGPRS phone to decode 8PSK USF and ES/P altogether. Since polling has a higher priority than USF, collisions will have to be prevented by the PCU by never using an GPRS USF if it refers to a FN that is already being used for polling. This commit just disables mixed usage by ignoring GPRS-only request if EGPRS is enabled. The following VTY command (config-pcu node) is changed: egprs -> egprs only Sponsored-by: On-Waves ehf
2016-02-08edge: Call update_window even if FINAL_ACK_INDICATION is setJacob Erlbeck1-0/+31
The bitvec RBB is always valid, even when FINAL_ACK_INDICATION is set. This is done by the ack/nack decoder function which fake a bitmap starting with V(A) up to V(S)-1 in that case (see Decoding::handle_final_ack). Call gprs_rlcmac_dl_tbf::update_window unconditionally and only use is_final for logging and TBF state changes in gprs_rlcmac_dl_tbf::rcvd_dl_ack. Sponsored-by: On-Waves ehf
2016-02-08tbf: Use bitvec based window methods for GPRSJacob Erlbeck3-3/+57
Currently the old fixed 64 bit RBB based implementation is used for GPRS. Use the new bitvec based methods instead. Sponsored-by: On-Waves ehf
2016-02-05edge: Support MCS data block encodingJacob Erlbeck1-0/+243
Currently only GPRS data block encoding is supported. This commit adds rlc_data_to_dl_append_egprs which does the EGPRS specific extension and chunk handling. It extends Encoding::rlc_data_to_dl_append to use that function for MCS coding schemes. Sponsored-by: On-Waves ehf
2016-02-05edge: Select implementation by mode in rlc_data_to_dl_appendJacob Erlbeck1-13/+13
Currently the GPRS data block encoding is applied to every coding scheme, even if an MCS is selected. This commit renames the actual encoding function to rlc_data_to_dl_append_gprs (not exported) and puts selection code into Encoding::rlc_data_to_dl_append. This requires an additional cs argument. Sponsored-by: On-Waves ehf
2016-02-05edge: Use rlc_data_to_dl_append in create_new_bsnJacob Erlbeck1-14/+14
Currently TBF related tasks (status changes, counter updates, LLC dummy command insertion) as well as RLC data block generation are done within create_new_bsn. The data block creation part has already been copied to the stateless Encoding::rlc_data_to_dl_append function. This commit changes create_new_bsn to use the encoder function and just care about the TBF related stuff. Since the rlc_data_to_dl_append function has been validated against the test cases being described in annex B of TS 44.060, this commit fixes an encoder bug which leads to broken LLC frames in a special case (see example B.2, the main header's E bit was erroneously set to 1 in that case). When this happens, the LLC frame will get discarded after reassembly, so that TCP will have to retransmit the lost packet. Sponsored-by: On-Waves ehf
2016-02-05edge: Add Encoding::rlc_data_to_dl_appendJacob Erlbeck2-0/+253
This function appends a single chunk to an RLC downlink data block. The implementation is basically taken from the gprs_rlcmac_dl_tbf::create_new_bsn method without the TBF related functionality and any side effects. Note that it still only supports GRPS. Sponsored-by: On-Waves ehf
2016-02-05edge: Use RLC data block encoding functionsJacob Erlbeck1-71/+142
This commit removes the use of struct rlc_dl_header from gprs_rlcmac_dl_tbf::create_dl_acked_block and gprs_rlcmac_dl_tbf::create_new_bsn. Instead of patching the data area directly, the RLC block encoding functions are used. Note that the data unit encoding is still hard-coded to GPRS in create_new_bsn, so using MCS 1-4 (albeit being supported by the encoder) will not work yet. Sponsored-by: On-Waves ehf
2016-02-05tbf/test: Add missing function name printfsJacob Erlbeck2-0/+14
Some test function don't have the "=== start/end ===" printfs. Sponsored-by: On-Waves ehf
2016-02-05edge: Add encoder for downlink RLC data blocksJacob Erlbeck1-0/+70
Currently the (GPRS) RLC block encoding is done by setting the header fields directly in gprs_rlcmac_dl_tbf::create_new_bsn. This is much more complex with EGPRS, since the data fields are not byte aligned, the header formats depend on the header type, and the mapping of bits to bytes is LSB first. This commit adds Encoding::rlc_write_dl_data_header which writes the header according to the given gprs_rlc_data_header structure. Encoding::rlc_copy_from_aligned_buffer is also added to copy byte sequences into the message. Note that the actual encoding of data units is not yet present. Sponsored-by: On-Waves ehf
2016-02-05edge: Add init functions for gprs_rlc_data_infoJacob Erlbeck2-0/+20
Add the functions gprs_rlc_data_info_init_dl/ul which initialise a gprs_rlc_data_info structure depending on the coding scheme. The fields num_data_blocks, data_offs_bits, cs, and the data_blocks are valid after this call. The other fields are set to 0. The data blocks are initialised to the correct data_len, e == 1 (no extension header field), cv == 15 (not a final block). The other data block fields are set to 0. The gprs_rlc_data_block_info can also be initialised separately by using the gprs_rlc_data_block_info_init function. Sponsored-by: On-Waves ehf
2016-02-05edge: Fix RLC message sizeJacob Erlbeck1-4/+4
Currently the RLC message length that is obtained from the DSP is reduced by 1 if the last byte of the buffer includes spare bits. While this worked well with GPRS, these bits are being used to encode RLC blocks in EGPRS mode. Thus this last byte must not be chopped off. The functionality of the code is not affected by this, since the modified length value is not used. This commit adds GprsCodingScheme::usedSizeDL/UL to return the number of bytes needed to encode the message block. If there are single bits at the end that are to be used (EGPRS), the functions return the number of full bytes plus 1 (which is the buffer size reported by the DSP and returned by sizeUL/sizeDL). The commit also removes the len parameter from rcv_data_block_acknowledged. Sponsored-by: On-Waves ehf
2016-02-05edge: Rename gprs_rlc_ul_header_egprs and gprs_rlc_ul_data_block_infoJacob Erlbeck1-1/+1
These struct names are more specific than necessary. They are used for GPRS (uplink) already. In downlink direction, only a few fields will be added to the header struct. Add addition, gprs_rlc_ul_header_egprs does not map directly to an encoded header, like many other 'header' structs do. Change the names to fit both modes and both directions: gprs_rlc_ul_header_egprs -> gprs_rlc_data_info gprs_rlc_ul_data_block_info -> gprs_rlc_data_block_info Sponsored-by: On-Waves ehf
2016-02-05edge: Enable EGPRS in downlink TBFsJacob Erlbeck1-51/+51
Currently GPRS is always used for downlink, which violates TS 44.060 (concurrent TBF must have the same mode). Enable EGPRS mode for downlink if the EGPRS MS class is != 0 and EGRPS has been enabled. Note that EGPRS Ack/Nack handling is not yet implemented, so enabling EGPRS will not work still. But we will now get EGPRS DL ACK/NACK messages now from the MS. Sponsored-by: On-Waves ehf
2016-02-01edge: Replace integer cs by GprsCodingSchemeJacob Erlbeck2-72/+72
Currently the TBF and MS object use a plain integer value (current_cs) to manage the coding scheme. This makes it difficult to support the MCS schemes. GprsCodingScheme supports a partial ordering of these values (CS and MCS) and provides safe increment and decrement methods. Use the GprsCodingScheme type instead of integer for cs fields and variables. Add a 'mode' to GprsMs which can be set to either GPRS, EGPRS, or EGPRS_GMSK which also set the initial values of current_cs_ul/dl. Select the mode based on max_mcs_ul and max_mcs_dl. Sponsored-by: On-Waves ehf
2016-02-01edge: Add methods and operators to GprsCodingSchemeJacob Erlbeck1-3/+4
Add a few new operators and methods to support the use of GprsCodingScheme instead of the plain integer currently used. Sponsored-by: On-Waves ehf
2016-02-01tbf: Use LListHead instead of llist_podsJacob Erlbeck1-6/+6
LListHead does basically the same like llist_pods, but more C++ish and with type safety. This commit turns the former list field of gprs_rlcmac_tbf into a private field, provides accessors, moves the related code from pcu_vty.c to pcu_vty_functions.cpp, and removes the llist_pods type and related code. Sponsored-by: On-Waves ehf
2016-02-01edge/test: Rename test_rlc_decoder to test_rlc_unit_decoderJacob Erlbeck2-4/+4
This test only covers RLC data units and not whole RLC messages. Sponsored-by: On-Waves ehf
2016-02-01rlc: Add constructor to window classesJacob Erlbeck1-3/+3
Currently the gprs_rlc_dl_window and gprs_rlc_ul_window do not have constructors, but need to get initialized explicitly. This commit adds constructors to both classes and removes explicit external initialization code. Sponsored-by: On-Waves ehf
2016-02-01rlc: Dump RLC data for debuggingJacob Erlbeck1-0/+18
Log incoming RLC data messages and RLC data units to LOGL_DEBUG. Sponsored-by: On-Waves ehf
2015-12-16edge: Use a single PDCH rcv_data_block method for GPRS and EGPRSJacob Erlbeck1-37/+44
Currently GPRS is handled by the old code path while EGPRS already uses the unified functions. The rcv_block_egprs is basically not specific to EGPRS and just needs minor modifications to handle GPRS. This commit turns gprs_rlcmac_pdch::rcv_block_egprs into a unified rcv_data_block method and uses it for GPRS, too. Note that the logging messages of the new parser are different. Sponsored-by: On-Waves ehf
2015-12-16tbf: Refactor parts of extract_tlli into set_tlli_from_ulJacob Erlbeck1-2/+2
Currently gprs_rlcmac_tbf::extract_tlli takes care of decoding and the TBF update. These are really different things and doing the decoding in extract_tlli makes EGPRS support more complex. This commit moves the TBF state related part into a new method gprs_rlcmac_tbf::set_tlli_from_ul. Sponsored-by: On-Waves ehf
2015-12-16rlc: Do not raise_v_q in receive_bsnJacob Erlbeck1-8/+17
Currently gprs_rlc_ul_window::receive_bsn calls raise_v_q and returns the number of RLC data blocks that can be taken from the queue. This does not fit the EGPRS feature to put 2 independant data blocks in a single RLC block. This commit removes raise_v_q from receive_bsn, hence it must be called explicitely to get the number of processable data blocks. Sponsored-by: On-Waves ehf