NG_PPTPGRE(4)
π NG_PPTPGRE(4) β the ng_pptpgre girlies' manual π
okay bestie, pull up a chair, because this is the manual page for ng_pptpgre β a kernel interfaces manual, no cap β and it's actually iconic once you get past the acronyms. let's get into it β¨
πΈ SYNOPSIS πΈ
like, include these first, obviously:
#include <sys/types.h>
#include <netgraph/ng_pptpgre.h>
π¦ DESCRIPTION π¦
so the pptpgre node type does Generic Routing Encapsulation (GRE) over IP for the PPTP protocol, exactly as specified by RFC 2637. like, that's the whole vibe. this involves packet encapsulation, sequencing, acknowledgement, and an adaptive timeout sliding window mechanism β yes, all four, she's multitalented π
but β and this is important β this node type does not handle any of the TCP control protocol or call negotiation defined by PPTP. not her job, not her problem, periodt.
the way this works is: the node expects to receive complete IP packets, including the IP header, on the "lower" hook β but it transmits outgoing frames without any IP header. asymmetric queen π
typical use? connect the "upper" hook to one of the link hooks of an ng_ppp(4) node, and the "lower" hook to the inet/raw/gre hook of an ng_ksocket(4) node. that's the classic build, iykyk.
π HOOKS π
she supports these hooks, bestie:
session_hhhhβ Session0xhhhhdata packets to the upper protocol layersupperβ same assession_hhhh, but for a single session with configurablecid(legacy β¨)lowerβ connection to the lower protocol layers
π₯ CONTROL MESSAGES π₯
this node type supports the generic control messages, plus these bad boys:
NGM_PPTPGRE_SET_CONFIG(setconfig) β this command resets and configures the hook for a session. if the correspondingsession_hhhhhook is not connected, theupperhook will be configured instead. it takes astruct ng_pptpgre_confas an argument:
/* Configuration for a session */
struct ng_pptpgre_conf {
u_char enabled; /* enables traffic flow */
u_char enableDelayedAck; /* enables delayed acks */
u_char enableAlwaysAck; /* always include ack with data */
u_char enableWindowing; /* enable windowing algorithm */
uint16_t cid; /* my call id */
uint16_t peerCid; /* peer call id */
uint16_t recvWin; /* peer recv window size */
uint16_t peerPpd; /* peer packet processing delay
(in 1/10 of a second) */
};
ok so field by field, because you know I love a breakdown π
- the
enabledfield enables traffic flow through the node. - the
enableDelayedAckfield enables delayed acknowledgement (maximum 250 milliseconds), which is a genuinely useful optimization and should generally be turned on. - the
enableAlwaysAckfield enables sending acknowledgements with every data packet, which is probably helpful as well. she's thorough like that.
now the spicy one πΆοΈ β enableWindowing enables the PPTP packet windowing mechanism specified by the protocol. disabling this will cause the node to violate the protocol, possibly confusing other PPTP peers β but often results in better performance. the windowing mechanism is a design error in the PPTP protocol; L2TP, the successor to PPTP, removes it entirely. so yeah, sometimes breaking the rules is the move, but know that you're doing it π
the remaining fields are as supplied by the PPTP virtual call setup process. not our business, we just pass them through π«Ά
NGM_PPTPGRE_GET_CONFIG(getconfig) β takes a two byte argument ascidand returns the current configuration as astruct ng_pptpgre_conf.NGM_PPTPGRE_GET_STATS(getstats) β this command returns astruct ng_pptpgre_statscontaining various node statistics. numbers, we love to see them πNGM_PPTPGRE_CLR_STATS(clrstats) β this command resets the node statistics. fresh start energy β¨NGM_PPTPGRE_GETCLR_STATS(getclrstats) β this command atomically gets and resets the node statistics, returning astruct ng_pptpgre_stats. get and clear in one go, efficient icon π
π SHUTDOWN π
this node shuts down upon receipt of a NGM_SHUTDOWN control message, or when both hooks have been disconnected. so if you're like "why is she gone", check your hooks bestie π
π SYSCTL VARIABLES π
a set of sysctl(8) variables controls this node's ability to deal with some amount of packet reorder that sometimes happens in transit. and like, packet reorder results in packet drops (unless the order is restored) because PPP protocol can not deliver reordered data. so these matter, fr fr. here they are with their default value and meaning:
net.graph.pptpgre.reorder_max: 1β defines maximum length of the node's private reorder queue used to keep data waiting for late packets. a zero value disables reordering. the default value allows the node to restore the order for two packets swapped in transit. greater values allow the node to deliver packets being late after more packets in sequence β at the cost of increased kernel memory usage. tradeoffs, always tradeoffs πnet.graph.pptpgre.reorder_timeout: 1β defines time value in milliseconds used to wait for late packets. she will wait, but she will not wait forever β³
π§ SEE ALSO π§
also, the reading list, no skimming π:
- K. Hamzeh, G. Pall, W. Verthein, J. Taarud, W. Little, and G. Zorn, Point-to-Point Tunneling Protocol (PPTP), RFC 2637.
- S. Hanks, T. Li, D. Farinacci, and P. Traina, Generic Routing Encapsulation over IPv4 networks, RFC 1702.
β HISTORY β
the ng_pptpgre node type was implemented in FreeBSD 4.0. vintage, but make it functional π
π«Ά AUTHORS π«Ά
Archie Cobbs <archie@FreeBSD.org> β we stan a legend β¨
π BUGS π
ok so this is a real one: the node should not expect incoming GRE packets to have an IP header. this behavior is inherited from the (converse) behavior of raw IP sockets. an intermediate node that strips IP headers in one direction should be used instead. so like, don't come for her, it's a whole inherited situation π
and that's the whole page bestie, you're officially certified ππ this was the Debian build, dated November 4, 2018 β so go forth, configure your sessions, and remember: windowing is a design error but sometimes faster, reordering has a queue, and both hooks disconnected means she's GONE. mwah π β¨
π¦ where this page comes from
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- Copyright (c) 1996-1999 Whistle Communications, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms