---
name: "ng_pred1"
section: "4"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/ng_pred1"
---

# ng\_pred1(4)

RFC 1978 Predictor-1 PPP compression netgraph node

## NAME

**ng\_pred1** – RFC 1978 Predictor-1 PPP compression netgraph node

## SYNOPSIS

**#include \<sys/types.h\>**

**#include \<netgraph/ng\_pred1.h\>**

## DESCRIPTION

The **pred1** node type implements the Predictor-1 sub-protocols of the Compression Control Protocol (CCP).

The node has two hooks, *comp* for compression and *decomp* for decompression. Only one of them can be connected at the same time, specifying node's operation mode. Typically that hooks would be connected to the [ng\_ppp(4)](/ng_ppp/4.md) node type hook of the same name.

## HOOKS

This node type supports the following hooks:

- *comp*

  Connection to [ng\_ppp(4)](/ng_ppp/4.md) *compress* hook. Incoming frames are compressed and sent back out the same hook.

- *decomp*

  Connection to [ng\_ppp(4)](/ng_ppp/4.md) *decompress* hook. Incoming frames are decompressed and sent back out the same hook.

Only one hook can be connected at the same time, specifying node's operation mode.

## CONTROL MESSAGES

This node type supports the generic control messages, plus the following:

- NGM\_PRED1\_CONFIG (**config**)

  This command resets and configures the node for a session (i.e., for compression or decompression). This command takes a *struct ng\_pred1\_config* as an argument:

  ```
  struct ng_pred1_config {
  	u_char		enable;			/* node enabled */
  };
  ```

  The *enable* field enables traffic flow through the node.

- NGM\_PRED1\_RESETREQ (**resetreq**)

  This message contains no arguments, and is bi-directional. If an error is detected during decompression, this message is sent by the node to the originator of the NGM\_PRED1\_CONFIG message 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 or Reset-Ack is received by the local PPP entity. The node will respond by flushing its compression state so the sides can resynchronize.

- NGM\_PRED1\_GET\_STATS (**getstats**)

  This control message obtains statistics for a given hook. The statistics are returned in *struct ng\_pred1\_stats*:

  ```
  struct ng_pred1_stats {
  	uint64_t	FramesPlain;
  	uint64_t	FramesComp;
  	uint64_t	FramesUncomp;
  	uint64_t	InOctets;
  	uint64_t	OutOctets;
  	uint64_t	Errors;
  };
  ```

- NGM\_PRED1\_CLR\_STATS (**clrstats**)

  This control message clears statistics for a given hook.

- NGM\_PRED1\_GETCLR\_STATS (**getclrstats**)

  This control message obtains and clears statistics for a given hook.

## SHUTDOWN

This node shuts down upon receipt of a NGM\_SHUTDOWN control message, or when hook have been disconnected.

## SEE ALSO

[netgraph(4)](/netgraph/4.md), [ng\_ppp(4)](/ng_ppp/4.md), [ngctl(8)](/ngctl/8.md) D. Rand, *PPP Predictor Compression Protocol*, RFC 1978. W. Simpson, *The Point-to-Point Protocol (PPP)*, RFC 1661.

## AUTHORS

Alexander Motin ⟨*mav@alkar.net*⟩

## BUGS

Due to nature of netgraph PPP implementation there are possible race conditions between data packet and ResetAck CCP packet in case of packet loss. As result, packet loss can produce bigger performance degradation than supposed by protocol.
