当前位置:网站首页>[5g NR] RRC reject analysis
[5g NR] RRC reject analysis
2022-07-28 03:28:00 【No.7 Huazai】
author : No.7 Huazai
Personal home page : Welcome to my home page
Personal creed : Starlight does not ask passers-by , Time and tide live up to those who want to .
Personal direction : The main direction is 5G, At the same time, take into account other network protocols , Codec protocol ,C/C++,linux, Cloud original, etc , Interested friends can pay attention to me , Communicate together .
Catalog
1. RRC Reject describe
The trigger condition : Base station receives from UE Of RRC Connection Request, According to the admission control algorithm , Don't allow UE Access .
send content :wait time, Timer T302 Duration
2. UE receive RRCReject Processing flow
When UE received RRC Reject after , Follow the following procedure :
Stop timer T300,T319,T302
Reset MAC And release the default MAC Cell Group To configure ;
If in RRCReject Configuration of the waitTime, Then start the timer T302, Set the timer value to waitTime;
If you receive RRCReject It is to respond to the request of the upper layer , Notify the upper layer that access is restricted ;
If you receive RRCReject It is used to reply RRCSetupRequest, Inform the top RRC The connection fails , Program end ;

If you receive RRCReject In response to RRCResumeRequest:

- If the upper layer triggers resume, Inform the upper level RRC The connection fails ;
- If because of RNA Update and trigger recovery , Put the variable pendingRnaUpdate Set to true, Discard the current KgNB secret key ,KRRCenc secret key ,KRRCint secret key ,KUPint Key and basis 5.3.13.3 Derived KUPenc secret key ;
- Pause SRB1, Program end ;
Timer T302 Runtime ,RRC_INACTIVE State of UE Will continue to monitor paging .
3. Message definition
RRCReject Messages are used to reject RRC Connection establishment or RRC Connection reconstruction .
Signaling wireless bearer :SRB0
transmission mode : TM
Logical channel :CCCH
Direction : Network to UE
-- ASN1START
-- TAG-RRCREJECT-START
RRCReject ::= SEQUENCE {
criticalExtensions CHOICE {
rrcReject RRCReject-IEs,
criticalExtensionsFuture SEQUENCE {
}
}
}
RRCReject-IEs ::= SEQUENCE {
waitTime RejectWaitTime OPTIONAL, -- Need N
lateNonCriticalExtension OCTET STRING OPTIONAL,
nonCriticalExtension SEQUENCE{
} OPTIONAL
}
-- TAG-RRCREJECT-STOP
-- ASN1STOP
RejectWaitTime Used for timer T302 Provide a value in seconds , Value range 1~16.
-- ASN1START
-- TAG-REJECTWAITTIME-START
RejectWaitTime ::= INTEGER (1..16)
-- TAG-REJECTWAITTIME-STOP
-- ASN1STOP
4. OAI RRC Reject Send judgment
Open source OAI In the code , Base station received rrcSetupRequest after , Will carry it UE Identity Type to judge , If it is neither random nor TMSI, Will go to UE send out RRC Reject.
if (NR_InitialUE_Identity_PR_randomValue == rrcSetupRequest->ue_Identity.present) {
......
} else if (NR_InitialUE_Identity_PR_ng_5G_S_TMSI_Part1 == rrcSetupRequest->ue_Identity.present) {
......
} else {
rrc_gNB_generate_RRCReject(ctxt_pP,
rrc_gNB_get_ue_context(gnb_rrc_inst, ctxt_pP->rnti),
CC_id);
}
5. OAI RRC Reject code
be familiar with ASN The usage is clear ,option There are many options , In order to adapt to flexible data structures , You need a lot of pointers in the structure . Before the actual assignment , Need to use malloc perhaps calloc Apply memory for pointer variables .RRC Reject Carried on CCCH channel , Therefore, the outer layer needs to be encoded DL_CCCH code .
uint8_t do_RRCReject(uint8_t Mod_id,
uint8_t *const buffer)
{
asn_enc_rval_t enc_rval;;
NR_DL_CCCH_Message_t dl_ccch_msg;
NR_RRCReject_t *rrcReject;
NR_RejectWaitTime_t waitTime = 1;
memset((void *)&dl_ccch_msg, 0, sizeof(NR_DL_CCCH_Message_t));
dl_ccch_msg.message.present = NR_DL_CCCH_MessageType_PR_c1; // Specifies that the logical channel message type is CCCH
dl_ccch_msg.message.choice.c1 = CALLOC(1, sizeof(struct NR_DL_CCCH_MessageType__c1));
dl_ccch_msg.message.choice.c1->present = NR_RRCReject__criticalExtensions_PR_rrcReject; // Appoint dl_ccch The message type is rrcReject
dl_ccch_msg.message.choice.c1->choice.rrcReject = CALLOC(1,sizeof(NR_RRCReject_t));
rrcReject = dl_ccch_msg.message.choice.c1->choice.rrcReject;
rrcReject->criticalExtensions.choice.rrcReject = CALLOC(1, sizeof(struct NR_RRCReject_IEs));
rrcReject->criticalExtensions.choice.rrcReject->waitTime = CALLOC(1, sizeof(NR_RejectWaitTime_t)); // by waitTime Application memory
rrcReject->criticalExtensions.present = NR_RRCReject__criticalExtensions_PR_rrcReject; // Set up rrcReject Inside present by rrcReject
rrcReject->criticalExtensions.choice.rrcReject->waitTime = &waitTime; //waitTime assignment
if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
xer_fprint(stdout, &asn_DEF_NR_DL_CCCH_Message, (void *)&dl_ccch_msg);
}
// Message body per code
enc_rval = uper_encode_to_buffer(&asn_DEF_NR_DL_CCCH_Message,
NULL,
(void *)&dl_ccch_msg,
buffer,
100);
if(enc_rval.encoded == -1) {
LOG_E(NR_RRC, "[gNB AssertFatal]ASN1 message encoding failed (%s, %lu)!\n",
enc_rval.failed_type->name, enc_rval.encoded);
return -1;
}
LOG_D(NR_RRC,"RRCReject Encoded %zd bits (%zd bytes)\n",
enc_rval.encoded,(enc_rval.encoded+7)/8);
return((enc_rval.encoded+7)/8);
}
边栏推荐
- Talk about the speech synthesis function of Baidu University of science and technology news Feiyun Zhisheng
- 什么是虚函数?
- vi命令详解
- 【SAML SSO解决方案】上海道宁为您带来SAML for ASP.NET/SAML for ASP.NET Core下载、试用、教程
- 如何一键进行重装Win11系统
- 并发编程面试题总结
- Redis实现分布式锁
- On weight decay and discarding method
- Shell:资源监控脚本和高负载报警
- Exness: Japanese prices rose and incomes fell, with the pound / yen breaking 165
猜你喜欢

【SAML SSO解决方案】上海道宁为您带来SAML for ASP.NET/SAML for ASP.NET Core下载、试用、教程

QFileDevice、QFile、QSaveFile、QTemporaryFile

When QML uses layout layout, a large number of < unknown file >: QML qquicklayoutattached: binding loop detected for property circular binding warnings appear

4天Excel实战训练营,0.01元特惠仅三天,赠200套学习资料包

Redis实现分布式锁

Summary of concurrent programming interview questions

Redis基本操作

Redis经典面试题总结

如何一键进行重装Win11系统

Redis内存回收
随机推荐
Redis持久化机制
图文并茂:JVM 内存布局详解
Stm32f407 ------- DSP learning
Response to questions about the balanced beacon group of Hubei University of Arts and Sciences
Redis memory recycling
Leetcode 208. implement trie (prefix tree) (2022.07.27)
xctf攻防世界 Web高手进阶区 PHP2
What is a virtual function?
C -- switch case statement
53. Maximum Subarray最大子数组和
[R language] environment specifies to delete RM function
ThreadLocal使用场景
同时导出多个excel,并且一个excel中包含多个sheet
The digital twin smart building visualization platform realizes the integration of enterprise and public services in the park
mysql存储过程 使用游标实现两张表数据同步数据
C#实现弹出一个对话框的同时,后面的form不可用
Exness: Japanese prices rose and incomes fell, with the pound / yen breaking 165
工程电磁场复习基本知识点
max_pool2d(): argument ‘input‘ (position 1) must be Tensor, not NoneType
MySQL的碎片有哪些