aboutsummaryrefslogtreecommitdiffstats
path: root/src/tbf.cpp
AgeCommit message (Collapse)AuthorFilesLines
2014-06-04gprs_rlcmac_pdch: Get rid of ul/dl_tbfDaniel Willmann1-13/+4
The current code keeps a reference to all tbfs in the bts and another reference in the pdch. This allows for the possibility of both lists to go out of sync. This patch removes the pdch-specific list of ul and dl tbfs and uses the lists in the bts to lookup tbfs everywhere. Performance for going through the global list is not an issue yet. We can optimize this later and in a better way. Sponsored-by: On-Waves ehf
2014-05-30tbf: Re-send dl assignment if we can upgrade to multislotDaniel Willmann1-2/+20
The current code would only ever assign one PDCH for the initial assignment (from CCCH). Only if reuse_tbf is called the algorithm would actually use multiple DL PDCHs if possible. This patch introduced a tbf attribute upgrade_to_multislot that is set if we have multiple PDCH configured, and support multislot assignment, but can only assign a single PDCH (alloc_algorithm_b, parameter single is set). In this case after the assignment completes (and the MS is listening on a PDCH) we resend a DL assignment though the PACCH and this time we can assign multiple timeslots.
2014-05-30tbf/bts, encoding: Keep track of WAIT_RELEASE state for DL assignmentDaniel Willmann1-1/+2
The current code does not properly distinguish between DL assignments to reuse a tbf (after it was put in state WAIT_RELEASE) and DL assignments for an active tbf to change the allocation of the PDCH timeslots. This patch introduces a new variable was_releasing which remembers if trigger_dl_ass() was called with a tbf in state WAIT_RELEASE. In that case we have to set the CONTROL_ACK field in the download assignment. This should allow us to send DL assignments to change PDCH TS allocation of a tbf before we enter FLOW state.
2014-05-30tbf/bts: Rename tbf->snd_dl_ack to tbf->rcvd_dl_ackDaniel Willmann1-1/+1
This function is called to act upon a received DL ACK packet so this name makes more sense.
2014-01-16tbf: Change the log area to RLCMACDL so we see it in a DL traceHolger Hans Peter Freyther1-4/+4
2014-01-16tbf: Make finding use-after-free more easy and set to NULL or returnHolger Hans Peter Freyther1-0/+4
Make finding use-after-free more easy by setting things to NULL or simply return after tbf_free(this) has been called.
2014-01-16tbf: Use past-tense and call it created_tsHolger Hans Peter Freyther1-2/+2
2014-01-15tbf: Save a timestamp at tbf allocation and print it in the VTYDaniel Willmann1-3/+5
2014-01-15pcu_vty: Add a command to print info about all TBFsDaniel Willmann1-2/+2
2014-01-15tbf: Add a function to output tbf info to VTYDaniel Willmann1-0/+20
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/tbf: Move v_b into DL windowDaniel Willmann1-9/+9
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-4/+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-3/+3
v_n is part of the UL window handling so move it inside the ul_window
2014-01-15alloc/tests: Create an allocation test for various scenariousHolger Hans Peter Freyther1-5/+0
The allocation in the TBF/BTS code is quite complex. In parts this is due the assignment and requests occuring under differen circumstances. Attempt to re-create the commono scenarios. Remove the bogus msclass check in gprs_rlcmac_tbf::update as the allocation code will check the ms class anyway.
2014-01-15tbf: Kill the tsc member as it duplicates dataHolger Hans Peter Freyther1-0/+5
We can just use first_ts and the trx/pdch to extract this information. Avoid duplication of data.
2014-01-15tbf: Fix typo and call it sameHolger Hans Peter Freyther1-1/+1
2013-12-25llc: Calculate the average queuing delay of the LLC queuesDaniel Willmann1-1/+4
Use a formula like it is used with TCP. This can help to make decisions about if frames should be dropped or not at the time we enqueue them. This code will store two timeval structs in fron the of the actual data and compute the average at the time of the dequeue.
2013-12-18llc: Count the number of frames queued inside the LLC queueHolger Hans Peter Freyther1-2/+2
2013-12-12decoding: Use 'I' and 'R' in rbb array for DLDaniel Willmann1-1/+1
We want to match up rbb decoding and encoding so it helps to use the same chars.
2013-12-04rlc: Make the RLC types only operate on the BSNHolger Hans Peter Freyther1-25/+20
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-12-04tbf: Separate the handling for rh->si and call in case of re-transmissionHolger Hans Peter Freyther1-8/+14
In case of a retransmission ack the window again..
2013-11-26tbf/sched: We pick the _last_ entry, rotate the listsHolger Hans Peter Freyther1-0/+9
We always pick the _last_ entry from the lists. Let's rotate so we make it a bit more fair.
2013-11-26tbf/rlc: Move raising of V(Q) into the ul window codeHolger Hans Peter Freyther1-11/+7
2013-11-26rlc/tbf: Move the code to raise V(R) into the ul_window handlingHolger Hans Peter Freyther1-14/+3
2013-11-26tbf/rlc: Move the putting of a block into the rlc codeHolger Hans Peter Freyther1-2/+1
2013-11-26tbf: Move the extraction of the TLLI into a separate methodHolger Hans Peter Freyther1-38/+47
2013-11-26tbf/rlc: Remove the side-effect from the loop.Holger Hans Peter Freyther1-7/+8
2013-11-26tbf: Reduce complexity and deal with only one way of assignmentHolger Hans Peter Freyther1-16/+4
The normal mode of the PCU doesn't really work right now. There is no place to have certain kind of features that are not built and not unit-tested.
2013-11-26tbf/rlc: Move the check if something is in the window out.Holger Hans Peter Freyther1-6/+3
2013-11-26tbf/rlc: Move the v_n handling into a dedicated objectHolger Hans Peter Freyther1-5/+4
2013-11-26tbf/rlc: Big change and move the window handling out to the rlcHolger Hans Peter Freyther1-65/+53
The send and receive window is now managed by an external object. There are some issues that can only be solved with C++11 but it is progres and removes some of the spaghetti code. For GPRS the sns and ws is hardcoded. Move that into the window code.
2013-11-26tbf: Update the legend and mention invalid as wellHolger Hans Peter Freyther1-1/+1
We should not see it but the legend should be complete.
2013-11-26tbf/rlc: Move the counting of unacked frames into the RLC V_B classHolger Hans Peter Freyther1-8/+4
Whenwe receive a final ack we assume that all the unacked frames have been acked now. Move the counting to V_B and now the caller can remove the BSN and the "lost" variable which has always been zero.
2013-11-26tbf: Split the handling of DL ACK/NACK into two separate partsHolger Hans Peter Freyther1-59/+67
Split the handling of the final ack and the handling of frames that is moving frames.
2013-11-26tbf/rlc: Change the code and generate the entire state in the V_BHolger Hans Peter Freyther1-8/+4
2013-11-26tbf/rlc: Move the moving of V(A) into the V_B codeHolger Hans Peter Freyther1-8/+2
Move the code that moves the V_B to the first not acked frame. Return how many indexes the V_B was moved and update the V_A in the caller.
2013-11-26tbf/rlc: Move the parsing of RBB to Decoding, move window marking outHolger Hans Peter Freyther1-26/+8
Move the parsing of the bitbmap out of the TBF code into Decoding. Move the updating of the V_B into the V_B class. Add some comments about handling the mod_sns, mod_sns_half parameters by using template code.
2013-11-26tbf: Fix the indention of this routineHolger Hans Peter Freyther1-1/+1
2013-11-26debug_diagram: Remove the special debug_diagram compilation modeHolger Hans Peter Freyther1-64/+0
This approach is somehow flawed. We need/want to debug problems on systems with real traffic and re-compiling it with debug_diagram is not an option. All internal logging needs to be expressive enough so we can understand what is going on (e.g. create a script to post-process the output).
2013-11-26tbf: Simplify the create_dl_acked_block into two partsHolger Hans Peter Freyther1-13/+21
Separate the resend from creating a new block. It shows that the first_fin_ack is always set to FALSE for re-sending. This might not be what we want.
2013-11-26tbf/rlc: Move the marking of frames for resend into the v_bHolger Hans Peter Freyther1-12/+4
2013-11-26tbf: Move the check if the window is stalled to a separate methodHolger Hans Peter Freyther1-2/+7
2013-11-26rlc/tbf: Move the loop into the gprs_rlc_v_b classHolger Hans Peter Freyther1-13/+12
2013-11-24tbf: Count how often we re-start a BSN in the send routineHolger Hans Peter Freyther1-2/+3
There appears to be a scheduling issue. Even without any NACKs we are re-transmitting a lot of frames. It might be because of this.
2013-11-23tbf: Always increase the tx_counter when we transmit a frameHolger Hans Peter Freyther1-6/+4
In case the ACK could not be scheduled we were not increasing the tx_counter. Change the code flow to always increase the tx_counter after we have created a frame.
2013-11-23tbf: Make the ws and sns number "private" (they should also be const)Holger Hans Peter Freyther1-13/+13
2013-11-23rlc: Move the ack state array into a separate class that can be testedHolger Hans Peter Freyther1-17/+14
2013-11-23rlc: Count nacked frames in the statistics tooHolger Hans Peter Freyther1-0/+1
2013-11-19rlc: Start to move things out of the tbf into the rlcHolger Hans Peter Freyther1-10/+13
Add remarks of possible broken behavior inside the tbf routines. Move the preparation (and init) into the new rlc.cpp file.