Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nguyenminh-phuc/ministun

High performance RFC#8489 STUN server
https://github.com/nguyenminh-phuc/ministun

c-plus-plus dpdk nat rfc-8489 seastar stun webrtc

Last synced: 4 months ago
JSON representation

High performance RFC#8489 STUN server

Awesome Lists containing this project

README

        

# High performance STUN server

## Introduction

- High-performance Shared-nothing Design - [SeaStar](http://seastar.io/): sharded, cooperative, non-blocking, micro-task scheduled design.
- Networking - [Intel DPDK](https://www.dpdk.org/): user-space TCP/IP stack, provide low-latency, high-throughput. Enjoy zero-copy, zero-lock, and zero-context-switch performance.
- STUN server: implement [RFC 8489](https://datatracker.ietf.org/doc/html/rfc8489), Prometheus metric reporting, long-term and short-term credential mechanisms, fingerprint mechanism, DNS discovery, IP rate limiting.
- STUN client.
- Tests: implement test vectors from [RFC 5769](https://datatracker.ietf.org/doc/html/rfc5769), [RFC 8489](https://datatracker.ietf.org/doc/html/rfc8489#appendix-B) and [RFC Errata 8489](https://www.rfc-editor.org/errata/rfc8489).

TODO: write stuff here

## License

MIT License.

## Building STUN server

- (Optional) Install [DPDK](https://doc.dpdk.org/guides/linux_gsg/build_dpdk.html).
- Install [SeaStar](https://github.com/scylladb/seastar#building-seastar) (set `Seastar_DPDK` flag to enable DPDK support).
- Install OpenSSL package (libssl-dev on Ubuntu-based distros).
- Install [uriparser](https://uriparser.github.io/).
- Configure [HugePages](http://doc.dpdk.org/spp/setup/getting_started.html).
- Tune [aio-max-nr](https://www.kernel.org/doc/Documentation/sysctl/fs.txt) if using linux-aio reactor backend.
- Build ministun project with CMake.

## Getting Started

### Run STUN server

```
./stunserver --log-level --config
```

Log levels: "trace", "debug", "info", "warn" or "error".

To enable userspace network stack, add `--network-stack native --dpdk-pmd --dhcp true`.

### Run STUN client

```
./stunclient --local-ip --server
```

server URI can be

stun://:
stun://:

`stuns` scheme is not supported.

Other options:

```
stunclient options:
-h [ --help ] show help message
--help-seastar show help message about seastar options
--help-loggers print a list of logger names and exit
--log-level arg (=info) either "trace", "debug", "info", "warn" or "error"
--family arg (=4) either "4" or "6" to specify the usage of INET or
INET6
--protocol arg (=udp) either "udp" or "tcp"
--mechanism arg either "ShortTerm" or "LongTerm"
--username arg username
--username arg password
--local-ip arg local IP
--local-port arg local port
--server arg server URI
```

### Run tests:

The project supports CTest.

## Sample config file

```xml


info


false



9180



ModuloRateLimiter

false



30

15

15




StaticLongTermAuthenticator

false



P@ssword!

example.com


true

true


3



user1
123456789






4

udp



3478

```