algebra.tbfSchedule
This function gives the outcome of each packet in a tbf qdisc. The buckets are full at the first arrival. A packet leaves at the first time after its arrival and after the packet before it, when the tokens of each bucket cover its time. After it leaves, each bucket loses its time. A bucket gains one token for each nanosecond, up to its depth.
CLI- Package
- @procedures/algebra · README
- Path
["algebra","tbfSchedule"]- CLI
mark algebra tbfSchedule --packets <object[]> --queue <object>- As data
{"$proc":["algebra","tbfSchedule"],"input":{}}
Use it
In TypeScript
import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/algebra/register"; // registers its procedures
const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["algebra","tbfSchedule"], { packets: [], queue: {} });
console.log(JSON.stringify(result));From the command line
$ mark algebra tbfSchedule --packets <object[]> --queue <object>
As data, in a program
{
"$proc": ["algebra", "tbfSchedule"],
"input": { "packets": [], "queue": {} }
}Input
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
packets | object[] | yes | ||
queue | object | yes |
Output
The schema does not list fields (object | object[]).
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"packets": {
"type": "array",
"items": {
"type": "object",
"properties": {
"at": {
"type": "number",
"description": "This value is the time of the arrival, in nanoseconds. The arrivals of a schedule do not go back in time."
},
"length": {
"type": "number",
"description": "This value is the qdisc length of the packet, in bytes."
}
},
"required": [
"at",
"length"
],
"additionalProperties": {}
}
},
"queue": {
"type": "object",
"properties": {
"rate": {
"type": "object",
"properties": {
"rate": {
"type": "number",
"description": "This value is the rate in bytes per second."
},
"overhead": {
"type": "number",
"description": "This value is the overhead that the rate adds to each length."
},
"mpu": {
"type": "number",
"description": "This value is the least length that the rate counts."
},
"linklayer": {
"type": "string",
"enum": [
"atm",
"ethernet"
],
"description": "An ATM link counts the length in cells of 48 bytes, and each cell takes 53 bytes."
}
},
"required": [
"rate"
],
"additionalProperties": {}
},
"burst": {
"type": "number"
},
"limit": {
"type": "number"
},
"peak": {
"type": "object",
"properties": {
"burst": {
"type": "number",
"description": "This value is the depth of the bucket of the peak rate, in bytes (`TCA_TBF_PBURST`)."
},
"rate": {
"type": "number",
"description": "This value is the rate in bytes per second."
},
"overhead": {
"type": "number",
"description": "This value is the overhead that the rate adds to each length."
},
"mpu": {
"type": "number",
"description": "This value is the least length that the rate counts."
},
"linklayer": {
"type": "string",
"enum": [
"atm",
"ethernet"
],
"description": "An ATM link counts the length in cells of 48 bytes, and each cell takes 53 bytes."
}
},
"required": [
"burst",
"rate"
],
"additionalProperties": {}
}
},
"required": [
"rate",
"burst",
"limit"
],
"additionalProperties": {}
}
},
"required": [
"packets",
"queue"
],
"additionalProperties": false
},
"output": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "dropped"
},
"why": {
"type": "string",
"enum": [
"limit",
"size"
],
"description": "A `limit` drop is a full queue. A `size` drop is a packet longer than the largest size of tbf."
},
"ahead": {
"type": "number"
},
"bytes": {
"type": "number"
}
},
"required": [
"kind",
"why",
"ahead",
"bytes"
],
"additionalProperties": {}
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "sent"
},
"at": {
"type": "number",
"description": "This value is the time that the packet leaves the qdisc, in nanoseconds."
},
"ahead": {
"type": "number",
"description": "This value is the packets in the queue at the arrival of the packet."
},
"bytes": {
"type": "number",
"description": "This value is the bytes in the queue at the arrival of the packet."
}
},
"required": [
"kind",
"at",
"ahead",
"bytes"
],
"additionalProperties": {}
}
]
}
}
}