libnl 3.5.0

Plug/Unplug Traffic (PLUG)
Routing Library (libnl-route) » Traffic Control » Queueing Disciplines

Queue traffic until an explicit release command. More...

## Attribute Modification
int | rtnl_qdisc_plug_buffer (struct rtnl_qdisc *qdisc)
| Insert a plug into the qdisc and buffer any incoming network traffic. More...
int | rtnl_qdisc_plug_release_one (struct rtnl_qdisc *qdisc)
| Unplug the qdisc, releasing packets from queue head to the last complete buffer, while new traffic continues to be buffered. More...
int | rtnl_qdisc_plug_release_indefinite (struct rtnl_qdisc *qdisc)
| Indefinitely unplug the qdisc, releasing all packets. More...
int | rtnl_qdisc_plug_set_limit (struct rtnl_qdisc *qdisc, int limit)
| Set limit of PLUG qdisc. More...

## Detailed Description

Queue traffic until an explicit release command.

There are two ways to use this qdisc:

1. A simple "instantaneous" plug/unplug operation, by issuing an alternating sequence of TCQ_PLUG_BUFFER & TCQ_PLUG_RELEASE_INDEFINITE commands.

2. For network output buffering (a.k.a output commit) functionality. Output commit property is commonly used by applications using checkpoint based fault-tolerance to ensure that the checkpoint from which a system is being restored is consistent w.r.t outside world.

   Consider for e.g. Remus - a Virtual Machine checkpointing system, wherein a VM is checkpointed, say every 50ms. The checkpoint is replicated asynchronously to the backup host, while the VM continues executing the next epoch speculatively.

   The following is a typical sequence of output buffer operations: 1.At epoch i, start_buffer(i)

   1. At end of epoch i (i.e. after 50ms): 2.1 Stop VM and take checkpoint(i). 2.2 start_buffer(i+1) and Resume VM
   2. While speculatively executing epoch(i+1), asynchronously replicate checkpoint(i) to backup host.
   3. When checkpoint_ack(i) is received from backup, release_buffer(i) Thus, this Qdisc would receive the following sequence of commands: TCQ_PLUG_BUFFER (epoch i) .. TCQ_PLUG_BUFFER (epoch i+1) ....TCQ_PLUG_RELEASE_ONE (epoch i) ......TCQ_PLUG_BUFFER (epoch i+2) ........

State of the queue, when used for network output buffering:

                plug(i+1)            plug(i)          head

---------------—+-----------------—+-------------—> | | | | pkts_current_epoch| pkts_last_epoch |pkts_to_release --------------—>|<-----—+------—>|+------------—> v v

## Function Documentation

## ◆ rtnl_qdisc_plug_buffer()

int rtnl_qdisc_plug_buffer | ( | struct rtnl_qdisc * | qdisc | ) |

Insert a plug into the qdisc and buffer any incoming network traffic.

Parameters

  qdisc | PLUG qdisc to be modified.

Definition at line 94 of file plug.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_qdisc_plug_release_one()

int rtnl_qdisc_plug_release_one | ( | struct rtnl_qdisc * | qdisc | ) |

Unplug the qdisc, releasing packets from queue head to the last complete buffer, while new traffic continues to be buffered.

Parameters

  qdisc | PLUG qdisc to be modified.

Definition at line 111 of file plug.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_qdisc_plug_release_indefinite()

int rtnl_qdisc_plug_release_indefinite | ( | struct rtnl_qdisc * | qdisc | ) |

Indefinitely unplug the qdisc, releasing all packets.

Network traffic will not be buffered until the next buffer command is issued.

Parameters

  qdisc | PLUG qdisc to be modified.

Definition at line 128 of file plug.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_qdisc_plug_set_limit()

int rtnl_qdisc_plug_set_limit | ( | struct rtnl_qdisc * | qdisc,
|  | int | limit
| ) |  |

Set limit of PLUG qdisc.

Parameters

  qdisc | PLUG qdisc to be modified.
  limit | New limit.

Returns
  0 on success or a negative error code.

Definition at line 145 of file plug.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function: