12-14-2011
Tc command and IP tos in linux
Hi,
I use comand Tc to set the traffic control in linux box .
I use below command to set Qos , search TOS field equal to 0x2 and put it in first queue
other put in to third queue ..
tc qdisc add dev eth0 root handle 1: prio priomap 2 0 2 2 2 2 2 2 2 2 2 2 2 2 2 2
tc qdisc add dev eth0 parent 1:1 handle 10: pfifo limit 999999
tc qdisc add dev eth0 parent 1:2 handle 20: pfifo limit 999999
tc qdisc add dev eth0 parent 1:3 handle 30: pfifo limit 999999
I also set filter to check Tos =0x2 and put it in to queue 1 ...
tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 \
match ip tos 0x2 0xff \
flowid 1:10
There is no error for commit the command
But when I generate the traffic with TOS=0x2 ,I use comamnd
tc -s qdisc ls dev eth0 to check the queue 1 (first, 10)traffic.
[root@localhost ~]# tc -s qdisc ls dev eth0
qdisc prio 1: bands 3 priomap 2 0 2 2 2 2 2 2 2 2 2 2 2 2 2 2
Sent 6960760 bytes 15785 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
qdisc pfifo 10: parent 1:1 limit 999999p
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
qdisc pfifo 20: parent 1:2 limit 999999p
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
qdisc pfifo 30: parent 1:3 limit 999999p
Sent 6945311 bytes 15751 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
[root@localhost ~]#
I cannot see the send packet increase.
I only see the traffic in queue 3 (third ,30 ) increase.
Even I use http or sftp, only queue 3 traffice incrase.
So, it seem the tc cannot filter for the packet mark TOS=0x2 and putit into queue 1...
So, any advice how to fix it ....???
4 More Discussions You Might Find Interesting
1. IP Networking
Helo Folks :)
i had read an answer in this thread unixcom/programming/117551-calculate-ip-header-checksum-manually.html
i need to know what the software name that was used to capturing packet data in a network, just like the packet's capture output that showed up in the thread.
Thank you :)... (5 Replies)
Discussion started by: polutan
5 Replies
2. Shell Programming and Scripting
Hi All
We are migrating our projects from unix environment to linux. I tried running a install script which sets up my project, i.e. the directory structure and all. But in the middle of the script i started receiveing following error : nawk: command not found .
So i need to know which... (1 Reply)
Discussion started by: vee_789
1 Replies
3. UNIX for Beginners Questions & Answers
Hello,
I am on a Mac and trying to clean up some monthly files with a very simple SED:
sed '3,10d;/<ACROSS>/,$d' input.txt > output.txt
(from the input, delete lines 3 - 10; then delete from the line containing <ACROSS> to the end of the file)
then output to output.txt
Even when I try... (2 Replies)
Discussion started by: verbatim
2 Replies
4. Shell Programming and Scripting
Hello.
From a script, a command for a test is use :
find /home/user_install -maxdepth 1 -type f -newer /tmp/000_skel_file_deb ! -newer /tmp/000_skel_file_end -name '.bashrc' -o -name '.profile' -o -name '.gtkrc-2.0' -o -name '.i18n' -o -name '.inputrc'
Tha command... (3 Replies)
Discussion started by: jcdole
3 Replies
LEARN ABOUT MOJAVE
tc-pfifo
PBFIFO(8) Linux PBFIFO(8)
NAME
pfifo - Packet limited First In, First Out queue
bfifo - Byte limited First In, First Out queue
SYNOPSIS
tc qdisc ... add pfifo [ limit packets ]
tc qdisc ... add bfifo [ limit bytes ]
DESCRIPTION
The pfifo and bfifo qdiscs are unadorned First In, First Out queues. They are the simplest queues possible and therefore have no overhead.
pfifo constrains the queue size as measured in packets. bfifo does so as measured in bytes.
Like all non-default qdiscs, they maintain statistics. This might be a reason to prefer pfifo or bfifo over the default.
ALGORITHM
A list of packets is maintained, when a packet is enqueued it gets inserted at the tail of a list. When a packet needs to be sent out to
the network, it is taken from the head of the list.
If the list is too long, no further packets are allowed on. This is called 'tail drop'.
PARAMETERS
limit Maximum queue size. Specified in bytes for bfifo, in packets for pfifo. For pfifo, defaults to the interface txqueuelen, as speci-
fied with ifconfig(8) or ip(8). The range for this parameter is [0, UINT32_MAX].
For bfifo, it defaults to the txqueuelen multiplied by the interface MTU. The range for this parameter is [0, UINT32_MAX] bytes.
Note: The link layer header was considered when counting packets length.
OUTPUT
The output of tc -s qdisc ls contains the limit, either in packets or in bytes, and the number of bytes and packets actually sent. An
unsent and dropped packet only appears between braces and is not counted as 'Sent'.
In this example, the queue length is 100 packets, 45894 bytes were sent over 681 packets. No packets were dropped, and as the pfifo queue
does not slow down packets, there were also no overlimits:
# tc -s qdisc ls dev eth0
qdisc pfifo 8001: dev eth0 limit 100p
Sent 45894 bytes 681 pkts (dropped 0, overlimits 0)
If a backlog occurs, this is displayed as well.
SEE ALSO
tc(8)
AUTHORS
Alexey N. Kuznetsov, <kuznet@ms2.inr.ac.ru>
This manpage maintained by bert hubert <ahu@ds9a.nl>
iproute2 10 January 2002 PBFIFO(8)