[bbr] remove domain prefix support from stack and harness (#13203)

This commit removes all Domain Prefix configuration and management logic
from the OpenThread stack, CLI commands, unit tests, and GRL harness
THCI wrapper.

- Removed public Backbone Router Domain Prefix APIs.
- Removed Domain Prefix flag ('mDp') and 'D' flag parser/formatter
  from core network data types, Spinel, and CLI.
- Cleaned up local Backbone Router and Leader logic to exclude Domain
  Prefix configuration, tracking, and events.
- Updated RoutingManager prefix advertisement (RIO) to exclude
  special handling for Domain Prefix.
- Updated CLI documentation to remove Domain Prefix references.
- Removed domain prefix helper methods from python test certification
  scripts.
- Removed auto-addition of default domain prefix and D flag support
  from GRL harness OpenThread.py.
This commit is contained in:
Jonathan Hui
2026-06-04 19:36:33 -07:00
committed by GitHub
parent c4a85578f5
commit 318b4b0771
40 changed files with 32 additions and 680 deletions
@@ -100,7 +100,7 @@ class Firewall(thread_cert.TestCase):
self.assertEqual('router', router1.get_state())
self.assertEqual('router', router2.get_state())
br1.set_domain_prefix(config.DOMAIN_PREFIX, 'prosD')
br1.add_prefix(config.DOMAIN_PREFIX, 'pros')
br1.register_netdata()
router1.add_ipmaddr(MA1)
+1 -1
View File
@@ -557,7 +557,7 @@ def check_compressed_address_registration_tlv(command_msg, cid, iid, cid_present
Args:
command_msg (MleMessage) : The Mle message to check.
cid (int): The context id of the domain prefix.
cid (int): The context id of the prefix.
iid (string): The Interface Identifier.
cid_present_once(boolean): True if cid entry should appear only once in AR Tlv.
False otherwise.
-5
View File
@@ -60,8 +60,6 @@ LINK_LOCAL_ALL_ROUTERS_ADDRESS = 'ff02::2'
TMF_PORT = 61631
DOMAIN_PREFIX = 'fd00:7d03:7d03:7d03::/64'
DOMAIN_PREFIX_REGEX_PATTERN = '^fd00:7d03:7d03:7d03:'
DOMAIN_PREFIX_ALTER = 'fd00:7d04:7d04:7d04::/64'
PORT_OFFSET = int(os.getenv('PORT_OFFSET', '0'))
BACKBONE_IPV6_ADDR_START = f'{0x9100 + PORT_OFFSET:04x}'
@@ -77,9 +75,6 @@ OTBR_DOCKER_NAME_PREFIX = f'otbr_{PORT_OFFSET}_'
ALL_NETWORK_BBRS_ADDRESS = 'ff32:40:fd00:db8:0:0:0:3'
ALL_DOMAIN_BBRS_ADDRESS = 'ff32:40:fd00:7d03:7d03:7d03:0:3'
ALL_DOMAIN_BBRS_ADDRESS_ALTER = 'ff32:40:fd00:7d04:7d04:7d04:0:3'
ONLINK_GUA_PREFIX = '2021::/64'
# Any address starts with 'fd' are considered on-link address.
-8
View File
@@ -1608,14 +1608,6 @@ class NodeImpl:
self.send_command(cmd)
self._expect_done()
def set_domain_prefix(self, prefix, flags='prosD'):
self.add_prefix(prefix, flags)
self.register_netdata()
def remove_domain_prefix(self, prefix):
self.remove_prefix(prefix)
self.register_netdata()
def multicast_listener_list(self) -> Dict[IPv6Address, int]:
cmd = 'bbr mgmt mlr listener'
self.send_command(cmd)
-1
View File
@@ -448,7 +448,6 @@ class TestCase(NcpSupportMixin, unittest.TestCase):
'interface': config.BACKBONE_DOCKER_NETWORK_NAME,
'prefix': config.BACKBONE_PREFIX,
},
'domain_prefix': config.DOMAIN_PREFIX,
'env': {
'PORT_OFFSET': config.PORT_OFFSET,
},
-161
View File
@@ -2754,164 +2754,6 @@ void TestLocalOnLinkPrefixDeprecation(void)
FinalizeTest();
}
#if OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE
void TestDomainPrefixAsOmr(void)
{
Ip6::Prefix localOnLink;
Ip6::Prefix localOmr;
Ip6::Prefix domainPrefix = PrefixFromString("2000:0000:1111:4444::", 64);
NetworkData::OnMeshPrefixConfig prefixConfig;
uint16_t heapAllocations;
Log("--------------------------------------------------------------------------------------------");
Log("TestDomainPrefixAsOmr");
InitTest();
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Start Routing Manager. Check emitted RS and RA messages.
sRsEmitted = false;
sRaValidated = false;
sExpectedPio = kPioAdvertisingLocalOnLink;
sExpectedRios.Clear();
heapAllocations = sHeapAllocatedPtrs.GetLength();
SuccessOrQuit(sInstance->Get<BorderRouter::RoutingManager>().SetEnabled(true));
SuccessOrQuit(sInstance->Get<BorderRouter::RoutingManager>().GetOnLinkPrefix(localOnLink));
SuccessOrQuit(sInstance->Get<BorderRouter::RoutingManager>().GetOmrPrefix(localOmr));
Log("Local on-link prefix is %s", localOnLink.ToString().AsCString());
Log("Local OMR prefix is %s", localOmr.ToString().AsCString());
sExpectedRios.Add(localOmr);
AdvanceTime(30000);
VerifyOrQuit(sRsEmitted);
VerifyOrQuit(sRaValidated);
VerifyOrQuit(sExpectedRios.SawAll());
Log("Received RA was validated");
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Check Network Data to include the local OMR and on-link prefix.
VerifyOmrPrefixInNetData(localOmr, /* aDefaultRoute */ false);
VerifyExternalRouteInNetData(kUlaRoute, kWithAdvPioFlagSet);
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Add a domain prefix directly into net data. The new prefix should
// be favored over the local OMR prefix.
otBackboneRouterSetEnabled(sInstance, true);
prefixConfig.Clear();
prefixConfig.mPrefix = domainPrefix;
prefixConfig.mStable = true;
prefixConfig.mSlaac = true;
prefixConfig.mPreferred = true;
prefixConfig.mOnMesh = true;
prefixConfig.mDefaultRoute = false;
prefixConfig.mDp = true;
prefixConfig.mPreference = NetworkData::kRoutePreferenceMedium;
SuccessOrQuit(otBorderRouterAddOnMeshPrefix(sInstance, &prefixConfig));
SuccessOrQuit(otBorderRouterRegister(sInstance));
AdvanceTime(100);
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Make sure BR emits RA without domain prefix or previous local OMR.
sRaValidated = false;
sExpectedPio = kPioAdvertisingLocalOnLink;
sExpectedRios.Clear();
sExpectedRios.Add(domainPrefix);
sExpectedRios.Add(localOmr);
AdvanceTime(20000);
VerifyOrQuit(sRaValidated);
// We should see RIO removing the local OMR prefix with lifetime zero
// and should not see the domain prefix as RIO.
VerifyOrQuit(sExpectedRios[0].mPrefix == domainPrefix);
VerifyOrQuit(!sExpectedRios[0].mSawInRa);
VerifyOrQuit(sExpectedRios[1].mPrefix == localOmr);
VerifyOrQuit(sExpectedRios[1].mSawInRa);
VerifyOrQuit(sExpectedRios[1].mLifetime <= kRioDeprecatingLifetime);
VerifyOrQuit(sExpectedRios[1].mPreference == NetworkData::kRoutePreferenceLow);
// Wait long enough for deprecating RIO prefix to expire
AdvanceTime(3200000);
sRaValidated = false;
sExpectedPio = kPioAdvertisingLocalOnLink;
sExpectedRios.Clear();
sExpectedRios.Add(domainPrefix);
sExpectedRios.Add(localOmr);
// Wait for next RA (650 seconds).
AdvanceTime(650000);
VerifyOrQuit(sRaValidated);
// We should not see either domain prefix or local OMR
// as RIO.
VerifyOrQuit(!sExpectedRios[0].mSawInRa);
VerifyOrQuit(!sExpectedRios[1].mSawInRa);
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Check Network Data. We should now see that the local OMR prefix
// is removed.
VerifyOmrPrefixInNetData(domainPrefix, /* aDefaultRoute */ false);
VerifyExternalRouteInNetData(kUlaRoute, kWithAdvPioFlagSet);
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Remove the domain prefix from net data.
SuccessOrQuit(otBorderRouterRemoveOnMeshPrefix(sInstance, &domainPrefix));
SuccessOrQuit(otBorderRouterRegister(sInstance));
AdvanceTime(100);
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Make sure BR emits RA with local OMR prefix again.
sRaValidated = false;
sExpectedRios.Clear();
sExpectedRios.Add(localOmr);
AdvanceTime(20000);
VerifyOrQuit(sRaValidated);
VerifyOrQuit(sExpectedRios.SawAll());
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Check Network Data. We should see that the local OMR prefix is
// added again.
VerifyOmrPrefixInNetData(localOmr, /* aDefaultRoute */ false);
VerifyExternalRouteInNetData(kUlaRoute, kWithAdvPioFlagSet);
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SuccessOrQuit(sInstance->Get<BorderRouter::RoutingManager>().SetEnabled(false));
AdvanceTime(3000);
VerifyOrQuit(heapAllocations == sHeapAllocatedPtrs.GetLength());
Log("End of TestDomainPrefixAsOmr");
FinalizeTest();
}
#endif // OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE
void TestExtPanIdChange(void)
{
static constexpr uint32_t kMaxRaTxInterval = 196; // In seconds
@@ -5594,9 +5436,6 @@ int main(void)
ot::TestAdvNonUlaRoute();
ot::TestFavoredOnLinkPrefix();
ot::TestLocalOnLinkPrefixDeprecation();
#if OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE
ot::TestDomainPrefixAsOmr();
#endif
ot::TestExtPanIdChange();
ot::TestConflictingPrefix();
ot::TestPrefixStaleTime();