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

/usr/local/share/p4c/p4include/v1model.p4(403) enum HashAlgorithm #6

Closed reachcool closed 2 years ago

reachcool commented 4 years ago

I have git your project and get errors when make it! At first, I think I should re build a new p4c, but the same error come out again after I git and make a new p4c. How could I fix this bug? what like bellow:

p4@p4:~/ddosm-p4$ make /usr/local/bin/p4c -b bmv2 -Isrc -o build src/ddosm.p4 src/ddosm.p4(132): [--Wwarn=deprecated] warning: mark_to_drop: Using deprecated feature mark_to_ndard_metadata) instead. mark_to_drop(); ^^^^^^^^^^^^ /usr/local/share/p4c/p4include/v1model.p4(415) extern void mark_to_drop(); ^^^^^^^^^^^^ src/ddosm.p4(191): [--Werror=type-error] error: HashAlgorithm.h1: Invalid enum tag hash(h1, HashAlgorithm.h1, 32w0, {ipv4_addr}, 32w0xffffffff); ^^^^^^^^^^^^^^^^ src/ddosm.p4(191): [--Werror=type-error] error: hash: Cannot unify Type(HashAlgorithm) to HashAl hash(h1, HashAlgorithm.h1, 32w0, {ipv4_addr}, 32w0xffffffff); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/local/share/p4c/p4include/v1model.p4(403) enum HashAlgorithm { ^^^^^^^^^^^^^ src/ddosm.p4(192): [--Werror=type-error] error: HashAlgorithm.h2: Invalid enum tag hash(h2, HashAlgorithm.h2, 32w0, {ipv4_addr}, 32w0xffffffff); ^^^^^^^^^^^^^^^^ src/ddosm.p4(192): [--Werror=type-error] error: hash: Cannot unify Type(HashAlgorithm) to HashAl hash(h2, HashAlgorithm.h2, 32w0, {ipv4_addr}, 32w0xffffffff); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/local/share/p4c/p4include/v1model.p4(403) enum HashAlgorithm { ^^^^^^^^^^^^^ src/ddosm.p4(193): [--Werror=type-error] error: HashAlgorithm.h3: Invalid enum tag hash(h3, HashAlgorithm.h3, 32w0, {ipv4_addr}, 32w0xffffffff); ^^^^^^^^^^^^^^^^ src/ddosm.p4(193): [--Werror=type-error] error: hash: Cannot unify Type(HashAlgorithm) to HashAl hash(h3, HashAlgorithm.h3, 32w0, {ipv4_addr}, 32w0xffffffff); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/local/share/p4c/p4include/v1model.p4(403) enum HashAlgorithm { ^^^^^^^^^^^^^ src/ddosm.p4(194): [--Werror=type-error] error: HashAlgorithm.h4: Invalid enum tag hash(h4, HashAlgorithm.h4, 32w0, {ipv4_addr}, 32w0xffffffff); ^^^^^^^^^^^^^^^^ src/ddosm.p4(194): [--Werror=type-error] error: hash: Cannot unify Type(HashAlgorithm) to HashAl hash(h4, HashAlgorithm.h4, 32w0, {ipv4_addr}, 32w0xffffffff); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/local/share/p4c/p4include/v1model.p4(403) enum HashAlgorithm { ^^^^^^^^^^^^^ src/ddosm.p4(198): [--Werror=type-error] error: HashAlgorithm.g1: Invalid enum tag hash(g1, HashAlgorithm.g1, 32w0, {ipv4_addr}, 32w0xffffffff); ^^^^^^^^^^^^^^^^ src/ddosm.p4(198): [--Werror=type-error] error: hash: Cannot unify Type(HashAlgorithm) to HashAl hash(g1, HashAlgorithm.g1, 32w0, {ipv4_addr}, 32w0xffffffff); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/local/share/p4c/p4include/v1model.p4(403) enum HashAlgorithm { ^^^^^^^^^^^^^ src/ddosm.p4(199): [--Werror=type-error] error: HashAlgorithm.g2: Invalid enum tag hash(g2, HashAlgorithm.g2, 32w0, {ipv4_addr}, 32w0xffffffff); ^^^^^^^^^^^^^^^^ src/ddosm.p4(199): [--Werror=type-error] error: hash: Cannot unify Type(HashAlgorithm) to HashAl hash(g2, HashAlgorithm.g2, 32w0, {ipv4_addr}, 32w0xffffffff); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/local/share/p4c/p4include/v1model.p4(403) enum HashAlgorithm { ^^^^^^^^^^^^^ src/ddosm.p4(200): [--Werror=type-error] error: HashAlgorithm.g3: Invalid enum tag hash(g3, HashAlgorithm.g3, 32w0, {ipv4_addr}, 32w0xffffffff); ^^^^^^^^^^^^^^^^ src/ddosm.p4(200): [--Werror=type-error] error: hash: Cannot unify Type(HashAlgorithm) to HashAl hash(g3, HashAlgorithm.g3, 32w0, {ipv4_addr}, 32w0xffffffff); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/local/share/p4c/p4include/v1model.p4(403) enum HashAlgorithm { ^^^^^^^^^^^^^ src/ddosm.p4(201): [--Werror=type-error] error: HashAlgorithm.g4: Invalid enum tag hash(g4, HashAlgorithm.g4, 32w0, {ipv4_addr}, 32w0xffffffff); ^^^^^^^^^^^^^^^^ src/ddosm.p4(201): [--Werror=type-error] error: hash: Cannot unify Type(HashAlgorithm) to HashAl hash(g4, HashAlgorithm.g4, 32w0, {ipv4_addr}, 32w0xffffffff); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/local/share/p4c/p4include/v1model.p4(403) enum HashAlgorithm { ^^^^^^^^^^^^^ Makefile:14: recipe for target 'ddosm' failed make: *** [ddosm] Error 1 p4@p4:~/ddosm-p4$

ddosm-p4-make error ddosm-p4-make error-2

asilha commented 4 years ago

Hello, reachcool! Thank you for your interest in our project. I'll get back to you on this issue as soon as possible.

Meanwhile, please paste the output for the following command:

/usr/local/bin/p4c -V

Alexandre

reachcool commented 4 years ago

HI Alexandre I am now at a step of reinstall p4c, and there are some errors here about the make check of p4c I think I thould be git the source coude from ddosd-p4's github site, maybe the author had modified the code of bmv2 and p4c Thanks a lot! after I complete the installation of p4c, I will try make ddosm-p4 again and I will send you a mail if any issues occured! Regards Ruichun Gu

reachcool@163.com

From: Alexandre Ilha Date: 2020-08-11 21:55 To: asilha/ddosm-p4 CC: reachcool; Author Subject: Re: [asilha/ddosm-p4] /usr/local/share/p4c/p4include/v1model.p4(403) enum HashAlgorithm (#6) Hello, reachcool! Thank you for your interest in our project. I'll get back to you on this issue as soon as possible. Meanwhile, please paste the output for the following command: /usr/local/bin/p4c -V Alexandre — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

asilha commented 4 years ago

Dear Ruichun Gu,

Since ddosm-p4 and ddosd-p4 require custom hashing functions (HashAlgorithm.*), you need to use our modified versions of both the P4 compiler and behavioral model, available at these links:

P4C BMv2

To build BMv2, please pay close attention to the dependencies. It took me a long time to get this (hopefully) right! :)

After building, you don't need to install them into your system; it is enough updating the path in the Makefile so that you run the proper binaries.

Let me know if you need further assistance.

Regards,

Alexandre

reachcool commented 4 years ago

Hi Alexandre, I have really configure and make the customed P4C and bmv2 again, and finally it's working after a long time(maybe two weeks with some errors :( ) and I make install them on the path, the ddosm-p4 could make without any issue, a new question is comming: How ddosm-p4's experiments work next ? could you give me some guides about it? Thanks Ruichun Gu

reachcool@163.com

From: Alexandre Ilha Date: 2020-08-12 00:16 To: asilha/ddosm-p4 CC: reachcool; Author Subject: Re: [asilha/ddosm-p4] /usr/local/share/p4c/p4include/v1model.p4(403) enum HashAlgorithm (#6) Dear Ruichun Gu, Since ddosm-p4 and ddosd-p4 require custom hashing functions (HashAlgorithm.*), you need to use our modified versions of the P4 compiler and behavioral model: P4C BMv2 To build BMv2, please pay close attention to the dependencies. It took me a long time to get this (hopefully) right! :) After building, you don't need to install them into your system; it is enough updating the path in the Makefile so that you run the proper binaries. Let me know if you need further assistance. Regards, Alexandre — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

asilha commented 2 years ago

Dear Ruichun, I'm glad you were able to get the prototype working. I'm closing this issue, considering your question concerns experimental setup and procedures. Please let me know if you need further assistance with that. In a few weeks, we're updating this repository to make it easier to use our prototype.

Regards,

Alexandre