aboutsummaryrefslogtreecommitdiffstats
path: root/src/bts.cpp
AgeCommit message (Collapse)AuthorFilesLines
2016-02-08edge: Disable GPRS/EGPRS mixed modeJacob Erlbeck1-0/+1
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: Use bitvec based window methods for EGPRSJacob Erlbeck1-23/+12
Currently a faked 'old' RBB with 64 ACKs is being used. Use the new bitvec based methods instead. Sponsored-by: On-Waves ehf
2016-02-08tbf: Use bitvec based window methods for GPRSJacob Erlbeck1-2/+21
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-08edge: Handle EGPRS PACKET DOWNLINK ACK NACKJacob Erlbeck1-0/+120
Currently this message is ignored. Support decoding and handling of this message. Use a bitvec for the decoder that just represents a BSN sequence without any encoding details (first bit -> first BSN). Return the corresponding BSN range (snsmod(bsn_begin + bits_in_bitvec) = bsn_end), so snsmod(bsn_end-1) is the last BSN if there is at least 1. If bsn_begin == bsn_end, no BSNs has been added. Note that this bitvec is not yet used for RBB handling. It just calls the old rcvd_dl_ack with a faked (all bits are 1) RBB map. Sponsored-by: On-Waves ehf
2016-02-05edge: Fix RLC message sizeJacob Erlbeck1-3/+3
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-01tbf: Use LListHead instead of llist_podsJacob Erlbeck1-14/+17
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-01tbf: Replace static casts by calls to as_ul_tbf/as_dl_tbfJacob Erlbeck1-8/+6
Currently casts from gprs_rlcmac_tbf to gprs_rlcmac_ul_tbf and gprs_rlcmac_dl_tbf are done by using static_cast. This doesn't provide protection against converting a gprs_rlcmac_ul_tbf pointer to a gprs_rlcmac_dl_tbf pointer and vice versa. This commit provides two functions as_ul_tbf and as_dl_tbf, that behave similar like dynamic_cast but use the direction field instead of RTTI. Sponsored-by: On-Waves ehf
2016-02-01rlc: Dump RLC data for debuggingJacob Erlbeck1-0/+2
Log incoming RLC data messages and RLC data units to LOGL_DEBUG. Sponsored-by: On-Waves ehf
2016-02-01pcu: Fix memory corruption bugs (ASAN)Jacob Erlbeck1-0/+5
ASAN has found improper deletion of objects. These only occur on shutdown but makes it impossible to run the test cases with full ASAN support. This commit fixes some of them and deactivates the freeing of the_pcu.bctx which may cause a corruption in BTS::~BTS() later on. Note that the latter is only a work-aound and should be fixed properly. It will leak bctx objects, but this is currently not critical, since gprs_bssgp_destroy is only called once, immediately before a call to exit(). Ticket: OW#1572 Sponsored-by: On-Waves ehf
2015-12-16edge: Remove unused GPRS functionsJacob Erlbeck1-21/+0
This commit removes the code that is no longer used due to the commit "Use a single PDCH rcv_data_block method for GPRS and EGPRS". Sponsored-by: On-Waves ehf
2015-12-16edge: Use a single PDCH rcv_data_block method for GPRS and EGPRSJacob Erlbeck1-15/+18
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-16edge: Implement gprs_rlcmac_pdch::rcv_block_egprsJacob Erlbeck1-5/+34
This commit replaces the stub by a method that decodes the block first, and passes it to the TBF object associated with the TFI. Sponsored-by: On-Waves ehf
2015-12-15edge: Rename rcv_data_block_acknowledgedJacob Erlbeck1-3/+3
This commit renames rcv_data_block_acknowledged to rcv_data_block_acknowledged_gprs to separate it from EGPRS data block decoding. Sponsored-by: On-Waves ehf
2015-12-15edge: Add gprs_rlcmac_pdch::rcv_block_egprs stubJacob Erlbeck1-0/+28
This stub function gets called when an EGPRS data package arrives. Sponsored-by: On-Waves ehf
2015-12-15edge: Use GprsCodingScheme to adjust the UL RLC block sizeJacob Erlbeck1-22/+24
Currently the block size is mapped by a switch statement to strip extra bits that are not used for RLC blocks. That information is already available via the GprsCodingScheme class. This commit moves the CS/MCS detection to the rcv_block message and passes the cs object via rcv_block_gprs, where the length gets adjusted, to gprs_rlcmac_pdch::rcv_data_block_acknowledged. There the switch statement is removed. Note that the TbfTest.err changes due to an additional log message. Sponsored-by: On-Waves ehf
2015-12-15edge: Support EGPRS multislot class handling in tbf_allocJacob Erlbeck1-4/+7
Add an egprs_ms_class argument to the allocation functions and set/pass it where necessary. Sponsored-by: On-Waves ehf
2015-11-30edge: Get EGPRS multislot classJacob Erlbeck1-2/+16
The EGPRS MS class ist contained in the MS_RA_capability information. Its presence indicates, that the MS is able (and willing) to use EGPRS. This commit implements basic support for retrieving, storing, and showing it in the VTY. The information is stored in the MS object. Sponsored-by: On-Waves ehf
2015-11-30stat: Add global stat groupJacob Erlbeck1-0/+14
Add a global stat_item group for measurement values and a corresponding macro to get and set the values. Add a stat_item STAT_MS_PRESET to monitor the number of MS objects in the storage. Sponsored-by: On-Waves ehf
2015-11-07stats: Include the header file for the new class identifierHolger Hans Peter Freyther1-0/+1
2015-11-07stats: Attempt to compile fix the new rate_ctrHolger Hans Peter Freyther1-0/+1
We wanted to support gcc-4.2 and this didn't allow us to use the C99 initializers inside C++ code. Attempt to initialize the class_id correctly.
2015-09-07poll: Count failed proceduresJacob Erlbeck1-0/+2
When a timeout has occured several times, the procedures handled by poll_timeout are aborted. This happens when the number of repetitions exceed N3105. Currently only the timeouts themselves are counted. This commits adds counters that are incremented if a procedure has really failed. New counter: - rlc.ass.failed: Count failing UL and DL assigments via PACCH - rlc.ack.failed: Count failing DL Ack/Nack requests Sponsored-by: On-Waves ehf
2015-09-01bts: Start a DL TBF if needed after establishment of an UL TBFJacob Erlbeck1-0/+6
Currently an existing DL TBF can get lost in the process of establishing an UL TBF via RACH. This can lead to stalled connections until the network sends more LLC frames. This commit adds a check for a non-empty LLC queue after the UL TBF has been established to rcv_control_ack (GPRS_RLCMAC_UL_ASS_WAIT_ACK path) to eventually establish a new DL TBF on the UL TBF's PACCH. Sponsored-by: On-Waves ehf
2015-09-01bts: Release DL TBF instead of killing in rcv_resource_requestJacob Erlbeck1-3/+9
Currently an existing DL TBF is freed immediately, when a resource request is received. This makes sense since the MS might have dropped it when switching to the PDCH signaled via the AGCH for the SBA. But if the TBF still is assumed to exist on the MS side, there might be TFI collisions if the old TBF object is not kept to block its TFI for some time. This commit changes rcv_resource_request to call release() instead of tbf_free() on the DL TBF object (if it exists). Sponsored-by: On-Waves ehf
2015-09-01Revert "tbf: Do not kill DL TBF on Packet Resource Request"Jacob Erlbeck1-5/+8
This reverts commit e91bd3babd5c04a154f296607b401a5050dcba31. That commit seems to cause hanging DL TBFs when there was a RACH based UL TBF establishment while it that TBF is active. This could be caused by the use of a different PDCH for the SBA. Conflicts: tests/tbf/TbfTest.cpp tests/tbf/TbfTest.err
2015-08-28l1: Use the FN of all data_ind/ra_ind DSP messagesJacob Erlbeck1-4/+2
Currently all of these messages are discarded if they are assumend to be caused by noise. But even in these cases, the FN and TN values which are added by the DSP are valid. So these can be used to update the current_frame value. The osmo-bts sets the fBFILevel of a physical channel to -200dB if it is used for PDTCH or PACCH which is the case for all PDCH. This way a data_ind or ra_ind message is already send at least once per block period (4 frames) per PDCH. These messages are passed to either handle_ph_data_ind or handle_ph_ra_ind even if they contain garbage data. The ra_ind messages are sometimes sent a few frames earlier than data_ind messages using the same frame. This commit adds calls to update the current_frame value based on all of these messages before they are discarded. The FN taken from ra_ind are passed with an increased max_delay (5) to compensate for early ra_ind messages. Sponsored-by: On-Waves ehf
2015-08-28poll: Count unexpected block FN valuesJacob Erlbeck1-1/+4
Currently a log entry is written if FN_data_ind - FN_time_ind <= -13. This commit adds a counter 'rlc.late-block' that is incremented in these cases. Sponsored-by: On-Waves ehf
2015-08-28poll: Use the data_ind FN as time source for current frameJacob Erlbeck1-0/+35
The FN of the data_ind taken from the DSP are monotonic, so latency does not affect the detection of poll timeouts if these FN are used. If the FN is larger than a poll_fn value, it can safely be assumed that the poll response will not arrive later on. Currently a max_delay of 60 frames is used, which has the drawback that additional ~250ms will pass until a lost ACK is detected. Using the data_ind's FN alone breaks the poll timeout detection if there are no other MS sending data blocks. This commit adds BTS::set_current_block_frame_number that is called with the FN taken from data_ind messages. The max_delay is set to 0 which removes the additional delay, when this FN is used to detect poll timeouts. So the average additional delay decreases with the number of data_ind per time. The current_frame is updated unless it seems to have been updated already (assumed if 0 < cur_fn - block_fn < 500). Thus the time_ind has still priority to update the current_frame value. Sponsored-by: On-Waves ehf
2015-08-28poll: Set the max_delay to 60 framesJacob Erlbeck1-2/+5
Currently the max_delay parameter is set to 13, since that is slightly above maximum number of frames that a time_ind can preceed a block's data_ind of the same frame. This assumes that these messages are not reordered after thay have been obtained from the DSP. In the current implementation, the GPRS data_ind can directly be taken from the DSP by the PCU while the time_ind messages are provided via the BTS. So the messages are queued differently in that case, resulting in a additional delay of the data_ind with respect to the time_ind. The propability for this raises with a increased CPU load of the PCU. If this happens, a poll timeout is detected by mistake and the poll is either retried or cleared. This commit increases the tolerance to 60 frames, since values for FN_data_ind - FN_time_ind of up to 50 frames have been observed under heavy PCU load. Sponsored-by: On-Waves ehf
2015-08-28poll: Add a max_delay parameter to PollController::expireTimedoutJacob Erlbeck1-1/+9
Currently the maximum additional delay is hard coded to 13. This value depends on the source of the frame number value. This commit adds the max_delay parameter to make it caller dependant. Sponsored-by: On-Waves ehf
2015-08-21tbf: Do not kill DL TBF on Packet Resource RequestJacob Erlbeck1-8/+5
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: Fix typos in log messages concerning UL/DLJacob Erlbeck1-1/+1
The TBF in create_dl_ass can be of any direction. The text in rcv_resource_request uses DL instead of UL. Sponsored-by: On-Waves ehf
2015-07-16alloc: Add counters for successful algo A/B allocationsJacob Erlbeck1-0/+2
This adds counters for algorithm A and B with count successful allocation combined for UL and DL. Ticket: #1934 Sponsored-by: On-Waves ehf
2015-07-16tbf: Put the TFI->TBF mapping into the PDCH objectsJacob Erlbeck1-52/+78
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-16tbf: Move TFI selection into alloc_algorithmJacob Erlbeck1-8/+1
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 Erlbeck1-4/+4
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-07tbf: Keep a set of used TFI and USF per PDCHJacob Erlbeck1-4/+24
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-07tbf: Add Poll Timeout countersJacob Erlbeck1-0/+3
This commits adds three poll timeout counters - RLC Assign Timeout - RLC Ack Timeout - RLC Release Timeout to help diagnosing to cause for these events. There seems to be an increased rate of these when a PDCH is shared by multiple TBFs. Sponsored-by: On-Waves ehf
2015-07-03ms: Add support for slot reservationJacob Erlbeck1-0/+29
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-03tbf: Maintain the number of TBF per PDCHJacob Erlbeck1-0/+16
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 Erlbeck1-0/+11
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 Erlbeck1-1/+1
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-1/+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-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 Erlbeck1-1/+63
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-22l1: Pass all L1 measurements upwardsJacob Erlbeck1-4/+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-08ms: Add back pointer to BTSJacob Erlbeck1-0/+1
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 Erlbeck1-1/+1
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: Remove TimingAdvance storageJacob Erlbeck1-1/+7
Currently the TA storage stores up to 30 TLLI->TA mappings, if more entries are created the oldest one is dropped. In theory this can lead to missing TA information if many MS are present. This commit removes the TimingAdvance class completely, since the TA value is now stored in the GprsMs objects. Note that the GprsMs objects are currently not kept after the TBFs have detached from them, so the TA values are now kept for a shorter time than before. Ticket: #1674 Sponsored-by: On-Waves ehf