devices not detected by onos

27 views
Skip to first unread message

Jacopo Terreri

unread,
Feb 12, 2021, 10:01:24 AM2/12/21
to P4 brigade
Hello everyone,
sorry for my bad english.
I have a problem with onos. 

When I try to push the netcfg.json in ONOS, the devices doesen't appear.
i use the virtual machine "ngsdn_tutorial.ova".
I want to create a simple static network with 1 switch and 2 hosts; the table will be pushed directly with P4runtime shell.
My idea is simple, when the switch detects excessive traffic, the switch send a packet_in to onos, and onos when recive the packet, print a line: "ATTENTION DOS DETECTED".

Mininet work normally and creates every hosts and links, but the ping doesen't work with static route and tables pushed with p4runtime.

I don't wan't onos worry about routin but only detect if packet_in was recived and print a string.

I use ipv4.

the network is:

mac addr h1 = 00:00:00:00:00:10
ip : 172.16.1.1 gw: 172.16.1.254
porta 2; (su file netcfg)

mac addr h2 = 00:00:00:00:00:20
ip : 172.16.1.2 gw: 172.16.1.254
porta 3 (su file netcfg)

mac addr leaf1 = 00:00:00:00:00:01
grpc: 50001;

the hosts is connected to the switch.

I'm attaching mine code to show you what have i done.
the file py.txt need to renominate in .py
the direcory of every files is

main.p4 in   "home/sdn/ngsdn-tutorial/p4src"
InterpreterImpl.java in     "/home/sdn/ngsdn-tutorial/app/src/main/java/org/onosproject/ngsdn/tutorial/pipeconf"

netcfg.json, topo-v4.py are in "home/sdn/ngsdn-tutorial/mininet"

to set static route i use this command

mininet> h1 route add -net 172.16.1.0 netmask 255.255.255.0 gw 172.16.1.254 dev h1-eth0
mininet> h2 route add -net 172.16.1.0 netmask 255.255.255.0 gw 172.16.1.254 dev h2-eth0

and to set tables with p4Runtime, i use the script in "home/sdn/ngsdn-tutorial/util" like that:

util/p4rt-sh --grpc-addr localhost:50001 --config p4src/build/p4info.txt,p4src/build/bmv2.json --election-id 0,1

than to push the tables:

te = table_entry["IngressPipeImpl.ipv4_lpm"](action = "IngressPipeImpl.ipv4_forward")
te.match["hdr.ipv4.dstAddr"] = ("172.16.1.1")
te.action["dstAddr"] = ("00:00:00:00:00:10")
te.action["port"] = ("2")
te.insert()

te2 = table_entry["IngressPipeImpl.ipv4_lpm"](action = "IngressPipeImpl.ipv4_forward")
te2.match["hdr.ipv4.dstAddr"] = ("172.16.1.2")
te2.action["dstAddr"] = ("00:00:00:00:00:20")
te2.action["port"] = ("3")
te2.insert()

thanks for the help to everyone.

netcfg.json.txt
pruntimeEseguire.txt
main.p4.txt
InterpreterImpl.java.txt
topo-v4.py.txt
Reply all
Reply to author
Forward
0 new messages