aboutsummaryrefslogtreecommitdiffstats
path: root/src/bts.cpp
AgeCommit message (Collapse)AuthorFilesLines
2016-12-30PDCH allocation across two TRXradisys/egprs_featuresaravind sirsikar1-16/+142
Implementation: PCU keeps track of number PDCH across all the TRXs at BTS context and also keeps number of active PDCHs in each TRX context. This ratio gives the CAPACITY of each TRX. 1st Phase: While selection of TRX, functions get_possible_trxs(for multiple TS) and get_possible_trxs_sba(Single block allocation, Ex: during RACH) gets possible TRXs based on TFIs availability. 2nd Phase: outcome of TRXs(from get_possible_trxs, get_possible_trxs_sba) will be fed to get_suitable_trx function. Which does actual load balancing on each TRX. And selects the best fit TRX, based on below equation PROBABILITY = MAX_PROBABILITY – ((LOAD * 100)/CAPACITY); If same PROBABILITY Select the one with higher capacity Else Find the TRX with higher PROBABILITY MAX_PROBABILITY = 65535; LOAD: Initialized to 0, Later gets incremented with number of TS allocated. and decremented whle TBF deletion, based on number of TS allocated Below are the test executed on Unit test environment 1) 2 TRXs, with same Capacity 2) 2 TRX with ½ capacity 3) 2 TRXs with ¼ capacity 4) 2 TRX with UL and DL allocation to ensure Tbfs on both direction is hosted on same TRX 5) 2 TRX with same Capacity and DL TBF creation and deletion scenarios to ensure proper load balancing criteria for actual Load. Below are the Test executed on Integration setup with Ettus B200 setup with 2 TRXs with same CAPACITY. 1) TRX allocation during RACH procedure(SBA allocation) 2) TRX allocation during DL TBF creation with multi time slots(4 time slots) 3) TRX allocation while Ping Test 4) TRX allocation while UDP test 5) TRX allocation for web browsing. 6) 2 MS test with each TRX sharing 1 MS. Received aggregate throughput of 446 kbps(223 Kbps each) Limitation: 1) BSSGP flow control needs to be tuned since test with 2 MS with each MS on different TRX runs for 20 mins 2) USF resource availibility is not checked while selecting the TRX as existing implementation Change-Id: Ifb61a7862d55af828383b6dfe728628e546ed12b Related: OS# 1775
2016-12-30Handle packet access reject during packet resource requestaravind sirsikar1-1/+5
When Packet resource request is received, PCU will generate the packet access reject if no resources are present. The encoding is done based on section 7.1.3.2.1 and 8.1.2.5 of 44.060 version 7.27.0 Release 7. This patch also includes the test case to validate the generated packet access reject message. This patch is integration tested on Osmo-trx setup with Ettus B210 board and LG F70 MS with some simulation code changes in Osmo-pcu. Change-Id: I05ff25124b58905586caa0c0c37023d69724f121
2016-12-22Add counter at BTS level And statistics at TBF/MS level.sivasankari1-0/+4
Adds spb counters at BTS level(show bts statistics). Adds RLC/MAC downlink control msg at ms level(show ms imsi <imsi_val>). Adds the number of coding schemes counter for UL at TBF level. Change-Id: Icbe4ba95e34bea89ee36f532d099db68204b7c38
2016-11-25Add new BTS level counterssivasankari1-1/+11
Adds counters for Immediate Assignment Reject, Packet Access Reject, Channel Request Description and Final Block resend. Change-Id: I23e326d4ea489aa4967e452fe02773b44ab146f7
2016-11-14Add BTS level countersMrinal Mishra1-2/+51
Adds counters for MCS blocks, 11 bit Rach counters and others. Change-Id: I605b0d66eb217decd35cbb8f87abfa577760245a
2016-11-11Handle packet access reject during EPDAN/PDAN with channel descriptionaravind sirsikar1-10/+24
When PDAN/EPDAN with channel description is received, PCU will generate the packet access reject if no resources are present. The encoding is done based on section 7.1.3.2.1 and 8.1.2.5 of 44.060 version 7.27.0 Release 7. This patch also includes the test case to validate the generated packet access reject message. This patch is integration tested on Osmo-trx setup with Ettus B210 board and LG F70 MS with some simulation code changes in Osmo-pcu. Change-Id: I096a3bb44a65533b9e9b091925dd5f70a8696d6
2016-11-09Handle Immediate assignment rejectaravind sirsikar1-42/+65
When RACH is received, PCU will generate the Immediate assignment reject message if no resources are present. The encoding is done based on section 9.1.20 of 44.018 version 11.7.0 Release 11. This patch also includes the test case to validate the generated Immediate assignment reject message. This patch is integration tested on Osmo-trx setup with Ettus B210 board and LG F70 MS with some simulation code changes in Osmo-pcu. Change-Id: I3d33e2b9746fa4f338fad0e6b63b1c5f07de6f9b
2016-10-19Use qbit-TA to update Timing AdvanceMax1-9/+18
Separate qbit-TA to TA conversion into separate function and use it for computing and updating Timing Advance. Note: the code was tested with TA=0 only to make sure it does not introduce regressions. Change-Id: I96fdbb20b09fb85fdd9fb6dcf3c25f6bee7f80e4 Fixes: OS#1531
2016-10-18Revert "tbf: Add state WAIT_ASSIGN"Neels Hofmeyr1-7/+2
This reverts commit f1a7b8fc6651f92a8b7f3f27b7ca05d07f4e44e0. Conflicts: tests/tbf/TbfTest.err The commit broke GPRS service at least for osmo-bts-sysmo on a SysmoBTS 1002 with current master of osmo-bts (ef30f50d5d6d5f863fc147d05ccdceb89284934e). The error observed is the following log output (was viewing both osmo-bts-sysmo and osmo-pcu logs interleaved): <0002> tbf.cpp:874 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=WAIT ASSIGN) T3169 timeout during transsmission <0002> tbf.cpp:893 - Assignment was on CCCH <0002> tbf.cpp:899 - No uplink data received yet <0007> l1sap.c:904 RACH for packet access <0001> pcu_l1_if.cpp:311 RACH request received: sapi=1 qta=0, ra=121, fn=13653 [repeat] When removing this single commit from current osmo-pcu master, GPRS service works well on SysmoBTS, with current osmo-bts master. The TbfTest.err expected output needed adjustment after the revert. Disclaimer: I am not aware of adverse effects this commit may have. I have no idea what the WAIT_ASSIGN state is used for -- further review is required. Change-Id: I1532f8e93194368cdc1e3846f82afa6d68cd5fbd
2016-09-16Update the function immediate assignment for EGPRSbhargava1-1/+1
Encode the EGPRS fields of immediate assignment message in uplink when EGPRS PACKET CHANNEL REQUEST (11 bit RACH) is received. The series of patches for 11 bit RACH are dependent on libosmocore and osmo-bts patches for 11 bit RACH. Change-Id: Ie5e309156e5dbbb6add74a1b4d257c4ee2332e52
2016-09-16Handle EGPRS 11 bit RACH in osmo-pcubhargava1-11/+82
A function is_single_block is added to get request type of RACH. EGPRS 11 bit RACH is handled. Change-Id: I61d74a32f7764644ed86f7fdf97fa3c2f61503f7
2016-09-09Fix Timing Advance handlingMax1-1/+2
* initialize with invalid TA instead of making assumption that phone is located within 550 meters (TA=0) * only set valid TA Change-Id: Idfc40ff0c11bdac13d9e28fbfa4e95dfc6b735b0 Related: OS#1526
2016-08-27Change interface in osmo-pcu for 11 bit RACHbhargava1-1/+2
Interface structure between osmo-bts and osmo-pcu is updated with the parameters to differentiate the type of RACH and further support 11 bit RACH. The function prototype and definitions are changed accordingly. Interface version number is increased. Change-Id: I265c2d92d36d6cbcbeee60cdd8407dafe1da06a4
2016-06-20typo in warningNeels Hofmeyr1-1/+1
(actually committing just to test gerrit, and if it goes through it's still a valid change.) Change-Id: I2ca9a1cc2f250801fbe62f3c50b73dff7101ee08
2016-06-16Remove GMSK only check in EGPRS ULAravind Sirsikar1-9/+0
Since we are supporting MCS 5-9 in this patch series for EGPRS UL, This condition is not relevant. So removing it. Change-Id: I567acc012d8ad49681715f0104ba7e91625e1e7a Reviewed-on: https://gerrit.osmocom.org/268 Tested-by: Jenkins Builder Reviewed-by: Harald Welte <laforge@gnumonks.org>
2016-06-07add KPI counter to count bytes for RLC and LLC framesAlexander Couzens1-0/+8
rlc.dl_bytes bytes before sending rlc rlc.dl_payload_bytes count data w/o LI rlc.ul_bytes bytes when received rlc (only valid) rlc.ul_payload_bytes count data fragments w/o LI llc.dl_bytes complete encapsulated LLC PDUs llc.ul_bytes complete received LLC PDUs Change-Id: I9a98a5a375d39b3f4990360056c4d6145e755f4d Reviewed-on: https://gerrit.osmocom.org/145 Reviewed-by: Harald Welte <laforge@gnumonks.org> Reviewed-by: Holger Freyther <holger@freyther.de> Tested-by: Jenkins Builder
2016-05-25add comments to describe functionsAlexander Couzens1-0/+1
Change-Id: Ie351632001abbeb82008a5eecae0d0323a8ef7d7 Reviewed-on: https://gerrit.osmocom.org/106 Reviewed-by: Harald Welte <laforge@gnumonks.org> Tested-by: Jenkins Builder
2016-05-24bts/counter: replace '_' with '-' in counter namesAlexander Couzens1-2/+2
Conform to the convention. Change-Id: I6162694aae8d354aba318cc1acfdac108239fef0 Reviewed-on: https://gerrit.osmocom.org/103 Tested-by: Jenkins Builder Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-22introduce new counter rlc_sent_controlAlexander Couzens1-0/+1
Counts control messages (UL/DL assignment, UL ACKs or page requests) Change-Id: Ib41031d430beddfb48d54470e632436f2c99c360 Reviewed-on: https://gerrit.osmocom.org/99 Reviewed-by: Holger Freyther <holger@freyther.de> Tested-by: Jenkins Builder
2016-05-22bts/rate_ctr: replace spaces by tabsAlexander Couzens1-1/+1
Use tabs like other counters for seperation. Introduced by 2cb1547 Change-Id: I32eebfe5934c919eccc1e28938ca00c49368297e Reviewed-on: https://gerrit.osmocom.org/96 Tested-by: Jenkins Builder Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-21introduce new counter rlc_sent_dummyAlexander Couzens1-0/+1
rlc_sent_dummy count the amount of dummy package which are sent in case no data packet is in the queue. Change-Id: Ia60eab853d9145980f30d63e4ce4b520b8c51381 Reviewed-on: https://gerrit.osmocom.org/85 Tested-by: Jenkins Builder Reviewed-by: Holger Freyther <holger@freyther.de>
2016-02-08tbf: Add state WAIT_ASSIGNJacob Erlbeck1-2/+7
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-08tbf: Only free TBF if it was replaced in rcv_control_ackJacob Erlbeck1-2/+4
Currently the TBF whose PACCH has been used to send an assigment is freed if it is in state WAIT_RELEASE. Sometimes this TBF could be used for several assignments (e.g. an 'old' DL TBF is used to assign an UL and then a DL TBF). The second of these assigments will never be sent in that case. On the other hand, the MS replaces a TBF of the same direction, so the old one can be freed in that case. Only free the TBF if it is in state WAIT_RELEASE and has the same direction like the new one. Sponsored-by: On-Waves ehf
2016-02-08encoding: Redesign Encoding::write_immediate_assignment APIJacob Erlbeck1-11/+13
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: Don't change type from CCCH to PACCH without ackJacob Erlbeck1-1/+11
Currently the CCCH flag is cleared and the PACCH flag is set when a multislot upgrade is scheduled for a downlink TBF, even if the MS has never confirmed in any way that the PACCH really exists. This can happen if the MS did not receive the DL IMM.ASS. Since the CCCH flags gets cleared in that case, the IMM.ASSS is never retried and all subsequent PACKET DOWNLINK ASSIGNMENTS will fail. This commit delays the update of these flags until the MS has responded with a corresponding CONTROL ACK. Sponsored-by: On-Waves ehf
2016-02-08tbf: Add and use tbf->poll_tsJacob Erlbeck1-2/+2
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 Erlbeck1-8/+4
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 counters for aborted TBF in state FLOWJacob Erlbeck1-0/+2
Increment CTR_TBF_DL_ABORTED/CTR_TBF_UL_ABORTED if a TBF gets freed that is still in state GPRS_RLCMAC_FLOW. Sponsored-by: On-Waves ehf
2016-02-08Revert "tbf: Use the control TS for Immediate Assignments"Jacob Erlbeck1-2/+2
According to spec, the lowest numbered PDCH of the TBF shall be used for the PACCH, only when concurrent TBF are active, the lowest common PDCH shall be used. An immediate assigment is in general only sent, if no TBF is active, so the latter case never applies. This reverts commit fdd8a1ba2312be3f33576ee994c0b5da6272e815.
2016-02-08tbf: Use the control TS for Immediate AssignmentsJacob Erlbeck1-2/+2
Currently the first TS is used, which can be different from the control TS on downlink TBFs. Use the control TS instead. Sponsored-by: On-Waves ehf
2016-02-08tbf: Refactor calls to write_immediate_assignmentJacob Erlbeck1-14/+31
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-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