Overview
Standard ICE nominates a single candidate pair for data transmission. Once nominated, switching to a different pair requires restarting the ICE process. Renomination extends ICE by allowing the controlling agent to nominate a new pair at any time, supporting scenarios like:- Network handoff (WiFi to cellular)
- Quality-based path switching (higher RTT → lower RTT path)
- Connection recovery after network issues
- Adaptive routing based on real-time metrics
Renomination follows the draft specification draft-thatcher-ice-renomination-01.
Enabling Renomination
Renomination requires a nomination value generator function:Custom Nomination Generator
Provide your own generator for custom nomination strategies:Nomination Attribute
Renomination adds a custom STUN attribute to binding requests:renomination.go
Custom Attribute Type
If the default attribute type conflicts with your setup, configure a custom one:The nomination attribute value is a 24-bit integer (0 to 16,777,215). Values are truncated to 24 bits if larger.
Performing Renomination
Only the controlling agent can trigger renomination:Requirements
- Controlling role: Only controlling agents can renominate
- Renomination enabled: Agent must be created with
WithRenomination() - Valid pair: Candidate pair must exist in the agent’s checklist
- Succeeded state: Pair should be in
CandidatePairStateSucceededstate
Controlled Agent Behavior
The controlled agent automatically handles incoming renominations:selector.go
The controlled agent applies “last nomination wins” logic regardless of whether it has local renomination enabled. This ensures compatibility when the controlling agent uses renomination.
Connection Migration Example
Network Handoff Scenario
Testing Renomination
From the test suite (renomination_test.go):
STUN Message Structure
A renomination request includes:Error Handling
Best Practices
Nomination Value Strategy
Nomination Value Strategy
Use a monotonically increasing counter. The default generator works for most cases:For advanced scenarios, consider timestamp-based values:
When to Renominate
When to Renominate
Renominate based on measurable quality degradation:
- RTT increases beyond threshold
- Packet loss exceeds acceptable rate
- New interface with better metrics becomes available
- Current path becomes unavailable
Monitoring for Renomination
Monitoring for Renomination
Use candidate pair statistics to make informed decisions:
Compatibility
Compatibility
Renomination is backward compatible with standard ICE:
- If remote peer doesn’t support renomination, nominations work as standard ICE
- Controlled agents handle renomination even without local renomination enabled
- The NOMINATION attribute is optional; absence means standard ICE behavior
Limitations
- 24-bit value space: Maximum 16,777,215 renominations per session
- Controlling agent only: Controlled agents cannot initiate renomination
- No rollback: Cannot renominate to a pair with a lower value
- Draft specification: Subject to change in future ICE specifications
Reference
- Nomination Attribute:
renomination.go:22- NominationAttribute type - Renomination Method:
agent.go- RenominateCandidate function - Controlled Selector:
selector.go- shouldAcceptNomination logic - Test Patterns:
renomination_test.go- Comprehensive test examples - Specification: draft-thatcher-ice-renomination-01