Deep dive into the 5G Radio Link Control in Acknowledged Mode

Image for post
Image for post

The RLC layer in the 5G NR stack is responsible for:

  • Transfer of upper layer PDUs in Acknowledged Mode (AM), Unacknowledged Mode (UM) and Transparent Mode (TM)
  • Error correction via retransmission of lost RLC PDUs (AM)
  • Segmentation and reassembly of RLC SDUs (UM and AM)
  • Re-segmentation of RLC data PDUs when a complete RLC PDU cannot be transmitted (AM).
  • Reordering of RLC data PDUs (UM and AM)

Here we will take a deep dive into the RLC AM procedures. The procedures are explained with flow charts that are based on the 3GPP specification 38.322 V15.5.0.

RLC entity handling

The RLC entity is established from the RRC layer whenever a radio bearer needs to be setup. The establishment involves creating the RLC entity and then initializing all the protocol state variables. Once the initialization is completed, the RLC entity moves into the ACTIVE state. …


Assisting the compiler in optimizing if conditions

Image for post
Image for post

A look at the Linux kernel code will show many if conditions enclosed in likely and unlikely macros. These macros invoke compiler directives that give the compiler a hint on the code leg that should be optimized for performance.

For example, the following translation lookaside buffer (TLB) insert function from the Linux kernel code contains an if-condition with the likely directive. Here the author is telling the compiler that it is very likely that the TLB entry lookup will fail.

static void tlb_entry_insert(unsigned int pd0, pte_t pd1)
{
unsigned int idx;
idx = tlb_entry_lkup(pd0);
if (likely(idx & TLB_LKUP_ERR))
write_aux_reg(ARC_REG_TLBCOMMAND, TLBGetIndex);
write_aux_reg(ARC_REG_TLBPD1, pd1);
write_aux_reg(ARC_REG_TLBCOMMAND, TLBWrite)…


Understand the closure generated from a lambda expression

Image for post
Image for post

Lambda expressions in C++ let developers define anonymous functions that can be used to inject code. Lambda expressions are more than just functions, they can capture the context from the code enclosing the lambda function. Here we will go under the hood and see how lambda functions operate by generating a closure.

A simple lambda expression

Consider the code presented below, a function visit that iterates over a vector and invokes the passed visitor. Note here that visitor does not need to be function, it could be any type that overloads operator ().

The main function passes the lambda function:

[] (int a) { printf(%d\n", a)…


Develop an intuitive understanding of polar codes

Image for post
Image for post

3GPP has selected polar codes as the error correcting code on the 5G NR control channels. Polar codes are unique in the way they split the channel into good and bad bit-channels. We will learn about the channel splitting by running experiments using Linux tools awk and gnuplot. These experiments are based on a talk by Professor Emre Telatar.

What do we mean by good and bad bit-channels? Consider a polar code where K information bits are being sent in a block of N bits. Polar code encoding will polarize the channel into reliable and unreliable bit-channels. The information bits will be transmitted on the most reliable K bit-channels. …


Eliminating the last function call and converting a recursive function into a loop based function

Image for post
Image for post

Examining the translation of simple examples of C++ code into assembly can be very instructive in developing an intuitive understanding of the code generation and optimization process.

We will be examining the generated assembly for simple code fragments that have been compiled with the GCC trunk (post 8.2). The optimization level switches have been set to O3.

Mapping C++ code to assembly

Consider the run function defined below. The function takes a single parameter, logLevel. The code shows two trace puts calls controlled by the logLevel. The actual application code is just represented as a puts call.

We have compiled the code into the assembly using the Compiler Explorer. The C++ code and the corresponding assembly is color-coded, enabling you to easily track the assembly generated for a particular line of C++ code. …


Declare a function to be side-effect free

Image for post
Image for post

C++ is not a functional programming language. Functions causing side-effects are the norm with functions routinely modifying member variables. If a compiler does not see the body of a function, it assumes that the function causes side effects. This can result in missed optimization opportunities.

A missed opportunity for optimization

Consider the following code. Here the main function (for some reason) computes the square of the total number of arguments twice and returns the sum of the squares.

int square(int x);int main(int argc, char *argv[])
{
auto x = square(argc);
auto y = square(argc);
return x+y;
}

Here the compiler does not see the body for the square function so it assumes that the function can cause side effects. The following assembly code shows two calls to the add function. …


UE registers with the 5G Core Network (5GC) via the 5G-RAN

Image for post
Image for post

The transition to 5G will probably start with 4G-5G dual connectivity-based solutions. With dual connectivity, the 5G data plane is introduced in a largely 4G network [See Figure (a) below].

As 5G gains momentum, the networks will transition to an end-to-end 5G solution with UEs registering with the 5G Core Network. In standalone mode, the UE control plane, as well as data plane, is served by 5G-NR [See Figure (b) below].


The 5G Core Network has been designed around services that are invoked using a standard API. On the surface, the 5G architecture looks very different from the 4G EPC but on close inspection, you can see the evolution from the 4G architecture to the 5G architecture.

We will look at the forcing driving the evolution of the 5G core (5GC) and look at the different functions that are defined in the 5G architecture.

Towards the 5G core network architecture

Evolution from 4G EPC

The 5G core has evolved from the 4G EPC in two steps:

  • Control and User Plane Separation (CUPS) of the 4G EPC
  • Reorganizing the 4G EPC CUPS functions into…


CUPS — Control and User Plane Separation

Image for post
Image for post

Facilitating 4G EPC transition to a centralized cloud

Vendors are moving the 4G EPC to the cloud. This lowers the network deployment and maintenance cost. Moving to the cloud, however, increases the user plane latency. All user plane data must be carried all the way to the cloud provider before it hits the Internet (Refer to the following figure).


Signaling flow for 5G access via LTE-5G NR dual connectivity (EN-DC)

Image for post
Image for post

Updated on March 15, 2019

Transition to 5G is being accelerated by enabling support for 5G bearers in the existing 4G-LTE infrastructure.

5G mobile broadband services will be available to users in a primarily 4G network via mobile terminals that support dual connectivity to 4G LTE and 5G NR base stations at the same time.

To enable dual connectivity, the 4G infrastructure will support connecting to a 5G NR base station (gNodeB). The following figure shows a 5G gNodeB connected to the 4G EPC at the data plane level. The 5G gNodeB does not connect to the MME. …

About

EventHelix

@EventHelix — 5G | LTE | Networking

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store