Skip to contentSkip to conversation

IFB working

LARTC Rajesh Mahajan 3 participants 4 messages Jul 2, 2006 – Jul 18, 2006

lore
Share & tools
lore
#1 lore raw
#2 lore raw
In reply to Rajesh Mahajan

All these documents have one line

action mirred egress redirect dev dummy0

what I can understand out of this is that all packets in egress of device are being redirected to dummy0, where as the need is to inject dummy 0 with packets in ingress of the device so that shaping can be done for packets storming in for our system and not the packets leaving our system. Policing can be done but here the requirement is for Shaping (queueing). With IMQ ingress shaping does work fine but the only question I have is how to shape packets coming in ingress of the device

I am enclosing my sample script suggest any changes that I can make to achieve the results.

IP ADDRESS on which shaping needs to be done 10.1.1.15 (host running the script)
IP ADDRESS from which packets are coming in ingress of eth0 which needs to be shaped: 10.1.1.100

Let me know the modifications required so that I am able to shape pakets destined for my system (10.1.1.15).

kernel version: 2.6.16-2-686
iproute2 version: iproute2-ss060323
OS: Debian

#!/bin/bash
export TC="/sbin/tc"

$TC qdisc del dev ifb0 root
$TC qdisc add dev ifb0 root handle 1: htb default 2

$TC class add dev ifb0 parent 1: classid 1:2 htb rate 10Kbit ceil 12Kbit

$TC filter add dev ifb0 parent 1: protocol ip prio 2 u32 match ip src 10.1.1.100/32 flowid 1:2

ifconfig ifb0 up
$TC qdisc del dev eth0 root handle 1: htb default 2 $TC qdisc add dev eth0 root handle 1: htb default 2

$TC class add dev eth0 parent 1: classid 1:2 htb rate 10Kbit ceil 16Kbit

$TC filter add dev eth0 parent 1: protocol ip prio 1 u32 match ip src 10.1.1.100/32 flowid 1:2 action mirred egress redirect dev ifb0

Thanks in advance :)

Quoted 18 lines · Rune Kock
Quoted 5 lines

How to use IFB as replacement of IMQ

There is not much documentation about it
Please explain with example

This is the docs that I have been able to find.

http://linux-net.osdl.org/index.php/IFB
http://marc.theaimsgroup.com/?l=linux-netdev&m=110712327422706&w=2
http://www.mail-archive.com/[email protected]/msg04846.html
http://www.mail-archive.com/[email protected]/msg04847.html
http://www.mail-archive.com/[email protected]/msg04900.html
http://www.mail-archive.com/[email protected]/msg04901.html

Rune

Signature · 1 line
Failure seldom stops you. What stops you is the fear of failure.

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

#3 lore raw
In reply to Rajesh Mahajan
Quoted 11 lines · Rajesh Mahajan

All these documents have one line

action mirred egress redirect dev dummy0

what I can understand out of this is that all packets in egress of device are being redirected to dummy0, where as the need is to inject dummy 0 with packets in ingress of the device so that shaping can be done for packets storming in for our system and not the packets leaving our system. Policing can be done but here the requirement is for Shaping (queueing). With IMQ ingress shaping does work fine but the only question I have is how to shape packets coming in ingress of the device

$TC qdisc add dev eth0 ingress
$TC filter add dev eth0 parent ffff: \
protocol ip prio 10 u32 match ip src 192.168.0.10 \
flowid 1:0 \
action mirred egress redirect dev ifb0

Andy.
_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc