本帖最后由 Helloamy2014 于 2015-9-5 17:28 编辑
我的4G之路-PDCP和RLC之间剪不断理还乱?
PDCP和RLC之间剪不断理还乱?
切换真的是一个很好的场景,能够说明白很多问题。在本章节将以切换现身说法,揭开RLC和PDCP层层交互的面纱。
首先抛出俩问题:
322协议中说:
When receiving a positive acknowledgement for an AMD PDU with SN = VT(A), the transmitting side of an AM RLC entity shall: - set VT(A) equal to the SN of the AMD PDU with the smallest SN, whose SN falls within the range VT(A) <= SN <= VT(S) and for which a positive acknowledgment has not been received yet. - if positive acknowledgements have been received for all AMD PDUs associated with a transmitted RLC SDU: - send an indication to the upper layers of successful delivery of the RLC SDU.
这句话说的是,RLC层从对方得到状态报告后,若判决该RLC SDU对应的所有PDU都正常收到后,将告知PDCP SDU正常收到。RLC告诉PDCP这个有啥用?
而PDCP中有这么一段描述: In addition, for radio bearers that are mapped on RLC AM, if the PDCP entity has previously performed the re-establishment procedure, the UE shall also consider the following as data available for transmission in the PDCP layer: For SDUs for which a corresponding PDU has only been submitted to lower layers prior to the PDCP re-establishment, starting from the first SDU for which the delivery of the corresponding PDUs has not been confirmed by the lower layer, except the SDUs which are indicated as successfully delivered by the PDCP status report, if received: - the SDU, if it has not yet been processed by PDCP, or - the PDU once it has been processed by PDCP.
这句说的是,PDCP重建后,比如说切换之后,要从没有从RLC层得到的确认的第一个包传起? 这是什么意思呢? 依然以切换为例,看明白切换的场景,你应该就彻底明白了。
虽然之前从300的角度来写过切换用户面处理,但这次将从RLC和PDCP的角度来写切换。
该图说的是在上行方向上,原基站收到1,2,4,5, 原基站将按序的包1,2提交到SGW,同时将失序的包4 以及SN status前传到目标eNB。
对于UE而言,收到了SN号为1,2和4 的PDCP PDU的确认,但3是第一个没有得到确认的包,于是将PDCP SN号为3,4,5,6的包依次向目标eNodeB发送。 目标eNodeB依据SN号来对PDCP的PDU进行排序和重复检测。于是目标enb收到包的顺序是:4, 3,4,5,6。在此例中,包4属于重复的数据包,将被丢弃。目标eNodeB将排序好的无重复的PDCP包3,4,5,6 包发送给SGW。
看到这里,你应该明白在切换的时候,乱序包以及重复包是如何造成的了。 假如没有RRC层配置PDCP的状态报告,那发送端PDCP层就得从第一个未确认的数据包开始重新发送,而这个第一个未确认数据包很有可能对方收到了,可能在切换前未来的及回复而已就已经发生了重建,于是就可能出现乱序和重复包。
假如RLC层在传输数据包3的时候,对方是真没有收到呢? 此时因为切换时重建的发生,RLC的发端将数据都丢弃,那依靠对方RLC层肯定是无法得到该包的重传包了。
我们都知道,RLC层的重传可以纠正MAC层的HARQ引起的丢包和失序,RLC层可以根据其头部的序列号来重新加以排序。而在切换的时候,RLC层的不给力只能依赖于高层,即PDCP层的重传才能保证连续性。RLC造的孽就只能PDCP来还。
既然PDCP如此如此给力, PDCP对删包是非常谨慎的,数据包必然有备份版本在,除非丢弃定时器超时,或者收到PDCP的状态报告表示对方已经收到。
PDCP即便是收到RLC的指示,也不会删除包,因为他觉得还是自己的状态报告最可靠,收到PDCP自己的状态报告才能显示删包。因为若是提早删除了,而对方RLC虽然正常接收而PDCP无法正常解压缩怎么办?此时就白删除了。
因此323中有一段描述:
5.4 PDCP discard When the discardTimer expires for a PDCP SDU, or the successful delivery of a PDCP SDU is confirmed by PDCP status report, the UE shall discard the PDCP SDU along with the corresponding PDCP PDU. If the corresponding PDCP PDU has already been submitted to lower layers the discard is indicated to lower layers.
可见,PDCP给RLC提供了强大的后盾,切换前后序列号的连续保证了切换过程中数据的有序传输和重复检测,以及切换过程中数据的无损传输。
配置PDCP层状态报告是切换过程的一种优化。这样可以少传输一些重复包的发送。 若配置了PDCP状态报告,且4被前传到目标enb,则当用户接入到目标小区后,下行方向上第一个包就是目标eNB向UE发送的状态报告,即要求UE重传3,UE无需重传包4,只需重传包3和5以及新包6等即可。目标eNB将3,4,5, 6顺序递交到SGW。
但是这种优化行为,是否有不良后果?正如状态报告是这么填写的(要看仔细哦):
- setting as ‘0’ in the corresponding position in the bitmap field for all PDCP SDUs that have not been received as indicated by lower layers, and optionally PDCP SDUs for which decompression have failed;
目前看来问题不大,因为状态报告中即将要选择性重传的包的反馈或许不包括解压缩失败的包,因此可能会导致选择性重传造成的有损。但毕竟这种情况处于rare error case。
最后,我们来郑重总结一下二者的关系: 本质上说,PDCP不是在RLC之上再叠加一个ARQ功能。 我觉得这段话深刻表达了PDCP和RLC之间的关系: There is common understanding in RAN2 not to make the PDCP layer into a full ARQ layer, but just as an optimisation layer for avoiding duplication and maintain in-sequence delivery. I.e. the PDCP Status reporting and SN maintenance in the target cell is only considered an optimisation for avoiding unnecessary duplication.
所以,PDCP和RLC之间剪不断理还乱的关系你应该是理明白了吧?呵呵
P.S.对于UM和SRB不用无损,也没有重传,维护旧Count值没有任何意义,换了新基站,从0开始最方便。 |