From 2e9fc0200ae10be5e7ce1de4a4729c7e320603aa Mon Sep 17 00:00:00 2001 From: Gyorgy Szaszko Date: Wed, 19 Aug 2026 15:20:22 +0200 Subject: [PATCH 1/2] mipv6: fix: apply the first-registration Binding Update retransmission timeout RFC 6275 section 11.8 requires a mobile node that holds no binding at its home agent to start the Binding Update retransmission backoff at InitialBindackTimeoutFirstReg instead of INITIAL_BINDACK_TIMEOUT, so that the timer outlasts the Duplicate Address Detection the home agent performs before it acknowledges a first home registration. createBUTimer() carried that branch but could never enter it: the two-argument overload creates the Binding Update List entry through fetch(), and the four-argument overload then tests isInBindingUpdateList() for the absence of that very entry. Test what the RFC names instead -- an existing binding -- through hasActiveBinding(), and only for a home registration, because a Binding Update addressed to a correspondent node causes no Duplicate Address Detection and keeps the shorter INITIAL_BINDACK_TIMEOUT. Behaviour is unchanged by this commit on its own: MIPv6_INITIAL_BINDACK_TIMEOUT and MIPv6_INITIAL_BINDACK_TIMEOUT_FIRST both still hold 1 second, so the revived branch selects the same value the dead one would have. Verified: the mipv6, mipv6roaming and pmipv6 fingerprints and the MIPv6 module tests produce results byte-identical to the parent commit. Fixes #1132 --- src/inet/networklayer/mipv6/Mipv6.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/inet/networklayer/mipv6/Mipv6.cc b/src/inet/networklayer/mipv6/Mipv6.cc index c70d39b322b..c4a1bf85aab 100644 --- a/src/inet/networklayer/mipv6/Mipv6.cc +++ b/src/inet/networklayer/mipv6/Mipv6.cc @@ -412,13 +412,21 @@ void Mipv6::createBUTimer(const Ipv6Address& buDest, NetworkInterface *ie, const If the mobile node is sending a Binding Update and does not have an existing binding at the home agent, it SHOULD use InitialBindackTimeoutFirstReg (see Section 13) as a value for the - initial retransmission timer.*/ - if (!bul->isInBindingUpdateList(buDest)) + initial retransmission timer. This long retransmission interval + will allow the home agent to complete the Duplicate Address + Detection procedure mandated in this case*/ + // hasActiveBinding() is the test the RFC describes. A Binding Update List entry + // exists from the moment a Binding Update is attempted -- the createBUTimer() + // overload above creates one through fetch() -- so its mere presence says nothing + // about whether the home agent holds a binding. Only a home registration makes the + // home agent run Duplicate Address Detection, so a first Binding Update sent to a + // correspondent node keeps the shorter INITIAL_BINDACK_TIMEOUT. + if (homeRegistration && !bul->hasActiveBinding(buDest)) buIfEntry->ackTimeout = ie->getProtocolData()->_getInitialBindAckTimeoutFirst(); // the backoff constant gets initialised here /*Otherwise, the mobile node should use the specified value of INITIAL_BINDACK_TIMEOUT for the initial retransmission timer.*/ else - buIfEntry->ackTimeout = ie->getProtocolData()->_getInitialBindAckTimeout(); // if there's an entry in the BUL, use different value + buIfEntry->ackTimeout = ie->getProtocolData()->_getInitialBindAckTimeout(); buIfEntry->homeRegistration = homeRegistration; From f513057d65e4f6356b440bb4614b5bb5e2064c05 Mon Sep 17 00:00:00 2001 From: Gyorgy Szaszko Date: Wed, 19 Aug 2026 15:20:35 +0200 Subject: [PATCH 2/2] mipv6: fix: set InitialBindackTimeoutFirstReg to the RFC value of 1.5 s RFC 3775 and RFC 6275 section 13 give InitialBindackTimeoutFirstReg a default of 1.5 seconds, derived as 1.5 times RetransTimer (RFC 4861) times DupAddrDetectTransmits (RFC 4862). INET used 1 second, which is exactly the Duplicate Address Detection delay the home agent applies before it answers a first home registration, so the timer had no margin left for the round trip. The Binding Acknowledgement therefore always arrived after the retransmission timer had already fired, and every first home registration cost two Binding Updates instead of one. In examples/ipv6/mipv6 -c Handover the acknowledgement lost that race by 2.35 ms. With 1.5 seconds the registration completes in a single Binding Update. Move the definition out of the section 12 protocol constants block as well: it is a section 13 protocol configuration variable, which is why the RFC writes it in CamelCase rather than in ALL_CAPS. Fingerprints: the three MIPv6 example rows in tests/fingerprint/examples.csv and in tests/fingerprint/mipv6-refactoring.csv are re-recorded, because the home registration now sends one Binding Update rather than two and every later event shifts. The pmipv6 row is left untouched, as it is unaffected by this change and its stale tyf value predates it. Three of the re-recorded rows likewise carried a stale tyf value, and mipv6roaming a stale ~tNlb value, before this commit; the re-recording absorbs those pre-existing mismatches. MIPv6 module tests: 10 pass. MIPv6_tcp_handover fails identically here and on the parent commit -- no TCP data arrives -- so that failure is pre-existing. Fixes #1133 --- src/inet/networklayer/ipv6/Mipv6InterfaceData.h | 11 ++++++++++- tests/fingerprint/examples.csv | 6 +++--- tests/fingerprint/mipv6-refactoring.csv | 6 +++--- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/inet/networklayer/ipv6/Mipv6InterfaceData.h b/src/inet/networklayer/ipv6/Mipv6InterfaceData.h index f21e1f4ccc8..05fe5b18885 100644 --- a/src/inet/networklayer/ipv6/Mipv6InterfaceData.h +++ b/src/inet/networklayer/ipv6/Mipv6InterfaceData.h @@ -31,11 +31,20 @@ namespace inet { #define MIPv6_MAX_UPDATE_RATE 3 // times #define MIPv6_PREFIX_ADV_RETRIES 3 // retransmissions #define MIPv6_PREFIX_ADV_TIMEOUT 3 // seconds -#define MIPv6_INITIAL_BINDACK_TIMEOUT_FIRST 1 // seconds #define MIPv6_MAX_RR_BINDING_LIFETIME 420 // seconds #define MIPv6_MAX_HA_BINDING_LIFETIME 3600 // seconds (1 hour) /***************END of RFC 3775 Protocol Constants*****************************/ +/*********RFC 3775: Section 13 Protocol Configuration Variables****************/ +// InitialBindackTimeoutFirstReg is the initial Binding Update retransmission +// timeout of a home registration for which the mobile node holds no binding +// yet. RFC 3775 and RFC 6275 derive its 1.5 second default as 1.5 times +// RetransTimer (RFC 4861) times DupAddrDetectTransmits (RFC 4862), so that the +// timer outlasts the Duplicate Address Detection that the home agent performs +// before it acknowledges such a registration. +#define MIPv6_INITIAL_BINDACK_TIMEOUT_FIRST 1.5 // seconds +/*********END of RFC 3775 Protocol Configuration Variables*********************/ + /** * Mobile IPv6 (RFC 3775) per-interface data: the Mobile Node's home address and * home agent, plus the MIPv6 host protocol constants. Attached to a diff --git a/tests/fingerprint/examples.csv b/tests/fingerprint/examples.csv index 283915ab865..ba33bccdca1 100644 --- a/tests/fingerprint/examples.csv +++ b/tests/fingerprint/examples.csv @@ -380,9 +380,9 @@ /examples/manetrouting/multiradio/, -f omnetpp.ini -c MultiRadio -r 0, 20s, ec17-5cc2/tplx;55f5-0894/~tNl, PASS, wireless adhoc Ipv4 /examples/manetrouting/multiradio/, -f omnetpp.ini -c SingleRadio -r 0, 20s, 85a0-51b8/tplx;c07a-44e1/~tNl;3aa0-49ed/tyf, PASS, wireless adhoc Ipv4 -/examples/ipv6/mipv6/, -f omnetpp.ini -c Handover -r 0, 70s, 19b8-20a4/tplx;b378-071d/~tNl;d358-e3bb/~tND;44ef-1a45/tyf, PASS, wireless EthernetMac -/examples/ipv6/mipv6/, -f omnetpp.ini -c RouteOptimizationTwoCNs -r 0, 60s, 3f0c-078d/tplx;04e1-1f03/~tNl;4199-2b15/~tND;ed3e-17fa/tyf, PASS, wireless EthernetMac -/examples/ipv6/mipv6roaming/, -f omnetpp.ini -c Roaming -r 0, 70s, 0798-40c2/tplx;a682-8d0e/~tNl;cdb7-1b34/~tND;afae-2b3c/tyf, PASS, wireless EthernetMac +/examples/ipv6/mipv6/, -f omnetpp.ini -c Handover -r 0, 70s, 1b65-9399/tplx;7c59-82c1/~tNl;8fe2-6dff/~tND;294d-c189/tyf, PASS, wireless EthernetMac +/examples/ipv6/mipv6/, -f omnetpp.ini -c RouteOptimizationTwoCNs -r 0, 60s, a792-7cff/tplx;d858-66a6/~tNl;4f74-d139/~tND;6826-7aa6/tyf, PASS, wireless EthernetMac +/examples/ipv6/mipv6roaming/, -f omnetpp.ini -c Roaming -r 0, 70s, 96e7-53b1/tplx;94b5-af90/~tNl;d72a-de62/~tND;89c6-1d0f/tyf, PASS, wireless EthernetMac /examples/ipv6/pmipv6/, -f omnetpp.ini -c General -r 0, 60s, f614-da0d/tplx;8b55-7191/~tNl;b490-dc09/~tND;0277-d784/tyf, PASS, wireless EthernetMac /examples/mobility/, -f omnetpp.ini -c AnsimMobility -r 0, 10000s, 72f8-5c0b/tplx;0000-0000/~tNl;0000-0000/~tND;7dd1-18eb/tyf, PASS, diff --git a/tests/fingerprint/mipv6-refactoring.csv b/tests/fingerprint/mipv6-refactoring.csv index e7a648648c0..ac251bb4192 100644 --- a/tests/fingerprint/mipv6-refactoring.csv +++ b/tests/fingerprint/mipv6-refactoring.csv @@ -8,9 +8,9 @@ # empty-shim step, which kept these fingerprints bit-for-bit identical. # MIPv6 example — the primary test -/examples/ipv6/mipv6/, -f omnetpp.ini -c Handover -r 0, 70s, aa29-a8c5/~tNlb, PASS, wireless EthernetMac -/examples/ipv6/mipv6/, -f omnetpp.ini -c RouteOptimizationTwoCNs -r 0, 60s, 068b-23aa/~tNlb, PASS, wireless EthernetMac -/examples/ipv6/mipv6roaming/, -f omnetpp.ini -c Roaming -r 0, 70s, c8dc-27c2/~tNlb, PASS, wireless EthernetMac +/examples/ipv6/mipv6/, -f omnetpp.ini -c Handover -r 0, 70s, bc88-95b3/~tNlb, PASS, wireless EthernetMac +/examples/ipv6/mipv6/, -f omnetpp.ini -c RouteOptimizationTwoCNs -r 0, 60s, abae-e24b/~tNlb, PASS, wireless EthernetMac +/examples/ipv6/mipv6roaming/, -f omnetpp.ini -c Roaming -r 0, 70s, 1d35-5070/~tNlb, PASS, wireless EthernetMac # IPv6 examples # MLD example — new PASS row; ~tNl locks the MLD Report/Query/Done/MAS-Query packet exchange (traffic+lengths);