From faffa657fb9c5d04a10cf16a87063cfd12ed811f Mon Sep 17 00:00:00 2001 From: Abdul Samad Date: Wed, 14 Feb 2024 11:21:10 -0600 Subject: [PATCH] Fix MRP SessionIdleInterval per spec to 500ms Spec has the default SESSION_IDLE_INTERVAL defined as 500ms https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/1.2/src/secure_channel/Message_Reliability_MRP.adoc#8-parameters-and-constants Originally defined as 300ms, this change was introduced as part of spec PR https://github.com/CHIP-Specifications/connectedhomeip-spec/pull/7186 --- src/app/tests/suites/certification/Test_TC_SC_4_10.yaml | 2 +- src/messaging/ReliableMessageProtocolConfig.cpp | 4 ++-- src/messaging/ReliableMessageProtocolConfig.h | 2 +- src/messaging/tests/MessagingContext.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/tests/suites/certification/Test_TC_SC_4_10.yaml b/src/app/tests/suites/certification/Test_TC_SC_4_10.yaml index 298b831b262f41..407f622dcf205b 100644 --- a/src/app/tests/suites/certification/Test_TC_SC_4_10.yaml +++ b/src/app/tests/suites/certification/Test_TC_SC_4_10.yaml @@ -42,7 +42,7 @@ tests: verification: | avahi-browse -rt _matter._tcp On the TH(Chip-tool) Log: Verify the DUT is advertising for: - -SII key is higher than the SLEEPY_IDLE_INTERVAL default value (> 300 milliseconds) + - SII key is higher than the SLEEPY_IDLE_INTERVAL default value (> 500 milliseconds) - SII key and SAI key is less than 3600000 (1hour in milliseconds) + eth0 IPv6 3A235FF3FA2DAC10-0000000000000055 _matter._tcp local diff --git a/src/messaging/ReliableMessageProtocolConfig.cpp b/src/messaging/ReliableMessageProtocolConfig.cpp index 86c95b1ff07346..d1a4deece9c0f8 100644 --- a/src/messaging/ReliableMessageProtocolConfig.cpp +++ b/src/messaging/ReliableMessageProtocolConfig.cpp @@ -60,8 +60,8 @@ void ClearLocalMRPConfigOverride() ReliableMessageProtocolConfig GetDefaultMRPConfig() { - // Default MRP intervals are defined in spec <2.11.3. Parameters and Constants> - static constexpr const System::Clock::Milliseconds32 idleRetransTimeout = 300_ms32; + // Default MRP intervals are defined in spec <4.12.8. Parameters and Constants> + static constexpr const System::Clock::Milliseconds32 idleRetransTimeout = 500_ms32; static constexpr const System::Clock::Milliseconds32 activeRetransTimeout = 300_ms32; static constexpr const System::Clock::Milliseconds16 activeThresholdTime = 4000_ms16; return ReliableMessageProtocolConfig(idleRetransTimeout, activeRetransTimeout, activeThresholdTime); diff --git a/src/messaging/ReliableMessageProtocolConfig.h b/src/messaging/ReliableMessageProtocolConfig.h index a49740ad4d5227..5b0c350c4280f1 100644 --- a/src/messaging/ReliableMessageProtocolConfig.h +++ b/src/messaging/ReliableMessageProtocolConfig.h @@ -84,7 +84,7 @@ namespace chip { #if CHIP_ENABLE_OPENTHREAD && !CHIP_DEVICE_LAYER_TARGET_LINUX #define CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL (800_ms32) #else -#define CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL (300_ms32) +#define CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL (500_ms32) #endif #endif // CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL && !CHIP_DEVICE_LAYER_TARGET_LINUX diff --git a/src/messaging/tests/MessagingContext.h b/src/messaging/tests/MessagingContext.h index a6a6d34fa1c36c..31143a727326be 100644 --- a/src/messaging/tests/MessagingContext.h +++ b/src/messaging/tests/MessagingContext.h @@ -78,7 +78,7 @@ class MessagingContext : public PlatformMemoryUser enum MRPMode { kDefault = 1, // This adopts the default MRP values for idle/active as per the spec. - // i.e IDLE = 4s, ACTIVE = 300ms + // i.e IDLE = 500ms, ACTIVE = 300ms kResponsive = 2, // This adopts values that are better suited for loopback tests that // don't actually go over a network interface, and are tuned much lower