Skip to content

Commit 42a1c72

Browse files
authored
Fix MRP SessionIdleInterval per spec to 500ms (#32124)
* 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 CHIP-Specifications/connectedhomeip-spec#7186 * Update Sleepy -> Session in context of active/idle intervals Reflecting the spec update CHIP-Specifications/connectedhomeip-spec#7186
1 parent d465691 commit 42a1c72

9 files changed

+16
-16
lines changed

src/app/tests/suites/TestDiscovery.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ tests:
203203
- name: "productId"
204204
value: productId
205205

206-
- label: "Optional TXT key for MRP Sleepy Idle Interval (SII)"
206+
- label: "Optional TXT key for MRP Session Idle Interval (SII)"
207207
PICS: MCORE.SC.SII_COMM_DISCOVERY_KEY
208208
cluster: "DiscoveryCommands"
209209
command: "FindCommissionable"
@@ -214,7 +214,7 @@ tests:
214214
minValue: 0
215215
maxValue: 3600000
216216

217-
- label: "Optional TXT key for MRP Sleepy Active Interval (SAI)"
217+
- label: "Optional TXT key for MRP Session Active Interval (SAI)"
218218
PICS: MCORE.SC.SAI_COMM_DISCOVERY_KEY
219219
cluster: "DiscoveryCommands"
220220
command: "FindCommissionable"

src/app/tests/suites/certification/Test_TC_SC_3_3.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ tests:
9999
responderSessionID is of uint16
100100
sigma2ResumeMIC is of Octet String maximum of length 16 bytes
101101
responderSEDParams is from any one of the following:
102-
SLEEPY_IDLE_INTERVAL - Verify that it is of uint32
103-
SLEEPY_ACTIVE_INTERVAL - Verify that it is of uint32
102+
SESSION_IDLE_INTERVAL - Verify that it is of uint32
103+
SESSION_ACTIVE_INTERVAL - Verify that it is of uint32
104104
105105
106106
[1683973658.044236][21637:21637] CHIP:EM: Rxd Ack; Removing MessageCounter:113416101 from Retrans Table on exchange 32995r

src/app/tests/suites/certification/Test_TC_SC_4_10.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ tests:
4242
verification: |
4343
avahi-browse -rt _matter._tcp
4444
On the TH(Chip-tool) Log: Verify the DUT is advertising for:
45-
-SII key is higher than the SLEEPY_IDLE_INTERVAL default value (> 300 milliseconds)
45+
- SII key is higher than the SESSION_IDLE_INTERVAL default value (> 500 milliseconds)
4646
- SII key and SAI key is less than 3600000 (1hour in milliseconds)
4747
4848
+ eth0 IPv6 3A235FF3FA2DAC10-0000000000000055 _matter._tcp local

src/lib/dnssd/Types.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ struct CommonResolutionData
112112

113113
bool IsDeviceTreatedAsSleepy(const ReliableMessageProtocolConfig * defaultMRPConfig) const
114114
{
115-
// If either sleepy interval (Idle - SII, Active - SAI) has a value and that value is greater
115+
// If either session interval (Idle - SII, Active - SAI) has a value and that value is greater
116116
// than the value passed to this function, then the peer device will be treated as if it is
117117
// a Sleepy End Device (SED)
118118
return (mrpRetryIntervalIdle.HasValue() && (mrpRetryIntervalIdle.Value() > defaultMRPConfig->mIdleRetransTimeout)) ||

src/lib/dnssd/tests/TestIncrementalResolve.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ void TestParseOperational(nlTestSuite * inSuite, void * inContext)
294294
{
295295
const char * entries[] = {
296296
"foo=bar", // unused data
297-
"SII=23" // sleepy idle interval
297+
"SII=23" // session idle interval
298298
};
299299

300300
CallOnRecord(inSuite, resolver, TxtResourceRecord(kTestOperationalName.Full(), entries));
@@ -369,7 +369,7 @@ void TestParseCommissionable(nlTestSuite * inSuite, void * inContext)
369369
{
370370
const char * entries[] = {
371371
"some", "foo=bar", "x=y=z", "a=", // unused data
372-
"SII=123" // Sleepy idle interval
372+
"SII=123" // session idle interval
373373
};
374374

375375
CallOnRecord(inSuite, resolver, TxtResourceRecord(kTestHostName.Full(), entries));
@@ -381,7 +381,7 @@ void TestParseCommissionable(nlTestSuite * inSuite, void * inContext)
381381
{
382382
const char * entries[] = {
383383
"foo=bar", // unused data
384-
"SAI=321", // sleepy active interval
384+
"SAI=321", // session active interval
385385
"D=22345", // Long discriminator
386386
"VP=321+654", // VendorProduct
387387
"DN=mytest" // Device name

src/messaging/ReliableMessageProtocolConfig.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ void ClearLocalMRPConfigOverride()
6060

6161
ReliableMessageProtocolConfig GetDefaultMRPConfig()
6262
{
63-
// Default MRP intervals are defined in spec <2.11.3. Parameters and Constants>
64-
static constexpr const System::Clock::Milliseconds32 idleRetransTimeout = 300_ms32;
63+
// Default MRP intervals are defined in spec <4.12.8. Parameters and Constants>
64+
static constexpr const System::Clock::Milliseconds32 idleRetransTimeout = 500_ms32;
6565
static constexpr const System::Clock::Milliseconds32 activeRetransTimeout = 300_ms32;
6666
static constexpr const System::Clock::Milliseconds16 activeThresholdTime = 4000_ms16;
6767
return ReliableMessageProtocolConfig(idleRetransTimeout, activeRetransTimeout, activeThresholdTime);

src/messaging/ReliableMessageProtocolConfig.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ namespace chip {
4545
* timeout when it sends a message to the present node and the present node is
4646
* perceived by the peer as active.
4747
*
48-
* This value is announced to the peer using SAI (Sleepy Active Interval) key
48+
* This value is announced to the peer using SAI (Session Active Interval) key
4949
* in the advertised DNS Service Discovery TXT records. Additionally, it is
5050
* exchanged in the initial phase of the PASE/CASE session establishment.
5151
*
@@ -84,7 +84,7 @@ namespace chip {
8484
#if CHIP_ENABLE_OPENTHREAD && !CHIP_DEVICE_LAYER_TARGET_LINUX
8585
#define CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL (800_ms32)
8686
#else
87-
#define CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL (300_ms32)
87+
#define CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL (500_ms32)
8888
#endif
8989
#endif // CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL && !CHIP_DEVICE_LAYER_TARGET_LINUX
9090

src/messaging/tests/MessagingContext.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class MessagingContext : public PlatformMemoryUser
7878
enum MRPMode
7979
{
8080
kDefault = 1, // This adopts the default MRP values for idle/active as per the spec.
81-
// i.e IDLE = 4s, ACTIVE = 300ms
81+
// i.e IDLE = 500ms, ACTIVE = 300ms
8282

8383
kResponsive = 2, // This adopts values that are better suited for loopback tests that
8484
// don't actually go over a network interface, and are tuned much lower

src/protocols/secure_channel/RendezvousParameters.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ namespace chip {
3232
// The largest supported value for Rendezvous discriminators
3333
const uint16_t kMaxRendezvousDiscriminatorValue = 0xFFF;
3434

35-
// The largest supported value for sleepy idle interval and sleepy active interval
36-
inline constexpr uint32_t kMaxSleepyInterval = 3600000;
35+
// The largest supported value for session idle interval and session active interval
36+
inline constexpr uint32_t kMaxSessionIdleInterval = 3600000;
3737

3838
class RendezvousParameters
3939
{

0 commit comments

Comments
 (0)