Skip to content

服务端 API 文档

POST /api/v2/interfaces

request

none

response

200

{
"NIC": [
<bytes sent>,
<bytes received>
]
}

example

{
"docker0": [
0,
0
],
"enp0s31f6": [
0,
0
],
"lo": [
21573968,
21573968
],
"wlp0s20f3": [
58817628,
2485692258
]
}

PUT /api/v2/netem

request

nametypedescription
nicstringnetwork interface name
delayMsfloatdelay time in ms
delayJitterMsfloatdelay jitter in ms
delayCorrelationPercentfloatdelay correlation percentage
delayDistributionstringdelay distribution: uniform | normal | pareto | paretonormal
lossRandomPercentfloatloss percentage in random mode
lossRandomCorrelationPercentfloatloss correlation percentage in random mode
lossStateP13floatp13 value of state mode loss
lossStateP31floatp31 value of state mode loss
lossStateP32floatp32 value of state mode loss
lossStateP23floatp23 value of state mode loss
lossStateP14floatp14 value of state mode loss
lossGEModelPercentfloatloss percentage in GE model mode
lossGEModelRfloatr value of GE model mode
lossGEModel1Hfloath value of GE model mode
lossGEModel1Kfloatk value of GE model mode
lossECNboolecn enabled
corruptPercentfloatpacket corruption percentage
corruptCorrelationPercentfloatpacket corruption correlation percentage
duplicatePercentfloatpacket duplication percentage
duplicateCorrelationPercentfloatpacket duplication correlation percentage
reorderPercentfloatpacket reorder percentage
reorderCorrelationPercentfloatpacket reorder correlation percentage
reorderGapDistancefloatpacket reorder gap distance
rateKbpsfloatrate limit in Kbps
slotMinDelayMsfloatminimum delay time in ms of slot mode
slotMaxDelayMsfloatmaximum delay time in ms of slot mode
slotDistributionstringslot distribution type: uniform | normal | pareto | paretonormal
slotDelayJitterMsfloatslot delay jitter time in ms
slotPacketsintslot packets count
slotBytesintslot bytes
queueTypestringqueue type: pfifo | bfifo
queueLimitBytesintqueue size limit in bytes
queueLimitPacketsintqueue size limit in packets

response

200

"ok"

400

"error"

500

"error"

POST /api/v2/bufferstate

request

nametypedescription
nicstringnetwork interface name

response

nametypedescription
qdiscNamestringqdisc the buffer belongs to
parentstringparent qdisc id
rulestring
sentBytesintbytes sent through this buffer
sentPacketsintpackets sent through this buffer
droppedPacketsintpackets dropped by this buffer
overlimitsintpackets dropped due to overlimit by this buffer
requeuesintpackets re-entered the queue
backlogBytesintbytes in buffer
backlogPacketsintbytes in buffer

example

[
{
"qdiscName": "netem 1",
"parent": "",
"rule": "root refcnt 2 limit 1000 rate 2048Kbit",
"sentBytes": 1310818,
"sentPackets": 183,
"droppedPackets": 0,
"overlimits": 0,
"requeues": 0,
"backlogBytes": 757724,
"backlogPackets": 40
},
{
"qdiscName": "bfifo 2",
"parent": "1",
"rule": "limit 1000Kb",
"sentBytes": 1310818,
"sentPackets": 183,
"droppedPackets": 0,
"overlimits": 0,
"requeues": 0,
"backlogBytes": 0,
"backlogPackets": 0
}
]