Testing Network Speed with Iperf3

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome back everybody today we're going to be taking a look at doing network speed tests between servers using a tool called iperf3 this is a great tool to use for measuring raw network performance because it takes out a lot of the other variables that you might encounter by just transferring a file over such as the overhead of higher level protocols or the limitations of the actual hard drive that you're reading or writing to if you're on a debian based distribution you can install this tool using sudo apt install iperf3 and i already have it installed and if you're on windows you'll need to go to the website and download the binary and do note that there is another tool called iperf which is just the older version of this one and it is not compatible with iperf 3. all right with that out of the way let's go ahead and jump in and see how this works so the first thing we need to do is get the service up and running on the server that we want to test to so we're gonna ssh into server o2 and then to get it started we're gonna use iper three slash s to run in server mode and then we're gonna jump back over to our workstation and we're gonna use i per three and then dash c for client mode and then server o2 or the ip address of the server and you can see it's passing the traffic from the client to the server and we're getting about 950 megabits per second which is basically line speed for the gigabit network that we're on and if we take a look over here on the left side on the server you can see we got a connection from 192.168.1.3 which is me coming from port 6048 so it does show you who you who connected to you so by default this is going to test a tcp connection but we can also run it in udp mode so if we clear out of that you come back up to here and we do dash u we can run this in udp mode you see it's a little bit slower in udp mode but it does give us additional statistics now such as jitter which you can see here in the right column we can also run this for a predefined period of time so if we clear this out we can do iperf 3 and if we use the attack t option this time we can say how long we want this to run in seconds so we want to run it for 120 seconds and then c for client mode and server 02 again so now it'll run for 120 seconds or whatever time frame that you give it and then return the results to you we'll go ahead and cancel that out another useful feature is running it in reverse mode so by default the client is going to send traffic to the server but if we run it in reverse mode with tac capital r it will have the server send the data in the client receive so this would be useful for say if you have a vpn connection to your remote site and it's over an asynchronous connection say like dsl where it's 100 down and 20 up you can test it in both directions and make sure you have optimal bandwidth on both sides if the remote server that you're testing to has a weak cpu it's sometimes useful to use the zero copy mode of iperf so if we clear this out we can use the attack capital z option and without going into detail with this basically this sends the data in such a way to where it just reduces the cpu load on the server so if you're running it on say a raspberry pi 3 you might see a higher tcp throughput just because it takes off a little bit of the load from the cpu and the last thing i want to show you is using parallel stream so again if we clear this out we can replace capital z with capital p for parallel streams and you can do any number of parallel streams that you want but typically somewhere between two and four is useful and the reason you would use this is if you were testing on a network that has a higher bandwidth than a gigabit so once you get up to about 10 or especially like 40 or 100 gigabit connections you're gonna need to use parallel streams and some other um fine-tuning on this to max out those connections so here if we run parallel streams you can see how we have two parallel streams and then the summary and we'll let it complete and then take a look at the end so we have both parallel streams here and then the summary for both so you'll see we're getting 954 megabits per second on a gigabit line this isn't going to make any difference but if you're on 10 or higher gigabit connection this is where you would start seeing the difference to take a look at some of the other options that are supported by iperf 3 you can run iperf3 with the tactac help option and if you scroll through here make that a little bit larger for you you can see all of the different options so we can change the port so if you don't want it running on the deep default port of 5201 you can change it here you can have it run in verbose mode run it in daemon mode and i'll show you something on that in a minute you can change the pid file if it's running in daemon mode here's udp mode again and so on so going back to the idea of running this as a daemon if we get out of here and we jump back over to the server clear that um we can have this run as a daemon if we create a systemd unit file um so what you want to do is use sudo b etsy systemd system and then we'll call it iperf 3. service and then in here we're going to copy in our unit file so the unit uh the description is going to be iperf3 server you can name that whatever you want the after is a little bit important so we're going to start after the syslog.target network.target and then the auditd.service the service is going to be the iperf 3 and then run it in the server mode and then wanted by multi-user.target so once we have that in there we can right-click and then we can use sudo systemctl enable iperf3 and now when you reboot your server it should start by default every time so you don't need to log into it and manually start it but just know if you do have this running on your server in a production system if someone sees that it's running they could flood your network with traffic and bring it to a halt kind of like a denial of service and this is also going to be running as root so it'd probably be best just to use it on your home network or only when you actually need to run it and that's about it for iperf 3. remember if you found this video helpful be sure to like and subscribe thank you
Info
Channel: SecureRandom
Views: 733
Rating: undefined out of 5
Keywords: Linux, Iperf, Iperf3, Speed Test
Id: 0MEBoPwoqKE
Channel Id: undefined
Length: 8min 7sec (487 seconds)
Published: Sat May 08 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.