# Generic Network Interface Emulator for Media Delivery Evaluation

## Introduction

This contribution proposes a generic network interface emulator for evaluating media delivery protocols under realistic 3GPP network conditions. The emulator supports evaluation objectives across three related study items:
- **FS_QStream_MED**: QUIC-based streaming protocols
- **FS_Q4RTC_MED**: Real-time communication
- **FS_6G_MED**: 6G media aspects

The emulator provides configurable network profiles based on custom and 5QI characteristics, supporting advanced netem controls for realistic traffic shaping to enable consistent and reproducible evaluation.

## Background and Motivation

The contribution addresses requirements from SP-251659 (FS_QStream_MED) and SP-251661 (FS_Q4RTC_MED) for evaluation frameworks under realistic UE-observed network conditions. A reusable emulator with standardized profiles improves repeatability and comparability across implementations.

### Key Capabilities
- One-way delay, jitter, loss, and bandwidth shaping
- Advanced netem controls: correlation, distributions, loss models, reordering, duplication, corruption, and queue limits
- HTB (Hierarchical Token Bucket) rate limiting combined with netem impairments
- YAML-based profile configuration

### Standard Profiles
- **ideal_6g**: 1 ms delay (baseline reference)
- **5g_urban**: 20 ms delay, 0.1% loss, 100 Mbit/s
- **wifi_good**: Home/office WiFi conditions
- **cell_edge**: 120 ms delay, 1% loss, 5 Mbit/s
- **satellite**: 600 ms delay, 0.5% loss, 10 Mbit/s
- **congested**: 200 ms delay, 3% loss, 1 Mbit/s
- **5QI-derived profiles**: Mapped from PDB/PER values

## Network Emulator Architecture

The emulator is built on Linux Traffic Control (tc) with netem qdisc, providing precise control over network characteristics. It implements a layered approach where network conditions are applied at the interface level, enabling transparent emulation for any media delivery protocol without requiring client or server modifications.

### 5QI-based Network Profiles

Pre-defined profiles derived from 3GPP 5QI specifications (TS 23.501 Table 5.7.4-1):

- **5QI 1**: Conversational Voice (PDB 100ms → delay, PER 10^-2 → 1% loss)
- **5QI 2**: Conversational Video/Live Streaming (PDB 150ms, PER 10^-3 → 0.1% loss)
- **5QI 7**: Voice, Video, Interactive Gaming (PDB 100ms, PER 10^-3 → 0.1% loss)
- **5QI 80**: Low-latency eMBB/AR (PDB 10ms, PER 10^-6 → 0.0001% loss)

### Advanced Netem Controls

The emulator supports sophisticated network modeling beyond basic delay and loss:

- **Delay distribution models**: normal, pareto, paretonormal
- **Delay correlation**: Controls smoothness of delay variations
- **Loss correlation**: Enables bursty loss patterns
- **Gilbert-Elliott loss models**: Two-state Markov model for realistic loss simulation
- **Bandwidth shaping**: HTB with configurable rate limits
- **Packet buffer limits**: Configurable queue sizes
- **Additional impairments**: Reordering, duplication, corruption

### YAML Configuration Structure

The contribution provides comprehensive YAML profile examples with detailed parameter mappings to tc/netem commands:

- **Delay parameters**: delay_ms, jitter_ms, delay_distribution, delay_correlation_pct
- **Loss parameters**: loss_pct, loss_correlation_pct, loss_model (Gilbert-Elliott)
- **Bandwidth parameters**: rate_mbit, limit_packets
- **Additional impairments**: reorder_pct, duplicate_pct, corrupt_pct

Each profile includes inline documentation explaining the parameter purpose and mapping to Linux tc commands.

### Deployment Scenarios

Multiple deployment configurations are supported:

1. **Standalone deployment**: Single host for client-side testing
2. **Docker deployment**: Containerized execution with NET_ADMIN capabilities for cross-platform consistency
3. **Network bridge deployment**: Positioned between client and server for transparent traffic shaping
4. **Integration with simulation frameworks**: Compatible with ns-3 and similar tools

### Example Usage

```python
from netemu import NetworkEmulator

emulator = NetworkEmulator(
    interface="eth0",
    profiles_path="profiles.yaml"
)

# Apply profiles for uplink and downlink
emulator.apply_profile("poor_cellular", 
                       ingress_profile="5g_urban")

# ... run tests ...

emulator.clear()
```

## Proposals

The contribution proposes that SA4 agrees on the following:

1. The network emulator based on Linux tc with netem qdisc provides an appropriate baseline for media delivery protocol evaluation under realistic 3GPP network conditions.

2. The 5QI-derived network profiles may be used as reference conditions for comparing media delivery technologies across the related study items.

3. Additional network profiles (satellite, congested, edge scenarios) complement the 5QI profiles for comprehensive evaluation coverage.

4. Document the emulator architecture and profiles in **TR 26.934** (Test platform for media delivery technologies) to ensure consistent evaluation methodology.

## References

- [1] SP-251652: New SID on Media Aspects for 6G System (FS_6G_MED)
- [2] SP-251659: New SID on evaluation of QUIC-based protocols for on-demand and live video services (FS_QStream_MED)
- [3] SP-251661: New SID on QUIC-based media delivery for Real-time Communication (FS_Q4RTC_MED)
- [4] 3GPP TS 23.501: System architecture for the 5G System (5GS)