Sponsored Content
Special Forums IP Networking Help understanding iproute2 and tc scripts Post 302552735 by shodg001 on Monday 5th of September 2011 10:09:08 AM
Old 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

Understanding System Vish startup scripts

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

Profile scripts versus rc scripts....

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

Need help on understanding the Shell and AWK scripts

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

Running scripts within scripts from cron

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

Changing the Bash Scripts to Bourne Scripts:URGENT

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

Need a better understanding of shell scripts (14 Replies)
Discussion started by: sureshkumar4737
14 Replies

7. Shell Programming and Scripting

KSH - How to call different scripts from master scripts based on a column in an Oracle table

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

iproute2 for Python?

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

iproute2 loopback source address

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

Understanding the difference between individual BASH login scripts

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
Route classifier in tc(8)					       Linux						 Route classifier in tc(8)

NAME
route - route traffic control filter SYNOPSIS
tc filter ... route [ from REALM | fromif TAG ] [ to REALM ] [ classid CLASSID ] [ action ACTION_SPEC ] DESCRIPTION
Match packets based on routing table entries. This filter centers around the possibility to assign a realm to routing table entries. For any packet to be classified by this filter, a routing table lookup is performed and the returned realm is used to decide on whether the packet is a match or not. 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. from REALM fromif TAG Perform source route lookups. TAG is the name of an interface which must be present on the system at the time of tc invocation. to REALM Match if normal (i.e., destination) routing returns the given REALM. EXAMPLES
Consider the subnet 192.168.2.0/24 being attached to eth0: ip route add 192.168.2.0/24 dev eth0 realm 2 The following route filter will then match packets from that subnet: tc filter add ... route from 2 classid 1:2 and pass packets on to class 1:2. NOTES
Due to implementation details, realm values must be in a range from 0 to 255, inclusive. Alternatively, a verbose name defined in /etc/iproute2/rt_realms may be given instead. SEE ALSO
tc(8), ip-route(8) iproute2 21 Oct 2015 Route classifier in tc(8)
All times are GMT -4. The time now is 05:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy