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.
- Host: GitHub
- URL: https://github.com/ppn-systems/nalix
- Owner: ppn-systems
- License: apache-2.0
- Created: 2024-12-26T03:14:17.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2026-05-20T18:03:58.000Z (26 days ago)
- Last Synced: 2026-05-20T22:36:20.871Z (26 days ago)
- Topics: csharp, dotnet, dotnetcore, framework, logging, lz4, nalix, network, open-source, packet, protocol, sdk, serialization, socket, tcp, udp, websocket
- Language: C#
- Homepage: https://ppn-system.me/
- Size: 48.1 MB
- Stars: 37
- Watchers: 2
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
- Agents: .github/AGENTS.md
Awesome Lists containing this project
README

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 |
| :--- | :--- |
|  | [](https://github.com/ppn-systems/nalix/actions/workflows/ci-linux.yml) |
|  | [](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
- **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!