<span class="since">Since 0.8.8</span>
</p>
+ <h5><a name="elementQoS">Quality of service</a></h5>
+
+<pre>
+ ...
+ <devices>
+ <interface type='network'>
+ <source network='default'/>
+ <target dev='vnet0'/>
+ <b><bandwidth>
+ <inbound average='1000' peak='5000' burst='1024'/>
+ <outbound average='128' peak='256' burst='256'/>
+ </bandwidth></b>
+ </interface>
+ <devices>
+ ...</pre>
+
+ <p>
+ This part of interface XML provides setting quality of service. Incoming
+ and outgoing traffic can be shaped independently. The
+ <code>bandwidth</code> element can have at most one <code>inbound</code>
+ and at most one <code>outbound</code> child elements. Leaving any of these
+ children element out result in no QoS applied on that traffic direction.
+ So, when you want to shape only domain's incoming traffic, use
+ <code>inbound</code> only, and vice versa. Each of these elements have one
+ mandatory attribute <code>average</code>. It specifies average bit rate on
+ interface being shaped. Then there are two optional attributes:
+ <code>peak</code>, which specifies maximum rate at which interface can send
+ data, and <code>burst</code>, amount of bytes that can be burst at
+ <code>peak</code> speed. Accepted values for attributes are integer
+ numbers. The units for <code>average</code> and <code>peak</code> attributes
+ are kilobytes per second, and for the <code>burst</code> just kilobytes.
+ <span class="since">Since 0.9.4</span>
+ </p>
+
<h4><a name="elementsInput">Input devices</a></h4>
<p>
to this host. <span class="since">Since 0.3.0; 'mode' attribute since
0.4.2</span></dd>
</dl>
+ <h5><a name="elementQoS">Quality of service</a></h5>
+
+<pre>
+...
+ <forward mode='nat' dev='eth0'/>
+ <b><bandwidth>
+ <inbound average='1000' peak='5000' burst='5120'/>
+ <outbound average='128' peak='256' burst='256'/>
+ </bandwidth></b>
+ <mac address='00:16:3E:5D:C7:9E'/>
+...</pre>
+
+ <p>
+ This part of network XML provides setting quality of service. Incoming
+ and outgoing traffic can be shaped independently. The
+ <code>bandwidth</code> element can have at most one <code>inbound</code>
+ and at most one <code>outbound</code> child elements. Leaving any of these
+ children element out result in no QoS applied on that traffic direction.
+ So, when you want to shape only network's incoming traffic, use
+ <code>inbound</code> only, and vice versa. Each of these elements have one
+ mandatory attribute <code>average</code>. It specifies average bit rate on
+ interface being shaped. Then there are two optional attributes:
+ <code>peak</code>, which specifies maximum rate at which bridge can send
+ data, and <code>burst</code>, amount of bytes that can be burst at
+ <code>peak</code> speed. Accepted values for attributes are integer
+ numbers, The units for <code>average</code> and <code>peak</code> attributes
+ are kilobytes per second, and for the <code>burst</code> just kilobytes.
+ The rate is shared equally within domains connected to the network.
+ <span class="since">Since 0.9.4</span>
+ </p>
<h3><a name="elementsAddress">Addressing</a></h3>
<optional>
<ref name="deviceBoot"/>
</optional>
+ <optional>
+ <ref name="bandwidth"/>
+ </optional>
</interleave>
</define>
<!--
</zeroOrMore>
</element>
</optional>
+ <optional>
+ <ref name="bandwidth"/>
+ </optional>
<!-- <ip> element -->
<zeroOrMore>
</group>
</choice>
</define>
+
+ <define name="bandwidth">
+ <element name="bandwidth">
+ <interleave>
+ <optional>
+ <element name="inbound">
+ <ref name="bandwidth-attributes"/>
+ <empty/>
+ </element>
+ </optional>
+ <optional>
+ <element name="outbound">
+ <ref name="bandwidth-attributes"/>
+ <empty/>
+ </element>
+ </optional>
+ </interleave>
+ </element>
+ </define>
+
+ <define name="bandwidth-attributes">
+ <attribute name="average">
+ <ref name="speed"/>
+ </attribute>
+ <optional>
+ <attribute name="peak">
+ <ref name="speed"/>
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name='burst'>
+ <ref name="BurstSize"/>
+ </attribute>
+ </optional>
+ </define>
+
+ <define name="speed">
+ <data type="unsignedInt">
+ <param name="pattern">[0-9]+</param>
+ <param name="minInclusive">1</param>
+ </data>
+ </define>
+ <define name="BurstSize">
+ <data type="unsignedInt">
+ <param name="pattern">[0-9]+</param>
+ <param name="minInclusive">1</param>
+ </data>
+ </define>
</grammar>