Skip to main content

Module agent

Module agent 

Source
Expand description

The ICE agent: a state machine over events (RFC 8445 §6–§8, §11; spec §2, §6–§10).

Sans-IO, and that is a constraint from the working agreement rather than a preference. The agent reads no clock, owns no socket and holds no tokio type. Time arrives as Input::TimerFired and leaves as Output::SetTimer; datagrams arrive as bytes with a source address and leave as bytes with a destination. Everything that makes ICE hard to get right — pacing, retransmission, the order two agents converge in — is therefore reachable from an ordinary unit test with no sleeping and no flakiness, which is the only way the seven rows of §7.3.1.1’s role-conflict table can each be asserted.

What is not here, deliberately:

  • Aggressive nomination. RFC 8445 §4 deprecated it and §8.1.1 explains why it is no longer even useful — “in this specification, data can always be sent on any valid pair, without nomination”. There is no option to enable it, because an option to enable it is an option to re-nominate mid-session, which is the behaviour a=ice-options:ice2 exists to stop. The controlled side still tolerates a peer that nominates more than once, by selecting the highest-priority nominated pair: tolerating a legacy peer is not the same as being one.
  • The lite role. spec §12, with the reason. Interoperating with a lite peer is in scope and is why Input::RemoteDescription carries lite.
  • Trickle ICE, TURN, and the socket. The first two are out of scope for the spec; the third is the driver’s, and the driver is a loop over Agent::handle.

Structs§

Agent
The sans-IO ICE agent.
Config
Everything about the agent a deployment may change.

Enums§

Input
Something that happened.
Output
Something the driver must do, in the order given.
Timer
What the agent may be waiting for.

Constants§

DEFAULT_PAIR_LIMIT
RFC 8445 §6.1.2.5’s default limit on the size of the checklist set.