Two-Way Active Measurement Protocol (TWAMP) Reflect Octets and Symmetrical Size Features
updates
- rfc-5357 — A Two-Way Active Measurement Protocol (TWAMP)
Extracted elements (24)
The Reflect Octets feature motivations include permitting the controller host to tag packets with an index for simplified identification, and enabling the Server to communicate its own short identifiers back through the test stream without requiring a separate out-of-band mechanism.
The Server octets field in Accept Session (rather than a longer SID echo) was chosen because the full SID is 16 octets and does not normally appear in TWAMP-Test packets; a compact 2-octet field allows the Server to signal a short identifier for round-trip embedding without bloating test packets.
The Symmetrical Size feature was added because TWAMP recommends padding truncation to achieve equal packet sizes but does not guarantee the Session-Reflector will perform truncation, and truncation is impossible when there is insufficient padding. A new Session-Sender format that explicitly embeds the size difference as MBZ octets removes this uncertainty.
Measurement systems are not required to implement the Reflect Octets or Symmetrical Size features to claim compliance with core TWAMP [RFC5357]. The features are OPTIONAL extensions that retain backward compatibility.
Bits marked MBZ (Must Be Zero) MUST be set to zero by senders and MUST be ignored by receivers. The HMAC MUST be calculated as defined in Section 3.2 of RFC 4656.
If the Control-Client intends to operate all test sessions using one or both new modes, it MUST set the Mode field bit corresponding to each function in the Setup Response message. The Control-Client MAY set multiple Mode field bits.
In Reflect Octets mode, the designated octets in the Session-Sender's Packet Padding (to be reflected) field MUST be included in the Session-Reflector's test packet, and the reflected field MUST conform to the length specified in the Request-TW-Session message.
In Symmetrical Size mode, the Session-Reflector MUST construct its test packet using information from the Session-Sender's test packet, and the length of the Session-Reflector's test packet SHALL equal the length of the Session-Sender's test packet.
In Unauthenticated mode with both Reflect Octets and truncation, Padding Length SHALL be >= 27 + Length of padding to reflect octets. In Authenticated/Encrypted modes, Padding Length SHALL be >= 56 + Length of padding to reflect octets.
The Padding Length SHOULD be >= 27 octets in Unauthenticated mode and >= 56 octets in Authenticated/Encrypted modes to allow for TWAMP-recommended truncation. The Padding Length SHALL be greater than the Length of padding to reflect field when using Reflect Octets mode.
When a Server does not require octets returned in TWAMP-Test packets, it MUST send all zeros in the Server octets field. When it does require octets returned, it MUST send a non-zero value, and the Session-Sender MUST include those octets at the beginning of the Packet Padding (to be reflected) field.
When combining Reflect Octets mode with truncation, the Session-Sender MUST append at least 27 octets of padding plus the Length of padding to reflect in Unauthenticated mode, and at least 56 octets plus the Length of padding to reflect in Authenticated/Encrypted modes.
When the Server and Control-Client have agreed to use Reflect Octets mode or Symmetrical Size mode during control connection setup, the Control-Client, Server, Session-Sender, and Session-Reflector MUST all conform to the requirements of that mode.
When truncation calculations reveal insufficient padding octets to produce equal-length Session-Sender and Session-Reflector test packets, the Accept field MUST be set to 3 to indicate the request cannot be supported.
When using the truncation process with Reflect Octets mode, the Session-Reflector MUST truncate the highest-numbered padding octets so the test packet equals the Session-Sender's packet length, truncating exactly 27 octets in Unauthenticated mode and exactly 56 octets in Authenticated/Encrypted modes.
The Reflect Octets feature allows the Server/Session-Reflector to return designated padding octets back to the Control-Client/Session-Sender in both TWAMP-Control and TWAMP-Test protocols, enabling the sender to embed index or identification octets with assurance they will be echoed.
The Symmetrical Size feature ensures TWAMP-Test packets are the same size in both directions by defining a new Session-Sender packet format that includes 27 MBZ octets (56 in Authenticated/Encrypted mode) to compensate for the Session-Reflector's larger header, making equal-size packets guaranteed rather than dependent on optional truncation.
The TWAMP-Modes registry (created by RFC 5618) is augmented with two new values: value 32 (bit position 5) for 'Reflect Octets Capability' and value 64 (bit position 6) for 'Symmetrical Size Sender Test Packet Format', both defined in this memo.
The Reflect Octets and Symmetrical Size extended modes do not appear to permit any new attacks on hosts communicating with core TWAMP [RFC5357]. The security considerations of RFC 4656 and RFC 5357 for active measurement of live networks apply.
The Accept Session packet for Reflect Octets adds two 2-octet fields: 'Reflected octets' (echoing the Request-TW-Session 'Octets to be reflected' field) and 'Server octets' (containing octets the Server intends to have returned in TWAMP-Test Packet Padding, or zero if none required).
The Reflect Octets Session-Sender test packet (Unauthenticated mode) re-designates the Packet Padding field into two parts: 'Packet Padding (to be reflected)' whose length is specified in the Request-TW-Session command, followed by 'Additional Packet Padding' whose length equals Padding Length minus Length of padding to reflect.
The Request-TW-Session packet for Reflect Octets mode adds two new fields after the Type-P Descriptor: 'Octets to be reflected' (2 octets) containing octets the Server MUST echo in the Accept Session, and 'Length of padding to reflect' (2 octets, unsigned binary) specifying how many padding octets the Session-Reflector SHALL return in its test packet.
The Symmetrical Size Session-Sender packet (Unauthenticated mode) inserts 27 MBZ octets between the Error Estimate field and the Packet Padding, replacing the area where the Session-Reflector's larger header fields reside, so that both directions carry equal-length packets without truncation.
When both Symmetrical Size and Reflect Octets modes are active, the Session-Sender packet places 27 MBZ octets (56 in Authenticated/Encrypted mode) before the 'Packet Padding (to be reflected)' field, which is itself followed by 'Additional Packet Padding'.