<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openvz.org/index.php?action=history&amp;feed=atom&amp;title=Changes_in_network_shaping_for_Virtuozzo_7</id>
	<title>Changes in network shaping for Virtuozzo 7 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openvz.org/index.php?action=history&amp;feed=atom&amp;title=Changes_in_network_shaping_for_Virtuozzo_7"/>
	<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Changes_in_network_shaping_for_Virtuozzo_7&amp;action=history"/>
	<updated>2026-06-30T16:09:15Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Changes_in_network_shaping_for_Virtuozzo_7&amp;diff=17809&amp;oldid=prev</id>
		<title>Sergey Bronnikov: added category</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Changes_in_network_shaping_for_Virtuozzo_7&amp;diff=17809&amp;oldid=prev"/>
		<updated>2015-10-13T13:55:37Z</updated>

		<summary type="html">&lt;p&gt;added category&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 13:55, 13 October 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l107&quot; &gt;Line 107:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 107:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== See also ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== See also ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [http://lists.openvz.org/pipermail/users/2015-July/006304.html Test Request Description]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [http://lists.openvz.org/pipermail/users/2015-July/006304.html Test Request Description]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category: TRD]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Sergey Bronnikov</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Changes_in_network_shaping_for_Virtuozzo_7&amp;diff=17102&amp;oldid=prev</id>
		<title>Sergey Bronnikov: TRD text</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Changes_in_network_shaping_for_Virtuozzo_7&amp;diff=17102&amp;oldid=prev"/>
		<updated>2015-07-22T14:06:32Z</updated>

		<summary type="html">&lt;p&gt;TRD text&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Feature ==&lt;br /&gt;
&lt;br /&gt;
a) Switch from CBQ traffic shaper to HTB. https://jira.sw.ru/browse/PSBM-18245&lt;br /&gt;
&lt;br /&gt;
b) Added packet rate limitation. https://jira.sw.ru/browse/PSBM-17708&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
a) HTB traffic shaper has following advantages:&lt;br /&gt;
&lt;br /&gt;
* higher accuracy&lt;br /&gt;
* does not need bandwidth for interfaces&lt;br /&gt;
&lt;br /&gt;
Therefore we made bandwidth rate optional in vz.conf:&lt;br /&gt;
https://jira.sw.ru/browse/PSBM-28834?focusedCommentId=2503775&amp;amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-2503775&lt;br /&gt;
&lt;br /&gt;
We use BANDWIDTH parameter from vz.conf only to get list of configured &lt;br /&gt;
devices. So&lt;br /&gt;
   BANDWIDTH=&amp;quot;eth0 eth1:100000&amp;quot;&lt;br /&gt;
is a valid syntax now.&lt;br /&gt;
&lt;br /&gt;
b) To prevent e.g. DoS attacks it is not enough to limit outgoing &lt;br /&gt;
bandwidth. Despite being limited in bandwidth, we still can produce a &lt;br /&gt;
great number of packets. Thus we need to limit packet rate along with &lt;br /&gt;
byte rate.&lt;br /&gt;
&lt;br /&gt;
This feature is implemented using HTB 'mpu' (Minimum packet unit) param. &lt;br /&gt;
It makes small packets with size &amp;lt; MPU bytes consume MPU HTB tokens. &lt;br /&gt;
Consequently, the maximum allowed packet rate is&lt;br /&gt;
TOTALRATE (bytes) / MPU (bytes/packet).&lt;br /&gt;
&lt;br /&gt;
We introduce a new *optional* parameter in vz.conf:&lt;br /&gt;
RATEMPU=&amp;quot;&amp;lt;dev|*&amp;gt;:&amp;lt;class&amp;gt;[:&amp;lt;mpu&amp;gt;] ...&amp;quot;&lt;br /&gt;
&lt;br /&gt;
1. If &amp;lt;dev&amp;gt;:&amp;lt;class&amp;gt; is not present in RATEMPU, no packet rate limitation is done for it.&lt;br /&gt;
2. If &amp;lt;mpu&amp;gt; is not present for &amp;lt;dev&amp;gt;:&amp;lt;class&amp;gt;, then the default MPU (1000) is used.&lt;br /&gt;
&lt;br /&gt;
The default value of 1000 (not e.g. mtu ~ 1500) was chosen because too &lt;br /&gt;
high MPU makes configured TOTALRATE unreachable (TOTALRATE can be &lt;br /&gt;
reached only with packets of size &amp;gt;= MPU; such large packets are &lt;br /&gt;
unusual). The value of 1000 is big enough to prevent DoS but realistic &lt;br /&gt;
in terms of packet size.&lt;br /&gt;
&lt;br /&gt;
To implement this feature we made the following modifications:&lt;br /&gt;
&lt;br /&gt;
1. Added RateMPU integer parameter to NetworkConfig.xsd in SDK (*default: 0 - enabled*).&lt;br /&gt;
2. Added NRM_ENABLED=0, NRM_DISABLED=-1 to PrlEnums.h in SDK.&lt;br /&gt;
3. Added PrlNetworkShapingEntry_Get(Set)RateMPU functions to PrlApiNet.h in SDK.&lt;br /&gt;
4. Added RATEMPU param to default config in vzctl, added entry to 'man 5 vz'.&lt;br /&gt;
5. Necessary implementation.&lt;br /&gt;
&lt;br /&gt;
RATEMPU is enabled by default for every newly created &lt;br /&gt;
NetworkShapingEntry. The values 0 and -1 are special, reserved for &lt;br /&gt;
constants NRM_ENABLED (use default MPU value) and NRM_DISABLED (do not &lt;br /&gt;
limit packet rate for this entry).&lt;br /&gt;
&lt;br /&gt;
== Products ==&lt;br /&gt;
&lt;br /&gt;
Virtuozzo 7 beta1&lt;br /&gt;
&lt;br /&gt;
Packages:&lt;br /&gt;
&lt;br /&gt;
a)&lt;br /&gt;
&lt;br /&gt;
* libvzctl &amp;gt;= 7.0.61&lt;br /&gt;
&lt;br /&gt;
b)&lt;br /&gt;
&lt;br /&gt;
* libprlsdk &amp;gt;= 7.0.20&lt;br /&gt;
* prl-disp-service &amp;gt;= 7.0.68&lt;br /&gt;
* libvzctl &amp;gt;= 7.0.70&lt;br /&gt;
* vzctl &amp;gt;= 7.0.50&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Need to test the following cases:&lt;br /&gt;
&lt;br /&gt;
a) Shaper is accurate, even for high rates (~1Gbit/s).&lt;br /&gt;
&lt;br /&gt;
b)&lt;br /&gt;
&lt;br /&gt;
* mpu parameter is used by HTB and shown in &amp;quot;tc -d class show ...&amp;quot;&lt;br /&gt;
* packet rate is limited by value of TOTALRATE / RATEMPU.&lt;br /&gt;
* packet rate limit is enabled for newly-created shaping entries with default RATEMPU (1000).&lt;br /&gt;
* packet rate is disabled (if arg == -1) or RATEMPU value is equal to given value (arg &amp;gt; 0) according to SetRateMPU() argument.&lt;br /&gt;
&lt;br /&gt;
== Known issues ==&lt;br /&gt;
&lt;br /&gt;
For mpu &amp;gt;= 300, there is some magic in tc, so given mpu value is split &lt;br /&gt;
into 'mpu' and 'overhead' parameters.&lt;br /&gt;
&lt;br /&gt;
mpu HTB parameter is (was?) ignored in vz7: https://jira.sw.ru/browse/PSBM-34874&lt;br /&gt;
&lt;br /&gt;
== What was checked by developer ==&lt;br /&gt;
&lt;br /&gt;
a) Two servers connected with a crossover. Measured HTB accuracy, got &lt;br /&gt;
the following results:&lt;br /&gt;
https://jira.sw.ru/browse/PSBM-18245?focusedCommentId=2525949&amp;amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-2525949&lt;br /&gt;
&lt;br /&gt;
b) Nothing. See section 5.&lt;br /&gt;
&lt;br /&gt;
== Feature owner ==&lt;br /&gt;
&lt;br /&gt;
* igor at virtuozzo.com&lt;br /&gt;
* mperevedentsev at virtuozzo.com&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [http://lists.openvz.org/pipermail/users/2015-July/006304.html Test Request Description]&lt;/div&gt;</summary>
		<author><name>Sergey Bronnikov</name></author>
		
	</entry>
</feed>