asilha / ddosm-p4

Offloading Real-time DDoS Attack Mitigation to Programmable Data Planes
GNU General Public License v3.0
20 stars 7 forks source link

Error while installing P4c Compiler #7

Open bhullarsukh96 opened 2 years ago

bhullarsukh96 commented 2 years ago

To install P4c compiler on ubuntu16.04, i have followed the instructions given in https://github.com/asilha/p4lang-p4c/tree/euclid., but i got this error while running "make -j2" command. please help me to resolve this issue. image

asilha commented 2 years ago

Dear @bhullarsukh96 ,

I appreciate your interest in our project!

We've published a Docker image containing everything you need to run our prototype: our modified p4c and the BMv2 switch.

I assume you're familiar with Docker.

You have two options.

The first and easiest option is to get and run our prebuilt image. Just run, for instance:

docker run -it --rm -v "<your_working_directory>:/workdir" --workdir /workdir asilha/p4lang-p4c:euclid

This command will pull the image and run a container within which you can run p4c and simple_switch.

The second option is using our Dockerfiles to build the images yourself. In this case, you'll need to clone these repositories:

https://github.com/asilha/p4lang-third-party/tree/euclid https://github.com/asilha/p4lang-behavioral-model/tree/euclid https://github.com/asilha/p4lang-p4c/tree/euclid

(Please note that you need to use the euclid branches.)

Next, in all three repositories, you should change the tags in the build.sh scripts; in the second and third repos, you should also change the tags in the Dockerfiles.

Finally, you can docker build them in the same order indicated above.

Be prepared: depending on your hardware, it may take several hours!

Let me know if you need any assistance!

Regards,

Alexandre

bhullarsukh96 commented 2 years ago

Thank you for your quick response. As per suggestion, i have downloaded the docker image and run the experiment with "make" command, but i got this error. image

asilha commented 2 years ago

Whoops! My bad.

Here's a complete example, now with the right images. Please note that I switched to the forwarding branch, which I just updated.

euclid_demo

After you run the simple_switch_CLI, you'll get this output:

euclid_demo2

These are the commands I used:

docker run -it --rm -v "/home/ilha/dev/p4/ddosm-p4:/workdir" --workdir /workdir asilha/p4lang-p4c:v122ok-euclid make

docker network create --driver bridge euclid_input
docker network create --driver bridge euclid_legitimate
docker network create --driver bridge euclid_suspect
docker network create --driver bridge euclid_stats
docker network ls

docker run -dit --rm -v "/home/ilha/dev/p4/ddosm-p4:/workdir" --workdir /workdir --network euclid_input --name euclid asilha/p4lang-behavioral-model:euclid 

docker network connect euclid_legitimate euclid
docker network connect euclid_suspect euclid
docker network connect euclid_stats euclid

docker attach euclid

simple_switch -i 1@euclid-input -i 2@euclid-legitimate -i 3@euclid-suspect -i 4@euclid-stats build/ddosm.json &
ps w | grep simple
simple_switch_CLI < scripts/control_rules.txt
fg

[I'm currently pressed for time; it may take a while before I can get back to you.]

asilha commented 2 years ago

Please make sure you read the annotated control rules.

bhullarsukh96 commented 2 years ago

Thanks for your valuable help. i got the output as shown in screenshot above. i just want to know which topology you have used in the experiment and command used to create the topology with the docker bmv2 switch. Whether i should create the topology in the docker container or in the host operating system. please guide me in creating the topology with this modified bmv2 switch. i am waiting for your positive response. Thanks again.

asilha commented 2 years ago

Dear @bhullarsukh96, I'm currently preparing to defend my graduate thesis, which is due in a few weeks and takes up a lot of time and energy. 😅 After finishing my degree, I'll be more than happy to provide all the much-needed support for this project! I appreciate your patience. Regards, Alexandre

bhullarsukh96 commented 2 years ago

Thanks a lot for your reply. I am waiting for your guidance and support in the project.

On Thu, Jun 2, 2022, 7:30 PM Alexandre Ilha @.***> wrote:

Dear @bhullarsukh96 https://github.com/bhullarsukh96, I'm currently preparing to defend my graduate thesis, which is due in a few weeks and takes up a lot of time and energy. 😅 After finishing my degree, I'll be more than happy to provide all the much-needed support for this project! I appreciate your patience. Regards, Alexandre

— Reply to this email directly, view it on GitHub https://github.com/asilha/ddosm-p4/issues/7#issuecomment-1144902577, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA3ATXL6PVJ52YBQ73C5AMDVNC5BRANCNFSM5UI7P5IA . You are receiving this because you were mentioned.Message ID: @.***>

bhullarsukh96 commented 2 years ago

Dear Sir I have created the topology with 1 Bmv2 switch and 4 hosts. Next, i have inserted the rules in switch with following command: simple_switch_CLI < scripts/control_rules.txt Now I am facing problems with traffic generation, entropy estimation, and detection and mitigation of attack traffic. Please guide me to resolve these issues. I am eagerly waiting for your response. I really want to extend this work in my thesis. Besides you, there is no other help available. Thank you for your valuable help.

On Thu, Jun 2, 2022 at 7:30 PM Alexandre Ilha @.***> wrote:

Dear @bhullarsukh96 https://github.com/bhullarsukh96, I'm currently preparing to defend my graduate thesis, which is due in a few weeks and takes up a lot of time and energy. 😅 After finishing my degree, I'll be more than happy to provide all the much-needed support for this project! I appreciate your patience. Regards, Alexandre

— Reply to this email directly, view it on GitHub https://github.com/asilha/ddosm-p4/issues/7#issuecomment-1144902577, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA3ATXL6PVJ52YBQ73C5AMDVNC5BRANCNFSM5UI7P5IA . You are receiving this because you were mentioned.Message ID: @.***>

--

With Regards

Sukhveer Kaur