373 | | |
| 373 | To explore packing, we need a [attachment:example6.tcl larger topology]: |
| 374 | |
| 375 | {{{ |
| 376 | source tb_compat.tcl |
| 377 | set ns [new Simulator] |
| 378 | |
| 379 | set center [$ns node] |
| 380 | tb-add-node-attribute $center "containers:PartitionPass" 0 |
| 381 | |
| 382 | |
| 383 | for { set i 1} { $i < 4 } { incr i} { |
| 384 | set lanlist $center |
| 385 | for { set j 0 } { $j < 20} { incr j } { |
| 386 | set idx [expr $i * 20 + $j] |
| 387 | set n($idx) [$ns node] |
| 388 | tb-add-node-attribute $n($idx) "containers:PartitionPass" $i |
| 389 | lappend lanlist $n($idx) |
| 390 | } |
| 391 | $ns make-lan [join $lanlist " "] 100Mb 0 |
| 392 | } |
| 393 | |
| 394 | # Creation boilerplate |
| 395 | $ns rtptoto Static |
| 396 | $ns run |
| 397 | }}} |
| 398 | |
| 399 | This creates 3 20-node subnetworks attached to a single central router. It looks like this: |
| 400 | |
| 401 | [[Image(packing-small.png)]] |
| 402 | |
| 403 | Each node in the topology is assigned a {{{containers::PackingPass}}} attribute that groups them into subsets. The {{{conatiners:PackingPass}}} attribute must be assigned an integer value. The nodes in each packing pass are considered together when packing. Each pass can be assigned different parameters. The passes are carried out in order, though that is rarely important. |
| 404 | |
| 405 | Our topology assigns |