lte: (fixes #1017) Make hardcoded EPC backhaul IP addresses configurable via attributes
Summary
Resolves #1017 — Hardcoded IP addresses in LTE EPC backhaul links are now configurable through the ns-3 Attribute system.
Previously, the EPC helper classes used fixed IP address ranges (7.0.0.0/8, 10.0.0.0/30, 11.0.0.0/30, 12.0.0.0/30, 13.0.0.0/30, 14.0.0.0/30) for backhaul links and UE address allocation. This caused conflicts when integrating LTE with other network technologies (WiFi, IoT, multi-operator) that use overlapping address spaces.
Changes
NoBackhaulEpcHelper — 5 new attributes:
| Attribute | Default | Purpose |
|---|---|---|
X2NetworkAddress |
12.0.0.0 |
X2 inter-eNB point-to-point links |
S11NetworkAddress |
13.0.0.0 |
S11 (MME-SGW) point-to-point links |
S5NetworkAddress |
14.0.0.0 |
S5 (SGW-PGW) point-to-point links |
UeNetworkAddress |
7.0.0.0 |
UE IP address pool base |
UeNetworkMask |
255.0.0.0 |
UE IP address pool mask |
PointToPointEpcHelper — 2 new attributes:
| Attribute | Default | Purpose |
|---|---|---|
S1uNetworkAddress |
10.0.0.0 |
S1-U (eNB-SGW data plane) links |
S1apNetworkAddress |
11.0.0.0 |
S1-AP (eNB-MME control plane) links |
EmuEpcHelper — 1 new attribute:
| Attribute | Default | Purpose |
|---|---|---|
EpcNetworkAddress |
10.0.0.0 |
All emulated EPC interfaces (S1-U, X2-U, X2-C) |
Additional fixes:
- Fixed
S1uLinkEnablePcapdescription typo inPointToPointEpcHelper("Enable Pcap for X2 link" -> "Enable Pcap for S1-U link") - Added
VirtualNetDeviceto PyViznetdevice_traitsdictionary to prevent visualization crash - Wrapped
Mac48Address::ConvertFrom()in try/except in PyVizcore.pyfor devices without MAC-48 addresses
Design decisions
- Uses
Ipv4AddressValue/Ipv4MaskValueattribute types withMakeIpv4AddressAccessor/MakeIpv4MaskAccessor— consistent with existing ns-3 patterns - Default values match the original hardcoded values ensuring full backward compatibility
- Member variables initialized in constructor, consumed in
NotifyConstructionCompleted()after attribute system has applied user-configured values - All 33 caller files (11 examples + 22 tests) verified — 100% coverage
Usage example
// Method 1: Config::SetDefault (before helper creation)
Config::SetDefault("ns3::PointToPointEpcHelper::S1uNetworkAddress",
Ipv4AddressValue(Ipv4Address("192.168.1.0")));
// Method 2: Command line
// ./ns3 run "lena-simple-epc --ns3::PointToPointEpcHelper::S1uNetworkAddress=192.168.1.0"
Testing
-
lte-epc-e2e-datatest suite: PASSED -
lena-simple-epcexample: runs cleanly - Build with Python bindings and visualizer: PASSED (35/35 targets)
- PyViz visualization: no longer crashes on LTE nodes
Closes #1017