top.rnc 6.75 KB
Newer Older
1
2
#
# EMULAB-COPYRIGHT
3
# Copyright (c) 2005-2007 University of Utah and the Flux Group.
4
5
6
# All rights reserved.
#

7
8
9
10
11
12
13
14
15
16
17
18
#
# 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 {
        ## 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.
19
        (element type_slots { xsd:integer { minInclusive = "0" } } |
20
21
22
23
24
25
26
27
28
         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
29
30
31
NodeSpec = element node { NodeContents }

NodeContents =
32
33
34
    ## Name of the node - each node name must be unique within the 
    ## top element
    attribute name { text },
35
36
    ## Additional attributes if any
    AdditionalNodeAttributeSpec,
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
    ## 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+

53
54
55
56
## Default additional flag spec to empty for the moment.
## It will be overridden in the ptop and vtop files
AdditionalNodeAttributeSpec = empty

57
58
59
60
61
62
63
64
65
66
67
68
## 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
69
70
71
LinkSpec = element link { LinkContents }

LinkContents =
72
73
    ## Name of the link - must be unique in the top
    attribute name { text },
74
75
76
77
78
79
80
81
    ## 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,
82
83
    ## Add additional specs for a link if necessary
    AdditionalLinkFlagSpec,
84
85
86
87
88
89
90
    ## Properties of this link
    PropertySpec*

## A link has two endpoints. Right now, they are order
## independent. But they might become order-dependant later.
LinkEndPoints =
    ## First interface for this link
91
92
    element source_interface { InterfaceSpec },
    ## Second interface for this link
93
94
95
96
97
98
    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 =
99
100
101
102
103
104
    ## 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%)
105
    element packet_loss { xsd:float { minInclusive = "0.0" } }
106
107

## A link can (by default) have zero or more types
108
LinkSpec.LinkType = LinkTypeSpec
109

110
111
112
113
## Set the additional link flag spec to empty for now.
## It will be overridden in the ptop and vtop files if required
AdditionalLinkFlagSpec = empty

114
115
116
117
118
119
120
121
122
123
124
## "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
125
    (GlobalSpec | LocalSpec)?
126
127
}

128
129
130
131
132
133
134
135
GlobalSpec = element global {
    element operator { "OnceOnly" | "FirstFree" }
}

LocalSpec = element local {
    element operator { "+" }
}

136
137
138
## "Legacy" assign node flags - will be replaced with properties, and in some
## cases, explicit links
NodeFlagSpec =
139
140
    ## Specify additional flags which are only valid in a particular topoplogy
    AdditionalNodeFlagSpec,
141
142
143
144
145
146
147
148
149
150
151
152
    ## 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 }?

153
154
155
156
## Set the additional node flag spec to empty for now.
## It will be overridden if required in the ptop and vtop files
AdditionalNodeFlagSpec = empty

157
## Interfaces
158
159
160
InterfaceSpec = element interface { InterfaceContents }

InterfaceContents =
161
162
163
    ## Name of the node, which must match one of the nodes in this topology
    element node_name { text },
    ## Name of the interface itself
164
    element interface_name { text },
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
    ## 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
Jonathon Duerig's avatar
Jonathon Duerig committed
182
    (GlobalSpec | LocalSpec)?
183
}