Skip to content

Commit abcaaa9

Browse files
committed
examples/ipv6/pmipv6: network-based mobility handover example + fingerprint
One LMA, two MAGs, a correspondent node, and a single wireless mobile node (a plain IPv6 host with no mobility software) that roams from mag1 to mag2. Each MAG registers the node with the LMA on attachment and advertises the home network prefix, so the node keeps a constant address across the handover; the correspondent node's pings follow it (only a few packets lost during the L2 re-binding window). Adds a tplx/~tNl/~tND/tyf fingerprint test.
1 parent 49e3f67 commit abcaaa9

6 files changed

Lines changed: 262 additions & 0 deletions

File tree

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
//
2+
// Copyright (C) 2026 OpenSim Ltd.
3+
//
4+
// SPDX-License-Identifier: LGPL-3.0-or-later
5+
//
6+
7+
package inet.examples.ipv6.pmipv6;
8+
9+
import inet.networklayer.configurator.ipv6.Ipv6NetworkConfigurator;
10+
import inet.node.ipv6.StandardHost6;
11+
import inet.node.pmipv6.LocalMobilityAnchor;
12+
import inet.node.pmipv6.MobileAccessGateway;
13+
import inet.node.mipv6.WirelessHost6;
14+
import inet.physicallayer.wireless.ieee80211.packetlevel.Ieee80211ScalarRadioMedium;
15+
16+
17+
channel ethernetline extends ned.DatarateChannel
18+
{
19+
parameters:
20+
delay = 0.1us;
21+
datarate = 100Mbps;
22+
}
23+
24+
//
25+
// A Proxy Mobile IPv6 (RFC 5213) domain with one Local Mobility Anchor and two
26+
// Mobile Access Gateways. A single mobile node -- a plain wireless IPv6 host with
27+
// no mobility software -- starts under mag1 and roams to mag2. Each gateway, on
28+
// detecting the attachment, registers the mobile node with the anchor on its
29+
// behalf and advertises the node's home network prefix on the access link, so the
30+
// node keeps its address throughout. A correspondent node behind the anchor
31+
// exchanges traffic with the mobile node across the handover.
32+
//
33+
network Pmipv6Network
34+
{
35+
parameters:
36+
**.mgmt.numChannels = 5;
37+
**.ipv6.configurator.networkConfiguratorModule = "configurator";
38+
@display("bgb=800,500");
39+
40+
submodules:
41+
configurator: Ipv6NetworkConfigurator {
42+
parameters:
43+
config = xmldoc("config.xml");
44+
// the mobile node autoconfigures its (home) address via SLAAC from the MAG's RA
45+
assignAddressesToHosts = false;
46+
@display("p=80,60;is=s");
47+
}
48+
radioMedium: Ieee80211ScalarRadioMedium {
49+
parameters:
50+
@display("p=80,160;is=s");
51+
}
52+
lma: LocalMobilityAnchor {
53+
parameters:
54+
@display("p=400,150;i=abstract/router");
55+
}
56+
cn: StandardHost6 {
57+
parameters:
58+
@display("p=400,60");
59+
}
60+
mag1: MobileAccessGateway {
61+
parameters:
62+
@display("p=250,260");
63+
}
64+
mag2: MobileAccessGateway {
65+
parameters:
66+
@display("p=550,260");
67+
}
68+
mn: WirelessHost6 {
69+
parameters:
70+
@display("p=250,400");
71+
}
72+
73+
connections allowunconnected:
74+
cn.ethg++ <--> ethernetline <--> lma.ethg++;
75+
mag1.ethg++ <--> ethernetline <--> lma.ethg++;
76+
mag2.ethg++ <--> ethernetline <--> lma.ethg++;
77+
}

examples/ipv6/pmipv6/README

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
Proxy Mobile IPv6 (RFC 5213)
2+
============================
3+
4+
This example demonstrates network-based mobility management with Proxy Mobile
5+
IPv6 (RFC 5213). In contrast to Mobile IPv6 (see examples/ipv6/mipv6*), the
6+
mobile node runs NO mobility software: it is a plain wireless IPv6 host that
7+
simply autoconfigures an address from Router Advertisements. The network does
8+
all the mobility work, through two entities:
9+
10+
- the Local Mobility Anchor (LMA, node `lma`): the topological anchor for the
11+
mobile node's home network prefix; it holds the binding cache and one end of
12+
the tunnel to each access gateway; and
13+
- two Mobile Access Gateways (MAGs, nodes `mag1` and `mag2`): access routers
14+
that double as 802.11 access points. When the mobile node attaches, the
15+
serving MAG sends a Proxy Binding Update to the LMA on the node's behalf,
16+
sets up a bidirectional tunnel to the LMA, and advertises the node's home
17+
network prefix on the access link.
18+
19+
Topology:
20+
21+
cn --- lma === mag1 (( )) mn ... roams ... mag2
22+
\ /
23+
=================================
24+
25+
`cn` (correspondent node) and the two MAGs hang off the LMA on separate wired
26+
links. `mn` (mobile node) is wireless.
27+
28+
Scenario (config General):
29+
30+
- `mn` starts in mag1's coverage, associates, and mag1 registers it with the
31+
LMA. The LMA routes the home network prefix (2001:db8:1::/64) into the tunnel
32+
toward mag1, and mag1 advertises that prefix on its access link, so `mn`
33+
autoconfigures its home address 2001:db8:1:0:8aa:ff:fe00:b.
34+
- At t=20s `mn` moves toward mag2. When it re-associates there, mag2 registers
35+
it with the LMA, which re-points the prefix route toward mag2. Because mag2
36+
advertises the SAME prefix, `mn` keeps the SAME address across the handover.
37+
- `cn` pings `mn`'s home address throughout. The echo replies follow `mn`
38+
across the handover (a few packets are lost only during the brief L2
39+
re-association/re-binding window), demonstrating session continuity.
40+
41+
What to look for:
42+
43+
- the Proxy Binding Update / Acknowledgement exchanges (mag1->lma, then
44+
mag2->lma after the move) and the "LMA handover: re-pointing prefix" log line;
45+
- `mn`'s address stays constant before and after the handover;
46+
- the correspondent node's ping loss rate is near zero.
47+
48+
Files:
49+
50+
- Pmipv6Network.ned - the topology
51+
- config.xml - IPv6 addressing of the wired links (access links are
52+
left unconfigured; the home prefix is advertised
53+
dynamically by the serving MAG)
54+
- movement.xml - the mobile node's movement schedule
55+
- omnetpp.ini - simulation parameters, including the per-MAG PMIPv6
56+
policy (mobile-node identifier, home network prefix, LMA)

examples/ipv6/pmipv6/config.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<config>
2+
<!-- Only the wired (backhaul) interfaces are configured here. The access
3+
(wlan) interfaces of the MAGs are deliberately left unconfigured: they
4+
advertise Router Advertisements (because the node is a router) but carry
5+
NO statically-assigned global prefix. The mobile node's home network
6+
prefix (2001:db8:1::/64) is advertised dynamically by the serving MAG. -->
7+
8+
<!-- LMA <-> correspondent node link (the CN autoconfigures from the LMA's RA) -->
9+
<interface hosts="lma" towards="cn" address="2001:db8:ff::1"/>
10+
11+
<!-- LMA <-> MAG1 backhaul -->
12+
<interface hosts="lma" towards="mag1" address="2001:db8:0:1::1"/>
13+
<interface hosts="mag1" towards="lma" address="2001:db8:0:1::2"/>
14+
15+
<!-- LMA <-> MAG2 backhaul -->
16+
<interface hosts="lma" towards="mag2" address="2001:db8:0:2::1"/>
17+
<interface hosts="mag2" towards="lma" address="2001:db8:0:2::2"/>
18+
</config>

examples/ipv6/pmipv6/movement.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<movement>
2+
<!-- The mobile node starts under mag1, dwells, then dashes to mag2's coverage
3+
area, performing a single PMIPv6 handover, then dwells again. -->
4+
<set x="250" y="400"/>
5+
<set speed="20"/>
6+
<wait t="20"/>
7+
<moveto x="550" y="400"/>
8+
<wait t="100"/>
9+
</movement>

examples/ipv6/pmipv6/omnetpp.ini

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
#
2+
# Proxy Mobile IPv6 (RFC 5213) example: a single mobile node -- a plain wireless
3+
# IPv6 host running NO mobility software -- attaches under mag1 and then roams to
4+
# mag2. Each Mobile Access Gateway detects the attachment at the link layer,
5+
# registers the node with the Local Mobility Anchor on its behalf (Proxy Binding
6+
# Update / Acknowledgement), tunnels the node's traffic to/from the anchor, and
7+
# advertises the node's home network prefix on the access link. The node keeps the
8+
# same address across the handover; a correspondent node's traffic follows it.
9+
#
10+
11+
[General]
12+
network = Pmipv6Network
13+
seed-set = 1
14+
num-rngs = 3
15+
**.mobility.rng-0 = 2 # give the mobility its own RNG, isolated from the wireless MAC
16+
sim-time-limit = 60s
17+
18+
# --- PMIPv6 configuration ---------------------------------------------------
19+
# Both MAGs serve the same mobile node (same identifier and home network prefix),
20+
# so the node keeps its address when it moves from one to the other. Each MAG
21+
# registers with the LMA via the LMA's address on its own backhaul link.
22+
*.mag1.ipv6.pmipv6.localMobilityAnchorAddress = "2001:db8:0:1::1"
23+
*.mag2.ipv6.pmipv6.localMobilityAnchorAddress = "2001:db8:0:2::1"
24+
*.mag*.ipv6.pmipv6.mobileNodeProfiles = xml("<mobileNodes><mobileNode id='mn1@example.com' homeNetworkPrefix='2001:db8:1::' prefixLength='64'/></mobileNodes>")
25+
26+
# --- wireless access links --------------------------------------------------
27+
*.mag*.numWlanInterfaces = 1
28+
*.mn.numWlanInterfaces = 1
29+
30+
# MAG access points: SSIDs, fixed MAC addresses, one channel each
31+
**.mag*.wlan*.mgmt.beaconInterval = 0.1s
32+
*.mag1.wlan*.mgmt.ssid = "MAG1"
33+
*.mag1.wlan*.address = "10:AA:00:00:01:01"
34+
*.mag1.wlan*.radio.channelNumber = 0
35+
*.mag2.wlan*.mgmt.ssid = "MAG2"
36+
*.mag2.wlan*.address = "10:AA:00:00:02:01"
37+
*.mag2.wlan*.radio.channelNumber = 1
38+
39+
# Mobile node: a known MAC so its home address is deterministic
40+
# (home prefix 2001:db8:1::/64 + EUI-64 of 0A:AA:00:00:00:0B).
41+
*.mn.wlan*.address = "0A:AA:00:00:00:0B"
42+
*.mn.wlan*.agent.channelsToScan = "0 1"
43+
*.mn.wlan*.agent.probeDelay = 0.1s
44+
*.mn.wlan*.agent.minChannelTime = 0.15s
45+
*.mn.wlan*.agent.maxChannelTime = 0.3s
46+
*.mn.wlan*.agent.authenticationTimeout = 5s
47+
*.mn.wlan*.agent.associationTimeout = 5s
48+
49+
**.mgmt.numChannels = 5
50+
**.wlan*.bitrate = 2Mbps
51+
**.wlan*.mac.dcf.channelAccess.cwMin = 7
52+
53+
# wireless channel physical parameters
54+
*.radioMedium.mediumLimitCache.maxTransmissionPower = 2.0mW
55+
*.radioMedium.mediumLimitCache.minReceptionPower = -82dBm
56+
*.radioMedium.mediumLimitCache.minInterferencePower = -82dBm
57+
**.radio.transmitter.power = 2.0mW
58+
**.analogModel.ignorePartialInterference = true
59+
60+
# quick movement detection: short RA intervals + L2-triggered router discovery
61+
**.neighbourDiscovery.minIntervalBetweenRAs = 1s
62+
**.neighbourDiscovery.maxIntervalBetweenRAs = 3s
63+
64+
# --- mobility ---------------------------------------------------------------
65+
*.mag1.mobility.typename = "StationaryMobility"
66+
*.mag1.mobility.initialX = 250m
67+
*.mag1.mobility.initialY = 260m
68+
*.mag2.mobility.typename = "StationaryMobility"
69+
*.mag2.mobility.initialX = 550m
70+
*.mag2.mobility.initialY = 260m
71+
*.mn.mobility.typename = "TurtleMobility"
72+
*.mn.mobility.turtleScript = xmldoc("movement.xml")
73+
*.mn.mobility.updateInterval = 0.1s
74+
**.mobility.constraintAreaMinZ = 0m
75+
**.mobility.constraintAreaMaxZ = 0m
76+
**.constraintAreaMinX = 0m
77+
**.constraintAreaMinY = 0m
78+
**.constraintAreaMaxX = 800m
79+
**.constraintAreaMaxY = 500m
80+
81+
# --- applications -----------------------------------------------------------
82+
# The correspondent node pings the mobile node's stable home address throughout
83+
# the simulation; the echo replies follow the node across the handover, showing
84+
# session continuity. The destination is the deterministic home address
85+
# (home prefix + the mobile node's EUI-64 interface id).
86+
*.cn.numApps = 1
87+
*.cn.app[0].typename = "PingApp"
88+
*.cn.app[0].destAddr = "2001:db8:1:0:8aa:ff:fe00:b"
89+
*.cn.app[0].packetSize = 56B
90+
*.cn.app[0].sendInterval = 0.5s
91+
*.cn.app[0].startTime = 8s
92+
*.cn.app[0].hopLimit = 32
93+
94+
# hosts do not forward; the LMA and MAGs forward by virtue of their NED type
95+
*.cn.forwarding = false
96+
*.mn.forwarding = false
97+
98+
# Ethernet queues
99+
**.eth[*].queue.typename = "EthernetQosQueue"
100+
**.eth[*].queue.dataQueue.typename = "DropTailQueue"
101+
**.eth[*].queue.dataQueue.packetCapacity = 100

tests/fingerprint/examples.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@
377377
/examples/ipv6/mipv6/, -f omnetpp.ini -c Handover -r 0, 70s, c5da-e27c/tplx;9413-63a6/~tNl;fbfb-2417/~tND;44ef-1a45/tyf, PASS, wireless EthernetMac
378378
/examples/ipv6/mipv6/, -f omnetpp.ini -c RouteOptimizationTwoCNs -r 0, 60s, d35f-dc03/tplx;7425-2b8e/~tNl;a47a-f278/~tND;ed3e-17fa/tyf, PASS, wireless EthernetMac
379379
/examples/ipv6/mipv6roaming/, -f omnetpp.ini -c Roaming -r 0, 70s, 88e2-ca2b/tplx;bdcc-fe8e/~tNl;a891-bcda/~tND;afae-2b3c/tyf, PASS, wireless EthernetMac
380+
/examples/ipv6/pmipv6/, -f omnetpp.ini -c General -r 0, 60s, 4b26-5f33/tplx;6c5e-3ae5/~tNl;262c-1c80/~tND;0277-d784/tyf, PASS, wireless EthernetMac
380381

381382
/examples/mobility/, -f omnetpp.ini -c AnsimMobility -r 0, 10000s, 72f8-5c0b/tplx;0000-0000/~tNl;0000-0000/~tND;7dd1-18eb/tyf, PASS,
382383
/examples/mobility, -f omnetpp.ini -c AttachedMobility, 10s, 566c-6355/tplx;0000-0000/~tNl;0000-0000/~tND;fa92-f68c/tyf, PASS,

0 commit comments

Comments
 (0)