Changes between Version 5 and Version 6 of TopDl


Ignore:
Timestamp:
Oct 4, 2012 6:03:54 PM (12 years ago)
Author:
faber
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TopDl

    v5 v6  
    166166  See below
    167167
    168 ===
     168=== Interfaces ===
    169169
    170170Interfaces are attached to elements.  Each is parameterized as follows:
     
    217217{{{fedd_ns2topdl.py}}} does not format the XML for easy reading by humans.  We recommend using a filter like {{{xmlformat}}}, which is also installed on {{{users}}} to format the topdl for reading or editing.
    218218
    219 The two node topology similar to the above can be generated from this ns2 code:
     219The two node topology similar to the above can be generated by running [attachment:two.tcl this ns2 code] through {{{fedd_ns2tpodl.py}}.  You can download and try that code on {{{users}}}.
    220220
    221221{{{
     
    233233}}}
    234234
    235 It does not produce the operating system parameters and does produce the capacity parameters.
     235{{{fedd_ns2topdl.py}}} includes some additional attributes that the example topdl above does not include.  They are described in the [TopDl#AttributeConventions attribute conventions] section.
    236236
    237237=== Generating and Manipulating Topdl using Python ===
    238238
    239 The topdl library is a set of python classes and function s that are [TopdlLibrary fully documented elsewhere].  This section gives a few examples that gives the feel for the library.  Each entity is represented by a class with attributes named and broken down as described above.  There are routines to import and export topologies in topdl as well as to translate between several formats, including ns2 and GENI Rspecs.
    240 
    241 The following python prints the example topdl above:
     239The topdl library is a set of python classes and function s that are [TopdlLibrary fully documented elsewhere].  This section gives a few examples that gives the feel for the library.  All the attached code will run on {{{users}}}. 
     240
     241Each entity is represented by a class with attributes named and broken down as described above.  There are routines to import and export topologies in topdl as well as to translate between several formats, including ns2 and GENI Rspecs.
     242
     243The [attachment:example1.py following python] prints the example topdl above:
    242244
    243245{{{
     
    258260}}}
    259261
    260 That code constructs the small topology entirely from constructors, which is impractical for large topologies.  This breaks the construction into a couple loops, which are easier to build on and understand.  Output is identical.
     262That code constructs the small topology entirely from constructors, which is impractical for large topologies.  [attachment:example2.py This code] breaks the construction into a couple loops, which are easier to build on and understand.  Output is identical.
    261263{{{
    262264#!/usr/bin/env python
     
    280282}}}
    281283
    282 There are also routines for changing existing topologies.  The following example numbers the computers in a topology by adding a "computer_number" attribute to them and prints the topology in topdl.
     284There are also routines for changing existing topologies.  The [attachment:example3.py following example] numbers the computers in a topology by adding a "computer_number" attribute to them and prints the topology in topdl.
    283285
    284286{{{
     
    302304}}}
    303305
     306When run on [attachment:two.xml the example topdl] and formatted, the output looks like this - with comments added to hilight the new attributes.
     307
     308{{{
     309<experiment>
     310 <version>1.0</version>
     311 <substrates>
     312  <name>link0</name>
     313 </substrates>
     314 <elements>
     315  <computer>
     316   <name>a</name>
     317   <interface>
     318    <substrate>link0</substrate>
     319    <name>inf000</name>
     320   </interface>
     321
     322   <!-- Here is an added attribute -->
     323   <attribute>
     324    <attribute>computer_number</attribute>
     325    <value>0</value>
     326   </attribute>
     327   <!-- end of added attribute -->
     328
     329  </computer>
     330 </elements>
     331 <elements>
     332  <computer>
     333   <name>b</name>
     334   <interface>
     335    <substrate>link0</substrate>
     336    <name>inf000</name>
     337   </interface>
     338
     339   <!-- Here is an added attribute -->
     340   <attribute>
     341    <attribute>computer_number</attribute>
     342    <value>1</value>
     343   </attribute>
     344   <!-- end of added attribute -->
     345
     346  </computer>
     347 </elements>
     348</experiment>
     349
     350}}}
     351
     352More details are available in the [TopdlLibrary library documentation]