Commit 93640e1d authored by Robert Ricci's avatar Robert Ricci

Merge in ptop/vtop schema from the assign-dev branch.

parent 568bba41
#
# EMULAB-COPYRIGHT
# Copyright (c) 2007 University of Utah and the Flux Group.
# All rights reserved.
#
#
# Description of a physical topology
#
default namespace = "http://emulab.net/resources/ptop/0.1"
include "top.rnc"
## A simple policy specification - it may end up that policy does not belong in
## the ptop file directly
TypeLimitSpec = element type_limit {
## Name of the type we are limiting
element type_name { text },
## Limit as to the number of nodes of this type the experiment can use
element type_limit { xsd:integer { minInclusive = "0" } }
}
start = element ptop {
## The testbed that this physical topology came from - will be used for
## federation
attribute testbed { text },
## Nodes in the topology - zero or more
NodeSpec*,
## Links in the topology - zero or more
LinkSpec*,
## Any limits on how many nodes of a particular type this experiment can
## use.
TypeLimitSpec*
}
<?xml version="1.0" encoding="UTF-8"?>
<!--
EMULAB-COPYRIGHT
Copyright (c) 2007 University of Utah and the Flux Group.
All rights reserved.
-->
<!--
Description of a physical topology
-->
<grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" ns="http://emulab.net/resources/ptop/0.1" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<include href="top.rng"/>
<define name="TypeLimitSpec">
<a:documentation>A simple policy specification - it may end up that policy does not belong in
the ptop file directly</a:documentation>
<element name="type_limit">
<element name="type_name">
<a:documentation>Name of the type we are limiting</a:documentation>
<text/>
</element>
<element name="type_limit">
<a:documentation>Limit as to the number of nodes of this type the experiment can use</a:documentation>
<data type="integer">
<param name="minInclusive">0</param>
</data>
</element>
</element>
</define>
<start>
<element name="ptop">
<attribute name="testbed">
<a:documentation>The testbed that this physical topology came from - will be used for
federation</a:documentation>
</attribute>
<zeroOrMore>
<ref name="NodeSpec">
<a:documentation>Nodes in the topology - zero or more</a:documentation>
</ref>
</zeroOrMore>
<zeroOrMore>
<ref name="LinkSpec">
<a:documentation>Links in the topology - zero or more</a:documentation>
</ref>
</zeroOrMore>
<zeroOrMore>
<ref name="TypeLimitSpec">
<a:documentation>Any limits on how many nodes of a particular type this experiment can
use.</a:documentation>
</ref>
</zeroOrMore>
</element>
</start>
</grammar>
<?xml version="1.0" encoding="UTF-8"?>
<!--
EMULAB-COPYRIGHT
Copyright (c) 2007 University of Utah and the Flux Group.
All rights reserved.
-->
<!--
Description of a physical topology
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://emulab.net/resources/ptop/0.1" xmlns:top="http://emulab.net/resources/top/0.2" xmlns:ptop="http://emulab.net/resources/ptop/0.1">
<xs:import namespace="http://emulab.net/resources/top/0.2" schemaLocation="top.xsd"/>
<xs:element name="type_limit">
<xs:complexType>
<xs:sequence>
<xs:element ref="ptop:type_name"/>
<xs:element name="type_limit">
<xs:annotation>
<xs:documentation>Limit as to the number of nodes of this type the experiment can use</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:minInclusive value="0"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="type_name" type="xs:string">
<xs:annotation>
<xs:documentation>Name of the type we are limiting</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="ptop">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="top:node">
<xs:annotation>
<xs:documentation>Nodes in the topology - zero or more</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="top:link">
<xs:annotation>
<xs:documentation>Links in the topology - zero or more</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="ptop:type_limit"/>
</xs:sequence>
<xs:attribute name="testbed" use="required"/>
</xs:complexType>
</xs:element>
</xs:schema>
#
# EMULAB-COPYRIGHT
# Copyright (c) 2005-2006 University of Utah and the Flux Group.
# Copyright (c) 2005-2007 University of Utah and the Flux Group.
# All rights reserved.
#
default namespace = "http://emulab.net/resources/vtop/1.0"
element top {
## Project ID
attribute pid {text},
## Experiment ID
attribute eid{text},
## Group ID (optional)
attribute gid{text}?,
## User ID owning the experiment (optional)
attribute uid{text}?,
## Nodes in the topology - zero or more
element node {
attribute name {text},
element node_type {
element type_name { text },
## TODO - Change type
element type_slots { text }?
},
element desire {
element desire_name { text },
element desire_weight { text },
element violatable { empty }?
}*,
element node_option{
element option_name { text },
element option_value { text }
}*
}*,
## Links in the topology - zero or more
element link {
text
}*
#
# Definition of common data structures used for representing topologies -
# shared between vtop (virtual topology) and ptop (physical topology)
# formats.
#
default namespace = "http://emulab.net/resources/top/0.2"
## Representation of a single node type
NodeTypeSpec = element node_type {
## Name of the type - will almost certainly not be unique
element type_name { text },
## How many virtual nodes of this type this physical node can
## handle.
(element type_slots { xsd:integer { minInclusive = "1" } } |
element unlimited { empty }),
## 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
element static { empty }?
}
## A node in the topology
NodeSpec = element node {
## Name of the node - each node name must be unique within the
## top element
attribute name { text },
## Type specification - we use a named pattern here (defined below), so
## that it can be overriden in the virtual topology schema, where you are
## only allowed to have one
NodeSpec.NodeType,
## Legacy flags
NodeFlagSpec,
## Legacy features and desires
FeatureDesireSpec*,
## Types of virtual nodes that this physical node can satisfy
## Desires of this node, which should (or must) be matched by the
## physical node we are assigned to
PropertySpec*
}
## A node can (by default) have one or more types
NodeSpec.NodeType = NodeTypeSpec+
## 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
LinkTypeSpec = element link_type {
element type_name { text }
}
## Links in the topology - zero or more
LinkSpec = element link {
## Name of the link - must be unique in the top
attribute name { text },
## First interface for this link - links are assumed to be
## symmetric, so the order of the interfaces does not currently
## matter
element source_interface { InterfaceSpec },
## Second interface for this link
element destination_interface { InterfaceSpec },
## TODO: In the future, the bandwidth, latency, and packet loss will be
## moved to features and/or properties
## Bandwidth of the link in kbps
element bandwidth { xsd:float { minExclusive = "0.0" } },
## Latency of the link in ms
element latency { xsd:float { minInclusive = "0.0" } },
## Static packet loss probability of the link as a fraction
## (ie. 0.01 == 1%)
element packet_loss { xsd:float { minInclusive = "0.0" } },
## Type of this link - we use a named pattern here (defined below), so
## that it can be overriden in the virtual topology schema, where you are
## only allowed to have one
LinkSpec.LinkType,
## Properties of this link
PropertySpec*
}
## A link can (by default) have zero or more types
LinkSpec.LinkType = LinkTypeSpec*
## "Legacy" assign features and desires - will be phased out in favor of
## properties
FeatureDesireSpec = element fd {
## Name of this feature or desire
element fd_name { text },
## Weight assocated with the feature or desire
element fd_weight { xsd:float },
## A flag indicating whether or not a failure to match the desire with a
## a feature is a constraint violation
element violatable { empty }?,
## Type information expressed in features and desires
((element global { empty }, element operator { "OnceOnly", "FirstFree" }) |
(element local { empty }, element operator { "+" }))?
}
## "Legacy" assign node flags - will be replaced with properties, and in some
## cases, explicit links
NodeFlagSpec =
## Gives the amount of bandwidth this node can forward through its loopback
## interface. In the future, we will make the loopback interface/link
## explicit in the topology
## Valid only for physical nodes
element trivial_bandwidth { xsd:integer },
## 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
element subnode_of { text }?,
## Indicates that this node should never be considered identical to any
## other node. Could be done with a property
## Valid only for physical nodes
element unique { empty }?,
## Indicates that virtual links must either all be trivial (loopback), or
## none of them must be. Possibly expressible with properties?
element disallow_trivial_mix { empty }?
## Interfaces
InterfaceSpec = element interface {
## Name of the node, which must match one of the nodes in this topology
element node_name { text },
## Name of the interface itself
element interface { text },
## Properties of the interface
PropertySpec*
}
## Properties - new: replacements for features and desires. Not yet implemented
## in assign, and not yet fully fleshed out in this schema.
PropertySpec = element property {
## Name of this property
element property_name { text },
## Value associated with this property
## TODO: Add ranges and other types from rspec
element property_value { text | xsd:float },
## The penalty associated with this property
element property_penalty { xsd:float { minInclusive = "0.0" } },
## If this flag is present, not having the property is considered a violation
element violatable { empty }?,
## TODO: Add more operators - equality, range test, etc
## Flags for special types of operators
((element global { empty }, element operator { "OnceOnly", "FirstFree" }) |
(element local { empty }, element operator { "=", "+" }))?
}
This diff is collapsed.
This diff is collapsed.
#
# EMULAB-COPYRIGHT
# Copyright (c) 2007 University of Utah and the Flux Group.
# All rights reserved.
#
#
# Description of a virtual topology
#
default namespace = "http://emulab.net/resources/vtop/0.2"
#
# We include the common topology specification schema, but override a few
# elements
#
include "top.rnc" {
## In the vtop file, a node is only allowed to have a single type
NodeSpec.NodeType = NodeTypeSpec
## In the vtop file, a link is only allowed to have a single type (which
## is optional)
LinkSpec.LinkType = LinkTypeSpec?
}
## Add an atribute to the 'node' tag that allows you to fix it to a specific
## physical node
NodeSpec &= attribute assigned_to { text }?
## Add an atribute to the 'node' tag that allows you to hint that it might
## be a good idea to assign it to a specific physical node
NodeSpec &= attribute hint_to { text }?
## Specify a virtual class - assign allows you to define classes for virtual
## nodes, and specify that all nodes using that class should, or must, be
## assigned to physical nodes of the same type
VclassSpec = element vclass {
## Name of the virtual class
attribute name { text },
## Specify whether the vclass is hard (ie. all nodes *must* be of the same
## type) or soft (ie. violating it is allowed, but penalize)
(element hard { empty } |
(element soft { empty },
element weight { xsd:float { minInclusive = "0.0" } } ))
}
## "Legacy" link flags used by assign. Will be replaced by properties
LinkFlagSpec =
## Indicates that it is not okay to use a delay node to artificially
## shape/delay traffic for this link. Replace by using type system.
element nodelay { empty }?,
## Indicates whether it is okay to multiplex this link with other virtual
## links onto the same physical link (old name: emulated) Probably replace
## by using the type system (ie. have an 'Ethernet' type that can only
## hold one slot, and an 'Ethernet-tagged' type that can hold more).
element multiplex_ok { empty }?,
## Indicates whether it is okay to satisfy this link with a trivial
## (loopback) link. Replace using type system.
element trivial_ok { empty }?,
## Gives the name of the interface that must be used to satisfy the source
## of this link - note that the interface name is given, not the node name
element fixsrciface { string }?,
## Same as fixsrciface, for destination of the link
element fixdstiface { string }?
## Add LinkFlagSpec to the base link specification, since it is only legal
## in the vtop file
LinkSpec &= LinkTypeSpec
## Virtual topology
start = element vtop {
## Project ID
attribute pid { text },
## Experiment ID
attribute eid { text },
## Group ID (optional)
attribute gid { text }?,
## User ID owning the experiment (optional)
attribute uid { text }?,
## Nodes in the topology - zero or more
NodeSpec*,
## Links in the topology - zero or more
LinkSpec*,
## Vclasses
VclassSpec*
}
<?xml version="1.0" encoding="UTF-8"?>
<!--
EMULAB-COPYRIGHT
Copyright (c) 2007 University of Utah and the Flux Group.
All rights reserved.
-->
<!--
Description of a virtual topology
-->
<grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" ns="http://emulab.net/resources/vtop/0.2" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<!--
We include the common topology specification schema, but override a few
elements
-->
<include href="top.rng">
<define name="NodeSpec.NodeType">
<a:documentation>In the vtop file, a node is only allowed to have a single type</a:documentation>
<ref name="NodeTypeSpec"/>
</define>
<define name="LinkSpec.LinkType">
<a:documentation>In the vtop file, a link is only allowed to have a single type (which
is optional)</a:documentation>
<optional>
<ref name="LinkTypeSpec"/>
</optional>
</define>
</include>
<define name="NodeSpec" combine="interleave">
<a:documentation>Add an atribute to the 'node' tag that allows you to fix it to a specific
physical node</a:documentation>
<optional>
<attribute name="assigned_to"/>
</optional>
</define>
<define name="NodeSpec" combine="interleave">
<a:documentation>Add an atribute to the 'node' tag that allows you to hint that it might
be a good idea to assign it to a specific physical node</a:documentation>
<optional>
<attribute name="hint_to"/>
</optional>
</define>
<define name="VclassSpec">
<a:documentation>Specify a virtual class - assign allows you to define classes for virtual
nodes, and specify that all nodes using that class should, or must, be
assigned to physical nodes of the same type</a:documentation>
<element name="vclass">
<attribute name="name">
<a:documentation>Name of the virtual class</a:documentation>
</attribute>
<choice>
<a:documentation>Specify whether the vclass is hard (ie. all nodes *must* be of the same
type) or soft (ie. violating it is allowed, but penalize)</a:documentation>
<element name="hard">
<empty/>
</element>
<group>
<element name="soft">
<empty/>
</element>
<element name="weight">
<data type="float">
<param name="minInclusive">0.0</param>
</data>
</element>
</group>
</choice>
</element>
</define>
<define name="LinkFlagSpec">
<a:documentation>"Legacy" link flags used by assign. Will be replaced by properties</a:documentation>
<optional>
<element name="nodelay">
<a:documentation>Indicates that it is not okay to use a delay node to artificially
shape/delay traffic for this link. Replace by using type system.</a:documentation>
<empty/>
</element>
</optional>
<optional>
<element name="multiplex_ok">
<a:documentation>Indicates whether it is okay to multiplex this link with other virtual
links onto the same physical link (old name: emulated) Probably replace
by using the type system (ie. have an 'Ethernet' type that can only
hold one slot, and an 'Ethernet-tagged' type that can hold more).</a:documentation>
<empty/>
</element>
</optional>
<optional>
<element name="trivial_ok">
<a:documentation>Indicates whether it is okay to satisfy this link with a trivial
(loopback) link. Replace using type system.</a:documentation>
<empty/>
</element>
</optional>
<optional>
<element name="fixsrciface">
<a:documentation>Gives the name of the interface that must be used to satisfy the source
of this link - note that the interface name is given, not the node name</a:documentation>
<data type="string" datatypeLibrary=""/>
</element>
</optional>
<optional>
<element name="fixdstiface">
<a:documentation>Same as fixsrciface, for destination of the link</a:documentation>
<data type="string" datatypeLibrary=""/>
</element>
</optional>
</define>
<define name="LinkSpec" combine="interleave">
<a:documentation>Add LinkFlagSpec to the base link specification, since it is only legal
in the vtop file</a:documentation>
<ref name="LinkTypeSpec"/>
</define>
<start>
<a:documentation>Virtual topology</a:documentation>
<element name="vtop">
<attribute name="pid">
<a:documentation>Project ID</a:documentation>
</attribute>
<attribute name="eid">
<a:documentation>Experiment ID</a:documentation>
</attribute>
<optional>
<attribute name="gid">
<a:documentation>Group ID (optional)</a:documentation>
</attribute>
</optional>
<optional>
<attribute name="uid">
<a:documentation>User ID owning the experiment (optional)</a:documentation>
</attribute>
</optional>
<zeroOrMore>
<ref name="NodeSpec">
<a:documentation>Nodes in the topology - zero or more</a:documentation>
</ref>
</zeroOrMore>
<zeroOrMore>
<ref name="LinkSpec">
<a:documentation>Links in the topology - zero or more</a:documentation>
</ref>
</zeroOrMore>
<zeroOrMore>
<ref name="VclassSpec">
<a:documentation>Vclasses</a:documentation>
</ref>
</zeroOrMore>
</element>
</start>
</grammar>
<?xml version="1.0" encoding="UTF-8"?>
<!--
EMULAB-COPYRIGHT
Copyright (c) 2007 University of Utah and the Flux Group.
All rights reserved.
-->
<!--
Description of a virtual topology
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://emulab.net/resources/vtop/0.2" xmlns:top="http://emulab.net/resources/top/0.2" xmlns:vtop="http://emulab.net/resources/vtop/0.2">
<xs:import namespace="http://emulab.net/resources/top/0.2" schemaLocation="top.xsd"/>
<!--
We include the common topology specification schema, but override a few
elements
-->
<xs:element name="NodeSpec.NodeType" abstract="true">
<xs:annotation>
<xs:documentation>In the vtop file, a node is only allowed to have a single type</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:group ref="top:type_name"/>
<xs:choice>
<xs:element ref="top:type_slots"/>
<xs:element ref="top:unlimited"/>
</xs:choice>
<xs:element minOccurs="0" ref="top:static"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:group name="LinkSpec.LinkType">
<xs:sequence>
<xs:element minOccurs="0" ref="top:link_type"/>
</xs:sequence>
</xs:group>
<xs:element name="vclass">
<xs:complexType>
<xs:choice>
<xs:element ref="vtop:hard"/>
<xs:sequence>
<xs:element ref="vtop:soft"/>
<xs:element ref="vtop:weight"/>
</xs:sequence>
</xs:choice>
<xs:attribute name="name" use="required">
<xs:annotation>
<xs:documentation>Name of the virtual class</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="hard">
<xs:complexType/>
</xs:element>
<xs:element name="soft">
<xs:complexType/>
</xs:element>
<xs:element name="weight">
<xs:simpleType>
<xs:restriction base="xs:float">
<xs:minInclusive value="0.0"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:group name="LinkFlagSpec">
<xs:annotation>
<xs:documentation>"Legacy" link flags used by assign. Will be replaced by properties</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element minOccurs="0" ref="vtop:nodelay"/>
<xs:element minOccurs="0" ref="vtop:multiplex_ok"/>
<xs:element minOccurs="0" ref="vtop:trivial_ok"/>
<xs:element minOccurs="0" ref="vtop:fixsrciface"/>
<xs:element minOccurs="0" ref="vtop:fixdstiface"/>
</xs:sequence>
</xs:group>
<xs:element name="nodelay">
<xs:complexType/>
</xs:element>
<xs:element name="multiplex_ok">
<xs:complexType/>
</xs:element>
<xs:element name="trivial_ok">
<xs:complexType/>
</xs:element>
<xs:element name="fixsrciface" type="xs:string"/>
<xs:element name="fixdstiface" type="xs:string">
<xs:annotation>
<xs:documentation>Same as fixsrciface, for destination of the link</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="vtop">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="top:node">
<xs:annotation>
<xs:documentation>Nodes in the topology - zero or more</xs:documentation>
</xs:annotation>
</xs:element>
<xs:group minOccurs="0" maxOccurs="unbounded" ref="top:LinkSpec">
<xs:annotation>
<xs:documentation>Links in the topology - zero or more</xs:documentation>
</xs:annotation>
</xs:group>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="vtop:vclass">
<xs:annotation>
<xs:documentation>Vclasses</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
<xs:attribute name="pid" use="required">
<xs:annotation>
<xs:documentation>Project ID</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="eid" use="required">
<xs:annotation>
<xs:documentation>Experiment ID</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="gid">
<xs:annotation>
<xs:documentation>Group ID (optional)</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="uid">
<xs:annotation>
<xs:documentation>User ID owning the experiment (optional)</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attributeGroup ref="top:NodeSpec"/>
</xs:complexType>
</xs:element>
</xs:schema>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment