All of lore.kernel.org
 help / color / mirror / Atom feed
* [HELP] for using class group classifier network controller
@ 2009-06-15  0:56 ` 김재열
  0 siblings, 0 replies; 12+ messages in thread
From: 김재열 @ 2009-06-15  0:56 UTC (permalink / raw)
  To: usui-vEbCzmPPqHe45+QrQBaojngSJqDPrsil, tgraf-wEGCiKHe2LqWVfeAwA7xHQ
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA

Hi.

 

I'm trying to use class group classifier network controller written by Thomas Graf.

But it doesn't work well.

I need a help to use this network classifier collectly

 

Below is the my testing environment

 

kernel : 2.6.29

iproute : iproute2-2.6.29-1 + net_cls patch

 

I compiled kernel in order to use control group classifier by enabling  CGROUPS and NET_CLS_CGROUPS and other cgroup related options.

And I operated like this.

 

mkdir -p /dev/cpuctl/

mount -t cgroup net_cls -onet_cls /dev/cpuctl

mkdir /dev/cpuctl/foo

mkdir /dev/cpuctl/bob

 

# classid 1:10

echo 0x1000A > /dev/cpuctl/foo/net_cls.classid

#classid 1:20

echo 0x10014 > /dev/cpuctl/bob/net_cls.classid

 

And I put two bashshell's pid into foo and bob group

 

echo $$ > /dev/cpuctl/foo/task

echo $$ > /dev/cpuctl/bob/task

 

And then I configured the kernel's traffic control policy

 

TC = /sbin/tc

$TC qdisc delete dev eth0 root

 

$TC qdisc add dev eth0 root handle 1: htb default 10 r2q 200

 

# add class 1:10 for foo group

$TC class add dev eth0 parent 1:0 classid 1:10 htb rate 50mbit

# add class 1:20 for bob group

$TC class add dev eth0 parent 1:0 classid 1:20 htb rate 30mbit

# default class

$TC class add dev eth0 parent 1:0 classid 1:30 htb rate 10mbit

 

# add net_cls filter for class foo and bob

$TC filter add dev eth0 parent 1: protocol ip prio 10 handle 100: cgroup

# default class filter
$TC filter add dev eth0 parent 1: protocol ip prio 20 basic classid 1:30

After finishing this configuration, I ran the iperf  for measuring the network BW.

Iperf showd about 10mbps in each group.

10mbps is the rate of class 1:30, default class.

 

When I send a data in group foo or group bob, the data rate is equal to default class 1:30 rate,

so I think kernel couldn't identify classified packet from normal packet.

What is wrong?

 

I expect your kindness.

 

- Cheiyol Kim

 

*************************************************************************************

 

This is the iproute patch

 

--- ./iproute2-2.6.29-1/tc/Makefile     2009-03-25 07:40:54.000000000 +0900
+++ ./iproute2-2.6.29-1-mod/tc/Makefile 2009-06-02 17:33:21.000000000 +0900
@@ -20,6 +20,7 @@
 TCMODULES += f_fw.o
 TCMODULES += f_basic.o
 TCMODULES += f_flow.o
+TCMODULES += f_cgroup.o
 TCMODULES += q_dsmark.o
 TCMODULES += q_gred.o
 TCMODULES += f_tcindex.o

--- ./iproute2-2.6.29-1/tc/NULL 1970-01-01 09:00:00.000000000 +0900
+++ ./iproute2-2.6.29-1-mod/tc/f_cgroup.c       2009-06-02 17:32:47.000000000 +0900
@@ -0,0 +1,101 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include "utils.h"
+#include "tc_util.h"
+#include "m_ematch.h"
+
+static void explain(void)
+{
+       fprintf(stderr, "Usage: ... cgroup [ match EMATCH_TREE ] [ police POLICE_SPEC ]\n");
+       fprintf(stderr, "                 [ action ACTION_SPEC ]\n");
+}
+
+static int cgroup_parse_opt(struct filter_util *qu, char *handle,
+                          int argc, char **argv, struct nlmsghdr *n) {
+       struct tcmsg *t = NLMSG_DATA(n);
+       struct rtattr *tail;
+       long h = 0;
+
+       if (handle) {
+               h = strtol(handle, NULL, 0);
+               if (h == LONG_MIN || h == LONG_MAX) {
+                       fprintf(stderr, "Illegal handle \"%s\", must be numeric.\n",
+                           handle);
+                       return -1;
+               }
+       }
+
+       t->tcm_handle = h;
+
+       tail = (struct rtattr*)(((void*)n)+NLMSG_ALIGN(n->nlmsg_len));
+       addattr_l(n, MAX_MSG, TCA_OPTIONS, NULL, 0);
+
+       while (argc > 0) {
+               if (matches(*argv, "match") == 0) {
+                       NEXT_ARG();
+                       if (parse_ematch(&argc, &argv, TCA_CGROUP_EMATCHES, n)) {
+                               fprintf(stderr, "Illegal \"ematch\"\n");
+                               return -1;
+                       }
+                       continue;
+               } else if (matches(*argv, "action") == 0) {
+                       NEXT_ARG();
+                       if (parse_action(&argc, &argv, TCA_CGROUP_ACT, n)) {
+                               fprintf(stderr, "Illegal \"action\"\n");
+                               return -1;
+                       }
+                       continue;
+
+               } else if (matches(*argv, "police") == 0) {
+                       NEXT_ARG();
+                       if (parse_police(&argc, &argv, TCA_CGROUP_POLICE, n)) {
+                               fprintf(stderr, "Illegal \"police\"\n");
+                               return -1;
+                       }
+                       continue;
+               } else if (strcmp(*argv, "help") == 0) {
+                       explain();
+                       return -1;
+               } else {
+                       fprintf(stderr, "What is \"%s\"?\n", *argv);
+                       explain();
+                       return -1;
+               }
+               argc--; argv++;
+       }
+
+       tail->rta_len = (((void*)n)+n->nlmsg_len) - (void*)tail;
+       return 0;
+}
+
+static int cgroup_print_opt(struct filter_util *qu, FILE *f,
+                          struct rtattr *opt, __u32 handle) {
+       struct rtattr *tb[TCA_CGROUP_MAX+1];
+
+       if (opt == NULL)
+               return 0;
+
+       parse_rtattr_nested(tb, TCA_CGROUP_MAX, opt);
+
+       if (handle)
+               fprintf(f, "handle 0x%x ", handle);
+
+       if (tb[TCA_CGROUP_EMATCHES])
+               print_ematch(f, tb[TCA_CGROUP_EMATCHES]);
+
+       if (tb[TCA_CGROUP_POLICE]) {
+               fprintf(f, "\n");
+               tc_print_police(f, tb[TCA_CGROUP_POLICE]);
+       }
+
+       if (tb[TCA_CGROUP_ACT])
+               tc_print_action(f, tb[TCA_CGROUP_ACT]);
+
+       return 0;
+}
+
+struct filter_util cgroup_filter_util = {
+       .id = "cgroup",
+       .parse_fopt = cgroup_parse_opt,
+       .print_fopt = cgroup_print_opt,
+};

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [HELP] for using class group classifier network controller
@ 2009-06-15  0:56 ` 김재열
  0 siblings, 0 replies; 12+ messages in thread
From: 김재열 @ 2009-06-15  0:56 UTC (permalink / raw)
  To: usui-vEbCzmPPqHe45+QrQBaojngSJqDPrsil, tgraf-wEGCiKHe2LqWVfeAwA7xHQ
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA

Hi.

 

I'm trying to use class group classifier network controller written by Thomas Graf.

But it doesn't work well.

I need a help to use this network classifier collectly

 

Below is the my testing environment

 

kernel : 2.6.29

iproute : iproute2-2.6.29-1 + net_cls patch

 

I compiled kernel in order to use control group classifier by enabling  CGROUPS and NET_CLS_CGROUPS and other cgroup related options.

And I operated like this.

 

mkdir -p /dev/cpuctl/

mount -t cgroup net_cls -onet_cls /dev/cpuctl

mkdir /dev/cpuctl/foo

mkdir /dev/cpuctl/bob

 

# classid 1:10

echo 0x1000A > /dev/cpuctl/foo/net_cls.classid

#classid 1:20

echo 0x10014 > /dev/cpuctl/bob/net_cls.classid

 

And I put two bashshell's pid into foo and bob group

 

echo $$ > /dev/cpuctl/foo/task

echo $$ > /dev/cpuctl/bob/task

 

And then I configured the kernel's traffic control policy

 

TC = /sbin/tc

$TC qdisc delete dev eth0 root

 

$TC qdisc add dev eth0 root handle 1: htb default 10 r2q 200

 

# add class 1:10 for foo group

$TC class add dev eth0 parent 1:0 classid 1:10 htb rate 50mbit

# add class 1:20 for bob group

$TC class add dev eth0 parent 1:0 classid 1:20 htb rate 30mbit

# default class

$TC class add dev eth0 parent 1:0 classid 1:30 htb rate 10mbit

 

# add net_cls filter for class foo and bob

$TC filter add dev eth0 parent 1: protocol ip prio 10 handle 100: cgroup

# default class filter
$TC filter add dev eth0 parent 1: protocol ip prio 20 basic classid 1:30

After finishing this configuration, I ran the iperf  for measuring the network BW.

Iperf showd about 10mbps in each group.

10mbps is the rate of class 1:30, default class.

 

When I send a data in group foo or group bob, the data rate is equal to default class 1:30 rate,

so I think kernel couldn't identify classified packet from normal packet.

What is wrong?

 

I expect your kindness.

 

- Cheiyol Kim

 

*************************************************************************************

 

This is the iproute patch

 

--- ./iproute2-2.6.29-1/tc/Makefile     2009-03-25 07:40:54.000000000 +0900
+++ ./iproute2-2.6.29-1-mod/tc/Makefile 2009-06-02 17:33:21.000000000 +0900
@@ -20,6 +20,7 @@
 TCMODULES += f_fw.o
 TCMODULES += f_basic.o
 TCMODULES += f_flow.o
+TCMODULES += f_cgroup.o
 TCMODULES += q_dsmark.o
 TCMODULES += q_gred.o
 TCMODULES += f_tcindex.o

--- ./iproute2-2.6.29-1/tc/NULL 1970-01-01 09:00:00.000000000 +0900
+++ ./iproute2-2.6.29-1-mod/tc/f_cgroup.c       2009-06-02 17:32:47.000000000 +0900
@@ -0,0 +1,101 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include "utils.h"
+#include "tc_util.h"
+#include "m_ematch.h"
+
+static void explain(void)
+{
+       fprintf(stderr, "Usage: ... cgroup [ match EMATCH_TREE ] [ police POLICE_SPEC ]\n");
+       fprintf(stderr, "                 [ action ACTION_SPEC ]\n");
+}
+
+static int cgroup_parse_opt(struct filter_util *qu, char *handle,
+                          int argc, char **argv, struct nlmsghdr *n) {
+       struct tcmsg *t = NLMSG_DATA(n);
+       struct rtattr *tail;
+       long h = 0;
+
+       if (handle) {
+               h = strtol(handle, NULL, 0);
+               if (h == LONG_MIN || h == LONG_MAX) {
+                       fprintf(stderr, "Illegal handle \"%s\", must be numeric.\n",
+                           handle);
+                       return -1;
+               }
+       }
+
+       t->tcm_handle = h;
+
+       tail = (struct rtattr*)(((void*)n)+NLMSG_ALIGN(n->nlmsg_len));
+       addattr_l(n, MAX_MSG, TCA_OPTIONS, NULL, 0);
+
+       while (argc > 0) {
+               if (matches(*argv, "match") == 0) {
+                       NEXT_ARG();
+                       if (parse_ematch(&argc, &argv, TCA_CGROUP_EMATCHES, n)) {
+                               fprintf(stderr, "Illegal \"ematch\"\n");
+                               return -1;
+                       }
+                       continue;
+               } else if (matches(*argv, "action") == 0) {
+                       NEXT_ARG();
+                       if (parse_action(&argc, &argv, TCA_CGROUP_ACT, n)) {
+                               fprintf(stderr, "Illegal \"action\"\n");
+                               return -1;
+                       }
+                       continue;
+
+               } else if (matches(*argv, "police") == 0) {
+                       NEXT_ARG();
+                       if (parse_police(&argc, &argv, TCA_CGROUP_POLICE, n)) {
+                               fprintf(stderr, "Illegal \"police\"\n");
+                               return -1;
+                       }
+                       continue;
+               } else if (strcmp(*argv, "help") == 0) {
+                       explain();
+                       return -1;
+               } else {
+                       fprintf(stderr, "What is \"%s\"?\n", *argv);
+                       explain();
+                       return -1;
+               }
+               argc--; argv++;
+       }
+
+       tail->rta_len = (((void*)n)+n->nlmsg_len) - (void*)tail;
+       return 0;
+}
+
+static int cgroup_print_opt(struct filter_util *qu, FILE *f,
+                          struct rtattr *opt, __u32 handle) {
+       struct rtattr *tb[TCA_CGROUP_MAX+1];
+
+       if (opt == NULL)
+               return 0;
+
+       parse_rtattr_nested(tb, TCA_CGROUP_MAX, opt);
+
+       if (handle)
+               fprintf(f, "handle 0x%x ", handle);
+
+       if (tb[TCA_CGROUP_EMATCHES])
+               print_ematch(f, tb[TCA_CGROUP_EMATCHES]);
+
+       if (tb[TCA_CGROUP_POLICE]) {
+               fprintf(f, "\n");
+               tc_print_police(f, tb[TCA_CGROUP_POLICE]);
+       }
+
+       if (tb[TCA_CGROUP_ACT])
+               tc_print_action(f, tb[TCA_CGROUP_ACT]);
+
+       return 0;
+}
+
+struct filter_util cgroup_filter_util = {
+       .id = "cgroup",
+       .parse_fopt = cgroup_parse_opt,
+       .print_fopt = cgroup_print_opt,
+};

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [HELP] for using class group classifier network controller
  2009-06-15  0:56 ` 김재열
  (?)
  (?)
@ 2009-06-15  2:36 ` Minoru Usui
  -1 siblings, 0 replies; 12+ messages in thread
From: Minoru Usui @ 2009-06-15  2:36 UTC (permalink / raw)
  To: 김재열
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	tgraf-wEGCiKHe2LqWVfeAwA7xHQ

Hi, Cheiyol

> # classid 1:10
> 
> echo 0x1000A > /dev/cpuctl/foo/net_cls.classid
> 
> #classid 1:20
> 
> echo 0x10014 > /dev/cpuctl/bob/net_cls.classid

(snip)

> # add class 1:10 for foo group
> 
> $TC class add dev eth0 parent 1:0 classid 1:10 htb rate 50mbit
> 
> # add class 1:20 for bob group
> 
> $TC class add dev eth0 parent 1:0 classid 1:20 htb rate 30mbit
> 
> # default class
> 
> $TC class add dev eth0 parent 1:0 classid 1:30 htb rate 10mbit

In class ID to use TC, both a major number and a minor number are hexadecimal.
So 1:10 equals 0x00010010.

I think, you should set 0x10010 to net_cls.classid if you classify to 1:10.
-- 
Minoru Usui <usui-vEbCzmPPqHe45+QrQBaojngSJqDPrsil@public.gmane.org>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [HELP] for using class group classifier network controller
  2009-06-15  0:56 ` 김재열
  (?)
@ 2009-06-15  2:36 ` Minoru Usui
  2009-06-15 10:30   ` Thomas Graf
       [not found]   ` <20090615113609.db5c0613.usui-vEbCzmPPqHe45+QrQBaojngSJqDPrsil@public.gmane.org>
  -1 siblings, 2 replies; 12+ messages in thread
From: Minoru Usui @ 2009-06-15  2:36 UTC (permalink / raw)
  To: 김재열; +Cc: tgraf, netdev, containers

Hi, Cheiyol

> # classid 1:10
> 
> echo 0x1000A > /dev/cpuctl/foo/net_cls.classid
> 
> #classid 1:20
> 
> echo 0x10014 > /dev/cpuctl/bob/net_cls.classid

(snip)

> # add class 1:10 for foo group
> 
> $TC class add dev eth0 parent 1:0 classid 1:10 htb rate 50mbit
> 
> # add class 1:20 for bob group
> 
> $TC class add dev eth0 parent 1:0 classid 1:20 htb rate 30mbit
> 
> # default class
> 
> $TC class add dev eth0 parent 1:0 classid 1:30 htb rate 10mbit

In class ID to use TC, both a major number and a minor number are hexadecimal.
So 1:10 equals 0x00010010.

I think, you should set 0x10010 to net_cls.classid if you classify to 1:10.
-- 
Minoru Usui <usui@mxm.nes.nec.co.jp>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [HELP] for using class group classifier network controller
       [not found]   ` <20090615113609.db5c0613.usui-vEbCzmPPqHe45+QrQBaojngSJqDPrsil@public.gmane.org>
@ 2009-06-15 10:30     ` Thomas Graf
  0 siblings, 0 replies; 12+ messages in thread
From: Thomas Graf @ 2009-06-15 10:30 UTC (permalink / raw)
  To: Minoru Usui
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA

On Mon, Jun 15, 2009 at 11:36:09AM +0900, Minoru Usui wrote:
> Hi, Cheiyol
> 
> > # classid 1:10
> > 
> > echo 0x1000A > /dev/cpuctl/foo/net_cls.classid
> > 
> > #classid 1:20
> > 
> > echo 0x10014 > /dev/cpuctl/bob/net_cls.classid
> 
> (snip)
> 
> > # add class 1:10 for foo group
> > 
> > $TC class add dev eth0 parent 1:0 classid 1:10 htb rate 50mbit
> > 
> > # add class 1:20 for bob group
> > 
> > $TC class add dev eth0 parent 1:0 classid 1:20 htb rate 30mbit
> > 
> > # default class
> > 
> > $TC class add dev eth0 parent 1:0 classid 1:30 htb rate 10mbit
> 
> In class ID to use TC, both a major number and a minor number are hexadecimal.
> So 1:10 equals 0x00010010.
> 
> I think, you should set 0x10010 to net_cls.classid if you classify to 1:10.

That's right, both net_cls.classid and tc use integers in hexadecimal form
for both, printing and parsing.

10:10 -> 0x100010
10:20 -> 0x100020

This seems to be the weak point regarding usability that's why I like
Minoru Usui's patch so much. It would no longer be necessary to really
understand the internals of classids etc.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [HELP] for using class group classifier network controller
  2009-06-15  2:36 ` Minoru Usui
@ 2009-06-15 10:30   ` Thomas Graf
       [not found]     ` <20090615103020.GA8894-PfSpb0PWhxZc2C7mugBRk2EX/6BAtgUQ@public.gmane.org>
  2009-06-22 18:05     ` Paul Menage
       [not found]   ` <20090615113609.db5c0613.usui-vEbCzmPPqHe45+QrQBaojngSJqDPrsil@public.gmane.org>
  1 sibling, 2 replies; 12+ messages in thread
From: Thomas Graf @ 2009-06-15 10:30 UTC (permalink / raw)
  To: Minoru Usui; +Cc: 김재열, netdev, containers

On Mon, Jun 15, 2009 at 11:36:09AM +0900, Minoru Usui wrote:
> Hi, Cheiyol
> 
> > # classid 1:10
> > 
> > echo 0x1000A > /dev/cpuctl/foo/net_cls.classid
> > 
> > #classid 1:20
> > 
> > echo 0x10014 > /dev/cpuctl/bob/net_cls.classid
> 
> (snip)
> 
> > # add class 1:10 for foo group
> > 
> > $TC class add dev eth0 parent 1:0 classid 1:10 htb rate 50mbit
> > 
> > # add class 1:20 for bob group
> > 
> > $TC class add dev eth0 parent 1:0 classid 1:20 htb rate 30mbit
> > 
> > # default class
> > 
> > $TC class add dev eth0 parent 1:0 classid 1:30 htb rate 10mbit
> 
> In class ID to use TC, both a major number and a minor number are hexadecimal.
> So 1:10 equals 0x00010010.
> 
> I think, you should set 0x10010 to net_cls.classid if you classify to 1:10.

That's right, both net_cls.classid and tc use integers in hexadecimal form
for both, printing and parsing.

10:10 -> 0x100010
10:20 -> 0x100020

This seems to be the weak point regarding usability that's why I like
Minoru Usui's patch so much. It would no longer be necessary to really
understand the internals of classids etc.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Devel] Re: [HELP] for using class group classifier network controller
       [not found]     ` <20090615103020.GA8894-PfSpb0PWhxZc2C7mugBRk2EX/6BAtgUQ@public.gmane.org>
@ 2009-06-22 18:05       ` Paul Menage
  0 siblings, 0 replies; 12+ messages in thread
From: Paul Menage @ 2009-06-22 18:05 UTC (permalink / raw)
  To: Minoru Usui, 김재열,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA

On Mon, Jun 15, 2009 at 3:30 AM, Thomas Graf<tgraf-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org> wrote:
>
> That's right, both net_cls.classid and tc use integers in hexadecimal form
> for both, printing and parsing.

net_cls.classid accepts integers in hexadecimal or decimal, and
reports in decimal.

Paul

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Devel] Re: [HELP] for using class group classifier network controller
  2009-06-15 10:30   ` Thomas Graf
       [not found]     ` <20090615103020.GA8894-PfSpb0PWhxZc2C7mugBRk2EX/6BAtgUQ@public.gmane.org>
@ 2009-06-22 18:05     ` Paul Menage
  1 sibling, 0 replies; 12+ messages in thread
From: Paul Menage @ 2009-06-22 18:05 UTC (permalink / raw)
  To: Minoru Usui, 김재열, netdev, containers

On Mon, Jun 15, 2009 at 3:30 AM, Thomas Graf<tgraf@infradead.org> wrote:
>
> That's right, both net_cls.classid and tc use integers in hexadecimal form
> for both, printing and parsing.

net_cls.classid accepts integers in hexadecimal or decimal, and
reports in decimal.

Paul

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [HELP] for using class group classifier network controller
       [not found] ` <d89801c9ef32$cdfcf480$8310fe81-tRM8rG9f+DVhl2p70BpVqQ@public.gmane.org>
@ 2009-06-18  4:13   ` Minoru Usui
  0 siblings, 0 replies; 12+ messages in thread
From: Minoru Usui @ 2009-06-18  4:13 UTC (permalink / raw)
  To: Chei-Yol Kim
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	tgraf-wEGCiKHe2LqWVfeAwA7xHQ

> when I set the classid to 0x10010, class 1:10's packet count was increased. 
> But, according to your configuration, every packet has to flowed to 1:10 class. 

Yes, you are right.

> Of course I know that the net_cls can't classify all packet because of the getting classid from the current task. 
> Even though we consider it, Many packets are flowed to 1:30 class. 
> therefore, the rate of the socket showed about 30mbps. This is the 1:30 class's rate.
> I think it's because that 1:30 class is the default class. 
> When I changed the default to 20, the rate was varied to 20mbps, class 1:20's rate.
>
> 
> To measure this rate, I used the iperf and scp command. Two results are the same.
> How about your experiment's result? 
> Would you check the accurate rate of the network using applications like a iperf?

I did same experience with nuttcp, I observed the same result, too.
(Almost packets were classified into default classid.)
 
> By the results of my experiments, net_cls couldn't control the network rate of the group. 
> What is your opinion?

I agree with you.
I'm going to investigate this problem. 

-- 
Minoru Usui <usui-vEbCzmPPqHe45+QrQBaojngSJqDPrsil@public.gmane.org>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [HELP] for using class group classifier network controller
       [not found] <d89801c9ef32$cdfcf480$8310fe81@etri.info>
       [not found] ` <d89801c9ef32$cdfcf480$8310fe81-tRM8rG9f+DVhl2p70BpVqQ@public.gmane.org>
@ 2009-06-18  4:13 ` Minoru Usui
  1 sibling, 0 replies; 12+ messages in thread
From: Minoru Usui @ 2009-06-18  4:13 UTC (permalink / raw)
  To: Chei-Yol Kim; +Cc: netdev, containers, tgraf

> when I set the classid to 0x10010, class 1:10's packet count was increased. 
> But, according to your configuration, every packet has to flowed to 1:10 class. 

Yes, you are right.

> Of course I know that the net_cls can't classify all packet because of the getting classid from the current task. 
> Even though we consider it, Many packets are flowed to 1:30 class. 
> therefore, the rate of the socket showed about 30mbps. This is the 1:30 class's rate.
> I think it's because that 1:30 class is the default class. 
> When I changed the default to 20, the rate was varied to 20mbps, class 1:20's rate.
>
> 
> To measure this rate, I used the iperf and scp command. Two results are the same.
> How about your experiment's result? 
> Would you check the accurate rate of the network using applications like a iperf?

I did same experience with nuttcp, I observed the same result, too.
(Almost packets were classified into default classid.)
 
> By the results of my experiments, net_cls couldn't control the network rate of the group. 
> What is your opinion?

I agree with you.
I'm going to investigate this problem. 

-- 
Minoru Usui <usui@mxm.nes.nec.co.jp>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [HELP] for using class group classifier network controller
       [not found] ` <9f8101c9ed80$b730b830$8310fe81-tRM8rG9f+DVhl2p70BpVqQ@public.gmane.org>
@ 2009-06-15  8:18   ` Minoru Usui
  0 siblings, 0 replies; 12+ messages in thread
From: Minoru Usui @ 2009-06-15  8:18 UTC (permalink / raw)
  To: Chei-Yol Kim
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	tgraf-wEGCiKHe2LqWVfeAwA7xHQ

On Mon, 15 Jun 2009 15:15:44 +0900
"Chei-Yol Kim" <gauri-mINagvnPBMnWF1p7bDn8Kw@public.gmane.org> wrote:

> 
> 
> >Hi, Cheiyol 
> > 
> >> # classid 1:10 
> >> 
> >> echo 0x1000A > /dev/cpuctl/foo/net_cls.classid 
> >> 
> >> #classid 1:20 
> >> 
> >> echo 0x10014 > /dev/cpuctl/bob/net_cls.classid 
> > 
> >(snip) 
> > 
> >> # add class 1:10 for foo group 
> >> 
> >> $TC class add dev eth0 parent 1:0 classid 1:10 htb rate 50mbit 
> >> 
> >> # add class 1:20 for bob group 
> >> 
> >> $TC class add dev eth0 parent 1:0 classid 1:20 htb rate 30mbit 
> >> 
> >> # default class 
> >> 
> >> $TC class add dev eth0 parent 1:0 classid 1:30 htb rate 10mbit 
> 
> >In class ID to use TC, both a major number and a minor number are hexadecimal. 
> >So 1:10 equals 0x00010010. 
> > 
> >I think, you should set 0x10010 to net_cls.classid if you classify to 1:10. 
> 
> 
> I have done this by your advice. But it didn't work.
> I followed the instructions by http://thread.gmane.org/gmane.linux.network/108551/focus=108661
> So I supposed classid 1:10 is the decimal number, so I set the 0xA0001 as 1:10.
>  
> I'm curious if this patch net_cls operates well in other's hands.
> How about you?
> Does your system using net_cls operate well?
> If then, would you let me know the environment and configuration of your system.
> I would reference your environment for solving my problem.

Which is your problem?

  a) network packet can't be classified into the class which is set to net_cls.classid

  b) network packet can be classified into the class which is set to net_cls.classid, 
     but its bandwidth limit doesn't work correctly.

If your problem is b), unfortunately I can't help you. 
Because I am a begginer of cls_cgroup, and I haven't tested enough.
(But I think I might be facing same problem.)

If your problem is a), you should check 'tc -s filter show'.
You can see the result of classifing by cls_cgroup.
I can classified to the class which is set to root's net_cls.classid.

Environment: 
  kernel: 2.6.30
  tc: iproute2-2.6.29-1 with tc/f_cgroup.c patch in latest git.
      (I think it's same, probably)

How to use:
  1) set to qdisc, class, filter

     # tc qdisc add dev bond0 root handle 1: htb default 30

     # tc class add dev bond0 parent 1:0 classid 1:10 htb rate 1mbit
     # tc class add dev bond0 parent 1:0 classid 1:20 htb rate 2mbit
     # tc class add dev bond0 parent 1:0 classid 1:30 htb rate 3mbit

     # tc filter add dev bond0 protocol ip parent 1: prio 1 handle 0x1 cgroup

     # tc -s class show dev bond0
     class htb 1:10 root prio 0 rate 1000Kbit ceil 1000Kbit burst 1724b cburst 1724b 
      Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)                         <- packet count is 0
      rate 0bit 0pps backlog 0b 0p requeues 0 
      lended: 0 borrowed: 0 giants: 0
      tokens: 13476 ctokens: 13476

     class htb 1:20 root prio 0 rate 2000Kbit ceil 2000Kbit burst 1849b cburst 1849b 
      Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
      rate 0bit 0pps backlog 0b 0p requeues 0 
      lended: 0 borrowed: 0 giants: 0
      tokens: 7226 ctokens: 7226

     class htb 1:30 root prio 0 rate 3000Kbit ceil 3000Kbit burst 1974b cburst 1974b 
      Sent 25804 bytes 214 pkt (dropped 0, overlimits 0 requeues 0) 
      rate 3992bit 4pps backlog 0b 0p requeues 0 
      lended: 214 borrowed: 0 giants: 0
      tokens: 4851 ctokens: 4851

  2) mount cls_cgroup and set root's net_cls.classid

     # mount -t cgroup -onet_cls none /cgroup/net/
     # cd /cgroup/net/
     # ls
     net_cls.classid  notify_on_release  release_agent  tasks

     # echo 0x10010 > net_cls.classid                 # I want to classify 1:10
     # cat net_cls.classid 
     65552                                            # 65552 = 65536 + 16 = 0x10010

  3) using network

  4) check the packet which is classified to the class which is set to net_cls.classid.

     # /home/usui/src/iproute2-2.6.29-1/tc/tc -s class show dev bond0
     class htb 1:10 root prio 0 rate 1000Kbit ceil 1000Kbit burst 1724b cburst 1724b 
      Sent 11238 bytes 95 pkt (dropped 0, overlimits 0 requeues 0)                    <- increase packet count
      rate 2944bit 3pps backlog 0b 0p requeues 0 
      lended: 95 borrowed: 0 giants: 0
      tokens: 12601 ctokens: 12601

     class htb 1:20 root prio 0 rate 2000Kbit ceil 2000Kbit burst 1849b cburst 1849b 
      Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
      rate 0bit 0pps backlog 0b 0p requeues 0 
      lended: 0 borrowed: 0 giants: 0
      tokens: 7226 ctokens: 7226

     class htb 1:30 root prio 0 rate 3000Kbit ceil 3000Kbit burst 1974b cburst 1974b 
      Sent 46092 bytes 342 pkt (dropped 0, overlimits 0 requeues 0) 
      rate 320bit 0pps backlog 0b 0p requeues 0 
      lended: 342 borrowed: 0 giants: 0
      tokens: 5017 ctokens: 5017


-- 
Minoru Usui <usui-vEbCzmPPqHe45+QrQBaojngSJqDPrsil@public.gmane.org>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [HELP] for using class group classifier network controller
       [not found] <9f8101c9ed80$b730b830$8310fe81@etri.info>
       [not found] ` <9f8101c9ed80$b730b830$8310fe81-tRM8rG9f+DVhl2p70BpVqQ@public.gmane.org>
@ 2009-06-15  8:18 ` Minoru Usui
  1 sibling, 0 replies; 12+ messages in thread
From: Minoru Usui @ 2009-06-15  8:18 UTC (permalink / raw)
  To: Chei-Yol Kim; +Cc: tgraf, netdev, containers

On Mon, 15 Jun 2009 15:15:44 +0900
"Chei-Yol Kim" <gauri@etri.re.kr> wrote:

> 
> 
> >Hi, Cheiyol 
> > 
> >> # classid 1:10 
> >> 
> >> echo 0x1000A > /dev/cpuctl/foo/net_cls.classid 
> >> 
> >> #classid 1:20 
> >> 
> >> echo 0x10014 > /dev/cpuctl/bob/net_cls.classid 
> > 
> >(snip) 
> > 
> >> # add class 1:10 for foo group 
> >> 
> >> $TC class add dev eth0 parent 1:0 classid 1:10 htb rate 50mbit 
> >> 
> >> # add class 1:20 for bob group 
> >> 
> >> $TC class add dev eth0 parent 1:0 classid 1:20 htb rate 30mbit 
> >> 
> >> # default class 
> >> 
> >> $TC class add dev eth0 parent 1:0 classid 1:30 htb rate 10mbit 
> 
> >In class ID to use TC, both a major number and a minor number are hexadecimal. 
> >So 1:10 equals 0x00010010. 
> > 
> >I think, you should set 0x10010 to net_cls.classid if you classify to 1:10. 
> 
> 
> I have done this by your advice. But it didn't work.
> I followed the instructions by http://thread.gmane.org/gmane.linux.network/108551/focus=108661
> So I supposed classid 1:10 is the decimal number, so I set the 0xA0001 as 1:10.
>  
> I'm curious if this patch net_cls operates well in other's hands.
> How about you?
> Does your system using net_cls operate well?
> If then, would you let me know the environment and configuration of your system.
> I would reference your environment for solving my problem.

Which is your problem?

  a) network packet can't be classified into the class which is set to net_cls.classid

  b) network packet can be classified into the class which is set to net_cls.classid, 
     but its bandwidth limit doesn't work correctly.

If your problem is b), unfortunately I can't help you. 
Because I am a begginer of cls_cgroup, and I haven't tested enough.
(But I think I might be facing same problem.)

If your problem is a), you should check 'tc -s filter show'.
You can see the result of classifing by cls_cgroup.
I can classified to the class which is set to root's net_cls.classid.

Environment: 
  kernel: 2.6.30
  tc: iproute2-2.6.29-1 with tc/f_cgroup.c patch in latest git.
      (I think it's same, probably)

How to use:
  1) set to qdisc, class, filter

     # tc qdisc add dev bond0 root handle 1: htb default 30

     # tc class add dev bond0 parent 1:0 classid 1:10 htb rate 1mbit
     # tc class add dev bond0 parent 1:0 classid 1:20 htb rate 2mbit
     # tc class add dev bond0 parent 1:0 classid 1:30 htb rate 3mbit

     # tc filter add dev bond0 protocol ip parent 1: prio 1 handle 0x1 cgroup

     # tc -s class show dev bond0
     class htb 1:10 root prio 0 rate 1000Kbit ceil 1000Kbit burst 1724b cburst 1724b 
      Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)                         <- packet count is 0
      rate 0bit 0pps backlog 0b 0p requeues 0 
      lended: 0 borrowed: 0 giants: 0
      tokens: 13476 ctokens: 13476

     class htb 1:20 root prio 0 rate 2000Kbit ceil 2000Kbit burst 1849b cburst 1849b 
      Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
      rate 0bit 0pps backlog 0b 0p requeues 0 
      lended: 0 borrowed: 0 giants: 0
      tokens: 7226 ctokens: 7226

     class htb 1:30 root prio 0 rate 3000Kbit ceil 3000Kbit burst 1974b cburst 1974b 
      Sent 25804 bytes 214 pkt (dropped 0, overlimits 0 requeues 0) 
      rate 3992bit 4pps backlog 0b 0p requeues 0 
      lended: 214 borrowed: 0 giants: 0
      tokens: 4851 ctokens: 4851

  2) mount cls_cgroup and set root's net_cls.classid

     # mount -t cgroup -onet_cls none /cgroup/net/
     # cd /cgroup/net/
     # ls
     net_cls.classid  notify_on_release  release_agent  tasks

     # echo 0x10010 > net_cls.classid                 # I want to classify 1:10
     # cat net_cls.classid 
     65552                                            # 65552 = 65536 + 16 = 0x10010

  3) using network

  4) check the packet which is classified to the class which is set to net_cls.classid.

     # /home/usui/src/iproute2-2.6.29-1/tc/tc -s class show dev bond0
     class htb 1:10 root prio 0 rate 1000Kbit ceil 1000Kbit burst 1724b cburst 1724b 
      Sent 11238 bytes 95 pkt (dropped 0, overlimits 0 requeues 0)                    <- increase packet count
      rate 2944bit 3pps backlog 0b 0p requeues 0 
      lended: 95 borrowed: 0 giants: 0
      tokens: 12601 ctokens: 12601

     class htb 1:20 root prio 0 rate 2000Kbit ceil 2000Kbit burst 1849b cburst 1849b 
      Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
      rate 0bit 0pps backlog 0b 0p requeues 0 
      lended: 0 borrowed: 0 giants: 0
      tokens: 7226 ctokens: 7226

     class htb 1:30 root prio 0 rate 3000Kbit ceil 3000Kbit burst 1974b cburst 1974b 
      Sent 46092 bytes 342 pkt (dropped 0, overlimits 0 requeues 0) 
      rate 320bit 0pps backlog 0b 0p requeues 0 
      lended: 342 borrowed: 0 giants: 0
      tokens: 5017 ctokens: 5017


-- 
Minoru Usui <usui@mxm.nes.nec.co.jp>

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2009-06-22 18:05 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-15  0:56 [HELP] for using class group classifier network controller 김재열
2009-06-15  0:56 ` 김재열
2009-06-15  2:36 ` Minoru Usui
2009-06-15 10:30   ` Thomas Graf
     [not found]     ` <20090615103020.GA8894-PfSpb0PWhxZc2C7mugBRk2EX/6BAtgUQ@public.gmane.org>
2009-06-22 18:05       ` [Devel] " Paul Menage
2009-06-22 18:05     ` Paul Menage
     [not found]   ` <20090615113609.db5c0613.usui-vEbCzmPPqHe45+QrQBaojngSJqDPrsil@public.gmane.org>
2009-06-15 10:30     ` Thomas Graf
2009-06-15  2:36 ` Minoru Usui
     [not found] <9f8101c9ed80$b730b830$8310fe81@etri.info>
     [not found] ` <9f8101c9ed80$b730b830$8310fe81-tRM8rG9f+DVhl2p70BpVqQ@public.gmane.org>
2009-06-15  8:18   ` Minoru Usui
2009-06-15  8:18 ` Minoru Usui
     [not found] <d89801c9ef32$cdfcf480$8310fe81@etri.info>
     [not found] ` <d89801c9ef32$cdfcf480$8310fe81-tRM8rG9f+DVhl2p70BpVqQ@public.gmane.org>
2009-06-18  4:13   ` Minoru Usui
2009-06-18  4:13 ` Minoru Usui

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.