Search Mailing List Archives


Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[mininet-discuss] In-band Controller in Mininet

Volkan YAZICI volkan.yazici at gmail.com
Thu Dec 26 23:18:44 PST 2013


I partially figured out the problem. Gregory was using *ifconfig*, but I
tried to stick with *ip*. The problem was *ip* by default does not turn the
interface up, whereas *ifconfig* does. Hence, updating the code as follows

    s1.start([c1]); s1.cmd("ip addr add 9.1.1.1/16 dev s1; ip link set dev
s1 up")
    s2.start([c1]); s2.cmd("ip addr add 9.1.1.2/16 dev s2; ip link set dev
s2 up")

helped me to observe the connection attempts from 9.1.1.1 (s1) to 9.1.2.1
(h1/c1) via tcpdump. This time I cannot observe any packets originating
from s2. That is, while *tcpdump -i any "src host 9.1.1.1 and tcp dst port
6633"* observes some traffic, it does not work for 9.1.1.2 (s2).

Any ideas? Bob? Gregory?


On Thu, Dec 26, 2013 at 1:34 PM, Volkan YAZICI <volkan.yazici at gmail.com>wrote:

> Hi!
>
> I am playing with Gregory Gee's in-band controller code here<http://gregorygee.wordpress.com/2013/10/05/in-band-controller-with-mininet-part-2/>and instead of
> *net.start()*, I want to start the switches manually in order to specify
> the controller they are supposed to connect, that is, *s1.start([c1])*and so on. For this purpose, I wrote a Mininet script which creates a
> topology as follows.
>
> [hC] ---1 [s1] 3---2 [s2]
>             |2         |1
>             |          |
>            h1         h2
>
> Here I plan to run the controller application on hC and create a
> RemoteController node c1 pointing to the controller running on hC. However,
> I could not make s1 ping hC. I would be really appreciated if anybody can
> provide some hints.
>
> In the following you can find the Mininet script I use.
>
> from mininet.net import Mininet
> from mininet.node import RemoteController, OVSKernelSwitch
> from mininet.cli import CLI
> from mininet.link import TCLink
>
> class InBandController(RemoteController):
>     def checkListening(self): return
>
> def main():
>     print("*** Creating the network...")
>     net = Mininet(controller=InBandController, switch=OVSKernelSwitch,
> link=TCLink)
>
>     print("*** Adding hosts")
>     h1 = net.addHost("h1", ip="9.1.3.1/16")                 # 9.1.3.0 for
> hosts
>     h2 = net.addHost("h2", ip="9.1.3.2/16")
>
>     print("*** Adding the controller")
>     c1 = net.addController("c1", ip="9.1.2.1", port=6633)   # 9.1.2.0 for
> controllers
>
>     print("*** Adding the controller host")
>     hC = net.addHost("hC", ip="9.1.2.1/16")
>
>     print("*** Adding switches")
>     s1 = net.addSwitch("s1")
>     s2 = net.addSwitch("s2")
>
>     print("*** Creating links")
>     net.addLink(hC, s1)            # [hC] ---1 [s1] 3---2 [s2]
>     net.addLink(h1, s1)            #            |2         |1
>     net.addLink(h2, s2)            #            |          |
>     net.addLink(s1, s2)            #            h1         h2
>
>     print("*** Building the network")
>     net.build()
>
>     print("*** Starting the controller")
>     c1.start()
>
>     print("*** Starting switches")
>     s1.start([c1]); s1.cmd("ip addr add 9.1.1.1/16 dev s1") # 9.1.1.0 for
> switches
>     s2.start([c1]); s2.cmd("ip addr add 9.1.1.2/16 dev s2")
>
>     print("*** Opening the command prompt")
>     CLI(net)
>
>     print("*** Stopping the network")
>     net.stop()
>
> if __name__ == "__main__": main()
>
> Best.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/mininet-discuss/attachments/20131227/8b6d47db/attachment.html>


More information about the mininet-discuss mailing list