tohojo / flent

The FLExible Network Tester.
https://flent.org
Other
431 stars 77 forks source link

Question about custom symbolic diffserv marking names feature #215

Closed olg33 closed 3 years ago

olg33 commented 3 years ago

Hello,

I have a system using the feature that implements custom symbolic diffserv marking names, In the past, I got it working with your help (Issue #203).

Now, I had to replicate settings in another server. First I cloned the VM of the first deployment and reviewed the flentrc file, which has the following lines:

[global] marking_names=10=0x28;12=0x30;14=0x38;16=0x40;18=0x48;20=0x50;26=0x68;34=0x88

Once everything was in place I ran the following test:

flent rrul_var -H 10.111.38.60 --test-parameter bidir_streams=5 --test-parameter markings=10,12,14,16,20

In principle all went fine:

Capture

Simultaneously, I performed a packet capture to see the marks in the traffic generated in the upload traffic as the download one doesn't seem to be marked maybe due to a router blocking, but that is not an issue right now.

Looking at the upload captures I'm not seeing the outcome expected. I should see values of 0x28, 0x30, 0x38, 0x40 and 0x50 in those packets. Instead, I see values like 0x10, 0x0a, ox0e, etc.

Capture

After banging my head for a wile, I would like to ask if you see anything that I may be missing in steps described above?

Any clue would be appreciated.

Thanks!

tohojo commented 3 years ago

olg33 notifications@github.com writes:

Hello,

I have a system using the feature that implements custom symbolic diffserv marking names, In the past, I got it working with your help (Issue #203).

Now, I had to replicate settings in another server. First I cloned the VM of the first deployment and reviewed the flentrc file, which has the following lines:

[global] marking_names=10=0x28;12=0x30;14=0x38;16=0x40;18=0x48;20=0x50;26=0x68;34=0x88

Once everything was in place I ran the following test:

flent rrul_var -H 10.111.38.60 --test-parameter bidir_streams=5 --test-parameter markings=10,12,14,16,20

In principle all went fine:

Capture

Simultaneously, I performed a packet capture to see the marks in the traffic generated in the upload traffic as the download one doesn't seem to be marked maybe due to a router blocking, but that is not an issue right now.

Looking at the upload captures I'm not seeing the outcome expected. I should see values of 0x28, 0x30, 0x38, 0x40 and 0x50 in those packets. Instead, I see values like 0x10, 0x0a, ox0e, etc.

Capture

After banging my head for a wile, I would like to ask if you see anything that I may be missing in steps described above?

Any clue would be appreciated.

Hmm, seems like the configuration is correct on the Flent side. However, note that the values you specify are the values of the entire TOS byte, whereas what wireshark displays is only the DSCP field. So you need to left-shift your values by two bits. I.e., if you want the DSCP field to be 0x28, you need to set the marking to (0x28 << 2) == 0xa0...

0x28 >> 2 is 0x0a, so this seems to be consistent with what you're seeing :)

olg33 commented 3 years ago

Thanks Toke, In order to do further testing with your suggestions, first I got rid of the .flentrc file (in part because it seemed not to be properly read by flent) and inserted the values directly in the command line using the --marking-name parameter described in cf4f3da:

flent rrul_var -H 10.111.38.60 --test-parameter bidir_streams=2 --marking-name 11=0x2C --marking-name 13=0x34 --test-parameter markings=11,13

However, the parameter is not being recognized:

flent: error: unrecognized arguments: --marking-name 11=0x2C --marking-name 13=0x34

is my syntax correct?

tohojo commented 3 years ago

olg33 notifications@github.com writes:

Thanks Toke, In order to do further testing with your suggestions, first I got rid of the .flentrc file (in part because it seemed not to be properly read by flent) and inserted the values directly in the command line using the --marking-name parameter described in cf4f3da:

flent rrul_var -H 10.111.38.60 --test-parameter bidir_streams=2 --marking-name 11=0x2C --marking-name 13=0x34 --test-parameter markings=11,13

However, the parameter is not being recognized:

flent: error: unrecognized arguments: --marking-name 11=0x2C --marking-name 13=0x34

is my syntax correct?

Yeah, should be; what version of Flent are you using?

olg33 commented 3 years ago

This one:

Started Flent 1.9.9-git-b8165da using Python 3.6.9.

olg33 commented 3 years ago

I just reviewed my notes and found the command that actually worked:

./run-flent rrul_var --test-parameter bidir_streams=5 --test-parameter markings=0x28,0x2C,0x34,0x44,0x4C --test-parameter labels='10','11','15','17','19' -H 10.111.38.60 All works good with the above command.

It works with ./run-flent or just with the flent command. Maybe just out of curiosity would I ask what might be the problem when using the --marking-name parameter?

tohojo commented 3 years ago

olg33 notifications@github.com writes:

This one:

Started Flent 1.9.9-git-b8165da using Python 3.6.9.

That's from before the --marking-name parameter was introduced, which would explain why it doesn't work :)

Try doing a 'git pull'...

olg33 commented 3 years ago

I did clone flent:

git clone https://github.com/tohojo/flent

Then installed it:

sudo python3 setup.py install

It is he following release:

Started Flent 1.9.9-git-0024eb9 using Python 3.6.9.

Hopefully this is the right one.

However, when I run flent with any test, I get the following error:

File "/usr/local/bin/flent", line 33, in sys.exit(load_entry_point('flent===1.9.9-git-0024eb9', 'console_scripts', 'flent')()) File "/usr/local/lib/python3.6/dist-packages/flent-1.9.9_git_0024eb9-py3.6.egg/flent/init.py", line 59, in run_flent b.run() File "/usr/local/lib/python3.6/dist-packages/flent-1.9.9_git_0024eb9-py3.6.egg/flent/batch.py", line 617, in run return self.run_test(self.settings, self.settings.DATA_DIR, True) File "/usr/local/lib/python3.6/dist-packages/flent-1.9.9_git_0024eb9-py3.6.egg/flent/batch.py", line 515, in run_test res = self.agg.postprocess(self.agg.aggregate(res)) File "/usr/local/lib/python3.6/dist-packages/flent-1.9.9_git_0024eb9-py3.6.egg/flent/aggregators.py", line 235, in aggregate measurements, metadata, raw_values = self.collect() File "/usr/local/lib/python3.6/dist-packages/flent-1.9.9_git_0024eb9-py3.6.egg/flent/aggregators.py", line 123, in collect t.check() File "/usr/local/lib/python3.6/dist-packages/flent-1.9.9_git_0024eb9-py3.6.egg/flent/runners.py", line 1193, in check self.command = self.find_binary(host=self.host, *args) File "/usr/local/lib/python3.6/dist-packages/flent-1.9.9_git_0024eb9-py3.6.egg/flent/runners.py", line 1268, in find_binary 'localhost'] + pingargs) File "/usr/local/lib/python3.6/dist-packages/flent-1.9.9_git_0024eb9-py3.6.egg/flent/runners.py", line 604, in run_simple proc = subprocess.run(args, capture_output=True, timeout=kill) File "/usr/lib/python3.6/subprocess.py", line 423, in run with Popen(popenargs, **kwargs) as process: TypeError: init() got an unexpected keyword argument 'capture_output'

Was a step in the installation missed?

tohojo commented 3 years ago

olg33 notifications@github.com writes:

I did clone flent:

git clone https://github.com/tohojo/flent

Then installed it:

sudo python3 setup.py install

It is he following release:

Started Flent 1.9.9-git-0024eb9 using Python 3.6.9.

Hopefully this is the right one.

However, when I run flent with any test, I get the following error:

Ah, that's a bug! Seems I accidentally broke support for old versions of Python, my apologies. Pushed a fix, so try doing another 'git pull' and see if that helps :)

olg33 commented 3 years ago

Done! This time all works just fine. :-)

Just one more thing. I'd like to have the marking names declared in the .flentrc file so that I don't have to type them every time I run a test. With that in mind, I created the ~/.flentrc file and added the following lines:

[global] marking_names=10=0x28;11=0x2C;13=0x34;15=0x3C;17=0x44;19=0x4C;21=0x54;23=0x5C

But when I run a test: flent rrul_var -H 10.111.38.60 --test-parameter bidir_streams=2 markings=11,13

The system returns the following error: flent: error: unrecognized arguments: markings=11,13

Looks like the flentrc file is not being read by flent. The file's permissions are as follows:

-rw-r--r-- 1 administrator administrator 755 Dec 8 16:39 .flentrc

Any idea on how can I make it work?

tohojo commented 3 years ago

olg33 notifications@github.com writes:

Done! This time all works just fine. :-)

Just one more thing. I'd like to have the marking names declared in the .flentrc file so that I don't have to type them every time I run a test. With that in mind, I created the ~/.flentrc file and added the following lines:

[global] marking_names=10=0x28;11=0x2C;13=0x34;15=0x3C;17=0x44;19=0x4C;21=0x54;23=0x5C

But when I run a test: flent rrul_var -H 10.111.38.60 --test-parameter bidir_streams=2 markings=11,13

The system returns the following error: flent: error: unrecognized arguments: markings=11,13

You have to repeat --test-parameter for each parameter. So try running:

flent rrul_var -H 10.111.38.60 --test-parameter bidir_streams=2 --test-parameter markings=11,13

You can also double-check the loading of the RC file by running with -v; that should make Flent print out whether it finds the file and which values it loads from it...

olg33 commented 3 years ago

Oops! Right I was forgetting the --test-parameter sentence. I tested again and now all looks good.

As always, thanks for your help.

tohojo commented 3 years ago

olg33 notifications@github.com writes:

Oops! Right I was forgetting the --test-parameter sentence. I tested again and now all looks good.

As always, thanks for your help.

Awesome - you're welcome! :)