Traverse NATs and Interop
ICE is useful for applications that want to establish peer-to-peer UDP data streams. It automates the process of traversing NATs and provides security against some attacks. It also allows applications to create reliable streams using a TCP over UDP layer.
Existing standards that use ICE include Session Initiation Protocol (SIP), XMPP Jingle and WebRTC.
libnice has been tested to interop with other major ICE implementations. In particular, it is widely used to interop with Google’s WebRTC library used to implement the WebRTC specifications in all major browers, Chrome, Firefox & Safari. It also implements some of the Microsoft variants used by Microsoft Office Communicator, Microsoft Lync & Microsoft Skype for Business.
libnice implements a number of current standards:
- RFC 8445: Interactive Connectivity Establishment (ICE) itself
- RFC 5766: TURN relay client
- RFC 5389: Full STUN implementation
- RFC 6544: TCP Candidates with ICE (ICE-TCP)
- Partial support, only passive and active candidates are supported
- Trickle ICE: Incremental Provisioning of Candidates
- Compatible with IPv4 & IPv6
It also implements a number of older version with appropriate compatibility flags:
- RFC 5242: The original ICE RFC
- Also implements Draft 6 as used by older programs.
- RFC 3489: The original STUN RFC
There is also compatibility mode with non-standard implemenations:
- Microsoft’s implementations, both compatible with Windows Live Messenger 2009, Office Communicator 2007, Office Communicator 2007R2, Lync, Skype for Business. - Those are mostly documented in MS-ICE2
- Compatibility with the old variant used by Google Talk
You can get libnice from our GitLab repository.
You can also download release tarballs:
- 0.1.16 (gpg)
- 0.1.15 (gpg)
- 0.1.14 (gpg)
- 0.1.13 (gpg)
- 0.1.12 (gpg)
- 0.1.11 (gpg)
- 0.1.10 (gpg)
- 0.1.9 (gpg)
- 0.1.8 (gpg)
- 0.1.7 (gpg)
- 0.1.6 (gpg)
- 0.1.5 (gpg)
- 0.1.4 (gpg)
- 0.1.3 (gpg)
- 0.1.2 (gpg)
- 0.1.1 (gpg)
- 0.1.0 (gpg)
- 0.0.11 (gpg)
- 0.0.10 (gpg)
- 0.0.9 (gpg)
- 0.0.8 (gpg)
- 0.0.7 (gpg)
- 0.0.6 (gpg)
- 0.0.5 (gpg)
- 0.0.4 (gpg)
- 0.0.3 (gpg)
- 0.0.2 (gpg)
The generated documentation for the latest released version is available online.
libnice has been designed to nice integrate with GStreamer, two GStreamer element are provided
nicesink to help with that.
libnice works with both GStreamer 0.10 and GStreamer 1.x.
Steps to use:
- Create a
- Create a stream with
- Create a
nicesrcGStreamer element for each component
- Set the
- Put the
nicesrcelements inside a
GstPipelineand connect them to the elements that will receive the packets, most likely rtpbin
- Set the
- libnice can now receive packets.
- Use the
nice_agent_gather_candidates()API to gather candidates
- Use the libnice APIs to exchange candidates and credentials, this will cause establish connectivity, be aware that as soon as connectivity is established (component state is CONNECTED), nicesrc may start producing data packets. Don’t forget to monitor the state of each component.
At any time after the libnice Stream has been created, you can create
nicesink elements and add them to your pipeline to send packets, you can do that at the same time as the
nicesrc elements or later.
Contributions are welcome! Please reports bugs using freedesktop.org GitLab.
Patches can also be submitted as merge requests on our GitLab.
Code of Conduct
libnice is hosted by freedesktop.org and as such applies its Code of Conduct. This applies to all of our forums, including GitLab and the mailing list. Please be excellent to each other.