2 releases

0.0.5 Jun 26, 2024
0.0.4 Jun 14, 2024

#869 in Network programming


Used in librice

MIT/Apache

380KB
8K SLoC

Build status codecov Dependencies crates.io docs.rs

librice-proto

Repository containing an (sans-IO) implementation of ICE (RFC8445) protocol written in the Rust programming language.

Warning

This still very much WIP code and everything is still subject to change.

Current status

The current status is that there is enough of the implementation to sucessfully transfer data with an external browser (Chrome and Firefox) in a WebRTC scenario. The STUN implementation is relatively mature at this stage. More work is needed on the ICE layer for efficiency and API experience. TURN support is still currently a work in progress. Supporting more scenarios and is certainly part of the near and long term future roadmap.

Why sans-io?

A couple of reasons: reusability, and testability.

Without being bogged down in the details of how IO happens, the same sans-IO implementation can be used without prescribing the IO pattern that an application must follow. Instead, the application (or parent library) has much more freedom in how bytes are transferred between peers. It's also possible to us a sans-IO library in either a synchronous or within an asynchronous runtime.

sans-IO also allows easy testing of any specific state the sans-IO implementation might find itself in. Combined with a comprehensive test-suite, this provides assurance that the implementation behaves as expected under all circumstances.

For other examples of sans-IO implementations, take a look at:

Relevant standards

  • RFC5245: Interactive Connectivity Establishment (ICE): A Protocol for Network Address Translator (NAT) Traversal for Offer/Answer Protocols
  • RFC5389: Session Traversal Utilities for NAT (STUN)
  • RFC5766: Traversal Using Relays around NAT (TURN): Relay Extensions to Session Traversal Utilities for NAT (STUN)
  • RFC5769: Test Vectors for Session Traversal Utilities for NAT (STUN)
  • RFC6156: Traversal Using Relays around NAT (TURN) Extension for IPv6
  • RFC6544: TCP Candidates with Interactive Connectivity Establishment (ICE)
  • RFC7675: Session Traversal Utilities for NAT (STUN) Usage for Consent Freshness
  • RFC8445: Interactive Connectivity Establishment (ICE): A Protocol for Network Address Translator (NAT) Traversal
  • RFC8489: Session Traversal Utilities for NAT (STUN)
  • RFC8656: Traversal Using Relays around NAT (TURN): Relay Extensions to Session Traversal Utilities for NAT (STUN)
  • RFC8838: Trickle ICE: Incremental Provisioning of Candidates for the Interactive Connectivity Establishment (ICE) Protocol

Structure

librice-proto

The sans-IO implementation of the ICE (RFC8445) protocol. Contains no IO code whatsover.

librice

An async implementation of ICE (RFC8445) built using librice-proto. Currently uses async-std however a tokio (or mio) implementation is planned.

TODO

  • RFC5766
  • RFC6554
  • RFC7675

Dependencies

~3–11MB
~118K SLoC