<p>I've a kubernetes cluster in aws, created with kops. I'm trying to evaluate network performance of the kubernetes cluster. I'm using default kubernetes CNI kubenet.</p>

<pre><code>networking:
    kubenet: {}
</code></pre>

<p>I've used <a href="https://github.com/kubernetes/perf-tests" rel="nofollow noreferrer">kubernetes-perf-test</a>'s <a href="https://github.com/kubernetes/perf-tests/tree/master/network/benchmarks/netperf" rel="nofollow noreferrer">net-perf</a> to evaluate kubernetes cluster's network performance.</p>

<p>I've used below command to run the test.</p>

<pre><code>go run ./launch.go --iterations 2
</code></pre>

<p>generated output</p>

<pre><code>MSS                                          , Maximum, 96, 160, 224, 288, 352, 416, 480, 544, 608, 672, 736, 800, 864, 928, 992, 1056, 1120, 1184, 1248, 1312, 1376, 1440,
1 iperf TCP. Same VM using Pod IP            ,36736.000000,2101,25486,36736,35636,36115,35631,6801,6544,7146,6565,6320,7252,6363,5707,5855,6034,36058,34098,36713,35625,34571,6341,
2 iperf TCP. Same VM using Virtual IP        ,30203.000000,5531,6072,5963,5294,6047,5879,5412,5456,5844,28499,29306,29289,30203,28516,5987,5460,5833,6029,4920,5027,5111,4700,
3 iperf TCP. Remote VM using Pod IP          ,664.000000,0,0,102,134,156,196,229,255,266,189,214,240,235,267,314,294,403,531,612,617,664,657,
4 iperf TCP. Remote VM using Virtual IP      ,778.000000,0,0,134,163,202,240,287,313,338,414,481,477,512,610,605,559,604,578,572,679,778,697,
5 iperf TCP. Hairpin Pod to own Virtual IP   ,29522.000000,974,547,19748,22219,24301,24043,25328,24531,4508,4471,5699,4339,4199,5001,5504,4974,15043,28658,29522,28902,28574,28956,
6 iperf UDP. Same VM using Pod IP            ,1592.000000,1592,
7 iperf UDP. Same VM using Virtual IP        ,1008.000000,1008,
8 iperf UDP. Remote VM using Pod IP          ,0.000000,0,
9 iperf UDP. Remote VM using Virtual IP      ,0.000000,0,
10 netperf. Same VM using Pod IP             ,3516.740000,3516.74,
11 netperf. Same VM using Virtual IP         ,0.000000,0.00,
12 netperf. Remote VM using Pod IP           ,422.430000,422.43,
13 netperf. Remote VM using Virtual IP       ,0.000000,0.00,

</code></pre>

<p>I'm not sure what actually this output means. How can I determine with this value, whether my k8s cluster's network is performing okay or not?</p>

<p>Also, I've tried to plot this data.<a href="https://i.stack.imgur.com/v0YcS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/v0YcS.png" alt="enter image description here"></a>
<a href="https://i.stack.imgur.com/Jqlkd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Jqlkd.png" alt="enter image description here"></a></p>

Abu Hanifa
<p><strong>This script is testing iperf/netperf transfer speed in MSS testpoint in 5 scenarios for TCP, UDP and NetPerf.</strong></p>

<p>Honestly all you have described in provided Github links.</p>

<p><code>Iperf</code> is a commonly used network testing tool that can create TCP/UDP data streams and measure the throughput of a network that is carrying them. It allows the user to set various parameters that can be used for testing a network, or alternatively for optimizing or tuning a network.</p>

<p><code>Netperf</code> is also another good network testing tool, which is also used by the PerfKitBenchmark suite to test performance and benchmark the various cloud providers to each other.</p>

<p>More information you can find <a href="https://medium.com/@duhroach/tools-to-profile-networking-performance-3141870d5233" rel="nofollow noreferrer">here</a></p>

<p>On the Github you have 2x5 ipetf scenarios for TCP and UPD and 5 scenarios for netperf.</p>

<blockquote>
  <p>The 5 major network traffic paths are combination of Pod IP vs Virtual
  IP and whether the pods are co-located on the same node/VM versus a
  remotely located pod.<br>
  - Same VM using Pod IP</p>
  
  <p>Same VM Pod to Pod traffic tests from Worker 1 to Worker 2 using its
  Pod IP.<br>
  - Same VM using Cluster/Virtual IP</p>
  
  <p>Same VM Pod to Pod traffic tests from Worker 1 to Worker 2 using its
  Service IP (also known as its Cluster IP or Virtual IP).<br>
  - Remote VM using Pod IP</p>
  
  <p>Worker 3 to Worker 2 traffic tests using Worker 2 Pod IP.<br>
  - Remote VM using Cluster/Virtual IP</p>
  
  <p>Worker 3 to Worker 2 traffic tests using Worker 2 Cluster/Virtual IP.<br>
  - Same VM Pod Hairpin to itself using Cluster IP</p>
</blockquote>

<p><strong>Regarding CSV output</strong></p>

<p>MMS - Maximum Segment Size. More information about it can be found <a href="http://ps-2.kev009.com/wisclibrary/aix51/usr/share/man/info/en_US/a_doc_lib/aixbman/prftungd/2365c93.htm" rel="nofollow noreferrer">here</a>.</p>

<blockquote>
  <p>Example TCP MMS The TCP protocol includes a mechanism for both ends of
  a connection to negotiate the maximum segment size (MSS) to be used
  over the connection. Each end uses the OPTIONS field in the TCP header
  to advertise a proposed MSS. The MSS that is chosen is the smaller of
  the values provided by the two ends.</p>
  
  <p>The purpose of this negotiation is to avoid the delays and throughput
  reductions caused by fragmentation of the packets when they pass
  through routers or gateways and reassembly at the destination host.</p>
  
  <p>The value of MSS advertised by the TCP software during connection
  setup depends on whether the other end is a local system on the same
  physical network (that is, the systems have the same network number)
  or whether it is on a different (remote) network.</p>
</blockquote>

<p>So for each scenario (Maximum Segment Size), for protocol, script is measuring transfer speed per MSS datapoint in Mbit/sec. This output will have better visibility if you paste it to excel and use "Text to Columns" divided by comma.</p>

<p>In graph you have the same values, just for better visibility.</p>
