tutorials icon indicating copy to clipboard operation
tutorials copied to clipboard

The tenth host's ip address, mac address and how to write the command

Open 1101293857 opened this issue 3 years ago • 4 comments

The first nine hosts can ping each other, but h10 cannot.I think it's the h10 commands error, but don't know how to fix it.thanks for your help.Here is the code in the h10 commands.

"h10": {"ip": "10.0.10.10/24", "mac": "08:00:00:00:0a:aa", "commands":["route add default gw 10.0.a.a0 dev eth0", "arp -i eth0 -s 10.0.a.a0 08:00:00:00:0a:00"]}

1101293857 avatar Sep 29 '22 14:09 1101293857

I believe there was a similar issue with 10 or more switches before, and the root cause ended up being some Python regular expressions that only matched against the pattern s\d with a single decimal digit, rather than s\d+ that matched multiple digits. There might be a similarly limited pattern h\d somewhere in the Python code that is causing the problem you are experiencing.

jafingerhut avatar Sep 30 '22 06:09 jafingerhut

Ah, I was misremembering the root cause of the problem with 10 or more switches. Here is the commit that fixed that limitation: https://github.com/p4lang/tutorials/commit/d9fdc0f446a458061453ea19694a454f3ba7360e

There might be a similar problem in processing host name strings somewhere.

jafingerhut avatar Sep 30 '22 06:09 jafingerhut

With the latest version of p4c, behavioral-model, etc. and this repo, I edited the tutorials/exercises/basic/pod-topo/topology.json file to replace all occurrences of "h4" with "h10", and then ran the basic exercise. I could ping to h10 from other hosts, and ping other hosts from h10.

It would help to have complete details about exactly which version of the tutorials repo you are running with, public links to any files you are using when you experienced the problem, and the steps you took to reproduce the problem.

jafingerhut avatar Oct 01 '22 02:10 jafingerhut

Thanks for your help

1101293857 avatar Oct 02 '22 00:10 1101293857