| Main index | Section 4 | Options |
#include <netgraph/ng_pipe.h>
| upper | |
| Hook leading to upper layer protocols. | |
| lower | |
| Hook leading to lower layer protocols. | |
Traffic flowing from upper to lower is considered downstream traffic. Traffic flowing from lower to upper is considered upstream traffic.
There are three mutually exclusive modes for the input queue:
| First In First Out (FIFO) | |
| A single queue holds packets in chronological order. | |
| Weighted fair queuing (WFQ) | |
| There are multiple queues for different traffic flows (based on IPv4 IPs). The longest queue is truncated if necessary. This approach assumes that the stalling flow is the flow with the most packets currently on hold. | |
| Deficit Round Robin (DRR) | |
| This mode is similar to WFQ, but packets are not taken out in strict chronological order. In principle oldest packets come first, but not too many packets from the same flow. | |
It is possible to configure a duplication probability. As the dice decides, the currently active packet stays in the queue while a copy of the packet is sent out. Nothing prevents a packet from being duplicated multiple times.
Packets are dropped with an increasing probability depending on the size of the packet, if a ber (bit error rate) is configured.
Surviving packets are delayed by the time the packet would need to travel through a link of the configured bandwidth. If this outbound queue is full, the packet is dropped.
| NGM_PIPE_SET_CFG ( setcfg) | |
|
Set node configuration to the one specified in
struct ng_pipe_cfg
Note: To set a value to zero, specify -1 instead. This allows omitting configuration values, which should not be modified. | |
| NGM_PIPE_GET_CFG ( getcfg) | |
Return current node configuration as
struct ng_pipe_cfg
struct ng_pipe_cfg {
u_int64_t bandwidth; /* bits per second */
u_int64_t delay; /* additional delay, usec */
u_int32_t header_offset; /* offset of IP header in bytes */
u_int32_t overhead; /* assumed L2 overhead in bytes */
struct ng_pipe_hookcfg downstream;
struct ng_pipe_hookcfg upstream;
};
| |
| NGM_PIPE_GET_STATS ( getstats) | |
Return node statistics as
struct ng_pipe_stats
/* Statistics structure for one hook */
struct ng_pipe_hookstat {
u_int64_t fwd_octets;
u_int64_t fwd_frames;
u_int64_t in_disc_octets;
u_int64_t in_disc_frames;
u_int64_t out_disc_octets;
u_int64_t out_disc_frames;
};
| |
| NGM_PIPE_CLR_STATS ( clrstats) | |
| Clear node statistics. | |
| NGM_PIPE_GETCLR_STATS ( getclrstats) | |
| Atomically return and clear node statistics. | |
| NGM_PIPE_GET_RUN ( getrun) | |
Return node statistics as
struct ng_pipe_run
/* Runtime structure for one hook */
struct ng_pipe_hookrun {
u_int32_t fifo_queues;
u_int32_t qin_octets;
u_int32_t qin_frames;
u_int32_t qout_octets;
u_int32_t qout_frames;
};
| |
/usr/sbin/ngctl -f- <<-SEQ
mkpeer fxp0: pipe lower lower
name fxp0:lower fxp0_pipe
connect fxp0: fxp0_pipe: upper upper
msg fxp0_pipe: setcfg { downstream={ bandwidth=20000000 fifo=1 } }
msg fxp0_pipe: setcfg { upstream={ bandwidth=500000 drr=1 duplicate=2 } }
SEQ
| NG_PIPE (4) | October 17, 2019 |
| Main index | Section 4 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
| “ | Ken Thompson was once asked by a reporter what he would have changed about Unix if he had it all to do over again. His answer: “I would spell creat with an ‘e.'” | ” |