免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3124 | 回复: 2
打印 上一主题 下一主题

[网络相关] tc命令--实现队列优先级---求助 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-06-17 15:53 |只看该作者 |倒序浏览
小弟新手,这两天才开始看tc,要实现一下功能:
     建立三条优先级队列,优先级分别为高、中、低

     普通上网报文走中等优先级队列。

     端口号为5027的报文,根据需要选择走某一个队列

     如何才能实现?

    下面的语句不知道有没有错误?

//绑定优先级prio队列 默认创建三个频道(子类)1:1,1:2,1:3,
#tc qdisc add dev vlan2 root handle 1: prio

#tc qdisc add dev vlan2 parent 1:1 handle 10: pfifo

#tc qdisc add dev vlan2 parent 1:2 handle 20: pfifo

#tc qdisc add dev vlan2 parent 1:3 handle 30: pfifo

//端口为5027被送到队列1:2
tc filter add dev vlan2 parent 1:0 protocol ip prio 1 u32 match ip sport 5027 0xffff flowid 1:2

论坛徽章:
15
2015年辞旧岁徽章
日期:2015-03-03 16:54:15双鱼座
日期:2015-01-15 17:29:44午马
日期:2015-01-06 17:06:51子鼠
日期:2014-11-24 10:11:13寅虎
日期:2014-08-18 07:10:55酉鸡
日期:2014-04-02 12:24:51双子座
日期:2014-04-02 12:19:44天秤座
日期:2014-03-17 11:43:36亥猪
日期:2014-03-13 08:13:51未羊
日期:2014-03-11 12:42:03白羊座
日期:2013-11-20 10:15:18CU大牛徽章
日期:2013-04-17 11:48:45
2 [报告]
发表于 2013-06-18 09:24 |只看该作者
这个没研究过。先放些基础。 慢慢看。

DESCRIPTION
       Tc  is  used  to configure Traffic Control in the Linux kernel. Traffic
       Control consists of the following:


       SHAPING
              When traffic is shaped, its rate of transmission is  under  con-
              trol.  Shaping may be more than lowering the available bandwidth
              - it is also used to smooth out bursts  in  traffic  for  better
              network behaviour. Shaping occurs on egress.


       SCHEDULING
              By  scheduling  the  transmission  of  packets it is possible to
              improve interactivity for traffic  that  needs  it  while  still
              guaranteeing  bandwidth  to  bulk  transfers. Reordering is also
              called prioritizing, and happens only on egress.


       POLICING
              Where shaping deals with transmission of traffic, policing  per-
              tains to traffic arriving. Policing thus occurs on ingress.


       DROPPING
              Traffic exceeding a set bandwidth may also be dropped forthwith,
              both on ingress and on egress.


       Processing of traffic is controlled by three kinds of objects:  qdiscs,
       classes and filters.


QDISCS
       qdisc is short for 'queueing discipline' and it is elementary to under-
       standing traffic control. Whenever the kernel needs to send a packet to
       an  interface,  it  is enqueued to the qdisc configured for that inter-
       face. Immediately afterwards, the kernel tries to get as  many  packets
       as  possible  from  the  qdisc,  for giving them to the network adaptor
       driver.

       A simple QDISC is the 'pfifo' one, which does no processing at all  and
       is a pure First In, First Out queue. It does however store traffic when
       the network interface can't handle it momentarily.

论坛徽章:
0
3 [报告]
发表于 2013-06-18 18:26 |只看该作者
这些我也看过
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP