09-05-2011
Help understanding iproute2 and tc scripts
Hi all,
I am new to linux routing and would like to keep a possible running dialog about some scripts I have been studying and what the different parts of them mean. We are using Openwrt backfire along with openvpn and Swyx as VoIP. My goal is to eventually implement some QoS using dsmark, but I want to understand what I am doing before I put anything into production.
Here is the first part of the script I have a question about:
# tc qdisc add dev eth0 handle ffff: ingress
# tc filter add dev eth0 parent ffff: protocol ip prop 1 u32 \ match ip protocol 17 0xff police rate 240kbit \ burst 15kb continue flowid :1
I think I comprehend everything except 'burst 15kb continue flowid :1'. What does that mean, and what is the point of it?
According to the author: opalsoft(.) net/qos/VoIP(.) htm
Our first ingress filter, priority 1, catchs UDP packets (UDP is protocol number 17) policing them up to 240kbits. Then we can manage with this 15 conversations of 16kbps each. Check your VoIP implementation to know the bandwidth requeriment per session and adjust your command according.
Now our valuable packets are in the outgoing queue *(What is the outgoing queue? out going as in the LAN side or WAN side?)*as fast as we can. For this side I suggest a prio queue to kick them asap to the outgoing interface (again which one is outgoing?); then something like this can help:
Here is the second part that is confusing:
# tc qdisc add dev eth1 root handle 1: prio
# tc filter add dev eth1 parent 1:0 protocol ip prio 1 \ handle 1 tcindex classid 1:1
Is this filter for stuff coming from the WAN to the LAN, the other way or both?
I am a bit confused on what constitutes ingress and egress. If the WAN (eth1) gets packets thats ingress, but then if eth1 sends the packets to eth0 (LAN) thats then egress?
Sorry to be long winded, but I think I need to chat a bit to work out all the stuff I read. Thank you in advance!
-Shawn
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I'm trying to get a clear picture of how startup scripts are executed during
bootup. When run-level N is entered, the scripts in /rcN.d are executed.
I understand that the S* scripts are executed in numerical order during bootup.
What I don't understand is if the K* scripts are executed... (0 Replies)
Discussion started by: darkmatter14B
0 Replies
2. UNIX for Dummies Questions & Answers
what is the difference between login and profile scripts versus the rc scripts? (1 Reply)
Discussion started by: rookie22
1 Replies
3. Shell Programming and Scripting
Hello Friends,
I am new to the scripting & have to analyze bunch of regular production scripts. It has .ksh which calls on the .awk script having many functions
I need to understand and debug the scripts ASAP
Can anybody please let me know as how can I debug, I want to see the flow of code... (3 Replies)
Discussion started by: amberj123
3 Replies
4. Shell Programming and Scripting
Hi all,
I have set up a cron job which calls another shell script shell script which in turn calls a Java process. The cron tab looks so.
0,30 7-18 * * 1-5 /u01/home/weblogic/brp/bin/checkstatus.sh >> /u01/home/weblogic/logs/checkstatus.log
The checkstatus.sh scripts looks like this.
... (4 Replies)
Discussion started by: sirbrian
4 Replies
5. Shell Programming and Scripting
Hi,
I have to write a program to compute the checksums of files
./script.sh
I wrote the program using bash and it took me forever since I am a beginner but it works very well.
I'm getting so close to the deadline and I realised today that actually I have to use normal Bourne shell... (3 Replies)
Discussion started by: pgarg1989
3 Replies
6. Shell Programming and Scripting
Need a better understanding of shell scripts (14 Replies)
Discussion started by: sureshkumar4737
14 Replies
7. Shell Programming and Scripting
Dear Members,
I have a table REQUESTS in Oracle which has an attribute REQUEST_ACTION. The entries in REQUEST_ACTION are like, ME, MD, ND, NE etc.
I would like to create a script which will will call other scripts based on the request action.
Can we directly read from the REQUEST_ACTION... (2 Replies)
Discussion started by: Yoodit
2 Replies
8. Programming
I have seen a lot of IPv4/IPv6 address manipulation libraries but I have yet to see a library allowing you to manipulate the interfaces/addresses/routes.
Anybody else have any experience finding an iproute2 equivalent for Python?
My basic requirements are the ability to add/remove addresses,... (1 Reply)
Discussion started by: jjinno
1 Replies
9. IP Networking
Hi,
I'm trying to set up a test bed where I can use a single machine to do some network packet captures between 2 different applications without needing a network connection.
I'm actually trying to do some SIP VoIP development, but for illustration purposes will use ping. I want:
ping 127.0.0.1... (0 Replies)
Discussion started by: racitup
0 Replies
10. UNIX for Beginners Questions & Answers
Hello... and thanks in advance for reading this or offering me any assistance
I'm trying to understand specific differences between the various login scripts... I understand the differences between interactive vs non-interactive and login vs non-login shells... and that's not where my question... (4 Replies)
Discussion started by: bodisha
4 Replies
LEARN ABOUT SUNOS
tc-matchall
Match-all classifier in tc(8) Linux Match-all classifier in tc(8)
NAME
matchall - traffic control filter that matches every packet
SYNOPSIS
tc filter ... matchall [ skip_sw | skip_hw ] [ action ACTION_SPEC ] [ classid CLASSID ]
DESCRIPTION
The matchall filter allows to classify every packet that flows on the port and run a action on it.
OPTIONS
action ACTION_SPEC
Apply an action from the generic actions framework on matching packets.
classid CLASSID
Push matching packets into the class identified by CLASSID.
skip_sw
Do not process filter by software. If hardware has no offload support for this filter, or TC offload is not enabled for the inter-
face, operation will fail.
skip_hw
Do not process filter by hardware.
EXAMPLES
To create ingress mirroring from port eth1 to port eth2:
tc qdisc add dev eth1 handle ffff: ingress
tc filter add dev eth1 parent ffff:
matchall skip_sw
action mirred egress mirror
dev eth2
The first command creats an ingress qdisc with handle ffff: on device eth1 where the second command attaches a matchall filters on it that
mirrors the packets to device eth2.
To create egress mirroring from port eth1 to port eth2:
tc qdisc add dev eth1 handle 1: root prio
tc filter add dev eth1 parent 1:
matchall skip_sw
action mirred egress mirror
dev eth2
The first command creats an egress qdisc with handle 1: that replaces the root qdisc on device eth1 where the second command attaches a
matchall filters on it that mirrors the packets to device eth2.
To sample one of every 100 packets flowing into interface eth0 to psample group 12:
tc qdisc add dev eth0 handle ffff: ingress
tc filter add dev eth0 parent ffff: matchall
action sample rate 100 group 12
SEE ALSO
tc(8),
iproute2 21 Oct 2015 Match-all classifier in tc(8)