A UE-side system for 5G network slicing that keeps a device's traffic on the best-performing slice. Multiple PDU sessions are established simultaneously, one per slice. Per-slice latency is measured continuously, and the default route is updated to whichever interface meets the application's latency requirements, without releasing and re-establishing PDU sessions.
Tested on a Raspberry Pi 4 with a Quectel RM520N-GL modem on an Amarisoft 5G SA core, using Linux policy-based routing and QMI/QMAP for multi-PDU session management.
| File / Folder | |
|---|---|
PoC_slice_selector/Get_interface_latency.py |
Measures per-interface latency |
PoC_slice_selector/Interface_Selector_Latency.py |
Switches the default route based on latency requirements |
slice_selection.md |
Guide on how to establish the multi-slice PDU sessions |
slice_switching_experiments/ |
Switching delay results: multi_pdu_switching/ and sequential_switching/ |
Step-by-step guide for bringing up the simultaneous multi-slice PDU sessions on the UE: establishing one PDU session per slice, the QMI/QMAP configuration, and the Linux policy-based routing. Read this first as the runtime slice selection assumes these sessions are already up.
The proof-of-concept that performs the live latency-based slice selection. It
uses two scripts that communicate through a shared active_ifaces.json file:
Get_interface_latency.py: pings each interface continuously to get the latency metrics and writes the active interfaces toactive_ifaces.json.Interface_Selector_Latency.py: readsactive_ifaces.jsonand, when the active interface's latency stays above the requirement, updates the default route to a better interface using route metrics (Linux routing).
Both read their settings (ping target, latency requirement, thresholds) from
config.json.
Run the latency measurement first, then the selector:
sudo python3 Get_interface_latency.py
sudo python3 Interface_Selector_Latency.pyThis folder contains the results of the experiments conducted to evaluate and compare the slice-switching delay of the two implemented switching mechanisms:
Switching-delay measurements comparing the two strategies:
- Sequential : the active PDU session is fully released before a new one is established on another slice, which introduces a visible service interruption.
- Multi-PDU : all sessions stay up and traffic is re-routed between them.
Results are split into one subfolder per strategy:
multi_pdu_switching/sequential_switching/
Each holds 10 trials, TEST1–TEST10, and every trial has two logs:
ping_<STRATEGY>_TEST<N>.log: continuouspingoutput for the trial. The service-interruption duration is derived from the gap in ICMP sequence numbers during the switch.switch_events_<STRATEGY>_TEST<N>.log: timestamped switch events (round start/stop markers) recording when the switch was issued and completed.