Network Engineer? You NEED to know iPerf.

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
network engineers and sysadmins need a way to test the speed of their network there's a ton of tools out there to help you but none of them are as reliable easy to use or cost effective as iperf iperf is the free open source tool that you can download and set up in minutes not only is iperf gonna help you test for your effective bandwidth but it's also gonna test a lot of different parameters it's gonna tell you your speed slash latency it's gonna tell you the amount of jitter that's on your network and most importantly the amount of packet loss so iperf is super simple to set up and we're going to go over it in this tutorial and i'm going to show you how you can do it from the windows perspective as well as linux so let's go ahead and hop into the command line and get started if you're using linux you can use sudo apt-get install iperf3 and this will install the binaries for iperf and the binaries for the client as well as the server are the same the way we're going to run client versus server is all with command line arguments so don't worry about downloading the client version or server version it's the same exact tool if you're using windows go to iperf.fr go on over to download iperf binaries and then select the one applicable to your operating system i would be using windows 64-bit once it's downloaded extract the files to a directory of your choice okay so let's have a look at how we can get our server started i'm going to do it from my linux machine first and then i will generate some client traffic from my windows box so on my linux machine i already have iperf3 installed so now i'm gonna start it in server mode so if you just type in iperf3 you can see all the commands that you can run for iperf and there's quite a few of them but to get the server started all you need to type is iperf 3 dash s and this will start the client in server mode and it lets you know the port that you're listening in on uh looks like i'm listening in on the default port of 5201 and just another thing to note here make sure when you run this command to run it as iperf3 some of you following along may have installed just the regular iperf client and that's for older versions of iperf we want to make sure that both our server and our client is running iperf version 3. so just make sure to run the version 3 command so now that that's running let's hop on over to the windows machine and from here we're going to do a very similar command but this time it's going to be iperf3 and then instead of dash s i'm going to put dash c for client connection and then i'm going to put in the ip address of my server and this is all i need to do to start out a connection and test the bandwidth so it looks like i'm getting about 850 megs of bandwidth which is pretty good and you can see that my client was trying to push out a gigabit worth of traffic but the network was only getting 860 megabits and then if you head on over to the server you can see all the information there as well so whether you're connected to the server or client both perspectives will show you the current testing that's going on the next thing that we can do here is add a little more depth into our testing and instead of just doing the basic test we can add some additional parameters here so we might want to increase or decrease the amount of time that we're testing so i'll set it down to five seconds as the default is around 10 but usually when you're doing this in production you'll probably want to do it for five to ten minutes or so a lot of the times when you're testing in production networks the issue is intermittent and you need your test to run for a long time so adjusting the time parameter is very important so now that we've changed it to five seconds let's go ahead and make another change here and this is another one that i use commonly and what this does is set the bandwidth so as you can see by default it just tries to push as much traffic to the server as possible but you might want to limit the amount of bandwidth that this client actually tries to use and i'm going to do that right now so i'm going to set it to 30 megabits and now you can see that it's just testing a 30 megabit transfer we can add an additional switch here uh dash capital v and this just gives us a little more verbose information now for those of you that are interested in seeing packet loss and jitter we actually need to run this test again but this time we need to run it in udp mode by default we are doing all the tests in tcp and when you do that with iperf you do not track the results of packet loss and jitter so we're going to go ahead and change this to udp mode and it's very simple to do all you need to do is go dash u and specify udp port and you can make this whatever you want i'm going to use port 6790 and i'm actually going to increase this to 15 seconds and now you can see that we got a udp stream going it's at 30 megs and going right to our server if we switch to our server we can see the connection coming in and you can see that it's counting the actual datagrams that came in and you can see that it's lost zero and right here at the bottom it measured the amount of jitter as well as the total packet loss we can see here we got zero percent packet loss so that's very good i have a very stable network and iperf has proved that for me now if you want to test out a connection to the internet there's some dedicated iperf servers out there that you can use so i'm going to pull up one of them right now and i'm going to do a test connection to them and here they are over here you can just go to iperf.fr and then it's iperf servers and here's a big list so let's go ahead and choose one and i'm going to use this scott linux server so i'll copy that in so i'll copy this in and it looks like it's just using the default port of 5201 and let's run this for my windows box so i'll change this ip here and uh i'm actually going to specify the port here even though i don't need to because it's using the default but just to show you that you can i'll set it to 5201 and we will run our tests and i think this is going it actually looks like it's not let's go ahead and cancel it and i'm actually going to take the udp off because they might be blocking udp and the bandwidth i'm just going to set this all to default here and rerun it and i'm not getting any results from them so i'm gonna rerun this but instead of using scott linux i'm gonna use another one of those servers from the lists which is iperf.he.net and it looks like their server's up and running and i'm able to get out to it now one thing that i will note is that these servers can only handle one connection per port so if i were to run this for 100 seconds here and then if i went to my other box and tried to do the same thing you'll notice that you get an error and the error that you get is the server is too busy it's running a test so these are public servers with only one port so if someone else in the world is running a test to this iperf server then you're not going to be able to do it so keep that in mind if you really want a reliable server on the internet you should build something out on the cloud and just have it there all the time and don't share the ip address with everyone because other people will be able to use it and take up your connections also what you could do on the same server is you could run multiple instances of iperf but just have it listen on multiple ports and i actually have a script for that so i'll show you that script here so you can see the script that i have for this and you could just create another similar script to this you can see basically it's just running the iperf server and setting the port and it has a unique port for each one so you can just do that to run multiple instances of iperf in the background on different ports and that way you can have multiple client connections in different places on your network going to the same iperf server so that's the best way to do that alright so that's all i have on this video on iperf i just want to thank everyone that's been watching and subscribing it really motivates me to continue creating this content and if you have any questions in regards to devops or network engineering please drop a comment below or join our discord the link is in the description below and basically it's just a community of network and devops engineers i also have a bunch of other videos in regards to devops and network engineering topics so please check out the other videos in my channel if you're interested in that thanks everyone and i'll catch you in the next video
Info
Channel: DevOps Journey
Views: 9,562
Rating: 4.9833331 out of 5
Keywords: networking, iperf, cisco, devops, netdev, network, developer, technology
Id: SjvP8fGJOoY
Channel Id: undefined
Length: 10min 15sec (615 seconds)
Published: Sat Sep 26 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.