I have completed P4 tutorial.
Now I want to collect network telemetry in ngSDN VM.
How could we do that?
Another thing related to P4 tutorial, how to get the telemtry from each switch to a central collector in out-of-band configuration?
Hi,
To collect telemetry using something like In-band Network Telemetry (INT), you could take a look into the work from Hyun (Telemetry Intents), if you plan to use ONOS. Anyway, you can probably extract some ideas from their P4 code.
If we stick to theory, according to the specification I last read, Telemetry reporting and collection involves (in general terms) encapsulating original packet+INT metadata into a Telemetry Report (Page 19 and on has examples of packet structure) sent over UDP. If you read the In-band Network Telemetry (INT) Dataplane Specification and the Telemetry Report specification,there are plenty of different working modes so there is no one way to design the way you “pick” telemetry (INT-XD (postcard) vs INT-MX (IOAM) vs INT-MD (classic in-band)) or the way you collect/report it (stacked ports, per-hop report, etc.).
If you follow most of the examples you find around, you will notice that what you probably need is a UDP server that can parse the payload (the packet structure sent as payload) as sent by the last hop switch. You don’t necessarily have to follow the specification to collect INT metadata (so no Telemetry Report if you do not want to) but you definitely need to encapsulate the “original packet + INT Metadata” as the payload of a new UDP packet (with new Ethernet and IP outer headers). You can create your own UDP server in Python if you just need a PoC implementation. If you need something better you have these examples [1] [2] [3].
Remember that when a packet is received at the last hop switch in the path (after traversing INT hops), this last hop switch has to: (1) remove INT shim and metadata headers and the INT metadata itself and send it to the endpoint as it was expected to be received and at the same time (2) clone the packet to Ingress so the original packet + INT metadata can be encapsulated for the collector. So you do two things in the last hop switch. You can find some examples here [1] [2] [3] [4] but searching a little more you will find other examples.
The bast way to collect the reports in Mininet (if that is what you refer to as out of band) is creating an interface for one of the switches in the network (say, the one that receives all reports from all last hop switches) and is able to forward the packet to the root namespace. You have an example here on how to create a root ns interface attached to a switch in Mininet. If you install the collector in the same host machine that runs Mininet, this method should be fine.
If you have particular questions about NG SDN exercises or the VM I recommend their Github repository or the onos-dev and onos-discuss Google groups.
Thank you.
I will try the suggestions