Home › Forums › FABRIC General Questions and Discussion › Layer 2 Network Topology with Edgecore Wedge100BF-32X P4 Tofino Switch on FABRIC
Tagged: p4 switches
- This topic has 4 replies, 2 voices, and was last updated 1 month ago by
Komal Thareja.
-
AuthorPosts
-
August 15, 2025 at 1:50 pm #8823
I have a question regarding the tutorial “Layer 2 Network Topology with Edgecore Wedge100BF-32X P4 Tofino Switch on FABRIC.”
I have been using this tutorial for a while and have been able to modify it for my own experiments. However, I have recently started experiencing problems with the setup.
#Create Slice
slice = fablib.new_slice(name=slice_name)# Create Network
net1 = slice.add_l2network(name=network1_name, subnet=IPv4Network(“192.168.0.0/24”))
net2 = slice.add_l2network(name=network2_name, subnet=IPv4Network(“192.168.0.0/24”))# Create Node 1 and its links
node1 = slice.add_node(name=node1_name, site=site1)
iface1 = node1.add_component(model=model, name=’nic1′).get_interfaces()[0]
iface1.set_mode(‘config’)
net1.add_interface(iface1)
iface1.set_ip_addr(IPv4Address(“192.168.0.1”))# Create P4 switch and its links
p4 = slice.add_switch(name=p4_name, site=site2)
iface2 = p4.get_interfaces()[0]
iface3 = p4.get_interfaces()[1]net1.add_interface(iface2)
net2.add_interface(iface3)# Create Node 2 and its links
node2 = slice.add_node(name=node2_name, site=site1)
iface4 = node2.add_component(model=model, name=’nic1′).get_interfaces()[0]
iface4.set_mode(‘config’)
net2.add_interface(iface4)
iface4.set_ip_addr(IPv4Address(“192.168.0.2″))# Submit Slice Request
slice.submit()”Although the above code creates three nodes : “Node1”, “Node2”, and “P4”, for some reason it only displays one. Nevertheless, I am able to retrieve node information for Node1 and Node2 as shown below::
node1 = slice.get_node(“Node1”)
node2 = slice.get_node(“Node2”)
print(node1)
print(node2)However,
switch = slice.get_node("P4")
returns a “not found” error, and I haven’t found a way to retrieve information about the switch. Strangely, the switch does appear in the slice’s graphical display.To reiterate, I’ve been using this code without issues for months; the problem started today.
Thank you for help on this matter
Hadi
August 15, 2025 at 2:43 pm #8824Hi,
Could you please share the Slice ID for your slice?
Thanks,
Komal
1 user thanked author for this post.
August 15, 2025 at 2:56 pm #8826It appears there may be an issue with
list_nodes
, which could be affecting the display.However, I suspect the P4 switch you requested at SITE is currently unavailable. You can verify this by checking your slice in the Portal. If your slice is in a Dead or Closed state, enable the “Include Dead/Closing Slices” option.
When you click on your slice, you may see an error message such as “insufficient resources.”
Please choose a different site or look at the P4 availability via following code or check from Portal-> Resources Overview screen.
p4_column_name = 'p4-switch_available'
[site2] = fablib.get_random_sites(count=1, filter_function=lambda x: x[p4_column_name] > 0)
Thanks,Komal
August 15, 2025 at 3:11 pm #8827Thank you Komal,My slice name is: “P4-Lab-Slice2”.Let me also provide some more information . I was able to SSH into Node2 using the information obtained from:node2 = slice.get_node("Node2")
print(node2)
However, it behaves strangely and does not have the192.168.0.2
interface.I was able to access the switch using the information from the slice visualization (it shows the details after the@
symbol), and I was able to compile P4 code there as before.That said, nothing seems to be working as intended, each component is disconnected from the other. It feels like there may have been a system update that has affected the experiment’s setup.Only node1 seems to be working as before, and it is the only node that appears after you create the slice (or request node with list_nodes).Thank you for your helpAugust 15, 2025 at 5:11 pm #8828Hi Abdulhadi,
Thank you for sharing the details. I was able to reproduce it and have posted a fix. If you try the Beyond Bleeding Edge JH container, this should work. I plan to update the other JH containers with the fix sometime next week.
Thanks,
Komal
-
AuthorPosts
- You must be logged in to reply to this topic.