Andreas Eversberg | e6228b3 | 2012-07-03 13:36:03 +0200 | [diff] [blame] | 1 | This document describes the handling of TBFs |
| 2 | -------------------------------------------- |
| 3 | |
| 4 | Notes: |
| 5 | TBF |
| 6 | Instance for one temporary block flow. |
| 7 | |
| 8 | LLC Frame |
| 9 | Current frame to be transmitted or received. If tbf->llc_length is not 0, |
| 10 | the frame exists, if 0, the frame does not exist. If tbf->llc_index is not |
| 11 | 0, parts of the frame have been transmitted or received so far. |
| 12 | |
| 13 | LLC Queue |
| 14 | Queue of next frames to be transmitted. |
| 15 | |
| 16 | States: |
| 17 | GPRS_RLCMAC_ASSIGN |
| 18 | After a downlink TBF is created, it resides in this state until the |
| 19 | block flow can start. This is required to give the mobile time to listen |
| 20 | to connect to downlink PDCH. |
| 21 | |
| 22 | GPRS_RLCMAC_FLOW, |
| 23 | During packet flow, this state indicates downlink and uplink TBF block |
| 24 | flow. |
| 25 | |
| 26 | GPRS_RLCMAC_FINISHED, |
| 27 | Uplink TBF: |
| 28 | After final block is received AND all other blocks are completely |
| 29 | received, the state is entered. The PACKET CONTROL ACK is still not |
| 30 | received. (Counter N3103 is counted on each poll request.) |
| 31 | Downlink TBF: |
| 32 | All blocks including the final block has been transmitted. Not all |
| 33 | downlink blocks are acknowledged yet. (Counter N3015 is counted on each |
| 34 | poll request.) |
| 35 | |
| 36 | GPRS_RLCMAC_WAIT_RELEASE, |
| 37 | The all blocks on downlink TBF have been acked by mobile. The penalty |
| 38 | timer T3192 is running on mobile. |
| 39 | |
| 40 | GPRS_RLCMAC_RELEASING, |
| 41 | Wait for TFI/USF to be re-used. This state is entered when a counter |
| 42 | reaches it's maximum and T3169 is running. |
| 43 | |
| 44 | |
| 45 | When downlink LLC PDU is received: |
| 46 | |
| 47 | If downlink TBF exists for given TLLI, but not in RELEASING state: |
| 48 | If downlink TBF is in FLOW or FINISHED state: |
| 49 | Enqueue PDU to LLC Queue of TBF. |
| 50 | Done. |
| 51 | If downlink TBF is in WAIT RELEASE state: |
| 52 | Attach PDU to LLC Frame of TBF. |
| 53 | Put TBF back into FLOW state. |
| 54 | Done. |
| 55 | If dowlink TBF does not exists for given TLLI, or in RELEASING state: |
| 56 | Create new downlink TBF. |
| 57 | Attach PDU to LLC Frame of TBF. |
| 58 | If uplink TBF exists for given TLLI, but not in RELEASING state: |
| 59 | Assign packet channel PACCH. |
| 60 | Done. |
| 61 | If uplink TBF does not exists for given TLLI, or in RELEASING state: |
| 62 | Assign packet channel AGCH. |
| 63 | Done. |
| 64 | |
| 65 | When channel request for uplink TBF is received: |
| 66 | |
| 67 | Create new uplink TBF. |
| 68 | If channel request was received on RACH |
| 69 | Assign packet channel AGCH. |
| 70 | Done |
| 71 | If channel request was received on PACCH |
| 72 | Assign packet channel PACCH. |
| 73 | Done |
| 74 | |
| 75 | Handling of LLC Frame of downlink TBF and LLC Queue of downlink TBF: |
| 76 | |
| 77 | If a downlink TBF is created, the LLC PDU is attached to LLC Frame of TBF |
| 78 | (downlink flow is assigned to MS). |
| 79 | |
| 80 | If a downlink TBF exists, the LLC PDU is enqueued to LLC Queue of TBF. |
| 81 | |
| 82 | During transfer of downlink blocks, the LLC Queue is dequeued whenever all |
| 83 | segments of LLC Frame were used for generation of downlink blocks. (If a |
| 84 | block is partly filled with LLC Frame segment, its remaining space is filled |
| 85 | with the next LLC Frame from the Queue.) |
| 86 | |
| 87 | If the transfer is finished, no more LLC Frames are dequeued from the LLC |
| 88 | Queue, in case a new frame has arrived during lifetime of TBF. |
| 89 | |
| 90 | If the all downlink blocks have been acknowledged, the LLC Queue is |
| 91 | dequeued and an existing frame is attached to LLC Frame. If so, the new |
| 92 | state is FLOW (downlink flow is assigned to MS), otherwise WAIT RELEASE. |
| 93 | |
| 94 | If a new LLC PDU is attached to LLC Frame during WAIT RELEASE state, the |
| 95 | state is changed to FLOW (downlink flow is assigned to MS). |
| 96 | |
Andreas Eversberg | 592e04a | 2012-07-15 06:25:37 +0200 | [diff] [blame] | 97 | |
Andreas Eversberg | e6228b3 | 2012-07-03 13:36:03 +0200 | [diff] [blame] | 98 | Handling of LLC Frame on uplink TBF: |
| 99 | |
| 100 | Received uplink blocks are appended to LLC Frame of TBF. If the PDU is |
| 101 | complete, it is forwarded to the upper layer. |
| 102 | |
Andreas Eversberg | 592e04a | 2012-07-15 06:25:37 +0200 | [diff] [blame] | 103 | |
| 104 | Control TS: |
| 105 | On uplink or downlink assignment, it is required to have one timeslot that |
| 106 | can be used to receive and transmit. This timeslot is used at uplink TBF |
| 107 | to acknowledge and to assign other TBF. This timeslot is used at downlink |
| 108 | TBF to poll acknowledgement and to assign other TBF. |
| 109 | |
| 110 | The first common TS (first_common_ts) is calculated when channels are |
| 111 | allocated. After creation of TBF or after assignment to different TS layout, |
| 112 | the first common TS is used for control TS. |
| 113 | |
| 114 | The first common TS (and so control TS) must not need to be allocated to |
| 115 | MS as uplink TBF. (E.g. in case of non-available USF for this slot) |
| 116 | |
| 117 | |
Andreas Eversberg | e6228b3 | 2012-07-03 13:36:03 +0200 | [diff] [blame] | 118 | Polling: |
| 119 | In order to poll uplink control block from MS, a special poll state and |
| 120 | frame number is stored at TBF. The scheduler reads that value and will not |
| 121 | assign uplink ressource for other TBFs at that frame number. |
| 122 | |
| 123 | When there is no uplink transmission received on the block, a timeout is |
| 124 | indicated by layer 1 interface. There are two ways of checking timeout: |
| 125 | - The received frame is bad (BFI). |
| 126 | - The GSM indicates that the block should have been already received. |
| 127 | |
Andreas Eversberg | 592e04a | 2012-07-15 06:25:37 +0200 | [diff] [blame] | 128 | Because polling requires uplink response from MS, the polling must be |
| 129 | performed at control TS. |
| 130 | |
| 131 | |
Andreas Eversberg | b0c7ea7 | 2012-07-13 14:46:03 +0200 | [diff] [blame] | 132 | Data structures of TBFs and PDCHs: |
| 133 | |
| 134 | There is a global structure for BTS. |
| 135 | |
| 136 | The BTS structure has 8 TRX structures. |
| 137 | |
| 138 | Each TRX structure has 8 PDCH structures, one for each timeslot. |
| 139 | |
| 140 | There are two linked lists of TBF instances: |
| 141 | - uplink TBFs |
| 142 | - downlink TBFs |
| 143 | |
| 144 | Each TBF instance also has: |
| 145 | - a direction |
| 146 | - a TFI of range 0..31 |
| 147 | - an array of 8 PDCH structures, one for each assigned timeslot |
| 148 | - in case of uplink TBF: an array of 8 USFs, one for each assigned timeslot |
| 149 | |
| 150 | Each PDCH structure also has: |
| 151 | - an array of 32 uplink TBFs that are assigned to this PDCH |
| 152 | - an array of 32 downlink TBFs that are assigned to this PDCH |
| 153 | |
| 154 | On creation of a new TBF, it links to all assigned PDCHs. |
| 155 | Each PDCH links to that TBF. The TBF is added to the list of TBFs. |
| 156 | In case of uplink TBF: The allocated USFs are stored for each timeslot. |
| 157 | |
| 158 | On release of a TBF, the link to this PDCH is removed from all assigned |
| 159 | PDCHs. The TBF is removed from the list of TBFs. The TBF is destroyed. |
| 160 | |
| 161 | |