Home › Forums › FABRIC General Questions and Discussion › No output using iperf for network monitoring
Tagged: iperf, network monitoring, Segment Routing, SRv6, traffic measuring, Ubuntu 22
- This topic has 9 replies, 3 voices, and was last updated 10 months, 2 weeks ago by Robin Schelstraete.
-
AuthorPosts
-
January 25, 2024 at 11:51 am #6417
Hi all,
I have been trying to monitor a network I made here in FABRIC by using the iperf package. All my nodes run Ubuntu 22.
I have been implementing SRv6 into my network and I want to use iperf to check if it works.I am able to install it and setup a client and server, but I can’t see any traffic. Does anyone know why this is and how to fix it?
I have tried to use it before and after implementing Segment Routing but that doesn’t change anything, so that is not the problem. I also tried editing the firewall rules using ufw but that didn’t help either.
Thanks!
January 25, 2024 at 12:13 pm #6419Hi Robin,
Could you share your notebook(s) here. It helps to replicate the issue and hopefully resolve and share a resolution.
Regards,
Acheme
January 29, 2024 at 6:32 am #6452Hi Acheme!
The link to my Jupyter Notebook: https://jupyter.fabric-testbed.net/hub/user-redirect/lab/tree/jupyter-examples-rel1.5.4/SRExperiment.ipynb .
The code I use to install iperf on the SR-ingress-node and start a server via a terminal:
$ <ssh command of SR-ingress-node>
$ sudo apt install iperf
$ iperf -sThe code I use to install iperf on Node2 and start a client in a second terminal:
$ <ssh command of Node2>
$ sudo apt install iperf
$ iperf -c <management IP of SR ingress node>In the attachement I included screenshots of both the outputs of these instructions as well as my network topology as shown in the FABRIC portal after creating it via the Jupyter Notebook.
January 29, 2024 at 4:21 pm #6469Hello Robin,
Could you copy and paste the content of your notebook here, I am unable to access the link you provided.
Regards,
Acheme
January 30, 2024 at 8:17 am #6472Yes, the contents of my notebook:
Show Slice
Show FABlib Config, slice and nodes
from fabrictestbed_extensions.fablib.fablib import FablibManager as fablib_manager
fablib = fablib_manager()
fablib.show_config();
Set Up ExperimentSlice
Setup slice to experiment on, consisting of five nodes located on the same site running Ubuntu 22 OS Images.
slice_name=”Experiment Slice”
node1_name=”Node1″
node2_name=”Node2″
# This will be the router node
node3_name=”SR-ingress-node”
node4_name=”Source-Node”
node5_name=”Destination-Node”# Create a slice
slice = fablib.new_slice(name=slice_name)# Add a node
slice.add_node(name=node1_name, site=”AMST”, image=”default_ubuntu_22″)node1 = slice.get_node(name=node1_name)
# node_location = node1.get_site()
node_location = “AMST”slice.add_node(name=node2_name, site=node_location, image=”default_ubuntu_22″)
slice.add_node(name=node3_name, site=node_location, image=”default_ubuntu_22″)
slice.add_node(name=node4_name, site=node_location, image=”default_ubuntu_22″)
slice.add_node(name=node5_name, site=node_location, image=”default_ubuntu_22″)# Submit the slice
slice.submit();List the slices and their data
fablib.list_slices();
slice = fablib.get_slice(slice_name)
slice.show()node1 = slice.get_node(name=node1_name)
node1.show()node2 = slice.get_node(name=node2_name)
node2.show();node3 = slice.get_node(name=node3_name)
node3.show();node4 = slice.get_node(name=node4_name)
node4.show();node5 = slice.get_node(name=node5_name)
node5.show();Enable SR on all Nodes
Enable SR on Src Node
###### Enable Segment Routing ######
# Check the kernel version, this has to be at least version 4.9
stdout, stderr = node4.execute(‘uname -r’)# Check if iproute2 is installed
stdout, stderr = node4.execute(‘ip -V’)# Install packages
stdout, stderr = node4.execute(‘sudo apt update && sudo apt upgrade | y’)
stdout, stderr = node4.execute(‘sudo apt install -y iproute2’)###### Enable IPv6 forwarding and Seg6 ######
stdout, stderr = node4.execute(‘echo “net.ipv6.conf.all.forwarding=1” | sudo tee -a /etc/sysctl.conf’)
stdout, stderr = node3.execute(‘echo “net.ipv6.conf.*.seg6_enabled=1” | sudo tee -a /etc/sysctl.conf’)stdout, stderr = node4.execute(‘sudo sysctl -p’)
stdout, stderr = node4.execute(‘cat /etc/sysctl.conf’)Setup SR on SR ingress node
###### Enable Segment Routing ######
# Check the kernel version, this has to be at least version 4.9
stdout, stderr = node3.execute(‘uname -r’)# Check if iproute2 is installed
stdout, stderr = node3.execute(‘ip -V’)# Install packages
stdout, stderr = node3.execute(‘sudo apt update && sudo apt upgrade | y’)
stdout, stderr = node3.execute(‘sudo apt install -y iproute2’)###### Enable IPv6 forwarding ######
stdout, stderr = node3.execute(‘echo “net.ipv6.conf.all.forwarding=1” | sudo tee -a /etc/sysctl.conf’)
stdout, stderr = node3.execute(‘echo “net.ipv6.conf.*.seg6_enabled=1” | sudo tee -a /etc/sysctl.conf’)stdout, stderr = node3.execute(‘sudo sysctl -p’)
stdout, stderr = node3.execute(‘cat /etc/sysctl.conf’)Setup SR on Node 1
###### Enable Segment Routing ######
# Check the kernel version, this has to be at least version 4.9
stdout, stderr = node1.execute(‘uname -r’)# Check if iproute2 is installed
stdout, stderr = node1.execute(‘ip -V’)# Install packages
stdout, stderr = node1.execute(‘sudo apt update && sudo apt upgrade | y’)
stdout, stderr = node1.execute(‘sudo apt install -y iproute2’)###### Enable IPv6 forwarding ######
stdout, stderr = node1.execute(‘echo “net.ipv6.conf.all.forwarding=1” | sudo tee -a /etc/sysctl.conf’)
stdout, stderr = node1.execute(‘echo “net.ipv6.conf.*.seg6_enabled=1” | sudo tee -a /etc/sysctl.conf’)stdout, stderr = node1.execute(‘sudo sysctl -p’)
stdout, stderr = node1.execute(‘cat /etc/sysctl.conf’)Setup SR on Node 2
###### Enable Segment Routing ######
# Check the kernel version, this has to be at least version 4.9
stdout, stderr = node2.execute(‘uname -r’)# Check if iproute2 is installed
stdout, stderr = node2.execute(‘ip -V’)# Install packages
stdout, stderr = node2.execute(‘sudo apt update && sudo apt upgrade | y’)
stdout, stderr = node2.execute(‘sudo apt install -y iproute2’)###### Enable IPv6 forwarding ######
stdout, stderr = node2.execute(‘echo “net.ipv6.conf.all.forwarding=1” | sudo tee -a /etc/sysctl.conf’)
stdout, stderr = node2.execute(‘echo “net.ipv6.conf.*.seg6_enabled=1” | sudo tee -a /etc/sysctl.conf’)stdout, stderr = node2.execute(‘sudo sysctl -p’)
stdout, stderr = node2.execute(‘cat /etc/sysctl.conf’)Setup SR on Dst Node
###### Enable Segment Routing ######
# Check the kernel version, this has to be at least version 4.9
stdout, stderr = node5.execute(‘uname -r’)# Check if iproute2 is installed
stdout, stderr = node5.execute(‘ip -V’)# Install packages
stdout, stderr = node5.execute(‘sudo apt update && sudo apt upgrade | y’)
stdout, stderr = node5.execute(‘sudo apt install -y iproute2’)###### Enable IPv6 forwarding ######
stdout, stderr = node5.execute(‘echo “net.ipv6.conf.all.forwarding=1” | sudo tee -a /etc/sysctl.conf’)
stdout, stderr = node5.execute(‘echo “net.ipv6.conf.*.seg6_enabled=1” | sudo tee -a /etc/sysctl.conf’)stdout, stderr = node5.execute(‘sudo sysctl -p’)
stdout, stderr = node5.execute(‘cat /etc/sysctl.conf’)Execute Experiment
Configure SR ingress node
Segment Routing is enabled. Now, the local SID table is created, active segments are mapped to functions (with this, the packet route is specified), the source address is set and the SRH is added onto the packet, which is then also encapsulated as SRv6 packet within the same command.
# Print addresses of the nodes
for node in slice.get_nodes():
stdout, stderr = node.execute(f’echohostname -s
: Hello! My IP is {node.get_management_ip()} :P’)# Create localSID table
stdout, stderr = node3.execute(‘echo Create localSID table’)
stdout, stderr = node3.execute(‘echo 100 localsid | sudo tee -a /etc/iproute2/rt_tables’)
stdout, stderr = node3.execute(‘sudo ip -6 rule add to 2001:610:2d0:fabc:f816:3eff::/64 lookup localsid’)
stdout, stderr = node3.execute(‘sudo ip -6 route add blackhole default table localsid’)
stdout, stderr = node3.execute(‘echo ……………………….’)# Map active segments to functions and add them to table 100, the localsid table
# using ip -6 route add <segment> encap seg6local action <action> <params> dev <device> table localsid
# segment node3-node1
stdout, stderr = node3.execute(‘echo Adding Node1 nexthop Node2′)
stdout, stderr = node3.execute(f’sudo ip -6 route add {node1.get_management_ip()} encap seg6local action End.X nh6 {node2.get_management_ip()} dev enp3s0 table localsid’)
stdout, stderr = node3.execute(‘echo ……………………….’)## segment node1-node2
stdout, stderr = node3.execute(‘echo Adding Node2 nexthop DstNode’)
stdout, stderr = node3.execute(‘sudo ip -6 route add 2001:610:2d0:fabc:f816:3eff:fe4d:4924 encap seg6local action End.X nh6 2001:610:2d0:fabc:f816:3eff:fe1a:8910 dev enp3s0 table localsid’)
stdout, stderr = node3.execute(‘echo ……………………….’)## segment node2-node5
stdout, stderr = node3.execute(‘echo Adding End on DstNode’)
stdout, stderr = node3.execute(‘sudo ip -6 route add 2001:610:2d0:fabc:f816:3eff:fe1a:8910 encap seg6local action End dev enp3s0 table localsid’)
stdout, stderr = node3.execute(‘echo ……………………….’)# Set source address (address of Source Node)
stdout, stderr = node3.execute(‘echo Set Source Address’)
stdout, stderr = node3.execute(‘sudo ip sr tunsrc set 2001:610:2d0:fabc:f816:3eff:feaa:fbf8’)
stdout, stderr = node3.execute(‘echo ……………………….’)# SR encapsulation and insertion
stdout, stderr = node3.execute(‘echo Adding segments to the route’)
stdout, stderr = node3.execute(‘sudo ip -6 route add 2001:400:a100:3090:f816:3eff::/64 encap seg6 mode inline segs 2001:610:2d0:fabc:f816:3eff:fed2:af83,2001:610:2d0:fabc:f816:3eff:fe4d:4924,2001:610:2d0:fabc:f816:3eff:fe1a:8910 dev enp3s0’)
stdout, stderr = node3.execute(‘echo ……………………….’)Check SR-ingress-node if Something Has Changed
# stdout, stderr = node3.execute(”)
stdout, stderr = node3.execute(‘echo Check if localsid is added as table 100:’)
stdout, stderr = node3.execute(‘sudo cat /etc/iproute2/rt_tables’)
stdout, stderr = node3.execute(‘echo ……………………….’)stdout, stderr = node3.execute(‘echo Show the contents of localsid:’)
stdout, stderr = node3.execute(‘sudo ip -6 route show table 100’)
stdout, stderr = node3.execute(‘echo ……………………….’)stdout, stderr = node3.execute(‘echo Show rules associated with the table:’)
stdout, stderr = node3.execute(‘sudo ip -6 rule show’)
stdout, stderr = node3.execute(‘echo ……………………….’)stdout, stderr = node3.execute(‘echo Show routing table:’)
stdout, stderr = node3.execute(‘ip -6 route show’)
stdout, stderr = node3.execute(‘echo ……………………….’)stdout, stderr = node3.execute(‘echo Show routing table:’)
stdout, stderr = node3.execute(‘ip -6 route’)Delete the Experiment Slice when the experiments are done
slice = fablib.get_slice(name=’Experiment Slice’)
slice.delete()January 30, 2024 at 9:34 pm #6480Hello Robin,
I am not very familiar with SR but I notice that you did not reserve network resources no connect the nodes with links. I never had to perform iperf using management IPs on this testbed so I am not sure how it should behave. Sorry I have to been more helpful.
Regards,
Acheme
January 31, 2024 at 2:34 am #6482Hi Acheme,
I am able to ping every node from every other node, so I didn’t think it was necessary to allocate network resources. Maybe it could help with my problem, do you know how I could reserve for IPv6 connections using code?
And did you use iperf with other kinds of IPs on this testbed? If yes, which kinds?
Kind regards,
Robin
- This reply was modified 10 months, 3 weeks ago by Robin Schelstraete.
January 31, 2024 at 9:57 am #6486Hi Robin,
Acheme is right. Management Network only supports SSH via bastion node and basic ICMP packets. We do not recommend conducting your experiments with Management Network.
Please consider modifying your experiment where you are also requesting a local network (L2Bridge or FabNetv4/FabNetv6) since all your VMs are on the same site. Setup your Segment routing using the data plane network instead of the management network. There are several examples available under Networking in the
start_here.ipynb
Also, I am enclosing a sample notebook, which requests the VMs and connects them with local L2 Network(IPv6). You can use this as a base and setup Segment Routing on the Data Plane interfaces. Please let us know if you have questions or run into any issues.
NOTE: Please rename the notebook from
.jpg
to.ipynb
as the forum doesn’t allow attaching files with.ipynb
extension.Thanks,
Komal
- This reply was modified 10 months, 3 weeks ago by Komal Thareja.
- This reply was modified 10 months, 3 weeks ago by Komal Thareja.
January 31, 2024 at 10:04 am #6489Attaching the notebook again.
February 6, 2024 at 12:26 pm #6535Hi Komal,
It works, thank you for your help!
-
AuthorPosts
- You must be logged in to reply to this topic.