通信人家园

标题: Logical channel prioritization中的BJ如何为负数  [查看完整版帖子] [打印本页]

时间:  2011-12-20 12:45
作者: 纪伯伦     标题: Logical channel prioritization中的BJ如何为负数

36.321中
5.4.3  Multiplexing and assembly
5.4.3.1  Logical channel prioritization
The UE shall maintain a variable Bj for each logical channel j. Bj shall be initialized to zero when the related logical channel is established, and incremented by the product PBR × TTI duration for each TTI, where PBR is Prioritized Bit Rate of logical channel j. However, the value of Bj can never exceed the bucket size and if the value of Bj is larger than the bucket size of logical channel j, it shall be set to the bucket size. The bucket size of a logical channel is equal to PBR × BSD, where PBR and BSD are configured by upper layers.
The UE shall perform the following Logical Channel Prioritization procedure when a new transmission is performed:
-  The UE shall allocate resources to the logical channels in the following steps:
-  Step 1: All the logical channels with Bj > 0 are allocated resources in a decreasing priority order. If the PBR of a radio bearer is set to “infinity”, the UE shall allocate resources for all the data that is available for transmission on the radio bearer before meeting the PBR of the lower priority radio bearer(s);
-  Step 2: the UE shall decrement Bj by the total size of MAC SDUs served to logical channel j in Step 1
NOTE:  The value of Bj can be negative.

首先step1中BJ不可能超过PBR,因为有 before meeting the PBR of the lower priority radio bearer,除非PBR是无穷的,不然allocated resources 不可能比PBR大。那么在step2种BJ减去served SDUs怎么可能为负数呢?
时间:  2012-4-17 13:03
作者: 纪伯伦     标题: 好几个月了,终于搞明白了这个问题了

BJ初始化为0,并且每个TTI加上PBR,BJ不能超过桶的size.
Step1:所有BJ>0的LC,按照优先级递减组包。BJ不能大于桶大小,否则传的数据最大就是桶大小PBR*BSD(Bucket Size Duration)。
     当PBR无穷大的时候,必须把这个LC的数据传完才会考虑比它优先级底的逻辑信道。
Step2:BJ减去步骤1里面的数据包的大小。
Step3:如果前两步执行完还有ulgrant的话,不管BJ,把剩下的数据按照LC优先级组包。

上面的话看起来很晦涩,换一种方式来理解。
用小学进出水管的办法理解令牌桶。

假设有一个容积为V的水桶,有一个进水管和一个出水管。
进水管常开,Vin=流速A*时间T,但是Vin必须小于等于V,再多水就会溢出了,进不到桶里。(这个进水管就是令牌桶原理里的令牌)

出水管偶尔才会打开。每一次流出的水不一定,而且Vout偶尔还会比V大(这个很难理解,我们姑且认为它用了魔法从别处借的水,信用卡式魔法桶,但是借的迟早要还的)。
那么桶里有多少水呢?(桶内的令牌数)Vnow=Vin-Vout
这是小学学的。

Vnow是可能为负数的。
为负数的可能性有以下几点:
1、首先Vin永远小于V,Vout却可能大于V, Vout大于V的时候肯定是负数。
2、假设t很小的时候,这时Vin也非常小,极限情况t=0,Vin=0。这时有Vout肯定是负数。
3、最正常的情况,Vout和Vin都在桶大小之内,但是Vout大于Vin的情况。这时也是负数。

刚才说了借债要还,所以出水管多倒出去的水是要还的,需要进水管很长时间补充才能偿还。
这段时间我们规定出水管不能再打开了。这就跟信用卡一样,你可以透支,但你透了一定程度的时候,就不能再透了。

我们再假设有好几个桶(比如10个逻辑信道),每一个桶都有进水管和出水管。优先级高的逻辑信道优先传输,但是一次传的太多了,信用卡欠账了,Vnow小于0了,这时它就不传输了。上行资源就留给其他低优先级的桶去调度,当高优先的桶把欠账还了,进水管的水补充好了,桶里有水了,就可以恢复传输了。

这样做的好处:
1、        兼顾各个优先级,避免低优先饥饿,总也分不到资源。
2、        起到一定的流控作用。虽然偶尔会有流量的波动,但这种方法可以保证长期流速在A值。
时间:  2012-4-17 13:25
作者: jeffyko

学习,thx
时间:  2012-4-20 15:08
作者: buaawh

"令牌桶原理",lz都知道令牌桶了,肯定也对这块编过程了。这东西自己看着空理解麻烦点,实际编编程之后就会发现非常简单。
时间:  2012-4-24 09:38
作者: kin5000

学习了,谢谢!
时间:  2012-5-4 10:28
作者: illidan

原帖由 纪伯伦 于 2011-12-20 12:45 发表
36.321中
5.4.3  Multiplexing and assembly
5.4.3.1  Logical channel prioritization
The UE shall maintain a variable Bj for each logical channel j. Bj shall be initialized to zero when the related lo ...


我一直觉得,step 1讲了如果PBR=infinity会如何,但没有说PBR!=infinity要如何。我理解是,某个TTI可以给逻辑信道高的分配较多的资源,使B<0,即使其它逻辑信道还没有满足Bj。到了下一个TTI,之前贪婪那个高优先级LC现在的B<0,本TTI它无资格再分资源…… 从字面看,并没有说PBR是per TTI的一个约束,它只是保证在若干个TTI内的公平;某个TTI内高优先级LC可以贪婪,但它迟早是要还的。




通信人家园 (https://www.txrjy.com/) Powered by C114