Changes between Initial Version and Version 1 of Cnbp2019/Agenda/PfsonarLab


Ignore:
Timestamp:
Feb 24, 2019, 1:59:30 PM (5 years ago)
Author:
admin
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Cnbp2019/Agenda/PfsonarLab

    v1 v1  
     1= Perfsonar, BWCTL and iperf =
     2
     3== Setup Perfsonar ==
     4
     5Installing perfsonar will take some time. Therefore we will give you a .ova file which you can import to your virtualbox. This will give youa vm with perfsonar installed.
     6
     7- Please download the .ova file. Note down the location.
     8[http://192.248.4.49/NetMon/centos--perfsonar4.0.1--NMM.ova download]
     9
     10 - Go to the location where file is downloaded and double click the file.
     11
     12 - You will get a window asking whether you need to import. check the '''Reinitialize the MAC address of all network cards''' check box and Click '''import'''
     13
     14 - Click '''agree''' to the conditions.
     15
     16 - It will take some time to import. After a while you will get a perfsonar instant in your virtulbox.
     17
     18 - Select the VM and click '''Settings'''. Go to '''Network'''. In adapter 1 Select '''Bridged Adapter''' in the Attached to: drop down list. and Select the correct network interface (Which you are using). Click '''Ok'''.
     19
     20 - Now start the VM and Log in as '''root''' password is <Class Password>.
     21
     22 - Once you log in it will ask you to create a user for web administration. Give the username as '''admin'''. Give the password as class password.
     23
     24 - Then it will ask whether you want to disable root ssh log in and create a ssh user. hit '''enter'''. Give your name as the username. Give password as <Class Password>.
     25
     26 - Give the following Command. and find out your network interface name
     27{{{
     28ifconfig
     29}}}
     30
     31 - You will get something like this. Which tells that your interface name is '''enp0s3'''
     32{{{
     33enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
     34        inet6 fe80::a00:27ff:fe06:dbb5  prefixlen 64  scopeid 0x20<link>
     35        ether 08:00:27:06:db:b5  txqueuelen 10000  (Ethernet)
     36        RX packets 48606  bytes 5307960 (5.0 MiB)
     37        RX errors 0  dropped 0  overruns 0  frame 0
     38        TX packets 17461  bytes 1943813 (1.8 MiB)
     39        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
     40}}}
     41
     42 - Now edit the '''/etc/sysconfig/network-scripts/ifcfg-<Your interface name>''' and add the following lines. You can find your perfsonar IPv4 and IPv6 Addresses from the [wiki:2017netmonipallocation table]
     43{{{
     44IPADDR=<Your IP Address>
     45GATEWAY=192.248.6.254
     46NETMASK=255.255.255.0
     47DNS1=192.248.1.161
     48IPV6ADDR=<Your IPv6 Address>
     49IPV6_DEFAULTGW=2401:dd00:1032:2::ffff
     50}}}
     51
     52 - Find the following line
     53{{{
     54BOOTPROTO="dhcp"
     55}}}
     56
     57and change it to
     58{{{
     59BOOTPROTO="static"
     60}}}
     61 
     62 - Restart network service
     63{{{
     64systemctl stop NetworkManager
     65systemctl disable NetworkManager
     66systemctl restart network
     67}}}
     68
     69Now you can access the web interface
     70
     71== Web interface ==
     72
     73 - Open a web browser in your host pc and give the IP address of you perfsonar VM. You will get the perfsonar toolkit.
     74
     75 - Log in to the toolkit by by clicking the log in button. Give username as '''admin''' and password as '''<Class Password>'''
     76
     77 - Let set up the NTP. To do that, Click '''Configure''' button and Click the '''Host'''. Click the '''Select the closest servers''' and it will show you some closest servers. Click '''Save'''.
     78
     79[[Image(https://ws.learn.ac.lk/raw-attachment/wiki/netmon2017perfsonar/ps1.png)]]
     80
     81 - Then Let's configure server details. Click the '''Administrative Information'''. Fill the following details. and Click '''Save'''
     82
     83  -- Organization Name : LEARN
     84
     85  -- City : Peradeniya
     86
     87  -- Country : Sri Lanka
     88
     89  -- !State/Province : Kandy
     90
     91  -- !ZIP/Postal Code : 22000
     92
     93  -- Administrator Name : <your Name>
     94
     95  -- Administrator Email : <Your E mail>
     96
     97  -- Node Role : NREN
     98
     99  -- Node Access Policy : Private
     100 
     101  -- Communities : LEARN
     102
     103== Testing with Perfsonar ==
     104
     105Lets do a ping test with perfsonar.
     106
     107 - First Click '''Configure''' and click '''Test''' tab.
     108 - Then Click '''+Test''' button and you will get the '''Test parameters''' page .
     109
     110[[Image(https://ws.learn.ac.lk/raw-attachment/wiki/netmon2017perfsonar/ps4.png)]]
     111
     112 - Select '''ping''' from '''Type''' drop down list.
     113 - Set the following details
     114     * Test name/description : Test with <Neighbor IP>
     115     * Interface : Default
     116     * Time between tests : 5
     117     * Units : minutes
     118     * Packets per test : 10
     119     * Hostname/IP : <Your Neighbor's IP Address>
     120     * Host description : <Neighbor's Name>
     121 - Click '''Ok'''
     122
     123[[Image(https://ws.learn.ac.lk/raw-attachment/wiki/netmon2017perfsonar/ps3.png)]]
     124
     125 - Click '''Save'''
     126 - You will the created test now appears in dashboard. Check for the values.
     127
     128== bwctl ==
     129
     130bwctl is a command line client application that is  used  to  initiate throughput tests. Let's measure throughput between your perfsonar node and your neighbors perfsonar node.
     131
     132 - ssh in to your perfsonar node. Use your name (which you give when you set up perfsonar) and <class password>
     133 - Give the following Command
     134{{{
     135bwctl -f m -t 10 -i 1 -c <your neighbors perfsonar IP address>
     136}}}
     137 - You will get an out put as follows
     138
     139[[Image(https://ws.learn.ac.lk/raw-attachment/wiki/netmon2017perfsonar/ps2.png)]]
     140
     141 - Check the values in '''Bitrate'''
     142
     143
     144= iperf =
     145
     146Linux systems administrators and network administrators often find diagnosing network speed degradation complicated, as there are very few tools available to diagnose these issues. iperf is a command-line tool used in the diagnostics of network speed issues. iperf measures the maximum network throughput a server can handle. It is particularly useful when experiencing network speed issues, as you can use iperf to determine which server is unable to reach maximum throughput.
     147
     148== Installation ==
     149
     150You can use apt-get to install iperf on Debian and Ubuntu:
     151{{{
     152apt-get install iperf
     153}}}
     154
     155'''Note: Installation of perfsonar gives you iperf3 by default. Therefore you do not have to install iperf.'''
     156
     157== How to Use iperf ==
     158
     159iperf must be installed on both computers between which you are testing the connection. If you are using a Unix or Linux-based operating system on your personal computer, you may be able to install iperf on your local machine. If you are testing the throughput of your Linode, however, it’s better to use another server as the end point, as your local ISP may impose network restrictions that can affect the results of your test.
     160
     161== TCP Clients & Servers ==
     162
     163iperf requires two systems because one system must act as a server, while the other acts as a client. The client connects to the server you’re testing the speed of.
     164
     165 - On the Linode you wish to test, launch iperf3 in server mode:
     166{{{
     167iperf -s
     168}}}
     169   
     170You should see output similar to:
     171{{{
     172------------------------------------------------------------
     173Server listening on TCP port 5001
     174TCP window size:  128 KByte (default)
     175------------------------------------------------------------
     176}}}
     177
     178 - On your second Linode, connect to the first. Replace 192.168.1.1 with the first Linode’s IP address.
     179
     180{{{
     181iperf -c 192.168.1.1
     182}}}
     183   
     184The output should be similar to:
     185{{{
     186------------------------------------------------------------
     187Client connecting to 192.168.1.1, TCP port 5001
     188TCP window size: 85.0 KByte (default)
     189------------------------------------------------------------
     190[  3] local 192.168.1.2 port 45448 connected with 192.168.1.1 port 5001
     191[ ID] Interval       Transfer     Bandwidth
     192[  3]  0.0-10.0 sec   524 MBytes   439 Mbits/sec
     193}}}
     194   
     195You will also see the connection and results on your iperf server. This will look similar to:
     196{{{
     197------------------------------------------------------------
     198Server listening on TCP port 5001
     199TCP window size:  128 KByte (default)
     200------------------------------------------------------------
     201[  4] local 192.168.1.1 port 5001 connected with 192.168.1.2 port 45448
     202[ ID] Interval       Transfer     Bandwidth
     203[  4]  0.0-10.1 sec   524 MBytes   437 Mbits/sec
     204}}}
     205
     206- To stop the iperf server process, press CTRL + c.
     207
     208== UDP Clients & Servers ==
     209
     210Using iPerf, you can also test the maximum throughput achieved via UDP connections.
     211
     212- Start a UDP iperf server:
     213{{{
     214iperf -s -u
     215}}}
     216
     217The output will be similar to:
     218{{{
     219------------------------------------------------------------
     220Server listening on TCP port 5001
     221Receiving 1470 byte datagrams
     222UDP buffer size:  192 KByte (default)
     223------------------------------------------------------------
     224}}}
     225
     226- '''-u''' Connect your client to your iperf UDP server. Replace 192.168.1.1 with your IP address:
     227{{{
     228iperf -c 198.168.1.1 -u
     229}}}
     230
     231The -u option we’ve passed tells iperf3 that we are connecting via UDP. This is important, because we want to see the maximum throughput achieved via UDP. The output should be similar to:
     232{{{
     233------------------------------------------------------------
     234Client connecting to 192.168.1.1, UDP port 5001
     235Sending 1470 byte datagrams
     236UDP buffer size:  208 KByte (default)
     237------------------------------------------------------------
     238[  3] local 192.168.1.2 port 35650 connected with 192.168.1.1 port 5001
     239[ ID] Interval       Transfer     Bandwidth
     240[  3]  0.0-10.0 sec  1.25 MBytes  1.05 Mbits/sec
     241[  3] Sent 893 datagrams
     242[  3] Server Report:
     243[  3]  0.0-10.0 sec  1.25 MBytes  1.05 Mbits/sec   0.408 ms    0/  893 (0%)
     244
     245}}}
     246
     247- Looking at the output we have received, 1.05 Mbits/sec is considerably less than what we received on the TCP tests. It is also considerably less than the maximum outbound bandwidth cap provided by the 1GB Linode. This is because iperf limits the bandwidth for UDP clients to 1 Mbit per second by default.
     248
     249You can change this with the -b flag, replacing the number after with the maximum bandwidth rate you wish to test against. If you are testing for network speed, we recommend setting this number above the maximum bandwidth cap provided by Linode. For example, this test was run on a 1GB Linode:
     250{{{
     251iperf -c 192.168.1.1 -u -b 100m
     252}}}
     253   
     254This tells the client that we want to achieve a maximum of 100 Mbits per second if possible.
     255{{{
     256------------------------------------------------------------
     257Client connecting to 192.168.1.1, UDP port 5001
     258Sending 1470 byte datagrams
     259UDP buffer size:  208 KByte (default)
     260------------------------------------------------------------
     261[  3] local 192.168.1.29 port 57998 connected with 192.168.1.1 port 5001
     262[ ID] Interval       Transfer     Bandwidth
     263[  3]  0.0-10.0 sec   120 MBytes   101 Mbits/sec
     264[  3] Sent 85471 datagrams
     265[  3] Server Report:
     266[  3]  0.0-10.0 sec   120 MBytes   101 Mbits/sec   0.147 ms    1/85470 (0.0012%)
     267[  3]  0.0-10.0 sec  1 datagrams received out-of-order
     268
     269}}}
     270
     271Now that is considerably better than the 1.05 Mbits/sec we were seeing earlier!
     272
     273== Bidirectional Tests ==
     274
     275In some cases, you may want to test both servers for the maximum amount of throughput. This can easily be done using the built-in bidirectional testing feature iperf offers.
     276
     277Run the following command to test both connections:
     278{{{
     279iperf -c 192.168.1.1 -d
     280}}}
     281
     282The result is that iperf will start a server and a client connection on the original client server (192.168.1.2). Once this has been done, iPerf will connect the original iperf server to the client connection, which is now acting as both a server connection and a client connection. This will look similar
     283
     284{{{
     285------------------------------------------------------------
     286Server listening on TCP port 5001
     287TCP window size: 85.3 KByte (default)
     288------------------------------------------------------------
     289------------------------------------------------------------
     290Client connecting to 192.168.1.1, TCP port 5001
     291TCP window size:  170 KByte (default)
     292------------------------------------------------------------
     293[  5] local 192.168.1.2 port 45544 connected with 192.168.1.1 port 5001
     294[  4] local 192.168.1.2 port 5001 connected with 192.168.1.1 port 50048
     295[ ID] Interval       Transfer     Bandwidth
     296[  5]  0.0-10.0 sec   304 MBytes   255 Mbits/sec
     297[  4]  0.0-10.0 sec   236 MBytes   197 Mbits/sec
     298}}}
     299
     300On the original iPerf server, you will see:
     301{{{
     302------------------------------------------------------------
     303Client connecting to 192.168.1.2, TCP port 5001
     304TCP window size:  129 KByte (default)
     305------------------------------------------------------------
     306[  6] local 192.168.1.1 port 50048 connected with 192.168.1.2 port 5001
     307Waiting for server threads to complete. Interrupt again to force quit.
     308[ ID] Interval       Transfer     Bandwidth
     309[  6]  0.0-10.0 sec   236 MBytes   198 Mbits/sec
     310[  4]  0.0-10.1 sec   304 MBytes   253 Mbits/sec
     311}}}