top.rng 11.6 KB
Newer Older
1
<?xml version="1.0" encoding="UTF-8"?>
2 3 4
<grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  <!--
    
Robert Ricci's avatar
Robert Ricci committed
5
    Copyright (c) 2005-2008 University of Utah and the Flux Group.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
    
    {{{EMULAB-LICENSE
    
    This file is part of the Emulab network testbed software.
    
    This file is free software: you can redistribute it and/or modify it
    under the terms of the GNU Affero General Public License as published by
    the Free Software Foundation, either version 3 of the License, or (at
    your option) any later version.
    
    This file is distributed in the hope that it will be useful, but WITHOUT
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public
    License for more details.
    
    You should have received a copy of the GNU Affero General Public License
    along with this file.  If not, see <http://www.gnu.org/licenses/>.
    
    }}}
25 26 27 28 29 30 31 32 33
    
  -->
  <!--
    
    Definition of common data structures used for representing topologies -
    shared between vtop (virtual topology) and ptop (physical topology)
    formats.
    
  -->
34 35 36 37 38 39 40 41 42 43 44 45
  <define name="NodeTypeSpec">
    <a:documentation>Representation of a single node type</a:documentation>
    <element name="node_type">
      <element name="type_name">
        <a:documentation>Name of the type - will almost certainly not be unique</a:documentation>
        <text/>
      </element>
      <choice>
        <a:documentation>How many virtual nodes of this type this physical node can
handle.</a:documentation>
        <element name="type_slots">
          <data type="integer">
46
            <param name="minInclusive">0</param>
47 48 49 50 51 52 53 54 55 56 57 58 59
          </data>
        </element>
        <element name="unlimited">
          <empty/>
        </element>
      </choice>
      <optional>
        <element name="static">
          <a:documentation>A flag that indicates that this physical node *always*
has this type - a node is only allowed to have one dynamic
(ie. not flagged as static) type at a time, but any number
of static types at a time</a:documentation>
          <empty/>
60
        </element>
61 62 63 64 65 66
      </optional>
    </element>
  </define>
  <define name="NodeSpec">
    <a:documentation>A node in the topology</a:documentation>
    <element name="node">
67 68 69 70 71 72
      <ref name="NodeContents"/>
    </element>
  </define>
  <define name="NodeContents">
    <attribute name="name">
      <a:documentation>Name of the node - each node name must be unique within the 
73
top element</a:documentation>
74 75 76
    </attribute>
    <ref name="NodeSpec.NodeType">
      <a:documentation>Type specification - we use a named pattern here (defined below), so
77 78
that it can be overriden in the virtual topology schema, where you are
only allowed to have one</a:documentation>
79 80 81 82 83 84 85
    </ref>
    <ref name="NodeFlagSpec">
      <a:documentation>Legacy flags</a:documentation>
    </ref>
    <zeroOrMore>
      <ref name="FeatureDesireSpec">
        <a:documentation>Legacy features and desires</a:documentation>
86
      </ref>
87 88 89 90
    </zeroOrMore>
    <zeroOrMore>
      <ref name="PropertySpec">
        <a:documentation>Types of virtual nodes that this physical node can satisfy
91 92
Desires of this node, which should (or must) be matched by the
physical node we are assigned to</a:documentation>
93 94
      </ref>
    </zeroOrMore>
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
  </define>
  <define name="NodeSpec.NodeType">
    <a:documentation>A node can (by default) have one or more types</a:documentation>
    <oneOrMore>
      <ref name="NodeTypeSpec"/>
    </oneOrMore>
  </define>
  <define name="LinkTypeSpec">
    <a:documentation>Link types are currently just a siple string. They will almost certainly 
have to get more complicated, for two reasons:
    First, I want to allow virtual links to specify more than one type, so
      that we can ask for links that are, say, 'ethernet or loopback'
    Second, I want to have a lot more control over links that get mapped to
      multi-hop paths
TODO: MAYBE this should be combined with NodeTypeSpec</a:documentation>
    <element name="link_type">
      <element name="type_name">
        <text/>
      </element>
    </element>
  </define>
  <define name="LinkSpec">
    <a:documentation>Links in the topology - zero or more</a:documentation>
    <element name="link">
119 120 121 122 123 124 125 126 127
      <ref name="LinkContents"/>
    </element>
  </define>
  <define name="LinkContents">
    <attribute name="name">
      <a:documentation>Name of the link - must be unique in the top</a:documentation>
    </attribute>
    <element name="source_interface">
      <a:documentation>First interface for this link - links are assumed to be
128 129
symmetric, so the order of the interfaces does not currently
matter</a:documentation>
130 131 132 133 134 135 136 137
      <ref name="InterfaceSpec"/>
    </element>
    <element name="destination_interface">
      <a:documentation>Second interface for this link</a:documentation>
      <ref name="InterfaceSpec"/>
    </element>
    <element name="bandwidth">
      <a:documentation>TODO: In the future, the bandwidth, latency, and packet loss will be
138 139
moved to features and/or properties
Bandwidth of the link in kbps</a:documentation>
140 141 142 143 144 145 146 147 148 149 150 151
      <data type="float">
        <param name="minExclusive">0.0</param>
      </data>
    </element>
    <element name="latency">
      <a:documentation>Latency of the link in ms</a:documentation>
      <data type="float">
        <param name="minInclusive">0.0</param>
      </data>
    </element>
    <element name="packet_loss">
      <a:documentation>Static packet loss probability of the link as a fraction
152
(ie. 0.01 == 1%)</a:documentation>
153 154 155 156 157 158
      <data type="float">
        <param name="minInclusive">0.0</param>
      </data>
    </element>
    <ref name="LinkSpec.LinkType">
      <a:documentation>Type of this link - we use a named pattern here (defined below), so
159 160
that it can be overriden in the virtual topology schema, where you are
only allowed to have one</a:documentation>
161 162 163 164
    </ref>
    <zeroOrMore>
      <ref name="PropertySpec">
        <a:documentation>Properties of this link</a:documentation>
165
      </ref>
166
    </zeroOrMore>
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197
  </define>
  <define name="LinkSpec.LinkType">
    <a:documentation>A link can (by default) have zero or more types</a:documentation>
    <zeroOrMore>
      <ref name="LinkTypeSpec"/>
    </zeroOrMore>
  </define>
  <define name="FeatureDesireSpec">
    <a:documentation>"Legacy" assign features and desires - will be phased out in favor of
properties</a:documentation>
    <element name="fd">
      <element name="fd_name">
        <a:documentation>Name of this feature or desire</a:documentation>
        <text/>
      </element>
      <element name="fd_weight">
        <a:documentation>Weight assocated with the feature or desire</a:documentation>
        <data type="float"/>
      </element>
      <optional>
        <element name="violatable">
          <a:documentation>A flag indicating whether or not a failure to match the desire with a
a feature is a constraint violation</a:documentation>
          <empty/>
        </element>
      </optional>
      <optional>
        <choice>
          <a:documentation>Type information expressed in features and desires</a:documentation>
          <group>
            <element name="global">
198 199
              <empty/>
            </element>
200
            <element name="operator">
201 202 203 204
              <choice>
                <value>OnceOnly</value>
                <value>FirstFree</value>
              </choice>
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221
            </element>
          </group>
          <group>
            <element name="local">
              <empty/>
            </element>
            <element name="operator">
              <value>+</value>
            </element>
          </group>
        </choice>
      </optional>
    </element>
  </define>
  <define name="NodeFlagSpec">
    <a:documentation>"Legacy" assign node flags - will be replaced with properties, and in some
cases, explicit links</a:documentation>
222 223 224
    <optional>
      <group>
        <a:documentation>Gives the amount of bandwidth this node can forward through its loopback
225 226 227
interface. In the future, we will make the loopback interface/link
explicit in the topology
Valid only for physical nodes</a:documentation>
228 229 230 231 232
        <element name="trivial_bandwidth">
          <data type="integer"/>
        </element>
      </group>
    </optional>
233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259
    <optional>
      <element name="subnode_of">
        <a:documentation>Specify that this node is a subnode of another node. We MIGHT
try to do this with properties in the future
Valid for both virtual and physical nodes</a:documentation>
        <text/>
      </element>
    </optional>
    <optional>
      <element name="unique">
        <a:documentation>Indicates that this node should never be considered identical to any
other node. Could be done with a property
Valid only for physical nodes</a:documentation>
        <empty/>
      </element>
    </optional>
    <optional>
      <element name="disallow_trivial_mix">
        <a:documentation>Indicates that virtual links must either all be trivial (loopback), or
none of them must be. Possibly expressible with properties?</a:documentation>
        <empty/>
      </element>
    </optional>
  </define>
  <define name="InterfaceSpec">
    <a:documentation>Interfaces</a:documentation>
    <element name="interface">
260 261 262 263 264 265 266
      <ref name="InterfaceContents"/>
    </element>
  </define>
  <define name="InterfaceContents">
    <element name="node_name">
      <a:documentation>Name of the node, which must match one of the nodes in this topology</a:documentation>
      <text/>
267
    </element>
268 269 270 271 272 273 274 275 276
    <element name="interface">
      <a:documentation>Name of the interface itself</a:documentation>
      <text/>
    </element>
    <zeroOrMore>
      <ref name="PropertySpec">
        <a:documentation>Properties of the interface</a:documentation>
      </ref>
    </zeroOrMore>
277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314
  </define>
  <define name="PropertySpec">
    <a:documentation>Properties - new: replacements for features and desires. Not yet implemented
in assign, and not yet fully fleshed out in this schema.</a:documentation>
    <element name="property">
      <element name="property_name">
        <a:documentation>Name of this property</a:documentation>
        <text/>
      </element>
      <element name="property_value">
        <a:documentation>Value associated with this property
TODO: Add ranges and other types from rspec</a:documentation>
        <choice>
          <text/>
          <data type="float"/>
        </choice>
      </element>
      <element name="property_penalty">
        <a:documentation>The penalty associated with this property</a:documentation>
        <data type="float">
          <param name="minInclusive">0.0</param>
        </data>
      </element>
      <optional>
        <element name="violatable">
          <a:documentation>If this flag is present, not having the property is considered a violation</a:documentation>
          <empty/>
        </element>
      </optional>
      <optional>
        <choice>
          <a:documentation>TODO: Add more operators - equality, range test, etc
Flags for special types of operators</a:documentation>
          <group>
            <element name="global">
              <empty/>
            </element>
            <element name="operator">
315 316 317 318
              <choice>
                <value>OnceOnly</value>
                <value>FirstFree</value>
              </choice>
319 320 321 322 323 324 325
            </element>
          </group>
          <group>
            <element name="local">
              <empty/>
            </element>
            <element name="operator">
326 327 328 329
              <choice>
                <value>=</value>
                <value>+</value>
              </choice>
330 331 332 333
            </element>
          </group>
        </choice>
      </optional>
334
    </element>
335 336
  </define>
</grammar>