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

https://github.com/ppn-systems/nalix

High-performance TCP networking framework for .NET, low-latency messaging.
https://github.com/ppn-systems/nalix

csharp dotnet dotnetcore framework logging lz4 nalix network open-source packet protocol sdk serialization socket tcp udp websocket

Last synced: 22 days ago
JSON representation

High-performance TCP networking framework for .NET, low-latency messaging.

Awesome Lists containing this project

README

          


nalix Banner
Claude Code mascot jumping


.NET
License
NuGet
Downloads


Issues
PRs
Repo Size
Commit Activity


Documentation ยท Examples ยท Benchmarks ยท Contributing

---

## ๐Ÿ“– About

**Nalix** is a modular, high-performance networking framework for .NET 10. It provides a complete stack for building real-time server applications โ€” from low-level transport (TCP/UDP) to middleware pipelines, packet routing, and client SDKs โ€” with a focus on zero-allocation hot paths, pluggable protocols, and enterprise-grade security.

---

## ๐Ÿ› ๏ธ Build Status

| Platform | Status |
| :--- | :--- |
| ![Linux](https://badgen.net/badge/icon/Ubuntu%20Linux%2022.04%20x64?icon=terminal&label&color=orange) | [![CI](https://github.com/ppn-systems/nalix/actions/workflows/ci-linux.yml/badge.svg?event=push)](https://github.com/ppn-systems/nalix/actions/workflows/ci-linux.yml) |
| ![Windows](https://badgen.net/badge/icon/Windows,.NET%2010?icon=windows&label&list=1) | [![CI](https://github.com/ppn-systems/nalix/actions/workflows/ci-windows.yml/badge.svg?event=push)](https://github.com/ppn-systems/nalix/actions/workflows/ci-windows.yml) |

---

## โœจ Features

| Category | Highlights |
| :--- | :--- |
| ๐Ÿ–ฅ๏ธ **Cross-Platform** | Runs on Windows, Linux, and macOS with .NET 10+. |
| โšก **High Performance** | Zero-allocation serialization, shard-aware dispatch, and buffer pooling for thousands of concurrent connections. |
| ๐Ÿ” **Security-First** | AEAD encryption (ChaCha20-Poly1305), Static-Ephemeral X25519 (Noise Protocol) with server identity pinning, and zero-RTT session resumption. |
| ๐Ÿ”Œ **Pluggable Protocols** | Swap network, serialization, or security protocols without modifying core logic. |
| ๐Ÿ›ค๏ธ **Middleware Pipeline** | Built-in authentication, rate limiting, traffic shaping, and audit logging โ€” or write your own. |
| ๐Ÿ“ก **Real-Time Updates** | Instant messaging, state synchronization, and live event broadcasting. |
| ๐Ÿ› ๏ธ **Extensible** | Attribute-based packet routing, auto-discovered controllers, and fluent builder APIs. |
| ๐Ÿงฉ **SOLID & DDD** | Clean architecture following SOLID principles and Domain-Driven Design patterns. |
| ๐Ÿ’ป **Modern C#** | Leverages C# 14 features โ€” `Span`, `ref struct`, pattern matching, and more. |

---

## ๐Ÿ”ง Requirements

| Requirement | Version |
| :--- | :--- |
| .NET SDK | [10.0+](https://dotnet.microsoft.com/download/dotnet/10.0) |
| C# Language | 14+ |
| IDE | [Visual Studio 2026](https://visualstudio.microsoft.com/downloads/) / [VS Code](https://code.visualstudio.com/) / [Rider](https://www.jetbrains.com/rider/) |

---

## ๐Ÿ’ป Technologies


Technologies

- **Language**: C# 14 on .NET 10
- **Testing**: xUnit + BenchmarkDotNet
- **CI/CD**: GitHub Actions (Linux & Windows)
- **Packaging**: NuGet

---

## ๐Ÿ“ˆ Benchmarks

> All benchmarks run on **.NET 10.0**, **Windows 11**, using **BenchmarkDotNet v0.15.8**.

### Environment

- CPU: 13th Gen Intel Core i7-13620H (10C/16T)
- Runtime: .NET `10.0.5` (X64 RyuJIT, Server GC)
- SDK: .NET SDK `10.0.201`
- Job config: `IterationCount=20`, `LaunchCount=3`, `WarmupCount=10`, `RunStrategy=Throughput`

### ๐Ÿ”„ Serialization (128 items, DTO payload)

| Serializer | Serialize | Deserialize | Allocated |
| :--- | ---: | ---: | ---: |
| LiteSerializer | 149.9 ns | 142.9 ns | 664โ€“856 B |
| MemoryPack | 121.6 ns | 145.0 ns | 664โ€“888 B |
| MessagePack | 422.5 ns | 1,095.2 ns | 504โ€“888 B |
| System.Text.Json | 897.7 ns | 2,548.2 ns | 1,976โ€“7,200 B |

> **More details:** See the [`docs/benchmarks`](docs/benchmarks/) folder for full data and additional test cases.

---

## ๐Ÿ“ฆ NuGet Packages

Nalix is composed of several modular packages โ€” install only what you need.

### ๐Ÿ—๏ธ Foundation

| Package | Description |
| :--- | :--- |
| **[Nalix.Abstractions](src/Nalix.Abstractions)** | Base abstractions, enums, and shared contracts for the Nalix ecosystem. |
| **[Nalix.Codec](src/Nalix.Codec)** | High-performance framing, cryptography, and serialization. |
| **[Nalix.Environment](src/Nalix.Environment)** | Low-level IO primitives, buffer leasing, and configuration loading. |
| **[Nalix.Framework](src/Nalix.Framework)** | High-performance core: cryptography, identity, DI, serialization, and task orchestration. |
| **[Nalix.Runtime](src/Nalix.Runtime)** | Packet dispatching, middleware pipelines, protection primitives, and throttling. |

### ๐Ÿ“ก Networking & Hosting

| Package | Description |
| :--- | :--- |
| **[Nalix.Network](src/Nalix.Network)** | High-performance TCP/UDP transport, connection management, and session persistence. |
| **[Nalix.Hosting](src/Nalix.Network.Hosting)** | Microsoft-style host and builder APIs for quick bootstrapping. |

### ๐Ÿ› ๏ธ Utilities & Tooling

| Package | Description |
| :--- | :--- |
| **[Nalix.Logging](src/Nalix.Logging)** | Lightweight asynchronous logging for debugging and diagnostics. |
| **[Nalix.SDK](src/Nalix.SDK)** | Client-side SDK: transport sessions, request/response patterns, and encryption. |
| **[Nalix.Analyzers](src/Nalix.Analyzers)** | Roslyn analyzers and code fixes to enforce Nalix best practices. |
| **[Nalix.Analyzers.Generators](src/Nalix.Analyzers.Generators)** | Source generators and analyzers. |

---

## ๐Ÿš€ Quick Start

Build a high-performance network application in minutes:

```csharp
using Nalix.Hosting;
using Nalix.Network.Options;

// Initialize and configure the application host
using var host = NetworkApplication.CreateBuilder()
.BindTcp().OnPort(8080).Bind()
.ScanHandlers() // Auto-discovers all custom PacketController types in the assembly
.Configure(opt => opt.NoDelay = true)
.Build();

// Run the server
await host.RunAsync();
```

> See the [examples](example/) directory for complete implementation details.

---

## ๐Ÿ“ฆ Installation

```bash
# Core server setup
dotnet add package Nalix.Network.Hosting

# Optional: structured logging
dotnet add package Nalix.Logging

# Optional: client SDK
dotnet add package Nalix.SDK

# Optional: Roslyn analyzers
# Optional: Roslyn analyzers generators
dotnet add package Nalix.Abstractions
```

---

## ๐Ÿ› ๏ธ Contributing

Please read [CONTRIBUTING.md](CONTRIBUTING.md) for the development workflow, commit conventions, and pull request guidelines. Follow our [Code of Conduct](CODE_OF_CONDUCT.md) and submit PRs with proper documentation and tests.

## ๐Ÿ›ก๏ธ Security

Please review our [Security Policy](SECURITY.md) for supported versions and vulnerability reporting procedures.

## ๐Ÿ“œ License

Nalix is copyright ยฉ PhcNguyen โ€” provided under the [Apache License, Version 2.0](http://apache.org/licenses/LICENSE-2.0.html).

## ๐Ÿ“ฌ Contact

For questions, suggestions, or support, open an issue on [GitHub](https://github.com/ppn-systems/Nalix/issues) or contact the maintainers at [ppn.system@gmail.com](mailto:ppn.system@gmail.com).

---


Give a โญ๏ธ if this project helped you!
Footer

Nalix divider