Hi,
I think this question is probably better asked in the Mininet mailing list, their Github repository, or in similar forums. Still, we might be able to help with some little comments .
I think some time ago I did add a root namespace interface attached to a switch. I did it in a similar way to the way done at this file:
My code was something like this:
for one_switch in switches_to_modify:
switch = self.net.switches[ int(one_switch[1:2] ) - 1] //this is to select a switch based on trimming part of the name and getting the position from "net.switches". Don't put a lot of attention on this.
root = Node( 'root', inNamespace=False )
intf = self.net.addLink( root, switch ).intf1
ip='10.0.223.2/32' // if you need an ip address
root.setIP(ip, intf=intf)
You can see the original version I based my code on from the file I linked before the code. Once the Mininet network is up, you should be able to list the interface and inject packets or listen for packets.
Cheers,