Two-Way Active Measurement Protocol
Note: I have worked on this full-time in Rust before, but I was a noob and didn’t build it properly.
Introduction
A more accurate network analysis tool for calculating round-trip delays between two devices. A better alternative to ping
so to speak.
One requirement for it is that it is based on the client-server architecture, so it requires a TWAMP client/server to be present on both devices.
The RFC provides an example implementation (Appendex I) called TWAMP Light which removes the requirement of TWAMP-Control, and is a way for adopting TWAMP quickly.
Communication
TWAMP uses two protocols for it’s operation:
- TWAMP-Control
- TWAMP-Test
TWAMP-Control
Used for starting/stopping sessions and comms other than the actual test. Uses 862/tcp
.
TWAMP-Test
Used for the actual test. Uses 862/udp
.
Model
Example model is also present in the RFC.
flowchart LR
subgraph "Controller"
cc("Control Client")
ss("Session-Sender")
end
subgraph "Responder"
s("Server")
sr("Session-Reflector")
end
cc<--TWAMP-Control-->s
ss<-. TWAMP-Test .->sr
Communication flow
sequenceDiagram
participant cc as Control-Client
participant s as Server
participant ss as Session-Sender
participant sr as Session-Reflector
cc->>s: TCP connection init
s->>cc: Greetings! I support X security/integrity mode(s)
cc->>s: yeah wutever, I choose X
s->>cc: Acceptable
cc->>s: yeah gimme test session with Y details
s->>cc: Acceptable sir
cc->>s: Aight i'ma start yeeting packets
s->>cc: Acknowledged
loop TWAMP-Test
ss-->>sr: YEET!
sr-->>ss: Chomp chomp! YEET!
end
cc->>s: AIGHT ENOUGH!
s->>cc: ok :'(