mirage/mirage-tcpip

TCP/IP networking stack in pure OCaml, using the Mirage platform libraries. Includes IPv4/6, ICMP, and UDP/TCP support.

OCaml

360

4,282 commits

updated Aug 26, 2026

See the code

See what people are saying

SourceMessageScoreDate

MirageOS also bills itself as an OS in a library — is this similar? https://mirage.io/

on FTL: A new operating system for clouds

0

Oct 3, 2026

You might like https://mirage.io/blog/bitcoin-pinata-results As far security: you can get a lock further, if you are willing to prove your code safe and secure. Thanks to LLMs that no longer requires a PhD.

on Anatomy of a Frontier Lab Agent Intrusion: A Timeline of the July 2026 Incident

0

Jul 30, 2026

Depends on the beholder. Unix system programming in OCaml https://ocaml.github.io/ocamlunix/ https://mirage.io/

on How Our Rust-to-Zig Rewrite Is Going

0

Jul 16, 2026

MirageOS – Build Unikernels in OCaml

3

Mar 25, 2026

Yes, you can have docker container images that only contain the actual binary you want to run. But if you are using a VM, you don't even need the Linux kernel: some systems let you compiler your program to run directly on the hypervisor. See eg https://github.com/hermit-os/hermit-rs or…

on The coming industrialisation of exploit generation with LLMs

0

Jan 20, 2026

I wonder how it compares to https://mirage.io/

on Toro: Deploy Applications as Unikernels

0

Dec 30, 2025

> GNU/Linux isn't the only system out there, [...] Yes? I'm especially keen on the project to make just 'Linux' without any Gnu components. Jokes aside, yes, other operating systems exist. > [...] and yes some parts of it are outdated in modern platforms, especially Apple, Google, Microsoft OSes…

on Rust in the kernel is no longer experimental

0

Dec 11, 2025

The MirageOS project [0] is a great collection of functionality pure OCaml libraries that are useful outside of unikernels. I've used the DNS library with an effectful layer for various nameserver experiments [1]. [0] https://mirage.io/ [1] https://ryan.freumh.org/eon.html

on Simplify your code: Functional core, imperative shell

0

Oct 28, 2025

there is also this: https://mirage.io which does something similar.

on SmolBSD – build your own minimal BSD system

0

Oct 15, 2025

MirageOS Powers Docker Desktop [2022]

1

Oct 15, 2025

README

mirage-tcpip - an OCaml TCP/IP networking stack

mirage-tcpip provides a networking stack for the Mirage operating system. It provides implementations for the following module types (which correspond with the similarly-named protocols):

  • IP (via the IPv4 and IPv6 modules)
  • ICMP
  • UDP
  • TCP

Implementations

There are two implementations of the IP, ICMP, UDP, and TCP module types - the socket stack, and the direct stack.

The socket stack

The socket stack uses socket calls to a traditional operating system to provide the functionality described in the module types.

See the src/stack-unix/ directory for the modules used as implementations of the socket stack.

The socket stack is used for testing or other applications which do not expect to run as unikernels.

The direct stack

The direct stack expects to write to a device implementing the NETIF module type defined for MirageOS.

See the src/ directory for the modules used as implementations of the direct stack, which is the expected stack for most MirageOS applications.

The direct stack is the only usable set of implementations for applications which will run as unikernels on a hypervisor target.

Community

License

mirage-tcpip is distributed under the ISC license.

arp
ethernet
icmp
ipv4
mirageos
networking-stack
ocaml
tcp
tcpip
udp
unikernel

mirage/mirage-tcpip

TCP/IP networking stack in pure OCaml, using the Mirage platform libraries. Includes IPv4/6, ICMP, and UDP/TCP support.

OCaml

360

4,282 commits

updated Aug 26, 2026

See the code

See what people are saying

SourceMessageScoreDate

MirageOS also bills itself as an OS in a library — is this similar? https://mirage.io/

on FTL: A new operating system for clouds

0

Oct 3, 2026

You might like https://mirage.io/blog/bitcoin-pinata-results As far security: you can get a lock further, if you are willing to prove your code safe and secure. Thanks to LLMs that no longer requires a PhD.

on Anatomy of a Frontier Lab Agent Intrusion: A Timeline of the July 2026 Incident

0

Jul 30, 2026

Depends on the beholder. Unix system programming in OCaml https://ocaml.github.io/ocamlunix/ https://mirage.io/

on How Our Rust-to-Zig Rewrite Is Going

0

Jul 16, 2026

MirageOS – Build Unikernels in OCaml

3

Mar 25, 2026

Yes, you can have docker container images that only contain the actual binary you want to run. But if you are using a VM, you don't even need the Linux kernel: some systems let you compiler your program to run directly on the hypervisor. See eg https://github.com/hermit-os/hermit-rs or…

on The coming industrialisation of exploit generation with LLMs

0

Jan 20, 2026

I wonder how it compares to https://mirage.io/

on Toro: Deploy Applications as Unikernels

0

Dec 30, 2025

> GNU/Linux isn't the only system out there, [...] Yes? I'm especially keen on the project to make just 'Linux' without any Gnu components. Jokes aside, yes, other operating systems exist. > [...] and yes some parts of it are outdated in modern platforms, especially Apple, Google, Microsoft OSes…

on Rust in the kernel is no longer experimental

0

Dec 11, 2025

The MirageOS project [0] is a great collection of functionality pure OCaml libraries that are useful outside of unikernels. I've used the DNS library with an effectful layer for various nameserver experiments [1]. [0] https://mirage.io/ [1] https://ryan.freumh.org/eon.html

on Simplify your code: Functional core, imperative shell

0

Oct 28, 2025

there is also this: https://mirage.io which does something similar.

on SmolBSD – build your own minimal BSD system

0

Oct 15, 2025

MirageOS Powers Docker Desktop [2022]

1

Oct 15, 2025

README

mirage-tcpip - an OCaml TCP/IP networking stack

mirage-tcpip provides a networking stack for the Mirage operating system. It provides implementations for the following module types (which correspond with the similarly-named protocols):

  • IP (via the IPv4 and IPv6 modules)
  • ICMP
  • UDP
  • TCP

Implementations

There are two implementations of the IP, ICMP, UDP, and TCP module types - the socket stack, and the direct stack.

The socket stack

The socket stack uses socket calls to a traditional operating system to provide the functionality described in the module types.

See the src/stack-unix/ directory for the modules used as implementations of the socket stack.

The socket stack is used for testing or other applications which do not expect to run as unikernels.

The direct stack

The direct stack expects to write to a device implementing the NETIF module type defined for MirageOS.

See the src/ directory for the modules used as implementations of the direct stack, which is the expected stack for most MirageOS applications.

The direct stack is the only usable set of implementations for applications which will run as unikernels on a hypervisor target.

Community

License

mirage-tcpip is distributed under the ISC license.

arp
ethernet
icmp
ipv4
mirageos
networking-stack
ocaml
tcp
tcpip
udp
unikernel

Project health

Overall

4.5/10

Maintained

5/10

Code review

6/10
OpenSSF Scorecard

Significant stargazers

Daniel Bünzli

368 followers · starred Jul 2014

Jürgen Hötzel

141 followers · starred Oct 2024

Matthias Görgens

100 followers · starred Jun 2017

Stephen Day

320 followers · starred Jul 2015