Skip to main content
Renomination allows the controlling ICE agent to nominate a different candidate pair after the initial nomination, enabling seamless connection migration in response to network changes or quality degradation.

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:
The nomination value must increase with each renomination. The controlled agent rejects nominations with values less than or equal to previously seen values.

Nomination Attribute

Renomination adds a custom STUN attribute to binding requests:
renomination.go
The attribute is automatically included in nomination requests when renomination is enabled:

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

  1. Controlling role: Only controlling agents can renominate
  2. Renomination enabled: Agent must be created with WithRenomination()
  3. Valid pair: Candidate pair must exist in the agent’s checklist
  4. Succeeded state: Pair should be in CandidatePairStateSucceeded state

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:
Verifying nomination attribute in captured packets:

Error Handling

Always verify the agent is controlling before attempting renomination. The IsControlling() method provides the current role.

Best Practices

Use a monotonically increasing counter. The default generator works for most cases:
For advanced scenarios, consider timestamp-based values:
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
Avoid renominating too frequently (thrashing). Implement hysteresis.
Use candidate pair statistics to make informed decisions:
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