NB-IoT中DCI Format N0格式解析

DCI Format N0的用途

DCI: Downlink Control Information 携带在NPDCCH中,用于上下行发送的调度。
DCI Format N0用于调度上行的NPUSCH。

RAR random access response

为什么需要先了解下RAR?

在解析在DCI Fromat N0时刻,有些信息在RAR中已经作为前置条件存在,如子载波间隔subcarrier spacing

RAR的组成(总长度15比特),从MSB到LSB:

  • Uplink subcarrier spacing: 1bit 0-3.75kHz 1-15kHz
  • subcarrier indication field: 6bits 参考DCI Format N0中的 subcarrier indication
  • Scheduling delay field: 2bits 参考DCI Format N0中的 Scheduling delay,不同的是值为0时,delay为12
  • Msg3 repetition number: 3bits 参考DCI Format N0中的repetition number
  • MCS index indicating TBS, modulation, and number of RUs for Msg3: 3bits 参考下图,第一次Msg3的RV0,后续重传使用NPDCCH中的配置
    NB-IoT中DCI Format N0格式解析_第1张图片

DCI Format N0包含的信元:

Flag for format N0/format N1

1bit 0-format N0 1-format N1

subcarrier indication - 6bits

  • Msg3MCS.PNG 从之前的RAR中获取;
  • 采用3.75k的情况下,信元指示的值即为所采用子载波,有效值为0-47,48-63为保留值;
  • 采用15kHz的情况下参考下图
    NB-IoT中DCI Format N0格式解析_第2张图片

Resource assignment -3bits

  • 能够到RU的个数,参考下图
    NB-IoT中DCI Format N0格式解析_第3张图片

Scheduling delay-2bits

  • 指示最后一个子帧距离第一个上行发送的子帧间隔
    NB-IoT中DCI Format N0格式解析_第4张图片

Modulation and scheme-4bits

  • 得到的值为 I M C S I_{MCS} IMCS,如 N s c > 1 N_{sc}>1 Nsc>1 I T B S = I M C S I_{TBS} = I_{MCS} ITBS=IMCS,否则通过下图映射得到
    NB-IoT中DCI Format N0格式解析_第5张图片
  • 根据TBS index和RU Index得到blocksize
    NB-IoT中DCI Format N0格式解析_第6张图片

Redundancy version-1bits

  • RV值,影响编解码

Repetition number-3bits

  • 重复次数配置
    NB-IoT中DCI Format N0格式解析_第7张图片

New data indicator-1bit

  • 指示前后两次数据是重传,还是新传;

DCI subframe repetition number-2bits

  • NPDCCH R的repeat次数,用于计算最后一个发送子帧,再根据delay可以算出NPUSCH发送的第一个子帧时间;

HARQ process number-1bit

  • R14 支持两个HARQ的情况下,指示哪一个HARQ传输。

Uplink Resource Unit

NB-IoT中DCI Format N0格式解析_第8张图片

解析RAR脚本

需要解析码流太麻烦,搞个小脚本~

#!/usr/bin/python3

class MyBitDecoderClass():
    '''MLB first'''
    def __init__(self,elementList):
        self.elmentList = elementList
        pass

    def __del__(Self):
        pass

    def bitdecoder(self,hexValStr,offset=0):
        decoderVal = int(hexValStr,16)
        decoderVal = decoderVal>>offset
        #print(decoderVal)
        decoderRslt = {}
        for eachKey in self.elmentList.keys():
            decoderRslt[eachKey] = decoderVal>>self.elmentList[eachKey][0]
            maskVal = (0x1<<self.elmentList[eachKey][1])-1
            decoderRslt[eachKey] = decoderRslt[eachKey] & maskVal
        return decoderRslt

def decoderRAR(hexValStr,offset=0):
    RaRElementList = {
        #key first Bit Index,bitNumber 
        'subcarrierSpacing':[14,1],
        'subcarrerIndication':[8,6],
        'schedulingDealy':[6,2],
        'Msg3RepetionNumber':[3,3],
        'MCSIndex':[0,3],
    }
    bitDecoder = MyBitDecoderClass(RaRElementList)
    decoderRslt = bitDecoder.bitdecoder(hexValStr,offset)

    if(decoderRslt['subcarrierSpacing'] == 0):
        print('subcarrierSpacing 3.75k')
        print('subcarrerIndication : %d'%decoderRslt['subcarrerIndication'])
    else:
        print('subcarrierSpacing 15k')
        if(decoderRslt['subcarrerIndication']<12):
            print('subcarrerIndication : %d'%decoderRslt['subcarrerIndication'])
        elif(decoderRslt['subcarrerIndication']<16):
            print('subcarrerIndication totalNumber 3 : start %d'%(3*(decoderRslt['subcarrerIndication']-12)))
        elif(decoderRslt['subcarrerIndication']<18):
            print('subcarrerIndication totalNumber 6 : start %d'%(3*(decoderRslt['subcarrerIndication']-16)))
        elif(decoderRslt['subcarrerIndication']<19):
            print('subcarrerIndication totalNumber 12')
        else:
            print('subcarrerIndication error configuration!')
        #print('schedulingDealy : %d'%(8*(1<
    if(decoderRslt['schedulingDealy'] == 0):
        print('schedulingDealy : %d'%12)
    else:
        print('schedulingDealy : %d'%(8*(1<<decoderRslt['schedulingDealy'])))
    print('Msg3RepetionNumber : %d'%(1<<decoderRslt['Msg3RepetionNumber']))
    print('MCSIndex : %d'%(decoderRslt['MCSIndex']))

    pass

if __name__ == '__main__':
    #print('test bit decoder')
    #print(decoderRslt)
    decoderRAR('0x88040',5)
    pass

参考文档

  • 3GPP 36.212 - R14
  • 3GPP 36.213 - R14
  • 3GPP 36.211 - R14

你可能感兴趣的:(通信系统)