Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ng_tcpmss(4) [freebsd man page]

NG_TCPMSS(4)						   BSD Kernel Interfaces Manual 					      NG_TCPMSS(4)

NAME
ng_tcpmss -- netgraph node to adjust TCP MSS option SYNOPSIS
#include <netgraph.h> #include <netgraph/ng_tcpmss.h> DESCRIPTION
The tcpmss node type is designed to alter the Maximum Segment Size option of TCP packets. This node accepts an arbitrary number of hooks. Initially a new hook is considered unconfigured. The NG_TCPMSS_CONFIG control message is used to configure a hook. CONTROL MESSAGES
This node type supports the generic control messages, plus the following. NGM_TCPMSS_CONFIG (config) This control message configures node to do given MSS adjusting on a particular hook. It requires the struct ng_tcpmss_config to be sup- plied as an argument: struct ng_tcpmss_config { char inHook[NG_HOOKSIZ]; char outHook[NG_HOOKSIZ]; uint16_t maxMSS; } This means: packets received on inHook would be checked for TCP MSS option and the latter would be reduced down to maxMSS if it exceeds maxMSS. After that, packets would be sent to hook outHook. NGM_TCPMSS_GET_STATS (getstats) This control message obtains statistics for a given hook. The statistics are returned in struct ng_tcpmss_hookstat: struct ng_tcpmss_hookstat { uint64_t Octets; /* total bytes */ uint64_t Packets; /* total packets */ uint16_t maxMSS; /* maximum MSS */ uint64_t SYNPkts; /* TCP SYN packets */ uint64_t FixedPkts; /* changed packets */ }; NGM_TCPMSS_CLR_STATS (clrstats) This control message clears statistics for a given hook. NGM_TCPMSS_GETCLR_STATS (getclrstats) This control message obtains and clears statistics for a given hook. EXAMPLES
In the following example, packets are injected into the tcpmss node using the ng_ipfw(4) node. # Create tcpmss node and connect it to ng_ipfw node ngctl mkpeer ipfw: tcpmss 100 qqq # Adjust MSS to 1452 ngctl msg ipfw:100 config '{ inHook="qqq" outHook="qqq" maxMSS=1452 }' # Divert traffic into tcpmss node ipfw add 300 netgraph 100 tcp from any to any tcpflags syn out via fxp0 # Let packets continue with ipfw after being hacked sysctl net.inet.ip.fw.one_pass=0 SHUTDOWN
This node shuts down upon receipt of an NGM_SHUTDOWN control message, or when all hooks have been disconnected. SEE ALSO
netgraph(4), ng_ipfw(4) HISTORY
The ng_tcpmss node type was implemented in FreeBSD 6.0. AUTHORS
Alexey Popov <lollypop@flexuser.ru> Gleb Smirnoff <glebius@FreeBSD.org> BUGS
When running on SMP, system statistics may be broken. BSD
June 9, 2005 BSD

Check Out this Related Man Page

NG_PRED1(4)						   BSD Kernel Interfaces Manual 					       NG_PRED1(4)

NAME
ng_pred1 -- Predictor-1 PPP compression (RFC 1978) netgraph node type 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) node type hook of the same name. HOOKS
This node type supports the following hooks: comp Connection to ng_ppp(4) compress hook. Incoming frames are compressed and sent back out the same hook. decomp Connection to ng_ppp(4) 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), ng_ppp(4), ngctl(8) 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. BSD
December 24, 2006 BSD
Man Page