This file is indexed.

/usr/share/doc/iptables-optimizer-doc/html/plausible.html is in iptables-optimizer-doc 0.9.13-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Plausibility &mdash; iptables-optimizer 0.9.13 documentation</title>
    
    <link rel="stylesheet" href="_static/cloud.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="//fonts.googleapis.com/css?family=Noticia+Text|Open+Sans|Droid+Sans+Mono" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    './',
        VERSION:     '0.9.13',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <script type="text/javascript" src="_static/cloud.js"></script>
    <link rel="top" title="iptables-optimizer 0.9.13 documentation" href="index.html" />
    <link rel="next" title="iptables-optimizer-tests.sh - shell tests" href="shunit2.html" />
    <link rel="prev" title="iptables-optimizer - intro" href="iptables-optimizer.html" /> 
        <meta name="viewport" content="width=device-width, initial-scale=1">
  </head>
  <body>
    <div class="relbar-top">
        
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a></li>
        <li class="right" >
          <a href="shunit2.html" title="iptables-optimizer-tests.sh - shell tests"
             accesskey="N">next</a> &nbsp; &nbsp;</li>
        <li class="right" >
          <a href="iptables-optimizer.html" title="iptables-optimizer - intro"
             accesskey="P">previous</a> &nbsp; &nbsp;</li>
    <li><a href="index.html">iptables-optimizer 0.9.13 documentation</a> &raquo;</li>
 
      </ul>
    </div>
    </div>
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="plausibility">
<h1>Plausibility<a class="headerlink" href="#plausibility" title="Permalink to this headline"></a></h1>
<div class="section" id="initial-scenario">
<h2>Initial Scenario<a class="headerlink" href="#initial-scenario" title="Permalink to this headline"></a></h2>
<p>Assume the following single chain as part of a NetFilter table, the number and the partition number rows
are meta information and not taken from or represented in the kernel.
(only meaningful content is shown here):</p>
<table border="1" class="docutils">
<colgroup>
<col width="19%" />
<col width="22%" />
<col width="37%" />
<col width="22%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">No</th>
<th class="head">pkts</th>
<th class="head">target</th>
<th class="head">part</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>1</td>
<td>15</td>
<td>accept</td>
<td>1</td>
</tr>
<tr class="row-odd"><td>2</td>
<td>18</td>
<td>accept</td>
<td>1</td>
</tr>
<tr class="row-even"><td>3</td>
<td>119</td>
<td>accept</td>
<td>1</td>
</tr>
<tr class="row-odd"><td>4</td>
<td>21</td>
<td>drop</td>
<td>2</td>
</tr>
<tr class="row-even"><td>5</td>
<td>30</td>
<td>accept</td>
<td>3</td>
</tr>
<tr class="row-odd"><td>6</td>
<td>36</td>
<td>accept</td>
<td>3</td>
</tr>
<tr class="row-even"><td>7</td>
<td>1</td>
<td>userdef1</td>
<td>4</td>
</tr>
<tr class="row-odd"><td>8</td>
<td>5</td>
<td>userdef2</td>
<td>5</td>
</tr>
<tr class="row-even"><td>9</td>
<td>6</td>
<td>drop</td>
<td>6</td>
</tr>
<tr class="row-odd"><td>10</td>
<td>6</td>
<td>drop</td>
<td>6</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="partitions">
<h2>Partitions<a class="headerlink" href="#partitions" title="Permalink to this headline"></a></h2>
<p>Partitions are assigned to the rules regarding their targets,
starting with the first rule and the target accept. Rule 4 has
another target, so rule 1, 2 and 3 build the first partition,
the second partition starts with rule 4 and ends with it,
because rule 5 has another target, so we continue until the
end of the chain. At last we have found the partition table as
a list:</p>
<div class="highlight-python"><div class="highlight"><pre>partition numbers  1       2       3       4       5       6
partition list = [[1, 3], [4, 4], [5, 6], [7, 7], [8, 8], [9, 10], ]
</pre></div>
</div>
<p>The list is constructed from elements, a two element list each. Every single element is build from the starting and ending
number of the rules having the same target and an implicit length, which is easily calculated as:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">length</span> <span class="o">=</span> <span class="mi">1</span> <span class="o">+</span> <span class="n">end</span> <span class="o">-</span> <span class="n">start</span>
</pre></div>
</div>
<p>Viewed as a table it looks like:</p>
<table border="1" class="docutils">
<colgroup>
<col width="28%" />
<col width="23%" />
<col width="21%" />
<col width="28%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head"><tt class="docutils literal"><span class="pre">Part.No</span></tt></th>
<th class="head"><tt class="docutils literal"><span class="pre">Start</span></tt></th>
<th class="head"><tt class="docutils literal"><span class="pre">End</span></tt></th>
<th class="head"><tt class="docutils literal"><span class="pre">Length</span></tt></th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><tt class="docutils literal"><span class="pre">1</span></tt></td>
<td><tt class="docutils literal"><span class="pre">1</span></tt></td>
<td><tt class="docutils literal"><span class="pre">3</span></tt></td>
<td><tt class="docutils literal"><span class="pre">3</span></tt></td>
</tr>
<tr class="row-odd"><td><tt class="docutils literal"><span class="pre">2</span></tt></td>
<td><tt class="docutils literal"><span class="pre">4</span></tt></td>
<td><tt class="docutils literal"><span class="pre">4</span></tt></td>
<td><tt class="docutils literal"><span class="pre">1</span></tt></td>
</tr>
<tr class="row-even"><td><tt class="docutils literal"><span class="pre">3</span></tt></td>
<td><tt class="docutils literal"><span class="pre">5</span></tt></td>
<td><tt class="docutils literal"><span class="pre">6</span></tt></td>
<td><tt class="docutils literal"><span class="pre">2</span></tt></td>
</tr>
<tr class="row-odd"><td><tt class="docutils literal"><span class="pre">4</span></tt></td>
<td><tt class="docutils literal"><span class="pre">7</span></tt></td>
<td><tt class="docutils literal"><span class="pre">7</span></tt></td>
<td><tt class="docutils literal"><span class="pre">1</span></tt></td>
</tr>
<tr class="row-even"><td><tt class="docutils literal"><span class="pre">5</span></tt></td>
<td><tt class="docutils literal"><span class="pre">8</span></tt></td>
<td><tt class="docutils literal"><span class="pre">8</span></tt></td>
<td><tt class="docutils literal"><span class="pre">1</span></tt></td>
</tr>
<tr class="row-odd"><td><tt class="docutils literal"><span class="pre">6</span></tt></td>
<td><tt class="docutils literal"><span class="pre">9</span></tt></td>
<td><tt class="docutils literal"><span class="pre">10</span></tt></td>
<td><tt class="docutils literal"><span class="pre">2</span></tt></td>
</tr>
</tbody>
</table>
<p>Now lets concentrate on the first partition and the rules in it:</p>
<table border="1" class="docutils">
<colgroup>
<col width="19%" />
<col width="22%" />
<col width="37%" />
<col width="22%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td>1</td>
<td>15</td>
<td>accept</td>
<td>1</td>
</tr>
<tr class="row-even"><td>2</td>
<td>18</td>
<td>accept</td>
<td>1</td>
</tr>
<tr class="row-odd"><td>3</td>
<td>119</td>
<td>accept</td>
<td>1</td>
</tr>
</tbody>
</table>
<p>We see, some (perhaps) different things shall be accepted by these
three filter rules. So if a packet matches one of them or more, it
is accepted. If it matches the third rule, the two before are
consulted for nothing. Is the overall policy affected, if we change
the position of the third rule to the top position? The answer is
no, because the accepted traffic in sum is exactly the same
regarding this partition of the complete rule set. So we can
rearrange it to:</p>
<table border="1" class="docutils">
<colgroup>
<col width="19%" />
<col width="22%" />
<col width="37%" />
<col width="22%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td>3</td>
<td>119</td>
<td>accept</td>
<td>1</td>
</tr>
<tr class="row-even"><td>2</td>
<td>18</td>
<td>accept</td>
<td>1</td>
</tr>
<tr class="row-odd"><td>1</td>
<td>15</td>
<td>accept</td>
<td>1</td>
</tr>
</tbody>
</table>
<p>As a result, the packets allowed by the now first rule are passed quicker because
the other to rules are not taken into account. <em>Latency is reduced.</em></p>
<p>Partitions with a length of one are of no interest, surprisingly. Their
content and their position are static all over the time.</p>
</div>
<div class="section" id="exchanged-rules">
<h2>Exchanged rules<a class="headerlink" href="#exchanged-rules" title="Permalink to this headline"></a></h2>
<p>Working down the partitions list, we come to this final result for the chain,
the rule numbers are kept from the example shown above:</p>
<table border="1" class="docutils">
<colgroup>
<col width="19%" />
<col width="22%" />
<col width="37%" />
<col width="22%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">No</th>
<th class="head">pkts</th>
<th class="head">target</th>
<th class="head">part</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>3</td>
<td>119</td>
<td>accept</td>
<td>1</td>
</tr>
<tr class="row-odd"><td>2</td>
<td>18</td>
<td>accept</td>
<td>1</td>
</tr>
<tr class="row-even"><td>1</td>
<td>15</td>
<td>accept</td>
<td>1</td>
</tr>
<tr class="row-odd"><td>4</td>
<td>21</td>
<td>drop</td>
<td>2</td>
</tr>
<tr class="row-even"><td>6</td>
<td>36</td>
<td>accept</td>
<td>3</td>
</tr>
<tr class="row-odd"><td>5</td>
<td>30</td>
<td>accept</td>
<td>3</td>
</tr>
<tr class="row-even"><td>7</td>
<td>1</td>
<td>userdef1</td>
<td>4</td>
</tr>
<tr class="row-odd"><td>8</td>
<td>5</td>
<td>userdef2</td>
<td>5</td>
</tr>
<tr class="row-even"><td>9</td>
<td>6</td>
<td>drop</td>
<td>6</td>
</tr>
<tr class="row-odd"><td>10</td>
<td>6</td>
<td>drop</td>
<td>6</td>
</tr>
</tbody>
</table>
<p>From the policy view, nothing has changed. Packets may pass as before or are dropped as before.
But the kernel now finds the more often used rules quicker than before.</p>
</div>
<div class="section" id="conclusion">
<h2>Conclusion<a class="headerlink" href="#conclusion" title="Permalink to this headline"></a></h2>
<p>That is exactly what was intended by the swapping. The length of the partitions is not changed,
for less latency the administrator should try to build as less partitions as possible. Exactly that is
his artwork and no optimizer nor any other automatism can help him to solve this puzzle.</p>
<p>How often shall this calculation be done? You have to find out yourself on your behalf.
When I wrote the python code, it was run by cron every second on a dual core system and reducing
latency for every end users joy.</p>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper"><div class="sphinxlocaltoc">
    <h3><a href="index.html">Page contents</a></h3>
    <ul>
<li><a class="reference internal" href="#">Plausibility</a><ul>
<li><a class="reference internal" href="#initial-scenario">Initial Scenario</a></li>
<li><a class="reference internal" href="#partitions">Partitions</a></li>
<li><a class="reference internal" href="#exchanged-rules">Exchanged rules</a></li>
<li><a class="reference internal" href="#conclusion">Conclusion</a></li>
</ul>
</li>
</ul>

  </div>
  <div class="sphinxprev">
    <h4>Previous page</h4>
    <p class="topless"><a href="iptables-optimizer.html"
                          title="Previous page">&larr; iptables-optimizer - intro</a></p>
  </div>
  <div class="sphinxnext">
    <h4>Next page</h4>
    <p class="topless"><a href="shunit2.html"
                          title="Next page">&rarr; iptables-optimizer-tests.sh - shell tests</a></p>
  </div>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="relbar-bottom">
        
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a></li>
        <li class="right" >
          <a href="shunit2.html" title="iptables-optimizer-tests.sh - shell tests"
             >next</a> &nbsp; &nbsp;</li>
        <li class="right" >
          <a href="iptables-optimizer.html" title="iptables-optimizer - intro"
             >previous</a> &nbsp; &nbsp;</li>
    <li><a href="index.html">iptables-optimizer 0.9.13 documentation</a> &raquo;</li>
 
      </ul>
    </div>
    </div>

    <div class="footer">
        &copy; Copyright 2014, 2015, Johannes Hubertz.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
    </div>
    <!-- cloud_sptheme 1.4 -->
  </body>
</html>