[routing-manager] remove vicarious router discovery feature (#7727)

The vicarious router discovery feature depends on the ability to
receive Router Advertisement messages sent in response to Router
Solicitation messages from other hosts. However, this does not work
since Router Advertisement messages are often sent unicast in
response.
This commit is contained in:
Jonathan Hui
2022-05-23 13:26:04 -07:00
committed by GitHub
parent 65c6f39300
commit 56db0d3eff
5 changed files with 5 additions and 65 deletions
@@ -73,9 +73,6 @@ RoutingManager::RoutingManager(Instance &aInstance)
, mDiscoveredPrefixStaleTimer(aInstance, HandleDiscoveredPrefixStaleTimer)
, mRouterAdvertisementCount(0)
, mLastRouterAdvertisementSendTime(TimerMilli::GetNow() - kMinDelayBetweenRtrAdvs)
#if OPENTHREAD_CONFIG_BORDER_ROUTING_VICARIOUS_RS_ENABLE
, mVicariousRouterSolicitTimer(aInstance, HandleVicariousRouterSolicitTimer)
#endif
, mRouterSolicitTimer(aInstance, HandleRouterSolicitTimer)
, mRouterSolicitCount(0)
, mRoutingPolicyTimer(aInstance, HandleRoutingPolicyTimer)
@@ -292,9 +289,6 @@ void RoutingManager::Stop(void)
mRouterAdvertisementCount = 0;
#if OPENTHREAD_CONFIG_BORDER_ROUTING_VICARIOUS_RS_ENABLE
mVicariousRouterSolicitTimer.Stop();
#endif
mRouterSolicitTimer.Stop();
mRouterSolicitCount = 0;
@@ -787,10 +781,6 @@ void RoutingManager::StartRouterSolicitationDelay(void)
OT_ASSERT(mRouterSolicitCount == 0);
#if OPENTHREAD_CONFIG_BORDER_ROUTING_VICARIOUS_RS_ENABLE
mVicariousRouterSolicitTimer.Stop();
#endif
static_assert(kMaxRtrSolicitationDelay > 0, "invalid maximum Router Solicitation delay");
randomDelay = Random::NonCrypto::GetUint32InRange(0, Time::SecToMsec(kMaxRtrSolicitationDelay));
@@ -991,27 +981,6 @@ bool RoutingManager::IsValidOnLinkPrefix(const Ip6::Prefix &aOnLinkPrefix)
return !aOnLinkPrefix.IsLinkLocal() && !aOnLinkPrefix.IsMulticast();
}
#if OPENTHREAD_CONFIG_BORDER_ROUTING_VICARIOUS_RS_ENABLE
void RoutingManager::HandleVicariousRouterSolicitTimer(Timer &aTimer)
{
aTimer.Get<RoutingManager>().HandleVicariousRouterSolicitTimer();
}
void RoutingManager::HandleVicariousRouterSolicitTimer(void)
{
LogInfo("Vicarious router solicitation time out");
for (const ExternalPrefix &prefix : mDiscoveredPrefixes)
{
if (prefix.mTimeLastUpdate <= mTimeVicariousRouterSolicitStart)
{
StartRouterSolicitationDelay();
break;
}
}
}
#endif
void RoutingManager::HandleRouterSolicitTimer(Timer &aTimer)
{
aTimer.Get<RoutingManager>().HandleRouterSolicitTimer();
@@ -1118,14 +1087,6 @@ void RoutingManager::HandleRouterSolicit(const InfraIf::Icmp6Packet &aPacket, co
LogInfo("Received Router Solicitation from %s on %s", aSrcAddress.ToString().AsCString(),
mInfraIf.ToString().AsCString());
#if OPENTHREAD_CONFIG_BORDER_ROUTING_VICARIOUS_RS_ENABLE
if (!mVicariousRouterSolicitTimer.IsRunning())
{
mTimeVicariousRouterSolicitStart = TimerMilli::GetNow();
mVicariousRouterSolicitTimer.Start(Time::SecToMsec(kVicariousSolicitationTime));
}
#endif
// Schedule routing policy evaluation with random jitter to respond with Router Advertisement.
StartRoutingPolicyEvaluationJitter(kRaReplyJitter);
}
@@ -237,13 +237,6 @@ private:
// The value is chosen in range of [`kMaxRtrAdvInterval` upper bound (1800s), `kDefaultOnLinkPrefixLifetime`].
static constexpr uint32_t kRtrAdvStaleTime = 1800;
// The VICARIOUS_SOLICIT_TIME in seconds. The Routing Manager will consider
// the discovered prefixes invalid if they are not refreshed after receiving
// a Router Solicitation message.
// The value is equal to Router Solicitation timeout.
static constexpr uint32_t kVicariousSolicitationTime =
kRtrSolicitationInterval * (kMaxRtrSolicitations - 1) + kMaxRtrSolicitationDelay;
static_assert(kMinRtrAdvInterval <= 3 * kMaxRtrAdvInterval / 4, "invalid RA intervals");
static_assert(kDefaultOmrPrefixLifetime >= kMaxRtrAdvInterval, "invalid default OMR prefix lifetime");
static_assert(kDefaultOnLinkPrefixLifetime >= kMaxRtrAdvInterval, "invalid default on-link prefix lifetime");
@@ -327,10 +320,6 @@ private:
void SendRouterAdvertisement(const OmrPrefixArray &aNewOmrPrefixes, const Ip6::Prefix *aNewOnLinkPrefix);
bool IsRouterSolicitationInProgress(void) const;
#if OPENTHREAD_CONFIG_BORDER_ROUTING_VICARIOUS_RS_ENABLE
static void HandleVicariousRouterSolicitTimer(Timer &aTimer);
void HandleVicariousRouterSolicitTimer(void);
#endif
static void HandleRouterSolicitTimer(Timer &aTimer);
void HandleRouterSolicitTimer(void);
static void HandleDiscoveredPrefixInvalidTimer(Timer &aTimer);
@@ -416,10 +405,6 @@ private:
uint32_t mRouterAdvertisementCount;
TimeMilli mLastRouterAdvertisementSendTime;
#if OPENTHREAD_CONFIG_BORDER_ROUTING_VICARIOUS_RS_ENABLE
TimerMilli mVicariousRouterSolicitTimer;
TimeMilli mTimeVicariousRouterSolicitStart;
#endif
TimerMilli mRouterSolicitTimer;
TimeMilli mTimeRouterSolicitStart;
uint8_t mRouterSolicitCount;
-10
View File
@@ -75,16 +75,6 @@
#define OPENTHREAD_CONFIG_BORDER_ROUTING_MAX_DISCOVERED_PREFIXES 8
#endif
/**
* @def OPENTHREAD_CONFIG_BORDER_ROUTING_VICARIOUS_RS_ENABLE
*
* Define to 1 to enable Border Routing Vicarious Router Solicitation.
*
*/
#ifndef OPENTHREAD_CONFIG_BORDER_ROUTING_VICARIOUS_RS_ENABLE
#define OPENTHREAD_CONFIG_BORDER_ROUTING_VICARIOUS_RS_ENABLE 1
#endif
/**
* @def OPENTHREAD_CONFIG_BORDER_ROUTING_NAT64_ENABLE
*
@@ -623,4 +623,8 @@
#error "OPENTHREAD_CONFIG_PLATFORM_CSL_UNCERT was removed and no longer supported"
#endif
#ifdef OPENTHREAD_CONFIG_BORDER_ROUTING_VICARIOUS_RS_ENABLE
#error "OPENTHREAD_CONFIG_BORDER_ROUTING_VICARIOUS_RS_ENABLE was removed and no longer supported"
#endif
#endif // OPENTHREAD_CORE_CONFIG_CHECK_H_
@@ -34,7 +34,7 @@ import config
import thread_cert
# Test description:
# This test verifies Vicarious Router Solicitation.
# This test verifies on-link prefix configuration.
#
# Topology:
# -------------(eth)----------------------------