From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Tarek Amr" Date: Tue, 23 Jul 2002 08:14:19 +0000 Subject: [LARTC] The re-classifying MIME-Version: 1 Content-Type: multipart/mixed; boundary="----=_NextPart_000_000E_01C2323A.16E3E040" Message-Id: List-Id: To: lartc@vger.kernel.org This is a multi-part message in MIME format. ------=_NextPart_000_000E_01C2323A.16E3E040 Content-Type: text/plain; charset="windows-1256" Content-Transfer-Encoding: quoted-printable Referring to Differentiated Services on Linux = I read the examples there; they seem to be very helpful. Especially the = last two ones of thee EF But in my case I am working on an exterior node (packets are not marked = yet) Here is a brief description of my problem. =20 =20 1. tc qdisc add dev eth0 handle 1:0 root dsmark indices 64 = set_tc_index 2. tc class change dev eth0 parent 1:0 classid 1:1 dsmark mask 0x3 = value 0xb8 3. tc class change dev eth0 parent 1:0 classid 1:2 dsmark mask 0x3 = value 0x28 4. tc class change dev eth0 parent 1:0 classid 1:3 dsmark mask 0x3 = value 0x30 5. tc class change dev eth0 parent 1:0 classid 1:4 dsmark mask 0x3 = value 0x38 6. tc class change dev eth0 parent 1:0 classid 1:5 dsmark mask 0x3 = value 0x48 7. tc class change dev eth0 parent 1:0 classid 1:6 dsmark mask 0x3 = value 0x50 8. tc class change dev eth0 parent 1:0 classid 1:7 dsmark mask 0x3 = value 0x58 9. tc class change dev eth0 parent 1:0 classid 1:8 dsmark mask 0x3 = value 0x60 10. tc class change dev eth0 parent 1:0 classid 1:9 dsmark mask 0x3 = value 0x70 11. tc class change dev eth0 parent 1:0 classid 1:a dsmark mask 0x3 = value 0x78 12. tc class change dev eth0 parent 1:0 classid 1:b dsmark mask 0x3 = value 0x88 13. tc class change dev eth0 parent 1:0 classid 1:c dsmark mask 0x3 = value 0x90 14. tc class change dev eth0 parent 1:0 classid 1:d dsmark mask 0x3 = value 0x98 15. tc qdisc add dev eth0 handle 2:0 parent 1:0 cbq bandwidth = 10Mbit cell 8 avpkt 1000 mpu 64 16. tc class add dev eth0 classid 2:1 parent 2:0 cbq bandwidth = 10Mbit rate 50Kbit avpkt 1000 prio 1 bounded allot 1514 weight 1 = maxburst 21 17. tc class add dev eth0 classid 2:2 parent 2:0 cbq bandwidth = 10Mbit rate 50Kbit avpkt 1000 prio 2 bounded allot 1514 weight 1 = maxburst 21 18. tc class add dev eth0 classid 2:3 parent 2:0 cbq bandwidth = 10Mbit rate 50Kbit avpkt 1000 prio 3 bounded allot 1514 weight 1 = maxburst 21 19. tc class add dev eth0 classid 2:4 parent 2:0 cbq bandwidth = 10Mbit rate 50Kbit avpkt 1000 prio 4 bounded allot 1514 weight 1 = maxburst 21 20. tc class add dev eth0 classid 2:5 parent 2:0 cbq bandwidth = 10Mbit rate 50Kbit avpkt 1000 prio 5 bounded allot 1514 weight 1 = maxburst 21 21. tc class add dev eth0 classid 2:6 parent 2:0 cbq bandwidth = 10Mbit rate 50Kbit avpkt 1000 prio 6 bounded allot 1514 weight 1 = maxburst 21 22. tc class add dev eth0 classid 2:7 parent 2:0 cbq bandwidth = 10Mbit rate 50Kbit avpkt 1000 prio 7 bounded allot 1514 weight 1 = maxburst 21 23. tc class add dev eth0 classid 2:8 parent 2:0 cbq bandwidth = 10Mbit rate 50Kbit avpkt 1000 prio 8 bounded allot 1514 weight 1 = maxburst 21 24. tc class add dev eth0 classid 2:9 parent 2:0 cbq bandwidth = 10Mbit rate 50Kbit avpkt 1000 prio 9 bounded allot 1514 weight 1 = maxburst 21 25. tc class add dev eth0 classid 2:a parent 2:0 cbq bandwidth = 10Mbit rate 50Kbit avpkt 1000 prio 10 bounded allot 1514 weight 1 = maxburst 21 26. tc class add dev eth0 classid 2:b parent 2:0 cbq bandwidth = 10Mbit rate 50Kbit avpkt 1000 prio 11 bounded allot 1514 weight 1 = maxburst 21 27. tc class add dev eth0 classid 2:c parent 2:0 cbq bandwidth = 10Mbit rate 50Kbit avpkt 1000 prio 12 bounded allot 1514 weight 1 = maxburst 21 28. tc class add dev eth0 classid 2:d parent 2:0 cbq bandwidth = 10Mbit rate 50Kbit avpkt 1000 prio 13 bounded allot 1514 weight 1 = maxburst 21 29. etc. =20 =20 =20 So here in lines 1, 2, till 14 I made a rood qdisc =93DSMARK=94 and put = in it two =93DSMARK=94 classes for marking 0xb8, and 0x28, etc In lines 15, 16, till 28 I added a =93CBQ=94 =20 Now I have no problem in making filters to classify the incoming traffic = according to their IP header (u32, etc) and to point them to the = =93DSMARK=94 classes 1:1, and 1:2. =20 But I need to reclassify the packets within the =93CBQ=94 again, = according to the mark they had had. The problem here that I tried to use a =93TCINDEX=94 filter =20 E.g. tc filter add dev eth0 parent 2:0 protocol ip prio 1 tcindex handle = 1 tcindex classid 2:1 =20 This filter is supposed to point the traffic with the mark 0xb8 to = classid 2:1 =20 But when I added the rest of the filters to point to the classes 2:2, = 2:3, 2:d .. only some of the filters worked well and the rest didn=92t =20 Also in that =93TCINDEX=94 filter, what value does that handle take? Is = it in hex or decimal or is it just the marking classid or what? =20 =20 BEST REGARDS=20 =20 ------=_NextPart_000_000E_01C2323A.16E3E040 Content-Type: text/html; charset="windows-1256" Content-Transfer-Encoding: quoted-printable
Referring to =
Differentiated Services on Linux =
<draft-almesberger-wajhak-diffserv-linux-01.txt>

I = read the=20 examples there; they seem to be very helpful. Especially the last two = ones of=20 thee EF

But = in my case=20 I am working on an exterior node (packets are not marked=20 yet)

Here = is a=20 brief description of my problem.

 

 

1.   =20 tc = qdisc add=20 dev eth0 handle 1:0 root dsmark indices 64=20 set_tc_index

2.   =20 tc = class=20 change dev eth0 parent 1:0 classid 1:1 dsmark mask 0x3 value=20 0xb8

3.   =20 tc = class=20 change dev eth0 parent 1:0 classid 1:2 dsmark mask 0x3 value=20 0x28

4.   =20 tc = class=20 change dev eth0 parent 1:0 classid 1:3 dsmark mask 0x3 value=20 0x30

5.   =20 tc = class=20 change dev eth0 parent 1:0 classid 1:4 dsmark mask 0x3 value=20 0x38

6.   =20 tc = class=20 change dev eth0 parent 1:0 classid 1:5 dsmark mask 0x3 value=20 0x48

7.   =20 tc = class=20 change dev eth0 parent 1:0 classid 1:6 dsmark mask 0x3 value=20 0x50

8.   =20 tc = class=20 change dev eth0 parent 1:0 classid 1:7 dsmark mask 0x3 value=20 0x58

9.   =20 tc = class=20 change dev eth0 parent 1:0 classid 1:8 dsmark mask 0x3 value=20 0x60

10.     =20 tc = class=20 change dev eth0 parent 1:0 classid 1:9 dsmark mask 0x3 value=20 0x70

11.     =20 tc = class=20 change dev eth0 parent 1:0 classid 1:a dsmark mask 0x3 value=20 0x78

12.     =20 tc = class=20 change dev eth0 parent 1:0 classid 1:b dsmark mask 0x3 value=20 0x88

13.     =20 tc = class=20 change dev eth0 parent 1:0 classid 1:c dsmark mask 0x3 value=20 0x90

14.     =20 tc = class=20 change dev eth0 parent 1:0 classid 1:d dsmark mask 0x3 value=20 0x98

15.     =20 tc = qdisc add=20 dev eth0 handle 2:0 parent 1:0 cbq bandwidth 10Mbit cell 8 avpkt 1000 = mpu=20 64

16.     =20 tc = class add=20 dev eth0 classid 2:1 parent 2:0 cbq bandwidth 10Mbit rate 50Kbit avpkt = 1000 prio=20 1 bounded allot 1514 weight 1 maxburst 21

17.     =20 tc = class add=20 dev eth0 classid 2:2 parent 2:0 cbq bandwidth 10Mbit rate 50Kbit avpkt = 1000 prio=20 2 bounded allot 1514 weight 1 maxburst 21

18.     =20 tc = class add=20 dev eth0 classid 2:3 parent 2:0 cbq bandwidth 10Mbit rate 50Kbit avpkt = 1000 prio=20 3 bounded allot 1514 weight 1 maxburst 21

19.     =20 tc = class add=20 dev eth0 classid 2:4 parent 2:0 cbq bandwidth 10Mbit rate 50Kbit avpkt = 1000 prio=20 4 bounded allot 1514 weight 1 maxburst 21

20.     =20 tc = class add=20 dev eth0 classid 2:5 parent 2:0 cbq bandwidth 10Mbit rate 50Kbit avpkt = 1000 prio=20 5 bounded allot 1514 weight 1 maxburst 21

21.     =20 tc = class add=20 dev eth0 classid 2:6 parent 2:0 cbq bandwidth 10Mbit rate 50Kbit avpkt = 1000 prio=20 6 bounded allot 1514 weight 1 maxburst 21

22.     =20 tc = class add=20 dev eth0 classid 2:7 parent 2:0 cbq bandwidth 10Mbit rate 50Kbit avpkt = 1000 prio=20 7 bounded allot 1514 weight 1 maxburst 21

23.     =20 tc = class add=20 dev eth0 classid 2:8 parent 2:0 cbq bandwidth 10Mbit rate 50Kbit avpkt = 1000 prio=20 8 bounded allot 1514 weight 1 maxburst 21

24.     =20 tc = class add=20 dev eth0 classid 2:9 parent 2:0 cbq bandwidth 10Mbit rate 50Kbit avpkt = 1000 prio=20 9 bounded allot 1514 weight 1 maxburst 21

25.     =20 tc = class add=20 dev eth0 classid 2:a parent 2:0 cbq bandwidth 10Mbit rate 50Kbit avpkt = 1000 prio=20 10 bounded allot 1514 weight 1 maxburst 21

26.     =20 tc = class add=20 dev eth0 classid 2:b parent 2:0 cbq bandwidth 10Mbit rate 50Kbit avpkt = 1000 prio=20 11 bounded allot 1514 weight 1 maxburst 21

27.     =20 tc = class add=20 dev eth0 classid 2:c parent 2:0 cbq bandwidth 10Mbit rate 50Kbit avpkt = 1000 prio=20 12 bounded allot 1514 weight 1 maxburst 21

28.     =20 tc = class add=20 dev eth0 classid 2:d parent 2:0 cbq bandwidth 10Mbit rate 50Kbit avpkt = 1000 prio=20 13 bounded allot 1514 weight 1 maxburst 21

29.     =20 etc.

 

 

 

So = here in=20 lines 1, 2, till 14 I made a rood qdisc =93DSMARK=94 and put in it two = =93DSMARK=94=20 classes for marking 0xb8, and 0x28, etc

In = lines 15,=20 16, till 28 I added a =93CBQ=94

 

Now = I have no=20 problem in making filters to classify the incoming traffic according to = their IP=20 header (u32, etc) and to point them to the =93DSMARK=94 classes 1:1, and = 1:2.

 

But = I need to=20 reclassify the packets within the =93CBQ=94 again, according to the mark = they had=20 had.

The = problem=20 here that I tried to use a =93TCINDEX=94 filter

 

E.g. = tc filter=20 add dev eth0 parent 2:0 protocol ip prio 1 tcindex handle 1 tcindex = classid=20 2:1

 

This = filter is=20 supposed to point the traffic with the mark 0xb8 to classid=20 2:1

 

But = when I=20 added the rest of the filters to point to the classes 2:2, 2:3, 2:d .. = only some=20 of the filters worked well and the rest didn=92t

 

Also = in that=20 =93TCINDEX=94 filter, what value does that handle take? Is it in hex or = decimal or=20 is it just the marking classid or what?

 

 

BEST = REGARDS=20

 

------=_NextPart_000_000E_01C2323A.16E3E040-- _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/