Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting result of the p4.basic experiment #3

Closed
sepehrabdous opened this issue Mar 11, 2017 · 29 comments
Closed

Getting result of the p4.basic experiment #3

sepehrabdous opened this issue Mar 11, 2017 · 29 comments

Comments

@sepehrabdous
Copy link

Hello,

I have exactly followed your instructions/steps in https://github.com/signorello/NDN.p4
and encountered two problems while using the following code:
sudo minindn $MININDN/p4.ndn.basic.conf --experiment=P4_NDN_experiment --p4

  1. I get the following error:
    minindn: error: unrecognized arguments: --p4

  2. and if I remove --p4 and use
    sudo minindn $MININDN/p4.ndn.basic.conf --experiment=P4_NDN_experiment
    the experiment does nothing and stays without any response; In other words, I don't see any result and it also doesn't finish (I was waiting for a long time).

What is the problem and how can I fix it?

Thanks.
Sepeh

@signorello
Copy link
Owner

signorello commented Mar 13, 2017

Hi Sepeh,

you will not be able to successfully run the experiment without passing to minindn the "--p4" option. You may look at the code in the "bin/minindn" script to see that the option is used to load the programmable P4switch class for the switches in your mininet topology. Without that option, a normal switch, which is not able to execute your p4 program, will be loaded instead.
So, to answer point 1), I would suggest you to check that the patch "mini-ndn.patch" has been applied correctly. Furthermore, if you have applied the patch to the mini-ndn dir, then be also sure that the minindn script you are launching refers to the one you've patched. (please let me know if you need more help on this)
W.r.t. point 2 since the experiment is not supposed to run w/o that option on, you should not worry too much about this condition. In any case, there could be plenty of reasons while it stays pending forever, I am going to check what happens asap.

Thank you for your interest in this work

@sepehrabdous
Copy link
Author

Thank you very much. Let me apply your comment and get back with you asap.

@sepehrabdous
Copy link
Author

Hello,
I reconsidered the steps and as you said, I forgot to apply patch files to mini-ndn, but when I try to apply them to mini-ndn I get the following errors:

  1. with the command: patch -p1 < /home/sepehr/NDN.p4/mini-ndn/mini-ndn.patch
    patching file bin/minindn
    Reversed (or previously applied) patch detected! Assume -R? [n] y
    Hunk Will you post the instructions? #1 succeeded at 1 with fuzz 1.
    Hunk Change to nfd.conf #2 FAILED at 69.
    Hunk Getting result of the p4.basic experiment #3 FAILED at 151.
    Hunk minindn issue #4 succeeded at 214 with fuzz 2 (offset 26 lines).
    Hunk mini-ndn v0.1.1 install error #5 succeeded at 264 (offset 54 lines).
    Hunk I don't understand the output of P4_NDN_experiment,help! #6 succeeded at 276 (offset 54 lines).
    Hunk Try to modify the topology of the experiment,help! #7 FAILED at 257.
    Hunk 版本 #8 FAILED at 277.
    Hunk Index Error in p4src/includes/actions.p4 #9 succeeded at 363 with fuzz 2 (offset 75 lines).
    4 out of 9 hunks FAILED -- saving rejects to file bin/minindn.rej

  2. with the command: patch -p1 < /home/sepehr/NDN.p4/mini-ndn/ndn_dir.patch
    patching file ndn/conf_parser.py
    Hunk Will you post the instructions? #1 succeeded at 1 with fuzz 2.
    patching file ndn/experiments/experiment.py
    Hunk Will you post the instructions? #1 FAILED at 107.
    1 out of 1 hunk FAILED -- saving rejects to file ndn/experiments/experiment.py.rej
    patching file ndn/ndn_host.py
    Hunk Will you post the instructions? #1 succeeded at 103 (offset 2 lines).
    Hunk Change to nfd.conf #2 succeeded at 116 (offset 2 lines).
    patching file ndn/nlsr.py
    Hunk Will you post the instructions? #1 succeeded at 30 with fuzz 2 (offset 9 lines).
    Hunk Change to nfd.conf #2 FAILED at 43.
    1 out of 2 hunks FAILED -- saving rejects to file ndn/nlsr.py.rej

I looked into minindn.rej and nlsr.py.rej but I really didn't understand how to handle my prblems with them.
can you please help me with this problem?
Thank you,
Sepehr Abdous

@signorello
Copy link
Owner

Hi Sepher,
from the error you have posted it seems you are trying to patch different files, so I would suggest you to check that you have the proper version of mini-ndn and mininet installed on your system. If not, you should check those out instead.
I report the required versions in what follows, but they are also listed in the main dir's README file:
mininet ver 2.2.1 and mini-ndn version 0.1.1
I guess the mininet version could also be different without much problems, but the mini-ndn version must be the same. You can check it with a simple 'git status' in the mini-ndn main dir that reports the tag version as first line of the cmd ouput, e.g.,
~/mini-ndn$ git status
HEAD detached at v0.1.1

Hope this helps,
Salvatore

@sepehrabdous
Copy link
Author

Hello, Thank you very much for your help
I installed mini-ndn version 0.1.1 and tried applyin patches again and I got the followint messages which I think means patching is done well:
1)
patching file bin/minindn
2)
patching file ndn/conf_parser.py
patching file ndn/experiments/experiment.py
patching file ndn/ndn_host.py
patching file ndn/nlsr.py

and then I tried running the experiment but again I encountered the following error:
minindn: error: no such option: --p4

so I have two questions:

  1. how to make sure patches are applied correctly?
  2. how to make sure that the minindn script I am launching refers to the one I've patched?

Thank you
Sepehr

@signorello
Copy link
Owner

Hi Sepehr,

  1. if the patch cmd does not give you any error, it means the patches have been applied correctly
  2. for this one, I am going to throw here my two cents, however, I am not an expert of the packaging and installation of python software on *nix-systems, so, please be aware that sth may not be totally correct.
    You can use the whereis (there are plenty of alternatives to find a binary, but let's stick to this) command to locate the binary in your system:
    $ whereis mini-ndn
    minindn: /usr/local/bin/minindn
    but if you look into that file, you may find a few lines of code loading the full script which is located in the package-distribution python folder on your system, for example,
    /usr/local/lib/python2.7/dist-packages/Mini_NDN-0.1.1-py2.7.egg/EGG-INFO/scripts/minindn
    This script should appear like the one you have patched.

One reason why this could not be the case in your system is that after repatching the files, you have not re-installed mini-ndn and so the old binary stays in the package-distribution python folder.

Hope this helps,
Salvatore

@sepehrabdous
Copy link
Author

Hi Salvatore,
Thank you very much for your help.
Fortunately, I could fix the above mentioned error by reinstalling a new VM (UBUNTU 14.04.5 TLS) as well as all the packages. I also encountered a new error on “no such file as p4_mininet" which was solved by copying the file p4_mininet.py from NDN.P4 directory into the $MINI-NDN/ndn/ directory.
Now I can run “sudo minindn $MININDN/p4.ndn.basic.conf --experiment=P4_NDN_experiment --p4” but facing a new error:
Reading config file /usr/local/etc/mini-ndn//p4-switch.conf
Traceback (most recent call last):
File "/usr/local/bin/minindn", line 5, in
pkg_resources.run_script('Mini-NDN==0.1.1', 'minindn')
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 528, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1394, in run_script
execfile(script_filename, namespace, namespace)
File "/usr/local/lib/python2.7/dist-packages/Mini_NDN-0.1.1-py2.7.egg/EGG-INFO/scripts/minindn", line 427, in
execute(options)
File "/usr/local/lib/python2.7/dist-packages/Mini_NDN-0.1.1-py2.7.egg/EGG-INFO/scripts/minindn", line 314, in execute
switch.parseConfig(options.p4Dir + "/p4-switch.conf")
File "/usr/local/lib/python2.7/dist-packages/Mini_NDN-0.1.1-py2.7.egg/ndn/p4_mininet.py", line 116, in parseConfig
self.sw_path = config.get('basic', 'exe')
File "/usr/lib/python2.7/ConfigParser.py", line 330, in get
raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'basic'

please help me to solve it asap. Thanks.

@sepehrabdous
Copy link
Author

Hello,
Fortunately the problem with the error:
ConfigParser.NoSectionError: No section: 'basic'
was solved by bringing the p4-switch.conf and to its right place
now I encountered an error which I have problem dealing with and that is:
when I run the experiment I get the following error:

Could not connect to thrift client on port 9090
Make sure the switch is running and that you have the right port


Parse of /home/sepehr/NDN.p4/mini-ndn/p4.ndn.basic.conf done.
*** Creating network
*** Adding controller
*** Adding hosts:
a b
*** Adding switches:
s1
*** Adding links:
(a, s1) (b, s1)
*** Configuring hosts
a b
Setup time: 4
Reading config file /usr/local/etc/mini-ndn//p4-switch.conf
/home/sepehr/behavioral-model/targets/simple_switch/simple_switch /home/sepehr/behavioral-model/targets/simple_switch/runtime_CLI /home/sepehr/NDN.p4/p4src/ndn_router.json l3 9090 True True /home/sepehr/NDN.p4/ndn_commands.partial.txt
*** Starting controller
c0
*** Starting 1 switches
s1 Starting P4 switch s1
/home/sepehr/behavioral-model/targets/simple_switch/simple_switch -i 1@s1-eth1 -i 2@s1-eth2 --pcap --thrift-port 9090 --nanolog ipc:///tmp/bm-0-log.ipc --log-console --device-id 0 /home/sepehr/NDN.p4/p4src/ndn_router.json
Disable IPv6 forwarding on the P4Switch
switch has been started
Filling switch tables using /home/sepehr/NDN.p4/ndn_commands.partial.txt
Could not connect to thrift client on port 9090
Make sure the switch is running and that you have the right port

I don't start the application
I don't start the application
Loading experiment: P4_NDN_experiment
Printing eth0 faceID: 257

*** Starting CLI:
mininet>


(I tried fixing it by cleaning the mininet but it didn't work.)
can you help me with this please?

Thank you
Sepehr

@sepehrabdous
Copy link
Author

Hi Salvatore, I could not fix the above error yet. I am looking forward to hearing from you. Thanks

@signorello
Copy link
Owner

Hi Sepehr,

the error msg is quite clear, the switch is not running properly and you should check why. I assume you have installed and compiled the p4 bmv2 switch and that you can start it without any problem on your machine. This is listed as second requirement on top of the main dir's README file. Have you done that step?

Salvatore

@sepehrabdous
Copy link
Author

Hi Salvatore,
Sure, I have already done that step and followed the instructions in https://github.com/p4lang/behavioral-model
please help me to fix this error.
Thanks
Sepehr

@signorello
Copy link
Owner

Hi Sepher,
it seems that the switch does not start successfully in your case. Unfortunately, I do not have the same problem on my machine, that's the reason why I could not give you a quick help. However, I have got sth similar when trying a freshly new installation on another machine. So, I'll be back to you soon with a possible fix.
Best,
Salvatore

@sepehrabdous
Copy link
Author

Hello,
You can help me by a new error.
when I try to run the new command bellow:
sudo minindn $MININDN/p4.ndn.basic.conf --no-cli --experiment=P4_NDN_experiment --p4
I get the following output:


*** Starting controller
c0
*** Starting 1 switches
s1 Starting P4 switch s1
/home/sepehr/behavioral-model/targets/simple_switch/simple_switch -i 1@s1-eth1 -i 2@s1-eth2 --pcap --thrift-port 9090 --nanolog ipc:///tmp/bm-0-log.ipc --log-console --device-id 0 /home/sepehr/NDN.p4/p4src/ndn_router.json
Disable IPv6 forwarding on the P4Switch
switch has been started
Filling switch tables using /home/sepehr/NDN.p4/ndn_commands.partial.txt
Could not connect to thrift client on port 9090
Make sure the switch is running and that you have the right port

I don't start the application
I don't start the application
Loading experiment: P4_NDN_experiment
Printing eth0 faceID: 257

*** Stopping 1 controllers
c0
*** Stopping 2 links
..
*** Stopping 1 switches
s1 ..
*** Stopping 2 hosts
a b
*** Done


as you see I encountered the same error "could not connect to thrift client on port 9090"

I've searched about this problem and got something about running the switch so I used the command bellow to do so:

python 1sw_demo.py --behavioral-exe ../targets/simple_router/simple_router --json ../targets/simple_router/simple_router.json

but when I use this command I get the following error running the experiment:


*** Creating network
*** Adding controller
*** Adding hosts:
a b
*** Adding switches:
s1
*** Adding links:
Traceback (most recent call last):
File "/usr/local/bin/minindn", line 5, in
pkg_resources.run_script('Mini-NDN==0.1.1', 'minindn')
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 528, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1394, in run_script
execfile(script_filename, namespace, namespace)
File "/usr/local/lib/python2.7/dist-packages/Mini_NDN-0.1.1-py2.7.egg/EGG-INFO/scripts/minindn", line 427, in
execute(options)
File "/usr/local/lib/python2.7/dist-packages/Mini_NDN-0.1.1-py2.7.egg/EGG-INFO/scripts/minindn", line 299, in execute
net = Mininet(topo,host=NdnHost, switch=P4Switch)
File "build/bdist.linux-x86_64/egg/mininet/net.py", line 172, in init
File "build/bdist.linux-x86_64/egg/mininet/net.py", line 442, in build
File "build/bdist.linux-x86_64/egg/mininet/net.py", line 429, in buildFromTopo
File "build/bdist.linux-x86_64/egg/mininet/net.py", line 364, in addLink
File "build/bdist.linux-x86_64/egg/mininet/link.py", line 424, in init
File "build/bdist.linux-x86_64/egg/mininet/link.py", line 468, in makeIntfPair
File "build/bdist.linux-x86_64/egg/mininet/util.py", line 194, in makeIntfPair
Exception: Error creating interface pair (a-eth0,s1-eth1): RTNETLINK answers: File exists


Is there something wrong about running the switch? or there is another way to handle the error?

Thank you,

Sepehr

@doctorhy doctorhy mentioned this issue Mar 28, 2017
@signorello
Copy link
Owner

Hi Sepher,

sorry for the late answer, I've been a bit busy those days. On a fresh installation, I got a similar problem to the one you have referenced in this issue. Your problem could be due to the switch trying to load a not-existent json file, you may get some confirmation by looking at some switch's log written in "/tmp/p4s.s1.log". I have updated the README and added a json file of the p4 program that was missing in this repo (in case you do not want to compile the program by using p4c-bmv2).

Hope this helps,
Salvatore

@sepehrabdous
Copy link
Author

Hi Salvatore,
Thank you very much,
However, I see no update in your repo.

@signorello
Copy link
Owner

sorry, I forgot to push it into the repo. just done!

@sepehrabdous
Copy link
Author

sepehrabdous commented Mar 30, 2017

Hi Salvatore,

The thrift problem was solved,
Although now the experiment is running, there are some problems in the procedure:

  1. Hello world is not written into the intended .txt file
  2. when I looked into a.log file, some failures were repeatedly happened:
  • 1490813500.739106 INFO: [Transport] [id=260,local=unix:///run/a.sock,remote=fd://20] setState UP -> FAILED
    1490813500.739171 INFO: [Transport] [id=260,local=unix:///run/a.sock,remote=fd://20] setState FAILED -> CLOSED

I also see this error showsup in a.log file after running exit in mininet CLI to finish the experiment:

  • 1490813515.774309 ERROR: [EthernetTransport] [id=257,local=dev://eth0,remote=ether://[01:00:5e:00:17:aa]] pcap_next_ex failed: The interface went down
  1. I added some print methods in the experiment so to see how much the experiment would go on and as I saw the two lines bellow are executed but nothing is written into the intended .txt file:
    host.cmd("ndnpeek -p ndn:/snt/sedan/state/signorello.pdf > packetPayload.txt")
    host.cmd("echo 'Hello world' | ndnpoke -w 30000 ndn:/snt/sedan/state/signorello.pdf &")

@sepehrabdous
Copy link
Author

Hi, Salvatore,
I am looking forward to hearing from you

@signorello
Copy link
Owner

Hi Sepher,
answers point-by-point:
2) those lines are normal log produced by nfd in between the creation and the removal of a face. As you can see from the log level, they are classified as INFO, so you do not need to worry about those for the sake of this experiment.
While the pcap error line is new to me, on which node do you have it? on a or on b or on both?
1-3) I have noticed some timing problem when repeating the experiment that could be due to an incorrect synchronization of instructions calling the application on the mininet hosts. I would suggest you to try the following shortly after the mininet prompt is ready:

mininet> b echo 'Blah' | ndnpoke -w 60000 ndn:/snt/sedan/state/blah.pdf &
mininet> a ndnpeek -p ndn:/snt/sedan/state/blah.pdf

The second command should print you "Blah". Even though I am afraid that because of the pcap error you will not be able to run this test. So, let's try to fix the point 2 first.

@sepehrabdous
Copy link
Author

Hi Salvatore,
Thank you very much
2)I've got the pcap problem in both log files
*I checked, from executing the experiment till when mininet CLI is appeared, there is no pcap problem in the files but when I run "quit" command in mininet CLI, the pcap problem shows up in both a.log and b.log
1-3)as you expected nothing was printed which can be because of the pcap problem

@signorello
Copy link
Owner

Hi Sepher,
I checked the error message you reported from the NFD log of the host nodes and this should be normal when mininet is stopped (It is just the nfd daemon which sees the host interface going down).
What about exiting the mininet prompt? Does it work correctly or do you get any error?

@sepehrabdous
Copy link
Author

Hi salvatore, Thanks for the fast response.
I don't get any error while exiting mininet prompt, and the terminal output is like this:
RuntimeCmd:

I don't start the application
I don't start the application
Loading experiment: P4_NDN_experiment
Printing eth0 faceID: 257
*** Starting CLI:
mininet> exit
*** Stopping 1 controllers
c0
*** Stopping 2 links
..
*** Stopping 1 switches
s1 ..
*** Stopping 2 hosts
a b
*** Done

but still nothing is written in the payloadpacket.txt.

@sepehrabdous
Copy link
Author

Hello Slavatore,
I found that you have changed the file "myExperiment" in the repository. So, I also updated the experiment file to the last version,
and then executed the following command in the mini-ndn directory:

./install.sh -i

and run the experiment. Unfortunately, I still see nothing printed in the packetpayload.txt file.

@signorello
Copy link
Owner

Hi Sepehr,
whenever there is a change committed in the mini-ndn related files (either the patch files or the additional python files), you need to re-patch and reinstall minindn. For the latter, please be also sure to clean previously installed files, I guess the two following commands should do the job:

cd $YOUR_MININDN_DIR
sudo python setup.py clean
sudo python setup.py install

@sepehrabdous
Copy link
Author

Hello Salvatore,
I applied the last changes and commits,
I removed mini-ndn and installed it again and applied the changed patch files and so the problem is solved and "Hello World" is printed in packetpayload.txt.
Thank you very much for your help

@medskept
Copy link

Hello sepehr,
can you tell me please which version of mini-ndn you installed? i have the same problem when i try runing: sudo minindn $MININDN/p4.ndn.basic.conf --experiment=P4_NDN_experiment --p4"

when i try 'get status' to check the version , i get the result below:

root@ubuntu:~/ndn-folder/mini-ndn# git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use "git checkout -- ..." to discard changes in working directory)

    modified:   bin/minindn
    modified:   ndn/conf_parser.py
    modified:   ndn/experiments/experiment.py
    modified:   ndn/ndn_host.py
    modified:   ndn/nlsr.py

Untracked files:
(use "git add ..." to include in what will be committed)

    bin/minindn.orig
    ndn/..rej
    ndn/conf_parser.py.orig
    ndn/experiments.rej
    ndn/experiments/experiment.py.orig
    ndn/ndn_host.py.orig
    ndn/nlsr.py.orig
    npm-debug.log
    p1.orig
    p1.rej

no changes added to commit (use "git add" and/or "git commit -a")
root@ubuntu:~/ndn-folder/mini-ndn#

I see you made it work, can you please help to solve the problem.

@medskept
Copy link

Hello signorello,

The mini-ndn version you are proposing is : 0.3.0, where can i find mini-ndn version 0.1.1 as you recommend.

Thanks for you help

@signorello
Copy link
Owner

Hi,

I do not think I have suggested the version 0.3.0 anywhere, I would really suggest to clean any previous mini-ndn installed on your system, if the version number is not the same, and re-install the indicated version from scratch. You can get the right version of mini-ndn from the official repo by downloading the sources in tar format at
https://github.com/named-data/mini-ndn/releases
or by checking out the 0.1.1 tag from a terminal with
$ git clone https://github.com/named-data/mini-ndn.git
$ git tag -l (to see the available tags and get the right name to use with the next checkout cmd)
$ git checkout v0.1.1

Hope this helps and thanks for checking this repo out.

@medskept
Copy link

Hi,
thank you for your help, i'm going to check this out .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants