Revision 54037995 mininet/topo.py

View differences:

mininet/topo.py
324 324

  
325 325
        self.k = k
326 326

  
327
        self._add_node(0, Node())
328
        hosts = range(1, k + 1)
327
        self._add_node(1, Node())
328
        hosts = range(2, k + 2)
329 329
        for h in hosts:
330 330
            self._add_node(h, Node(is_switch = False))
331
            self._add_edge(h, 0, Edge())
331
            self._add_edge(h, 1, Edge())
332 332

  
333 333
        if enable_all:
334 334
            self.enable_all()
......
347 347

  
348 348
        self.k = k
349 349

  
350
        switches = range(0, k)
350
        switches = range(1, k + 1)
351 351
        for s in switches:
352 352
            h = s + k
353 353
            self._add_node(s, Node())
354 354
            self._add_node(h, Node(is_switch = False))
355 355
            self._add_edge(s, h, Edge())
356 356
        for s in switches:
357
            if s != k - 1:
357
            if s != k:
358 358
                self._add_edge(s, s + 1, Edge())
359 359

  
360 360
        if enable_all:

Also available in: Unified diff