Skip to contentSkip to conversation

'sport' is good but 'dport'?

LARTC 박정은 4 participants 5 messages Oct 11, 2002

lore
Share & tools
lore

박정은

author
#0 lore raw

hi all

I just tried to test whether the HTB works well or not .. (policy is very simple ^^;;)

I tried HTB simulator 'Ethloop' with lo (loopback ) and I found HTB works well....(very well)

So I changed lo to eth0 and tested ..

./tc qdisc add dev eth0 root handle 1: htb default 10
./tc class add dev eth0 parent 1: classid 1:1 htb rate 500kbps ceil 500kbps ./tc class add dev eth0 parent 1:1 classid 1:2 htb rate 180kbps ceil 500kbps ./tc class add dev eth0 parent 1:2 classid 1:10 htb rate 150kbps ceil 500kbps prio 2 ./tc class add dev eth0 parent 1:2 classid 1:11 htb rate 5kbps ceil 10kbps prio 2 ./tc class add dev eth0 parent 1:1 classid 1:12 htb rate 10kbps ceil 20kbps prio 1 ./tc qdisc add dev eth0 parent 1:10 handle 20: pfifo limit 5
./tc qdisc add dev eth0 parent 1:11 handle 30: pfifo limit 5
./tc qdisc add dev eth0 parent 1:12 handle 40: sfq perturb 10

./tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip sport 23 0xffff flowid 1:11 ./tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip sport 80 0xffff flowid 1:12

It works well with outgoing packets ..

BUT!!

I changed last two lines to control Incoming packets .. like below..
./tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dport 23 0xfffe flowid 1:11 ./tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dport 80 0xfffe flowid 1:12

It never works .. !! If I send to 23 port 50kbps It receive 50kbps.. I have no idea ..

Did I thought wrong?

thanks in advance...

author
#1 lore raw

aGkgYWxsDQoNCkkganVzdCB0cmllZCB0byB0ZXN0IHdoZXRoZXIgdGhlIEhUQiB3b3JrcyB3ZWxs IG9yIG5vdCAuLiAocG9saWN5IGlzIHZlcnkgc2ltcGxlIF5eOzspDQoNCkkgdHJpZWQgSFRCIHNp bXVsYXRvciAnRXRobG9vcCcgd2l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hcmVudCAxOjAgcHJpbyAxIHUzMiBtYXRjaCBpcCBzcG9ydCAyMyAw eGZmZmYgZmxvd2lkIDE6MTENCi4vdGMgZmlsdGVyIGFkZCBkZXYgZXRoMCBwcm90b2NvbCBpcCBw YXJlbnQgMTowIHByaW8gMSB1MzIgbWF0Y2ggaXAgc3BvcnQgODAgMHhmZmZmIGZsb3dpZCAxOjEy DQoNCiBJdCB3b3JrcyB3ZWxsIHdpdGggb3V0Z29pbmcgcGFja2V0cyAuLiAgDQoNCiBCVVQhISAg IA0KDQogIEkgY2hhbmdlZCBsYXN0IHR3byBsaW5lcyB0byBjb250cm9sIEluY29taW5nIHBhY2tl dHMgLi4gbGlrZSBiZWxvdy4uDQouL3RjIGZpbHRlciBhZGQgZGV2IGV0aDAgcHJvdG9jb2wgaXAg cGFyZW50IDE6MCBwcmlvIDEgdTMyIG1hdGNoIGlwIGRwb3J0IDIzIDB4ZmZmZSBmbG93aWQgMTox MQ0KLi90YyBmaWx0ZXIgYWRkIGRldiBldGgwIHByb3RvY29sIGlwIHBhcmVudCAxOjAgcHJpbyAx IHUzMiBtYXRjaCBpcCBkcG9ydCA4MCAweGZmZmUgZmxvd2lkIDE6MTINCg0KSXQgbmV2ZXIgd29y a3MgLi4gISEgICBJZiBJIHNlbmQgdG8gMjMgcG9ydCA1MGticHMgIEl0IHJlY2VpdmUgNTBrYnBz Li4gSSBoYXZlIG5vIGlkZWEgLi4gIA0KDQpEaWQgSSB0aG91Z2h0IHdyb25nPyAgICANCg0KdGhh bmtzIGluIGFkdmFuY2UuLi4NCg0K

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

#2 lore raw
In reply to 박정은
Quoted 5 lines · ¹ÚÁ¤Àº

hi all

I just tried to test whether the HTB works well or not .. (policy is very simple ^^;;)

Quoted 8 lines

I tried HTB simulator 'Ethloop' with lo (loopback ) and I found HTB works well....(very well)

So I changed lo to eth0 and tested ..

./tc qdisc add dev eth0 root handle 1: htb default 10 ./tc class add dev eth0 parent 1: classid 1:1 htb rate 500kbps ceil 500kbps

./tc class add dev eth0 parent 1:1 classid 1:2 htb rate 180kbps

Quoted 10 lines

ceil 500kbps ./tc class add dev eth0 parent 1:2 classid 1:10 htb rate 150kbps ceil 500kbps prio 2 ./tc class add dev eth0 parent 1:2 classid 1:11 htb rate 5kbps ceil 10kbps prio 2 ./tc class add dev eth0 parent 1:1 classid 1:12 htb rate 10kbps ceil 20kbps prio 1 ./tc qdisc add dev eth0 parent 1:10 handle 20: pfifo limit 5
./tc qdisc add dev eth0 parent 1:11 handle 30: pfifo limit 5 ./tc qdisc add dev eth0 parent 1:12 handle 40: sfq perturb 10

./tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip sport 23 0xffff flowid 1:11

./tc filter add dev eth0 protocol ip parent 1:0 prio

Quoted 8 lines

1 u32 match ip sport 80 0xffff flowid 1:12
It works well with outgoing packets ..

BUT!!

I changed last two lines to control Incoming packets .. like below..
./tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dport 23 0xfffe flowid 1:11

./tc filter add dev eth0 protocol ip parent 1:0 prio

Quoted 5 lines

1 u32 match ip dport 80 0xfffe flowid 1:12
It never works .. !! If I send to 23 port 50kbps It receive 50kbps.. I
have no idea ..

Did I thought wrong?

Yes :)

You can only shape outgoing packets. If you want to shape incoming packets, you can use policers or the imq device.

Stef

Signature · 8 lines
[email protected]
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.oftc.net

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
#3 lore raw
In reply to 박정은
Quoted 5 lines · 박정은

It never works .. !! If I send to 23 port 50kbps It receive 50kbps.. I have no idea ..

Did I thought wrong?

You should read the FAQ / HOWTO again; it mentions that you can only shape outgoing packets for a variety of reasons. You can limit incoming packets to some degree (not as well controlled, and somewhat pointless in some cases) by dropping the packets you don't want however, with the ingress filter.

Signature · 8 lines
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock


_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
#4 lore raw
In reply to 박정은

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 5 lines · Michael T. Babcock

You should read the FAQ / HOWTO again; it mentions that you can only shape outgoing packets for a variety of reasons. You can limit incoming packets to some degree (not as well controlled, and somewhat pointless in some cases) by dropping the packets you don't want however, with the ingress filter.

or better use imq
http://luxik.cdi.cz/~patrick/imq/index.html

- --
Regards,
Robert
- ----------------
Robert Penz
robert.penz AT outertech.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9ptgj8tTsQqJDUBMRAnO5AJ9muDj6cI9iZzgrbE2A/2Wzkz9z6gCfftLy NCFV8+0M7VQ4ihL863QEeiA=
=dPfA
-----END PGP SIGNATURE-----

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/