3 releases (breaking)

0.2.0 Jul 14, 2024
0.1.0 Jun 26, 2024
0.0.1 Jun 16, 2024

#1171 in Network programming

21 downloads per month
Used in 2 crates

MIT/Apache

280KB
5.5K SLoC

Build status codecov Dependencies crates.io docs.rs

stun-proto

Repository containing a sans-IO implementation of the STUN (RFC5389/RFC8489) protocol written in the Rust programming language.

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
  • 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)

Dependencies

~1.5–2.2MB
~44K SLoC