top.rnc 5.08 KB
Newer Older
1
#
Robert Ricci's avatar
Robert Ricci committed
2
# Copyright (c) 2005-2009 University of Utah and the Flux Group.
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
# 
# {{{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/>.
# 
# }}}
22 23
#

24 25 26 27 28 29 30 31
#
# Definition of common data structures used for representing topologies -
# shared between vtop (virtual topology) and ptop (physical topology)
# formats.
#

## Representation of a single node type
NodeTypeSpec = element node_type {
32
	## Name of the type - will almost certainly not be unique
33
	attribute type_name { text } &
34 35
	## How many virtual nodes of this type this physical node can
	## handle.
36
	attribute type_slots { xsd:integer { minInclusive = "0" } | "unlimited" } &
37 38 39 40 41 42
		##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 }?
43 44
	attribute static { "true" }? &
        NodeTypeContents
45 46
}

47 48
NodeTypeContents = empty

49 50 51 52 53 54 55 56
## 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 {
57
    attribute type_name { text }
58 59
}

60 61 62 63
## A link has two endpoints. Right now, they are order
## independent. But they might become order-dependant later.
LinkEndPoints =
    ## First interface for this link
64 65
    element source_interface { InterfaceSpec },
    ## Second interface for this link
66 67 68 69 70 71
    element destination_interface { InterfaceSpec }

## Link characterstics which affect traffic.
## TODO: In the future, the bandwidth, latency, and packet loss will be
## moved to features and/or properties
LinkCharacteristics =
72 73 74 75 76 77
    ## 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%)
78
    element packet_loss { xsd:float { minInclusive = "0.0" } }
79 80 81 82 83

## "Legacy" assign features and desires - will be phased out in favor of
## properties
FeatureDesireSpec = element fd {
    ## Name of this feature or desire
84 85
    ## element fd_name { text },
    attribute fd_name { text },
86
    ## Weight assocated with the feature or desire
87 88
    ## element fd_weight { xsd:float },
    attribute fd_weight { text },
89 90
    ## A flag indicating whether or not a failure to match the desire with a
    ## a feature is a constraint violation
91 92
	##element violatable { empty }?,
	attribute violatable { "true" }?,
93
    ## Type information expressed in features and desires
94
    (GlobalSpec | LocalSpec)?
95 96
}

97 98 99 100
## GlobalSpec = element global {
##	element operator { "OnceOnly" | "FirstFree" }
##}
GlobalSpec = attribute global_operator { "OnceOnly" | "FirstFree" }
101

102 103 104 105 106
## LocalSpec = element local {
##	element operator { "+" }
##	attribute local_operator { "+" }
##}
LocalSpec = attribute local_operator { "+" }
107

108
## Interfaces
109 110 111 112 113 114 115
## InterfaceSpec = element interface { InterfaceContents }
InterfaceSpec = 
	attribute node_name { text },
	attribute interface_name { text },
	attribute physical_node_name { text }?,
	attribute physical_interface_name { text }?,
	PropertySpec*
116 117

InterfaceContents =
118 119 120
    ## Name of the node, which must match one of the nodes in this topology
    element node_name { text },
    ## Name of the interface itself
121
    element interface_name { text },
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
    ## 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
139
    (GlobalSpec | LocalSpec)?
140
}