MNP(7) Miscellaneous Information Manual MNP(7)

mnpmesh network protocol

mnp is a mesh network built on top of datagram sockets and little abstractions. It is used to exchange messages over a set of peers.

The mnp message has the following structure:

type ttl payload
1 byte 1 byte N-2 bytes

where

is the maximum message size supported which is implementation-defined.
type
is the type of a message. Supported types are listed in Message Types section.
ttl
is the time to live. It is decremented on message receiving. When it is zero, message must not be transferred more.
payload
is the additional information for a message. It is type-defined.

Message type defines the meaning of a message. It can be any of the following:

0
That message stores an information that should be broadcasted to all the sessions with an exception of sender. Payload stores the content which is undefined. If the same content was seen less than CONTENT_TIMEOUT seconds ago or less, it is discarded. Equality may be checked via an implementation-defined hash algorithm. CONTENT_TIMEOUT is an implementation-defined integer not less than 10.
1
Since mnp is based, peers should know whether connection is still active. Payload is implementation-defined.
2
Should be returned in reply to PING. Payload is implementation-defined.
3
Since mnp is a protocol, there should be some way to find peers. NEIGHBOURS is that way. Payload is empty.
4
Returns a neighbour peer. Payload contains implementation-defined details of a peer which must be enough information to connect. Should be returned in reply to NEIGHBOURS.

Sessions are the way how mnp mesh is formed. Session is a very implicit thing. Upon receiving PING or PONG from an unknown client a session is created. If there was no activity in a session within SESSION_TIMEOUT seconds, it is destroyed. is an implementation-defined natural number.

Payload of TRANSFER is undefined. This is done this way because mnp does not care about data being transferred, and content should be defined on a higher level.

recvfrom(2), sendto(2)

Nakidai Perumenei <nakidai@disroot.org>

mnp depends on datagram sockets. If to use something like UDP, it is important to keep in mind that it is unreliable. Also, it uses flooding broadcast mechanism. This means, that mnp wants not too many peers, but enough to not loose messages.

February 11, 2026 OpenBSD 7.7