Changes between Version 5 and Version 6 of TopDl
- Timestamp:
- Oct 4, 2012 6:03:54 PM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TopDl
v5 v6 166 166 See below 167 167 168 === 168 === Interfaces === 169 169 170 170 Interfaces are attached to elements. Each is parameterized as follows: … … 217 217 {{{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. 218 218 219 The two node topology similar to the above can be generated from this ns2 code:219 The 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}}}. 220 220 221 221 {{{ … … 233 233 }}} 234 234 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. 236 236 237 237 === Generating and Manipulating Topdl using Python === 238 238 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: 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. All the attached code will run on {{{users}}}. 240 241 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. 242 243 The [attachment:example1.py following python] prints the example topdl above: 242 244 243 245 {{{ … … 258 260 }}} 259 261 260 That code constructs the small topology entirely from constructors, which is impractical for large topologies. Thisbreaks the construction into a couple loops, which are easier to build on and understand. Output is identical.262 That 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. 261 263 {{{ 262 264 #!/usr/bin/env python … … 280 282 }}} 281 283 282 There are also routines for changing existing topologies. The following examplenumbers the computers in a topology by adding a "computer_number" attribute to them and prints the topology in topdl.284 There 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. 283 285 284 286 {{{ … … 302 304 }}} 303 305 306 When 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 352 More details are available in the [TopdlLibrary library documentation]