scy-phy / minicps

MiniCPS: a framework for Cyber-Physical Systems real-time simulation, built on top of mininet
MIT License
166 stars 70 forks source link

Loops in topology #8

Closed sraddhanjali closed 7 years ago

sraddhanjali commented 7 years ago

If the topology has loops, I can't send packets to another plc. Any idea why?

francozappa commented 7 years ago

Hi @tilaprimera,

Can you please provide more information about the topology that you are using?

Thanks

sraddhanjali commented 7 years ago

It is an IEEE 9 test bus case analogous topology as posted below. Thank you.

!/usr/bin/python

from mininet.node import Host
from mininet.topo import Topo

class IEEE9Topo(Topo):

    "IEEE 9 Topology with no controller and mininet" 

     def __init__(self):
        Topo.__init__(self)
        h1 = self.addHost('h1', cls=Host, IP='192.168.1.1', MAC='00:1D:9C:C7:B0:01', defaultRoute=None) 
        s1 = self.addSwitch('s1') 
        self.addLink(s1, h1) 
        h2 = self.addHost('h2', cls=Host, IP='192.168.1.2', MAC='00:1D:9C:C7:B0:02', defaultRoute=None) 
        s2 = self.addSwitch('s2') 
       self.addLink(s2, h2) 
       h3 = self.addHost('h3', cls=Host, IP='192.168.1.3', MAC='00:1D:9C:C7:B0:03', defaultRoute=None) 
       s3 = self.addSwitch('s3') 
       self.addLink(s3, h3) 
       h4 = self.addHost('h4', cls=Host, IP='192.168.1.4', MAC='00:1D:9C:C7:B0:04', defaultRoute=None) 
       s4 = self.addSwitch('s4') 
       self.addLink(s4, h4) 
       h5 = self.addHost('h5', cls=Host, IP='192.168.1.5', MAC='00:1D:9C:C7:B0:05', defaultRoute=None) 
       s5 = self.addSwitch('s5') 
       self.addLink(s5, h5) 
       h6 = self.addHost('h6', cls=Host, IP='192.168.1.6', MAC='00:1D:9C:C7:B0:06', defaultRoute=None) 
       s6 = self.addSwitch('s6') 
       self.addLink(s6, h6) 
       h7 = self.addHost('h7', cls=Host, IP='192.168.1.7', MAC='00:1D:9C:C7:B0:07', defaultRoute=None) 
       s7 = self.addSwitch('s7') 
       self.addLink(s7, h7) 
       h8 = self.addHost('h8', cls=Host, IP='192.168.1.8', MAC='00:1D:9C:C7:B0:08', defaultRoute=None) 
       s8 = self.addSwitch('s8') 
       self.addLink(s8, h8) 
       h9 = self.addHost('h9', cls=Host, IP='192.168.1.9', MAC='00:1D:9C:C7:B0:09', defaultRoute=None) 
       s9 = self.addSwitch('s9') 
       self.addLink(s9, h9) 
       self.addLink(s1, s4) 
       self.addLink(s3, s6) 
       self.addLink(s4, s5) 
       self.addLink(s5, s6) 
       self.addLink(s6, s7) 
       self.addLink(s7, s8) 
       self.addLink(s8, s2) 
       self.addLink(s8, s9) 
       self.addLink(s9, s4) 

topo = {'mytopo': (lambda: IEEE9Topo())}
francozappa commented 7 years ago

From a quick look at the topology code I'm guessing that you have a routing problem. I'm not familiar with the IEEE9 test case but as far as I know if you want to establish and maintain over time a ring topology you need a dedicated protocol (eg: Device Level Ring).

p.s. I think that you are still using the SDN controller under the hood. Watch out because in its default configuration it can manages a limited amount of switches.

I have to close this issue because it is not directly related to MiniCPS.