Repository navigation
RLC and PDCP Layer
The PDCP/RLC layer represents a simple abstraction of the higher layer levels within the full stack of 5G networks and beyond. It is in charge of queuing IP packets from all the UEs, both real and simulated. One queue is created for each UE and transmission direction. The PDCP/RLC layer communicates to the MAC layer, in a Scheduling Request (SR), how many bits are ready for transmission for each UE. Whenever a slot is allocated to an UE by the MAC layer, the IP packets of such UE are split into smaller blocks if necessary and moved through the HARQ model.
We added the RLC packet re-ordering and re-transmission capabilities. The simplified flow follows:
RLC Packet Ordering Capabilities: IP packets are generally larger than the Transport Block Size (TBS) or packet size used for transmission. As the transmitted packets can be retransmitted in an HARQ process, they might arrive unordered. The RLC is in charge of reordering and reconstructing the received packets into their corresponding IP packets. If one packet from the IP packet is lost, the entire IP packet is dropped. We emulate this behaviour by checking the correct integrity of the IP packet. The IP packet is not released until all the packets have been received. Besides, RLC also tries to ensure IP packet order when order_pkts is enabled.
Note: No specific 3GPP models/implementations were followed: this module just represents a high level abstraction of the described layers. None of the protocols and interfaces described in the different 3GPP specifications describing these layers are implemented. We just understood this layer as a packet queuer, divider and provider.
The current implementation uses a common pdcp_layer class for both simulated and captured traffic. This class orchestrates:
-
ip_buffer: stores packets waiting for radio transmission. It can optionally use the DualQ/L4S queue. -
harq_handler: stores packets that must be retransmitted according to the HARQ model. -
packet_handler: abstracts the source and final release/drop behavior.
There are two packet handler implementations:
-
simulated_packet_handler: generates virtual traffic using the configured traffic model and records final simulated packet results. -
captured_packet_handler: consumes packets from Netfilter Queues and applies final verdicts to the original packets.
This refactoring makes real and simulated traffic share the same PDCP/RLC, HARQ and queueing path. The difference is only the packet source and the final action once the emulated radio behavior has been applied.
Each UE can define a packet delay budget:
[UE]
pkt_delay_budget: 0.300
The value is expressed in seconds. Packets older than the allowed budget are dropped from the IP buffer or HARQ buffer. This is useful when emulating latency-sensitive traffic, because packets that missed their budget should not consume additional radio resources.
For actual IP traffic, captured packet metadata is pushed into the same PDCP/RLC flow as simulated packets. The metadata includes the packet ID, size and ECN state. When the virtual packet is finally released, CE-marked or dropped, the captured packet handler applies the corresponding verdict to the original packet in the NFQUEUE.
The queue IDs are configured in the UE section:
[UE]
ue_type: 0
ul_queue_n: 100
dl_queue_n: 101
n_ues: 1
See Netfilter Module and Run Scripts and NFQUEUE Lab for setup details.
There is a PDCP/RLC configuration shared by all UEs:
[PDCP_RLC]
backhaul_d: 0.003
backhaul_d_var: 0.0
order_pkts: true
[MACLayer]
max_rtx_ul: 4
max_rtx_dl: 4
[PHYLayer]
air_delay_var_ul: 0.0
rtx_period_ul: 0.004
rtx_period_var_ul: 0
rtx_proc_delay_ul: 0.002
rtx_proc_delay_var_ul: 0.0
air_delay_var_dl: 0.0
rtx_period_dl: 0.005
rtx_period_var_dl: 0
rtx_proc_delay_dl: 0.002
rtx_proc_delay_var_dl: 0.0
Which define:
-
max_rtx_ul/max_rtx_dl: maximum number of retransmissions for UL/DL HARQ packets. -
air_delay_var_*: added variance to the delay coming from air propagation. -
rtx_period_*: ACK/NACK delay in seconds for HARQ packets. -
rtx_period_var_*: white noise spread around the ACK/NACK delay in seconds. -
rtx_proc_delay_*: ACK/NACK processing delay in seconds. -
rtx_proc_delay_var_*: white noise spread around the processing delay. -
backhaul_d: backhauling delay before final packet release. -
backhaul_d_var: white noise spread around the backhauling delay. -
order_pkts: enable/disable RLC reordering for captured traffic.
The IP buffer can be configured to use DualQ/L4S behavior for a specific UE. When enabled, packets are separated according to their ECN state and the queue may CE-mark or drop packets according to the AQM model. See L4S and DualQ.