tutorials icon indicating copy to clipboard operation
tutorials copied to clipboard

How Can have CPU Utilizations of Switches

Open faliakbari opened this issue 3 years ago • 4 comments

Hello all,

Would you please let me know how to have CPU utilization of switches and hosts in the P4 tutorial? Is it possible to add CPU utilization to the MRI exercise, the scaled-down version of In-Band Network Telemetry (INT)?

Best regards, Fatemeh

faliakbari avatar Jan 09 '22 02:01 faliakbari

I am not sure if this meets your needs, but have you considered running the top or https://github.com/sysstat/sysstat commands while running your tests, then collecting and summarizing that data in some way useful to you at the end of the experiment?

jafingerhut avatar Jan 09 '22 02:01 jafingerhut

Dear Andy,

Thank you for your information. As I have understood and tried, top and sysstat work for the whole Linux system. In fact, I have not found a way to use them to have statistics for switches and hosts in the Mininet separately. In detail, I need to have information about the availability of CPU and link bandwidth of each switch and host in the Mininet topology in the P4 tutorial. By using the Link Monitoring exercise I could extract the link bandwidth of nodes. Now, I was wondering if you would help me to have CPU utilization of each switch and host in the topology.

faliakbari avatar Jan 09 '22 18:01 faliakbari

In the tutorial, the "hosts" are running on the same CPU cores as each other, and as the BMv2 software switches. Either simple_switch or simple_switch_grpc is the name of the process that runs the BMv2 software switch. On the hosts, it depends upon what processes you run there to send/receive packets that you could determine what their CPU utilization is.

top can give per-process CPU and memory utilization. In the tutorials repo, I do not know exactly how mininet does it, but I suspect it runs the virtual hosts and the software switch in different network namespaces. I do not know if all of the processes are visible from 'top' running in the default namespace, or whether you might also need to run 'top' in some separate process namespace in order to see the software switch and host processes.

jafingerhut avatar Jan 09 '22 20:01 jafingerhut

Dear Andy,

Thank you so much for your guidance. Regarding your comments, I have found the following steps in Mininet that could be useful:

  1. Getting all the running processes PIDs. The "ps aux" gives us the PID for all nodes in Mininet, such as PID:47622 for mininet:h1.
  2. Using the required PID to have information about hosts, switches and controllers are running. For instance, the " top -p 47622 " lets us monitor the CPU usage of h1.

faliakbari avatar Jan 10 '22 22:01 faliakbari