I would like to build a SRv6 network with p4 language and bmv2. In P4-tutorials(https://github.com/p4lang/tutorials) they use mininet while I'm using Proxmox VE to build different virtual machines. I want to use bmv2 as software switches but I failed to load control plane configurations.
I'm using a SRv6 implement on Github(https://github.com/XiaoM1573/p4-tutorial-srv6) and I tried to write a s1-runtime.json to define my own control plane configurations. Here's my s1-runtime.json:
{
"target":"bmv2",
"p4info":"build/srv6.p4.p4info.txt",
"bmv2_json":"build/srv6.json",
"Table_entries":[
{
"table":"ingress.local_mac_table",
"match":{
"hdr.ethernet.dst_addr":"22:b8:f2:fd:8a:52"
},
"action_name":"NoAction",
"action_params":{
}
},
{
"table":"ingress.local_sid_table",
"match":{
"hdr.ipv6.dst_addr":["1::1","128"]
},
"action_name":"ingress.end",
"action_params":{
}
},
{
"table":"ingress.transit_table",
"match":{
"hdr.ipv6.dst_addr":["3::3","128"]
},
"action_name":"ingress.insert_segment_list_2",
"action_params":{
"s1":"2::2",
"s2":"4::4"
}
},
{
"table":"ingress.transit_table",
"match":{
"hdr.ipv6.dst_addr":["4::4","128"]
},
"action_name":"ingress.insert_segment_list_2",
"action_params":{
"s1":"A3:33::33",
"s2":"3::3"
}
},
{
"table":"ingress.routing_v6_table",
"match":{
"hdr.ipv6.dst_addr":["2::2","128"]
},
"action_name":"ingress.set_next_hop",
"action_params":{
"dmac":"22:b8:f2:fd:8a:52",
"port":"1"
}
},
{
"table":"ingress.routing_v6_table",
"match":{
"hdr.ipv6.dst_addr":["2::2","128"]
},
"action_name":"ingress.set_next_hop",
"action_params":{
"dmac":"22:b8:f2:fd:8a:52",
"port":"2"
}
},
{
"table":"ingress.routing_v6_table",
"match":{
"hdr.ipv6.dst_addr":["4::4","128"]
},
"action_name":"ingress.set_next_hop",
"action_params":{
"dmac":"22:b8:f2:fd:8a:52",
"port":"3"
}
}
]
}
I compiled the srv6.p4 with p4c -b bmv2 srv6.p4 -o build
and the files look like:
tree
I'm tring to use simple_switch
command to build the network directly.
simple_switch -i 0@ens18 -i 1@ens19 build/srv6.json -- --enable-swap
However, I have no idea how to load the s1-runtime.json. I've tried going into runtimeCLI and using load_new_config_files
command to load this json, and it seems not working.
If this works correctly, when I ping6 4::4
I should read the packets with a Segment-Routing-Header. However I only get this:
My Header now