aboutsummaryrefslogtreecommitdiffstats
path: root/src/gprs_rlcmac_sched.cpp
AgeCommit message (Collapse)AuthorFilesLines
2016-02-01tbf: Use LListHead instead of llist_podsJacob Erlbeck1-5/+9
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-01sched: Assert that the generated message is not emptyJacob Erlbeck1-0/+1
Currently the msg data is accessed and index 0 assuming the msg is not empty. While this should be always the case, the msg can be empty if there are software errors in the message creation functions. This commit adds an assertion to catch this kind of bugs. Sponsored-by: On-Waves ehf
2015-12-16sched: Change next_ctrl_prio incrementJacob Erlbeck1-1/+1
Currently the control block scheduler does not seem to be fair in all cases. At least it happend while testing the EGPRS code, that a Uplink Ack/Nack message got never be sent, because a Downlink assignment took over all the times. This commit changes the round robin code to always increment the priority offset by 1 instead of (i + 1). The former definitely ensures that every message type gets the highest priority after some steps. The latter might be more fair in some situations, but that and its correctness are not proven. Sponsored-by: On-Waves ehf
2015-09-11bssgp: Use measured leak rate for flow controlJacob Erlbeck1-0/+3
The leak rate sent to the SGSN does not reflect the current CS level, lost frames, and control message overhead. So the SGSN cannot do proper queue control under non-optimal conditions. This commit computes the leak rate for the last flow control interval by computing the maximum theoretical leak rate and basically substracting control blocks, nacked blocks, and reduced block sizes due to CS downgrade. By using this approach, the value will by more stable on low load, where the value will tend to be near the value derived from the configuration. On full load the transmitted value is completely derived from the measurements. Note that the MS default values are no adapted to the adapted BVC leak rate, since a single MS which has a lower link quality would otherwise be reducing the rate of another MS with good radio conditions, which would not make much sense if they did not share any PDCH. Sponsored-by: On-Waves ehf
2015-03-25tbf: Poll MS on idle DL TBFsJacob Erlbeck1-7/+34
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-06sched: Modify DL scheduling to use different prioritiesJacob Erlbeck1-6/+23
Currently the DL blocks are scheduled round robin to each TBF that is either in state FLOW or FINISHED and not waiting for an IMM.ASS confirmation. This way, if single blocks has been NACK'ed by the MS and the PCU has already resent the missing packets, the PCU starts retransmitting them until it has received an ACK/NACK even if other TBF have RLC blocks that need to be transmitted. This commit changes sched_select_downlink to select the next TBF with the highest priority, where blocks that are going to be resent again have a lower priority unless the window is stalling. If there is only one TBF the old behaviour is kept, since there is no other TBF that can have a higher priority. If there is much packet loss on a single phone, this modification can lead to a higher latency for that MS. Sponsored-by: On-Waves ehf
2014-08-07tbf, ...: Make the fields in the dl/ul struct member variablesDaniel Willmann1-2/+2
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-08-07gprs_rlcmac_sched: Use UL/DL TBFs in schedulerDaniel Willmann1-28/+32
Ticket: SYS#389 Sponsored by: On-Waves ehf
2014-08-07tbf: Make create_new_bsn and create_dl_acked_block a method of DL TBFDaniel Willmann1-1/+1
These functions are only used for DL TBFs so move them. sched_select_downlink() in src/gprs_rlcmac_sched.cpp now needs to deal with DL TBFs instead of the base class. Ticket: SYS#389 Sponsored-by: On-Waves ehf
2014-07-30tbf: Use plain old data structure (PODS) for llist managementDaniel Willmann1-2/+3
The PODS struct has a back pointer to access the actual object. llist_pods_for_each_entry traverses the list of struct llist_pods and makes the entry available (through the back pointer). Ticket: SYS#389 Sponsored-by: On-Waves ehf
2014-06-04gprs_rlcmac_pdch: Don't access private membersDaniel Willmann1-2/+2
This patch introduces methods to get ul and dl tbf by tfi and uses them in gprs_rlcmac_sched. Sponsored by: On-Waves ehf
2013-12-25sched: Attempt to improve the fairness and schedule UL/AL ACK/ASSHolger Hans Peter Freyther1-14/+22
It is possible that certain UL ACK messages are not sent when there are many many uplink and downlink assignments. Try to be more fair and schedule them round-robin. This way no starvation should occur.
2013-12-25sched: Remove unused bts parameter from the internal methodHolger Hans Peter Freyther1-2/+2
2013-11-26tbf/sched: We pick the _last_ entry, rotate the listsHolger Hans Peter Freyther1-0/+1
We always pick the _last_ entry from the lists. Let's rotate so we make it a bit more fair.
2013-11-23sched: Make internal methods staticHolger Hans Peter Freyther1-3/+4
2013-10-30tbf: Make tfi private and update the codeHolger Hans Peter Freyther1-6/+4
All logging code that used tbf->tfi is now using tbf_name to print the the TBF. External code is now using tfi() which is inlined and should result in the same code being generated as before (+debug code that can be stripped).
2013-10-30tbf: Remove the trx_no field from the tbf, go through the trx objectHolger Hans Peter Freyther1-2/+2
2013-10-30misc: Change the logging for the tbf and what to logHolger Hans Peter Freyther1-3/+3
TLLIs got printed as TBF. Fix that but also rename things to TFI. The TFI is not required to be unique per BTS but it is the indicator we use right now.
2013-10-30misc: Fix typo.. resource in english only has one 's'Holger Hans Peter Freyther1-7/+7
2013-10-30tbf: Move gprs_rlcmac_send_data_block_acknowledged into tbfHolger Hans Peter Freyther1-1/+1
We can now remove the gprs_rlcmac_data as the code has been moved into the tbf, pdch and bts.
2013-10-30tbf: Move gprs_rlcmac_send_packet_uplink_assignment to the tbfHolger Hans Peter Freyther1-1/+1
Again the function was called send but didn't do any sending
2013-10-30tbf: Move gprs_rlcmac_send_uplink_ack into the tbfHolger Hans Peter Freyther1-1/+1
The method was called send but didn't send anything. Move it to the tbf
2013-10-30tbf: Move gprs_rlcmac_send_packet_downlink_assignment into the tbfHolger Hans Peter Freyther1-1/+1
This method was called _send_packet_ but actually didn't do any sending at all. It just formated the right assignment. I replaced tbf-> with nothing.
2013-10-30misc: Remove the bts parameter from calls that take a tbfHolger Hans Peter Freyther1-5/+4
Mark some of the tbf manipulation that is burried in the data sending routine.. that it should be moved around.
2013-10-30sched: Add another warning about trx->arfcn and arfcn..Holger Hans Peter Freyther1-0/+2
2013-10-30bts/tbf: Move the lists into the BTS and do the look-up from the BTSHolger Hans Peter Freyther1-4/+5
The list belongs to the BTS. This makes cleaning this up more easy and establishes a hierachy of resources that start from the BTS. The debug_diagram code is now broken.
2013-10-30sba: Create a SBAController that will manage the sbas for a BTSHolger Hans Peter Freyther1-1/+1
The PollController is a friend of the SBAController and is allowed to access the internal list. The list is hidden from everyone else. This is done because the calculation of timeout should belong into the PollController and not into the SBAController.
2013-10-30sba: Move the sba code to a dedicated fileHolger Hans Peter Freyther1-17/+0
Move the code around and then turn it into an object...
2013-10-30pdch: Move paging dequeue into the PDCH objectHolger Hans Peter Freyther1-2/+1
Rely on packet_paging_request returning NULL in case the queue is empty. We should move the write_packet_paging_request into a separate file/object as well.
2013-10-30pdch: Move enable/disable into the PDCH codeHolger Hans Peter Freyther1-1/+1
When a PDCH is disabled all resources should be freed. This is currently not possible as the PDCH does not know where it belongs to. On top of that the list (and other resources) should be properly initialized on construction so that disable() is idempotent and does not check if it was disabled. During the re-factoring I noticed that during a sysmobts re-start some resources are not freed. I left a warning in the code to resolve this issue later.
2013-10-30bts: Move struct gprs_rlcmac_bts and other structs into a bts.hHolger Hans Peter Freyther1-0/+1
Begin to make the BTS a real C++ object with real responsibilities. The biggest issue will be the pcu_vty.c that might not like C++ at all.
2013-10-30bts: Remove global state from gprs_rlcmac_rcv_rts_blockHolger Hans Peter Freyther1-2/+2
2013-10-30bts: Remove global state from gprs_rlcmac_send_packet_uplink_assignmentHolger Hans Peter Freyther1-1/+1
This was the last method of gprs_rlcmac_data.cpp to access the gprs_rlcmac_bts variable.
2013-10-30bts: Remove global state from gprs_rlcmac_send_data_block_acknowledgedHolger Hans Peter Freyther1-3/+4
2013-10-30bts: Remove global state from gprs_rlcmac_send_packet_downlink_assignmentHolger Hans Peter Freyther1-1/+1
2013-10-30bts: Remove the global state from write_packet_uplink_ackHolger Hans Peter Freyther1-3/+4
Similiar to the previous patches
2013-10-30sched: Make sched_poll static and add a warning about fairnessHolger Hans Peter Freyther1-1/+2
2013-10-30alloc: Call it trx_no and not trx as it is not trx objectHolger Hans Peter Freyther1-2/+2
2013-10-28tbf: Prepare to make thing things private in the tbf, start with the stateHolger Hans Peter Freyther1-3/+3
There really shouldn't be too many callers of state. Instead the tbf should dispatch depending on the internal state. For now introduce state_is and state_is_not accessor functions so we can start to see who is using the internal state.
2013-10-28tbf: Move the struct to the tbf.h header fileHolger Hans Peter Freyther1-0/+1
This is the begin of a long march of turning tbf into a C++ class and properly hiding the secrets inside this implementation instead of having it spread across various different files.
2013-10-16misc: Fix some typos sed -i s,ressources,resources,gHolger Hans Peter Freyther1-3/+3
2013-05-13Added timing advance support for up and downlink TBFsAndreas Eversberg1-4/+1
The timing advance of any TBF is stored when it ends. Whenever a new TBF with the same TLLI is created (downlink TBF), the stored TA is recalled. This algorithm assumes that the mobile does not move too fast during transfer. Also the mobile must start a connection in order to get correct initial timing advance. This algorithm does not implement the timing advance procedure as defined in TS 04.60. To implement the standard timing advance procedure, the BTS must decode RACH on certain bursts, the mobile is expected to send them. This requires much more complexity to a transceiver like USRP/UmTRX or Calypso BTS. The algorithm was tested at TA >= 8 and works quite well.
2012-09-27Use PCH confirm from BTS to start downlink packet flowAndreas Eversberg1-0/+4
Since we don't know when the IMM.ASS message is sent on it's paging group on PCH, we will wait for confirm from BTS and start packet flow then.
2012-08-07Adding single block allocationAndreas Eversberg1-6/+34
It is mandatory to support it because MS may request a single block. In this case the network must assign a single block. It is possible to force single block allocation for all uplink requests on RACH. (VTY option)
2012-07-26Minor changes on comments of schedulerAndreas Eversberg1-3/+3
2012-07-25Be sure to priorize uplink assignment (PACCH)Andreas Eversberg1-15/+15
This is required because uplink assignment (PACCH) is done on a request by mobile, so the mobile expects that it get this assignment in return. After that we may assign downlink.
2012-07-25Cleanup by splitting gprs_rlcmac_rcv_rts_block() into seperate methodsAndreas Eversberg1-115/+171
2012-07-20Fixed Paging RR on PACCHAndreas Eversberg1-4/+8
Addition to 2b91464862270d72800b6dcc5a521f933fbbd489
2012-07-19Added paging for RR connection on PACCH of active TBFsAndreas Eversberg1-0/+4
Untested
2012-07-15Fixed contention resolution issueAndreas Eversberg1-8/+6
In order to do downlink assignment during uplink TBF, the content resolution must be completed. It is completed when the first Packet Uplink Ack/Nack message is transmitted to the mobile.