Changes between Version 16 and Version 17 of TopdlLibrary


Ignore:
Timestamp:
Oct 8, 2012 11:40:43 AM (12 years ago)
Author:
faber
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TopdlLibrary

    v16 v17  
    3535  * [TopdlLibrary#CPUClass CPU] (0 or more)
    3636    * [TopdlLibrary#AttributeClass Attribute] (0 or more)
    37   * [TopdlLibrary#OperatingSystemClass !OperatingSystem] (0 or more)
     37  * [TopdlLibrary#OperatingSystemClass OperatingSystem] (0 or more)
    3838    * [TopdlLibrary#AttributeClass Attribute] (0 or more)
    3939  * [TopdlLibrary#SoftwareClass Software] (0 or more)
     
    4646    * [TopdlLibrary#AttributeClass Attribute] (0 or more)
    4747  * [TopdlLibrary#ServiceClass Service] (0 or more)
    48     * [TopdlLibrary#ServiceParamClass !ServiceParam] (0 or more)
     48    * [TopdlLibrary#ServiceParamClass ServiceParam] (0 or more)
    4949
    5050Most classes can have attributes attached to them that contain extention attributes that different applications make use of.  The presence or absence of an optional nested object does not mean the presence or absence of the thing it describes, but that the description is unbound.  As [TopDl#Representation we have seen] a Computer without a nested CPU object does not describe a computer without a CPU, but a computer with no constraints on the CPU.
     
    479479This example constructs the topdl describing a simple start topology with 11 nodes, one center and 10 satellites.
    480480
    481 [[Image(ten_smaller.png)]]
    482 
    483 A python program to create that looks like this:
     481[[Image(ten_small.png)]]
     482
     483A python program to print the topdl describing that topology looks like this:
    484484
    485485{{{
     
    519519}}}
    520520
    521 The program builds the topology by creating a [TopdlLibrary#ComputerClass computer object] that is the center of the star, then creates other computers that are connected to the center.  The connection is accomplished by creating a [TopdlLibrary#SubstrateClass Substrate object] that represents the connection and adding [TopdlLibrary#InterfaceClass Interface objects] to the center computer and the satellite that bind them to the substrate.
    522 
    523 
     521The [attachment:ten.py program] builds the topology by creating a [TopdlLibrary#ComputerClass Computer object] that is the center of the star, then creates other computers that are connected to the center.  The connection is accomplished by creating a [TopdlLibrary#SubstrateClass Substrate object] that represents the connection and adding [TopdlLibrary#InterfaceClass Interface objects] to the center computer and the satellite that bind them to the substrate.
     522
     523For comparison, [attachment:ten.tcl here] is the equivalent ns2 description:
     524
     525{{{
     526source tb_compat.tcl
     527set ns [new Simulator]
     528
     529# Create the center node (named by its variable name)
     530set center [$ns node]
     531
     532# Connect 10 satellites
     533for { set i 0} { $i < 10 } { incr i} {
     534    # Create node n-1 (tcl n($i) becomes n-$i in the experiment)
     535    set n($i) [$ns node]
     536    # Connect center to $n($i)
     537    ns duplex-link $center $n($i) 100Mb 0ms DropTail
     538}
     539
     540# Creation boilerplate
     541$ns rtptoto Static
     542$ns run
     543}}}
     544
     545== A More Complex Topology ==
     546
     547The next few examples will build on one another to show a more complex change to a topology.  We will take a topology, find the degrees of nodes, assign operating systems to them based on that degree, and output DETER-ready ns2.
     548
     549To try this we need a more complex topology.  The program below creates a topology with {{{nrouters}}} completely connected routers, each of which has {{{nleaves}}} leaves, except for one central router that has none.