Commit 37449f7a authored by Tarun Prabhu's avatar Tarun Prabhu

Modified the xml format to have attributes which makes the parse much faster....

Modified the xml format to have attributes which makes the parse much faster. The change affected the rspecs as well and that was also corrected.
parent 2b5f72d6
......@@ -10,17 +10,68 @@
default namespace = "http://emulab.net/resources/ptop/0.1"
include "top.rnc" {
## There are no node attributes unique to ptop
AdditionalNodeAttributeSpec = empty
## Adding an additional optional trivial_bandwidth flag only for ptop
AdditionalNodeFlagSpec = element trivial_bandwidth { xsd:integer }?
## Adding addition flags which are unique to vtop links
AdditionalLinkFlagSpec = empty
}
include "top.rnc"
## "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 }?
## A node in the topology
NodeSpec = element node { NodeContents }
NodeContents =
## 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
NodeTypeSpec+,
## 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*
## Links in the topology - zero or more
LinkSpec = element link { LinkContents }
LinkContents =
## Name of the link - must be unique in the top
attribute name { text },
## The two interfaces which form the endpoints of this link.
LinkEndPoints,
## The characteristics (bandwidth, latency, loss) which affect traffic.
LinkCharacteristics,
## 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
LinkTypeSpec+,
## Properties of this link
PropertySpec*
## A link can (by default) have zero or more types
## LinkSpec.LinkType = LinkTypeSpec*
start = element ptop {
## The testbed that this physical topology came from - will be used for
## federation
......
......@@ -12,48 +12,20 @@
## 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 = "0" } } |
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 }?
## Name of the type - will almost certainly not be unique
attribute type_name { text },
## How many virtual nodes of this type this physical node can
## handle.
attribute type_slots { xsd:integer { minInclusive = "0" } | "unlimited" },
##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 }?
attribute static { "true" }?
}
## A node in the topology
NodeSpec = element node { NodeContents }
NodeContents =
## Name of the node - each node name must be unique within the
## top element
attribute name { text },
## Additional attributes if any
AdditionalNodeAttributeSpec,
## 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+
## Default additional flag spec to empty for the moment.
## It will be overridden in the ptop and vtop files
AdditionalNodeAttributeSpec = empty
## 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
......@@ -62,28 +34,9 @@ AdditionalNodeAttributeSpec = empty
## multi-hop paths
## TODO: MAYBE this should be combined with NodeTypeSpec
LinkTypeSpec = element link_type {
element type_name { text }
attribute type_name { text }
}
## Links in the topology - zero or more
LinkSpec = element link { LinkContents }
LinkContents =
## Name of the link - must be unique in the top
attribute name { text },
## The two interfaces which form the endpoints of this link.
LinkEndPoints,
## The characteristics (bandwidth, latency, loss) which affect traffic.
LinkCharacteristics,
## 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,
## Add additional specs for a link if necessary
AdditionalLinkFlagSpec,
## Properties of this link
PropertySpec*
## A link has two endpoints. Right now, they are order
## independent. But they might become order-dependant later.
LinkEndPoints =
......@@ -104,58 +57,42 @@ LinkCharacteristics =
## (ie. 0.01 == 1%)
element packet_loss { xsd:float { minInclusive = "0.0" } }
## A link can (by default) have zero or more types
LinkSpec.LinkType = LinkTypeSpec
## Set the additional link flag spec to empty for now.
## It will be overridden in the ptop and vtop files if required
AdditionalLinkFlagSpec = empty
## "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 },
## element fd_name { text },
attribute fd_name { text },
## Weight assocated with the feature or desire
element fd_weight { xsd:float },
## element fd_weight { xsd:float },
attribute fd_weight { text },
## A flag indicating whether or not a failure to match the desire with a
## a feature is a constraint violation
element violatable { empty }?,
##element violatable { empty }?,
attribute violatable { "true" }?,
## Type information expressed in features and desires
(GlobalSpec | LocalSpec)?
}
GlobalSpec = element global {
element operator { "OnceOnly" | "FirstFree" }
}
LocalSpec = element local {
element operator { "+" }
}
## "Legacy" assign node flags - will be replaced with properties, and in some
## cases, explicit links
NodeFlagSpec =
## Specify additional flags which are only valid in a particular topoplogy
AdditionalNodeFlagSpec,
## 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 }?
## GlobalSpec = element global {
## element operator { "OnceOnly" | "FirstFree" }
##}
GlobalSpec = attribute global_operator { "OnceOnly" | "FirstFree" }
## Set the additional node flag spec to empty for now.
## It will be overridden if required in the ptop and vtop files
AdditionalNodeFlagSpec = empty
## LocalSpec = element local {
## element operator { "+" }
## attribute local_operator { "+" }
##}
LocalSpec = attribute local_operator { "+" }
## Interfaces
InterfaceSpec = element interface { InterfaceContents }
## InterfaceSpec = element interface { InterfaceContents }
InterfaceSpec =
attribute node_name { text },
attribute interface_name { text },
attribute physical_node_name { text }?,
attribute physical_interface_name { text }?,
PropertySpec*
InterfaceContents =
## Name of the node, which must match one of the nodes in this topology
......
......@@ -13,28 +13,84 @@ 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
## There are no additional flags specific to vtop
AdditionalNodeFlagSpec = empty
## The assigned_to and hint_to attributes are unique to vtop
AdditionalNodeAttributeSpec =
## Add an atribute to the 'node' tag that allows you to fix it to a specific
## physical node
include "top.rnc"
## "Legacy" assign node flags - will be replaced with properties, and in some
## cases, explicit links
NodeFlagSpec =
## 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 }?
## A node in the topology
NodeSpec = element node { NodeContents }
NodeContents =
## Name of the node - each node name must be unique within the
## top element
attribute name { text },
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
attribute hint_to { text }?
## Adding addition flags which are unique to vtop links
AdditionalLinkFlagSpec = LinkFlagSpec
attribute hint_to { 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
NodeTypeSpec,
## 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*
## Links in the topology - zero or more
LinkSpec = element link { LinkContents }
LinkContents =
## Name of the link - must be unique in the top
attribute name { text },
## The two interfaces which form the endpoints of this link.
LinkEndPoints,
## The characteristics (bandwidth, latency, loss) which affect traffic.
LinkCharacteristics,
## 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
LinkTypeSpec,
## "Legacy" link flags used by assign. Will be replaced by properties
LinkFlagSpec,
## The annotated link/path
LinkMapping?,
## Properties of this link
PropertySpec*
## The path to which a link has been mapped
## For the moment only 2 interface mappings are specified because
## every link only has 2 interfaces for the moment.
LinkMapping =
element component_hop {
attribute assigned_to { text },
InterfaceMapping,
InterfaceMapping
}+
# Each interface represents a particular physical interface. If that
# interface is one of the link end points, it is also mapped to that
# virtual node and its interface name.
InterfaceMapping = element interface {
attribute physical_node_name { text },
attribute physical_interface_name { text },
attribute virtual_node_name { text }?,
attribute virtual_interface_name { text }?
}
......
......@@ -8,8 +8,13 @@
# Common definitions for advertisements, requests, and tickets
#
include "../../assign/top.rnc" {
NodeContents =
include "../../assign/top.rnc"
NodeSpec = element node { NodeContents }
LinkSpec = element link { LinkContents }
NodeContents =
# Each node has exactly one virtualization technology, which we simply
# enumerate here
attribute virtualization_type { "raw" | "trellis-vserver" |
......@@ -27,17 +32,20 @@ include "../../assign/top.rnc" {
}*
LinkContents =
# Each link has exactly one virtualization technology, which we simply
# enumerate here
attribute virtualization_type { "raw" | "trellis-vserver" |
"planetlab-vserver" | "emulab-vnode" }? &
# Link types
LinkTypeList &
# The interfaces which this link spans.
element interface {
InterfaceRef
}*
}
NodeTypeList = NodeSpec.NodeType
NodeTypeList = NodeTypeSpec+
LinkTypeList = LinkSpec.LinkType+
LinkTypeList = LinkTypeSpec+
VirtualName = attribute virtual_id { text }
......
......@@ -8,25 +8,36 @@
# Prototype of a request RSpec, to be used by ProtoGENI
#
default namespace = "http://www.protogeni.net/resources/rspec/0.1"
include "protogeni-rspec-common.rnc"
# The ComponentName will only be available after an assignment
# The SliverName will be available only after the request has been redeemed.
NodeContents &=
VirtualName &
ComponentName &
SliverName
ComponentName? &
SliverName?
# The LinkMapping will only be available after an assignment
# The SliverName will be available only after the request has been redeemed.
LinkContents &=
VirtualName &
LinkMapping &
SliverName
LinkMapping? &
SliverName? &
# Characteristics (bandwidth, latency, loss) which affect traffic.
LinkCharacteristics?
# The ComponentInterfaceDeclName will only be available after an assignment
InterfaceDecl &=
ComponentInterfaceDeclName &
ComponentInterfaceDeclName? &
VirtualName
# The ComponentInterfaceRefName will only be available after an assignment
InterfaceRef &=
ComponentInterfaceRefName &
VirtualName
ComponentInterfaceRefName? &
attribute virtual_node_id { text } &
attribute virtual_interface_name { text }
RSpecContents &=
attribute type { "request" }
......@@ -36,7 +47,7 @@ RSpecContents &=
# provide any additional information and can be derived from the
# interface mapping.
LinkMapping =
element component_hop { ComponentName, InterfaceMapping* }*
element component_hop { ComponentName, InterfaceMapping* }+
# Each interface represents a particular physical interface. If that
# interface is one of the link end points, it is also mapped to that
......
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