NG_MPPC(4)
π NG_MPPC β the Microsoft MPPC/MPPE compression + encryption netgraph node type, bestie
okay so this is NG_MPPC(4) from the Kernel Interfaces Manual and honestly it's giving "niche but essential" energy β¨ β it's the netgraph node type that does Microsoft's Point-to-Point Compression and Encryption. iykyk.
β¨ SYNOPSIS β¨
#include <sys/types.h>
#include <netgraph/ng_mppc.h>
πΈ DESCRIPTION πΈ
the mppc node type implements the Microsoft Point-to-Point Compression (MPPC) and Microsoft Point-to-Point Encryption (MPPE) sub-protocols of the PPP protocol, fr fr. and like, these protocols are so often used together with the Point-to-Point Tunneling Protocol (PPTP) β they're basically a trio at this point π
.
so the node has two hooks: comp for compression and decomp for decompression. typically one or both of these hooks would be connected to the ng_ppp(4) node type hook of the same name β matching names, cute, iconic π. and each direction of traffic flow is independent of the other, no cap. they don't talk to each other, they just vibe separately β¨.
π¦ HOOKS π¦
this node type supports the following hooks, bestie:
compβ connection to theng_ppp(4)comphook. incoming frames are compressed and/or encrypted, and sent back out the same hook π₯.decompβ connection to theng_ppp(4)decomphook. incoming frames are decompressed and/or decrypted, and sent back out the same hook π₯.
π CONTROL MESSAGES π
this node type supports the generic control messages plus these following ones β get comfy, there's a whole struct coming π«Ά:
NGM_MPPC_CONFIG_COMPβ this command resets and configures the node for a session in the outgoing traffic direction (i.e., for compression and/or encryption). this command takes astruct ng_mppc_configas an argument:
/* Length of MPPE key */
#define MPPE_KEY_LEN 16
/* MPPC/MPPE PPP negotiation bits */
#define MPPC_BIT 0x00000001 /* mppc compression bits */
#define MPPE_40 0x00000020 /* use 40 bit key */
#define MPPE_56 0x00000080 /* use 56 bit key */
#define MPPE_128 0x00000040 /* use 128 bit key */
#define MPPE_BITS 0x000000e0 /* mppe encryption bits */
#define MPPE_STATELESS 0x01000000 /* use stateless mode */
#define MPPC_VALID_BITS 0x010000e1 /* possibly valid bits */
/* Configuration for a session */
struct ng_mppc_config {
u_char enable; /* enable */
uint32_t bits; /* config bits */
u_char startkey[MPPE_KEY_LEN]; /* start key */
};
the enabled field enables traffic flow through the node π¦. the bits field contains the bits as negotiated by the Compression Control Protocol (CCP) in PPP. and the startkey is only necessary if MPPE was negotiated, and it must be equal to the session start key as defined for MPPE β that key is based on the MS-CHAP credentials used at link authentication time π. so don't just make one up, mkkay?
NGM_MPPC_CONFIG_DECOMPβ this command resets and configures the node for a session in the incoming traffic direction (i.e., for decompression and/or decryption). this command takes astruct ng_mppc_configas an argument. same struct, opposite direction, slay π .NGM_MPPC_RESETREQβ this message contains no arguments, and is bi-directional, periodt. if an error is detected during decompression, this message is sent by the node to the originator of theNGM_MPPC_CONFIG_DECOMPmessage that initiated the session π. the receiver should respond by sending a PPP CCP Reset-Request to the peer.
this message may also be received by this node type when a CCP Reset-Request is received by the local PPP entity. the node will respond by flushing its outgoing compression and encryption state so the remote side can resynchronize π. iconic resync behavior ngl.
π SHUTDOWN π
this node shuts down upon receipt of a NGM_SHUTDOWN control message, or when both hooks have been disconnected π. that's it. two ways out. main character exit energy.
β COMPILATION β
the kernel options NETGRAPH_MPPC_COMPRESSION and NETGRAPH_MPPC_ENCRYPTION are supplied to selectively compile in either or both capabilities π οΈ.
ok so real talk: at least one of these must be defined, or else this node type is useless π. like literally useless. zero purpose. so don't forget, bestie.
π SEE ALSO π
netgraph(4),ng_ppp(4),ngctl(8)- G. Pall, Microsoft Point-To-Point Compression (MPPC) Protocol, RFC 2118.
- G. S. Pall and G. Zorn, Microsoft Point-To-Point Encryption (MPPE) Protocol, draft-ietf-pppext-mppe-04.txt.
- K. Hamzeh, G. Pall, W. Verthein, J. Taarud, W. Little, and G. Zorn, Point-to-Point Tunneling Protocol (PPTP), RFC 2637.
π AUTHORS π
Archie Cobbs <archie@FreeBSD.org> β the whole entire legend who wrote this π
π BUGS π
not me having to say this but: in PPP, encryption should be handled by the Encryption Control Protocol (ECP) rather than CCP π. however, Microsoft combined both compression and encryption into their "compression" algorithm, which is confusing. and that's just... the way it is. we live in their world π«Ά. no cap, it's genuinely confusing, not just you.
β¨ that's the whole page babes β¨ β Debian, June 7, 2016, from the Kernel Interfaces Manual, NG_MPPC(4). go forth and tunnel responsibly π
ππ¦
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- Copyright (c) 1996-2000 Whistle Communications, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms