aboutsummaryrefslogtreecommitdiffstats
path: root/src/rlc.h
AgeCommit message (Collapse)AuthorFilesLines
2017-01-24Add test case for testing PUANsivasankari1-0/+13
This test case is for testing generation of EGPRS PUAN. Corresponding log files .ok and .err are modified. Change-Id: I18e6d4a9e90fd6453fe14187beab27dfeae8dbe9
2017-01-23Add compression support in EGPRS PUANsivasankari1-0/+1
This adds compression of bitmap in PUAN. The compressed bitmap is used only if the number of bits in the bitmap does not fit in the message and there is a gain after compression. The algorithm is part of libosmocore and so there is dependency on the libosmocore for compilation. The algorithm is tested on integration setup by forcing compression. Change-Id: Id2eec4b5eb6da0ebd24054b541b09b700b9b40ba
2016-11-02Modify return type of gprs_rlc_dl_window::distance to uint16_taravind sirsikar1-2/+2
Since there is a "&mod_sns()" present in this function, the outcome is always unsigned. Change-Id: I66f3db4dc27a6cbef146c832bf8b43f1492358a4
2016-08-25Modify EGPRS DL TBF flow to support SPBAravind Sirsikar1-3/+4
Modify the EGPRS DL TBF flow to support Split block during Retx. This patch will also Upgrade the test suite with test cases to validate the EGPRS Downlink SPB for Retransmission Scenarios like MCS6->MCS3, MCS4->MCS1, MCS5->MCS2, MCS9->MCS3 MCS7->MCS2, MCS8->MCS3 have been simulated and Integration tested in NuRAN 1.0 hardware thoroughly. Change-Id: I242afdd8ae7622dec8593b26382ad66bad5b9516
2016-08-25Add data structure to handle SPB for EGPRS DLAravind Sirsikar1-4/+41
Modify the header files with necessary data structure to handle Split block for EGPRS DL TBF. The EGPRS resegmentation feature allows PCU to retransmit RLC blocks of HeaderType1, HeaderType2 by segmenting them to 2 HeaderType3 blocks(Example MCS5 will be retransmitted as 2 MCS2 blocks). Table 10.4.8b.2 of 44.060 explains the possible values of SPB in HeadrType3 for DL direction. The PCU decides to retransmit the blocks by resegmenting it based on Table 8.1.1.1 of 44.060. The retransmission MCS is calculated based on current MCS of the Block and demanded MCS by PCU. Section 10.3a.3.3 of 44.060 shows the HeadrType3 with SPB field present in it Change-Id: I57673e53a9da2affa7e8aaa6551ac4b271c3d525
2016-08-02Add data structure for SPB in EGPRS ULAravind Sirsikar1-0/+40
Modify header files with data structures required to support split blocks for EGPRS UL TBF This feature provides provision for MS to retransmit RLC blocks of HeaderType1, HeaderType2 by segmenting them to 2 HeaderType3 blocks(Example MCS5 will be retransmitted as 2 MCS2 blocks). Table 10.4.8b.1 of 44.060 explains the possible values of SPB in HeadrType3 for UL direction. When the MCS is changed at the PCU, PCU directs the changed MCS to MS by PUAN or UPLINK ASSIGNMENT message along with RESEGMENT flag, Then MS may decide to retransmit the blocks by resegmenting it based on Table 8.1.1.1 of 44.060. The retransmission MCS is calculated based on current MCS of the Block and demanded MCS by PCU. Section 10.3a.4.3 of 44.060 shows the HeadrType3 with SPB field present in it. Change-Id: I83ccd136bb361adcfd511c57c5a9d95ed72c36c2
2016-07-14egprs: Use RLC/MAC headers from libosmocoreTom Tsou1-99/+0
EGPRS Type 1, 2, and 3 headers are used by OsmoPCU and OsmoBTS. Move the header definitions to libosmocore to be shared by both packages. Modify the struct variable naming to use *_hi/*_lo instead of *_a/*_b in order to be consistent with existing naming used in libosmocore. Change-Id: I98687ad981d27502aec42729611937ba1caf207c
2016-07-12Add data structure for ARQ-II in EGPRS DLAravind Sirsikar1-1/+11
Modify the existing data structure to support ARQ-II for Retx in EGPRS DL. This will also hadle compilation issue related to renaming the variable. Change-Id: I734b1024bb32f2daa43af4adf59f4a17f2294afe
2016-06-01rlc.h: correct gprs_rlc_data commentAlexander Couzens1-2/+2
It's the block data, not the history. Also add including LI headers. Change-Id: Id4d99d1d21c7fa372771fd569d87bbcf2c6b6d22 Reviewed-on: https://gerrit.osmocom.org/144 Reviewed-by: Harald Welte <laforge@gnumonks.org> Tested-by: Jenkins Builder
2016-05-25rlc.h: remove duplicated define RLC_EGPRS_SNSAlexander Couzens1-1/+0
The second #define RLC_EGPRS_SNS is 3 lines below of the first one. Change-Id: Ibb718ba9be21831c56c5949e730fab5acd691d7c Reviewed-on: https://gerrit.osmocom.org/107 Tested-by: Jenkins Builder Reviewed-by: Holger Freyther <holger@freyther.de>
2016-03-30Support puncturing scheme selection for EGPRS DLAravind Sirsikar1-1/+5
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-30Update CPS calculation with new data structuresAravind Sirsikar1-2/+2
Update existing CPS calculation function to align with new data structure introduced
2016-03-30Add data structure for CPS calculation in DLAravind Sirsikar1-0/+24
Define new data structure with respect to TS 44.060 10.4.8a.3.1, 10.4.8a.2.1, 10.4.8a.1.1 for puncturing scheme values and initialize the variable introduced
2016-03-16Introduce EGPRS header type1 and type2 in ULAravind Sirsikar1-0/+38
Defines new structures for UL EGPRS header type1 and type2 for supporting MCS5-MCS9
2016-02-08edge: Send a second BSN block in an RLC message if possibleJacob Erlbeck1-0/+1
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-08rlc: Add gprs_rlc_mcs_cps_decodeJacob Erlbeck1-0/+2
To access EGPRS data blocks, the optional padding must be taken into account. Whether padding has been used must be dervied from the CPS field in the header of the RLC EGPRS data message. Add this function to decode the CPS value and extract that information. Sponsored-by: On-Waves ehf
2016-02-08rlc: Add with_padding argument to gprs_rlc_data_info_init_dl/ulJacob Erlbeck1-3/+4
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-08rlc: Support encoding of EGPRS header type 1 + 2Jacob Erlbeck1-1/+31
Currently only header type 3 (MCS-1 to MCS-4) is supported. Add header structs to rlc.h and extend Encoding::rlc_write_dl_data_header accordingly. Sponsored-by: On-Waves ehf
2016-02-08rlc: Add unified gprs_rlc_window parent classJacob Erlbeck1-50/+28
Currently gprs_rlc_ul_window and gprs_rlc_dl_window are completely separate classes, containing several identical members and methods. This commit add a shared parent class containing WS and SNS handling. Sponsored-by: On-Waves ehf
2016-02-08edge: Add bitvec based DL window updating methodsJacob Erlbeck1-0/+4
The current methods are based on the GRPS specific RBB and SSN values and formats which are not compatible with EGPRS. Add a second set of similar methods with the same semantics but which are based on a bitvec and the first BSN instead. The following methods are affected: - gprs_rlc_dl_window::update - gprs_rlcmac_dl_tbf::rcvd_dl_ack - gprs_rlcmac_dl_tbf::update_window Sponsored-by: On-Waves ehf
2016-02-05edge: Provide and use CS -> CPS conversionJacob Erlbeck1-0/+1
The MS' RLC receiver needs a valid CPS field to decode the block. Add the function gprs_rlc_mcs_cps to generate the CPS value based on coding scheme, puncturing, and padding. Sponsored-by: On-Waves ehf
2016-02-05edge: Add encoder for downlink RLC data blocksJacob Erlbeck1-0/+15
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 Erlbeck1-0/+7
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-05rlc: Add info fields for downlinkJacob Erlbeck1-1/+5
This commit extends gprs_rlc_data_info and gprs_rlc_data_block_info by the fields required for downlink RLC data messages. Sponsored-by: On-Waves ehf
2016-02-05edge: Rename gprs_rlc_ul_header_egprs and gprs_rlc_ul_data_block_infoJacob Erlbeck1-4/+4
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-01tbf: Use LListHead instead of llist_podsJacob Erlbeck1-5/+1
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-01rlc: Make WS and SNS variableJacob Erlbeck1-7/+28
Currently the values for WS and SNS are fixed to 64 (WS) and 128 (SNS) which are the only values that can be used with GPRS. On the other hand, EGPRS requires an SNS of 2014 and a WS in the range of 64 to 1024. This commit adds member variables and setters to both window classes. By default, the GPRS values are being used. Sponsored-by: On-Waves ehf
2016-02-01rlc: Add constructor to window classesJacob Erlbeck1-0/+16
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/edge: Consistently use uint16_t for BSNs and SSNsJacob Erlbeck1-5/+5
Currently in some places uint8_t is being used to encode BSNs and SSNs. This is inconsistent and (even worse) not enough for EPGRS which uses an SNS of 2014. This commit changes these to uint16_t. Sponsored-by: On-Waves ehf
2016-02-01rlc: Add and use mod_sns(bsn) methodJacob Erlbeck1-4/+16
Currently there is only a mod_sns() method which is being used in expression like bsn_expr & win.mod_sns(). This only works, because it is known that mod_sns() is (sns() - 1) where sns() in turn is always 2^n. This is error prone, hard to read, and relies on window specifics that should be kept inside the respective module. This commit adds a mod_sns(uint bsn) method to gprs_rlc_ul_window and gprs_rlc_dl_window, that encapsulates and hides this optimized computation. Sponsored-by: On-Waves ehf
2015-12-16edge: Add methods for unified GPRS/EGPRS UL data block handlingJacob Erlbeck1-0/+1
The current rcv_data_block_acknowledged_gprs method is tightly coupled to GPRS. This commit adds variants of the involved methods that support EGPRS and GPRS RLC encodings likewise. Sponsored-by: On-Waves ehf
2015-12-16edge: Store GprsCodingScheme in gprs_rlc_dataJacob Erlbeck1-1/+1
Currently the coding scene is stored as number N, where there scheme is CS-N. This commit replaces this by a GprsCodingScheme type cs value. The gprs_rlcmac_cs table is no longer needed and thus removed. Sponsored-by: On-Waves ehf
2015-12-16edge: Add is_received and invalidate_bsn to gprs_rlc_ul_windowJacob Erlbeck1-0/+11
These methods will be needed for EGPRS decoding. The is_received method returns true iff a block with the given BSN has already been received in the current window. A call to invalidate_bsn marks the block as not received. Sponsored-by: On-Waves ehf
2015-12-16rlc: Do not raise_v_q in receive_bsnJacob Erlbeck1-1/+1
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
2015-12-16edge: Add unified decoder methods for GPRS/EGPRSJacob Erlbeck1-0/+46
This commit adds new RLC block decoder functions that support both GPRS and EGPRS. The code path is selected based on the value of the GprsCodingScheme cs object. - rlc_parse_ul_data_header parses the header of an RLC data block including the E and FBI/TI flags (currently supported CS-1 - CS-4, MCS-1 - MCS-4). - rlc_copy_to_aligned_buffer copies an RLC data unit to a byte aligned buffer and returns the unit's length. - rlc_get_data_aligned is a convenience wrapper around rlc_copy_to_aligned_buffer that avoids copying if the data unit is already byte aligned. Sponsored-by: On-Waves ehf
2015-12-15rlc: Check endianness for bit field declarationsJacob Erlbeck1-0/+6
Currently the declarations of rlc_ul_header, rlc_dl_header, and rlc_li_field silently assume that a gcc for a little endian platform is being used. This commit adds '#if OSMO_IS_LITTLE_ENDIAN' the ensure the correct byte ordering. Sponsored-by: On-Waves ehf
2015-06-08tbf: Add adaptive DL CS adjustmentJacob Erlbeck1-0/+2
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
2014-08-07tbf, ...: Make the fields in the dl/ul struct member variablesDaniel Willmann1-0/+1
There is no need for the union/struct anymore. Make the variable members of the UL/DL class. As a result gprs_rlc_dl_window gets a reset() method because memset(&dir.dl, 0, sizeof(dir.dl)) doesn't work anymore in reuse_tbf(). Ticket: SYS#389 Sponsored by: On-Waves ehf
2014-07-02misc: Do not mix struct/class in the forward declarationHolger Hans Peter Freyther1-1/+1
2014-01-15rlc: Rename state() to show_state() to better reflect its functionDaniel Willmann1-1/+1
show_state() is only used for debugging output to make the v(b) array human readable.
2014-01-15rlc: Use an enum for the state array instead of charsDaniel Willmann1-31/+45
gprs_rlc_bsn_state is now used to hold the ACK state of sent/received rlc packets.
2014-01-15rlc/tbf: Move v_b into DL windowDaniel Willmann1-38/+46
Move functions resend_needed(), mark_for_resend(), update(), move_window(), state(), count_unacked() out of v_b directly into the UL window and provide a function get_state in v_b to access the v_b elements.
2014-01-15rlc/tbf: Add function receive_bsn that updates v_r, v_q, v_nDaniel Willmann1-0/+2
We don't need to expose the mecanics of updating the variables to the outside.
2014-01-15rlc/tbf: Move v_n into gprs_rlc_ul_window and adapt the testsDaniel Willmann1-18/+20
v_n is part of the UL window handling so move it inside the ul_window
2014-01-15rlc: Rename the simple raise_v_r method to avoid naming conflictsDaniel Willmann1-2/+2
2013-12-12rlc: Manage the received block bitmap in the ul_windowDaniel Willmann1-0/+8
Added two methods to gprs_rlc_ul_window * ssn() returns the starting sequence number * update_rbb() returns an array of chars representing the state of the received block bitmap. Each element is either 'I'nvalid or 'R'eceived. The rbb is generated from v_n rbb[63] relates to BSN ssn-1 ... rbb[0] relates to BSN ssn-64
2013-12-04rlc: Make the RLC types only operate on the BSNHolger Hans Peter Freyther1-71/+77
The code has an internal optimization to only use window_size space. This means that the caller needed to know that only half of the size was used. Change the API to work on the BSN and do the mapping internally. The compiler should have plenty of opportunity to propagate the constant(s) but this has not been verified.
2013-11-26tbf/rlc: Move raising of V(Q) into the ul window codeHolger Hans Peter Freyther1-5/+6
2013-11-26rlc/tbf: Move the code to raise V(R) into the ul_window handlingHolger Hans Peter Freyther1-0/+3
2013-11-26tbf/rlc: Move the putting of a block into the rlc codeHolger Hans Peter Freyther1-0/+1