LiteNetLib: five delivery modes, and a NuGet DLL the Unity notes tell you not to use
Lite reliable UDP library for Mono and .NET
At a glance
- What is it?
- LiteNetLib is a reliable UDP library for .NET with five named delivery modes, hole punching, loss simulation and automatic fragmentation. Its Unity section instructs you not to use the prebuilt package the rest of the page tells you to download, and its documentation has two update scripts.
- Who is it for?
- LiteNetLib suits a game or tool on .NET that needs peer to peer connections with reliability options rather than a full engine stack, and that can choose its delivery semantics per message. Four things to check before you depend on it.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 1 day ago.
- What is it written in?
- Mainly C#, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 25, 2026, and from our analysis. They are not legal advice.
Star history
- RevenantX/LiteNetLib3,646 ★ · +22
| Repository | 2026-09-24 | 2026-11-25 |
|---|---|---|
| RevenantX/LiteNetLib | 3.6k | 3.6k |
22 Stars in the last 62 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
Five delivery modes, and two of them have contradictory labels
The feature list's centrepiece is that there is not one kind of reliable packet but five, named on the page. There is reliable with ordering. There is reliable without ordering. There is a sequenced mode described as reliable but only for the last packet. There is an ordered mode that is explicitly unreliable yet claims duplication prevention. And there is plain UDP with neither ordering nor reliability. Two of those labels deserve a second look from anyone designing a protocol on top. A mode that is ordered and unreliable with duplication prevention has to define what happens when a packet arrives twice, since receiving a duplicate is exactly what unreliable transport permits. And a sequenced mode described as reliable only for the last packet is not reliable in the sense the other two use. The point of listing them separately is that the choice is per message rather than per connection, so a protocol can mix them.
The overhead claim is specific: one byte, or four
Most libraries describe themselves as lightweight and leave it there. This one puts a number on it: one byte of overhead for unreliable packets and four bytes for reliable ones. That figure is the whole marketing claim, and it is checkable, because it is visible in a packet capture. It also tells you something about the design. Four bytes is enough for a sequence number and an acknowledgement-related field, so the reliable path is not adding a checksum by default and is not adding a timestamp. Checksums are listed as optional and specifically CRC32C, which is the hardware-accelerated variant, so the cost of integrity is something you opt into rather than something you inherit. Alongside that there is automatic merging of small packets, automatic fragmentation of reliable ones, and automatic detection of the maximum transmission unit, so the three ways a reliable protocol usually gets expensive are each handled by default rather than by configuration.
The Unity notes tell you not to use the package the build section offers
This is the sharpest internal contradiction on the page. The build section presents three ways to get the library: a package from NuGet, tagged release builds, and a compiled build straight from the tip with an explicit warning in parentheses that the tip can be unstable. Then a section headed with three exclamation marks says that for Unity you should always use the library sources or the package from the Unity package registry instead of precompiled dynamic libraries, and gives the reason in parentheses: there are platform specific conditional compilation directives and workarounds for engine bugs. So for the engine the library advertises most prominently, the primary distribution channel is the wrong one, and the two supported substitutes are the source and a different registry. The version floor is stated too: Unity 2021.2 is the minimum, and older engine versions are directed to the one point series branch.
Loss and latency simulation is a feature, not a diagnostic
Buried in the middle of the feature list is packet loss and latency simulation. That is an unusual thing to ship in a transport library, and it is useful for exactly one reason: a reliable UDP protocol that has never seen a dropped packet has never been tested. Being able to inject loss lets you exercise retransmission, ordering, duplication handling and the five delivery modes against a network that misbehaves, without unplugging anything. It also means you cannot assume a clean link unless you check that the simulation is off, and the feature list gives you no switch name, so the documentation is where you would look. Two adjacent entries point the same way. Connection statistics are provided, and there is a built in path for requesting network time from a peer, which is what you need to measure latency rather than infer it.
The platform list includes a headset system that no longer ships
The supported platforms list is worth reading as a document rather than as a claim. Desktop systems are covered across four different .NET shapes, from the full framework through Mono and Core to the standard, which is the widest combination you will see on any one library. Then there is a headset operating system, listed by both its marketing name and its vendor. That platform's hardware company wound down years ago, so its presence in the list dates the page rather than describing a target you can ship to. Two game engines are named, one of them with an explicit version floor across desktop, two mobile targets and a console. And one line is not a platform at all but a runtime optimisation: support for a specific .NET major version's socket calls, described as reducing garbage collection pressure. So the matrix mixes operating systems, engines, runtime versions and a discontinued device in a single flat list.
The client sample polls on a fifteen millisecond timer
The usage samples are short and idiomatic enough to copy, and one detail in them is worth noticing. The client wires an event handler onto the listener for received messages, which receives the sender, a data reader, a channel number and a delivery method, reads a string with an explicit maximum length, and then recycles the reader. The recycling is the important part: readers come from a pool, so failing to recycle one costs you an allocation on every message. The loop underneath, though, is a busy wait on a console key check with a fifteen millisecond sleep between polls:
while (!Console.KeyAvailable)
{
client.PollEvents();
Thread.Sleep(15);
}So the sample reacts at most about sixty times a second no matter how fast the network is, which is fine for a sample and a real ceiling for a fast action game. A different listener type exists for polling designs, since the sample's one is named as the event based variant. The server sample follows the same shape: it checks the connected peer count against a cap before accepting a request with a text key, and rejects otherwise, so the sample shows both sides of the handshake rather than only the happy path.
Documentation is generated, and the update step has two scripts
The repository carries a documentation project configuration, a documentation directory, and two update scripts, one for Windows and one for a shell. That is a conventional layout for a .NET library whose API surface is documented from source, and it means the published documentation and the code cannot drift. The samples in the page are the other half of the documentation, and they follow the library's own conventions closely: the connection key is a text string or a writer object, the server sample checks a connection count against a cap before accepting and rejects otherwise, and the writer is a separate object you fill and hand over. Those two samples cover a client and a server with a shared listener type, so the shape of a typical program is visible in about twenty lines.
A trimming test project sits beside the library, and the tip ships a DLL build
Two structural details round out the picture. First, the solution contains a small project whose name ends in a trimming dummy, which is how a .NET library checks that it still works after the compiler removes code the linker thinks is unused, and it matters here because the library calls into socket APIs that static analysis does not always recognise as reachable. Second, the build section offers a compiled build of the master branch hosted by the continuous integration service, with a warning that it can be unstable, alongside the package registry and the tagged releases. That is a genuinely useful escape hatch when you want the tip without waiting for a release, and it is also a channel with no version guarantee, so the warning is doing real work.
Editorial conclusion
LiteNetLib suits a game or tool on .NET that needs peer to peer connections with reliability options rather than a full engine stack, and that can choose its delivery semantics per message. Four things to check before you depend on it. If your target is Unity, do not install the NuGet package the build section offers; the project tells you to use sources or the Unity package registry instead, because the compiled build carries conditional compilation and engine-specific workarounds. If you need packet loss behaviour in production, note the built-in loss and latency simulation is a feature, not a diagnostic you can assume is off. The platform list includes a headset operating system that no longer exists and a .NET 8 specific fast path, so treat the matrix as descriptive rather than tested. And the newest release is from May 2026 while the branch has moved since, with an explicitly unstable build channel offered straight from the tip.
Frequently asked questions
What are the delivery modes in LiteNetLib?
Five, chosen per message rather than per connection: reliable with ordering, reliable without ordering, a sequenced mode that is reliable only for the last packet, an ordered but unreliable mode with duplication prevention, and plain UDP with neither ordering nor reliability. On top of that the library merges small packets automatically, fragments reliable ones automatically, detects the maximum transmission unit automatically, and adds one byte of overhead for unreliable packets or four for reliable ones.
Which .NET versions does LiteNetLib support?
The library targets .NET Standard 2.1 and runs on the full .NET framework, Mono and .NET Core. One feature line is specific to a single .NET major version, describing optimised socket calls said to reduce garbage collection pressure. Named engines are supported too, with an explicit floor of Unity 2021.2 across desktop, Android, iOS and Switch, plus MonoGame and Godot, and the platform list also names a headset operating system from a vendor that has wound down.
How do I install LiteNetLib in Unity?
Not from the package registry build. The project says to always use the library sources or the package from the Unity package registry instead of precompiled dynamic libraries, because there are platform specific conditional compilation directives and workarounds for engine bugs in the compiled build. The minimum supported engine version is 2021.2; for anything older you are directed to the one point series branch.
Does LiteNetLib simulate packet loss?
Yes. Packet loss and latency simulation is listed among the features, alongside connection statistics and network time requests so you can measure latency rather than infer it. Being able to inject loss is how you exercise retransmission, ordering and the different delivery modes against a misbehaving link, and the feature list gives no switch name for turning it off, so check the documentation before assuming a clean network.
How do I get a build newer than the last release?
The build section lists three routes: the package registry, the tagged release builds, and a compiled build of the master branch produced by the continuous integration service, which carries an explicit warning that the tip can be unstable. The repository's own branch naming also matters: the default branch is the current development line, and a separate one point branch holds the older library and its examples for engine versions below the current floor.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/revenantx-litenetlib)Star history chart for your README
[](https://hysenlabs.com/projects/revenantx-litenetlib)Was this useful?