网络流控配置

更新时间:
2024-03-14
下载文档

网络流控配置

概述

网络流控(Network Flow Control)是网络中的一个基本功能,其目的是防止网络在拥塞的情况下出现丢帧。先看一个简单的使用场景。

由于网络节点 A 产生数据的速率远大于网络节点 B 接收数据的速率,而当两边的 Buffer 缓冲区有限的情况下,新产生的数据就无法正常发送,就产生了丢包现象。

对于上述场景所产生的异常情况,网络就引入了流控机制,目的就是为了解决端到端的发送方和接收方速度不匹配的问题。

实现方式

在 SylixOS 系统中,通过使用 flowctl 命令来实现网络流控功能。 flowctl 命令不仅可以对网络接口进行流量控制,而且可以对 IPv4、IPv6 进行流量控制。

在Shell命令行通过 help flowctl 命令可以查看到该指令的实际使用方式。

[root@sylixos:/root]# help flowctl 
show, add, delete, change flow control status.
eg. flowctl
    flowctl add ip 192.168.1.1 192.168.1.10 tcp 20 80 dev en1 50 100 64
       add a flow control rule: iface: en1(LAN Port) ip frome 192.168.1.1 to 192.168.1.10 tcp protocol port(20 ~ 80)
       uplink 50KBytes downlink 100KBytes buffer is 64KBytes

    flowctl add ip 192.168.1.1 192.168.1.10 udp 20 80 dev en1 50 100
       add a flow control rule: iface: en1(LAN Port) ip frome 192.168.1.1 to 192.168.1.10 udp protocol port(20 ~ 80)
       uplink 50KBytes downlink 100KBytes buffer is default size

    flowctl add ip 192.168.1.1 192.168.1.10 all dev en1 50 100
       add a flow control rule: iface: en1(LAN Port) ip frome 192.168.1.1 to 192.168.1.10 all protocol
       uplink 50KBytes downlink 100KBytes buffer is default size

    flowctl chg ip 192.168.1.1 192.168.1.10 tcp 20 80 dev en1 50 100
       change flow control rule: iface: en1(LAN Port) ip frome 192.168.1.1 to 192.168.1.10 tcp protocol port(20 ~ 80)
       uplink 50KBytes downlink 100KBytes buffer is default size

    flowctl del ip 192.168.1.1 192.168.1.10 tcp 20 80 dev en1
       delete a flow control rule: iface: en1(LAN Port) ip frome 192.168.1.1 to 192.168.1.10 tcp protocol port(20 ~ 80)

    flowctl add if dev en1 50 100 64
       add flow control rule: iface: en1(LAN Port)
       uplink 50KBytes downlink 100KBytes buffer 64K

    flowctl chg if dev en1 50 100
       change flow control rule: iface: en1(LAN Port)
       uplink 50KBytes downlink 100KBytes buffer is default size

    flowctl del if dev en1
       delete a flow control rule: iface: en1(LAN Port)
flowctl [add | del | chg] [ip | if] [...]
[root@sylixos:/root]# 

命令格式:

flowctl [cn] [type] ips ipe [proto] ps pe dev [ifname] [dl][ul] bufs 

参数说明:

cn:

  • add:添加流控规则。
  • del:删除流控规则。
  • chg:修改流控规则。

type:

  • ip:对 IP 地址进行流量控制。
  • ips :开始 IP 地址,
  • ipe :结束 IP 地址
  • ps :开始端口号
  • pe :结束端口号
  • tcp:TCP 协议 。
  • udp:UDP 协议。
  • all:默认协议。
  • if:对网络接口进行流量控制。
  • ifname:网络接口名。
  • dl:下行速度。
  • ul:上行速度。
文档内容是否对您有所帮助?
有帮助
没帮助