Network Performance Troubleshooting

Video Activity
Join over 3 million cybersecurity professionals advancing their career
Sign up with
Required fields are marked with an *
or

Already have an account? Sign In »

Time
21 hours 25 minutes
Difficulty
Intermediate
CEU/CPE
21
Video Transcription
00:00
>> Hey there Cybrarians, and welcome back
00:00
>> to the Linux plus course here at Cybrary.
00:00
>> I'm your instructor Rob Goelz.
00:00
In today's lesson, we're going to be
00:00
covering network performance commands.
00:00
Upon completion of today's lesson,
00:00
you are going to be able to use
00:00
the iperf and iftop commands
00:00
to view network performance.
00:00
The iftop command can display
00:00
a continuous graph of
00:00
the network bandwidth on an adapter.
00:00
For example, we can give it
00:00
an adapter to look at by using
00:00
iftop -i, that i option, and then the adapter name.
00:00
By comparison, the iperf command can
00:00
be used to perform network through protests,
00:00
and we actually have to set that up on both sides of
00:00
the network that we want to test so we can
00:00
set it up on one side as the server
00:00
and on the other side as the client.
00:00
Let's take a look at both of
00:00
these commands with some demo time.
00:00
Here we are in our demo environment,
00:00
today we're going to start with CentOS,
00:00
but we're also going to use Ubuntu,
00:00
>> that's going to be our other system for the other side
00:00
>> of the iperf tests that we're going to run later.
00:00
But first off, let's just go ahead
00:00
and take a look at our adapters,
00:00
and we'll do an IP link show
00:00
to just get our adapter information.
00:00
We're going to use emp0S3
00:00
right here as our guinea pig today.
00:00
What we're going to do next is let's
00:00
make sure that our tools are installed.
00:00
We can do that by ringing the which command,
00:00
if you recall,
00:00
Which will tell us whether or not something is
00:00
installed and where it's located, and in this case,
00:00
we see that iftop is not installed,
00:00
we can't find in any of our path locations.
00:00
If we do a search for iperf,
00:00
actually iperf3, we can do which iperf3,
00:00
we see the same thing here.
00:00
Let's go ahead and install those first,
00:00
right off the bat we're going to do a sudo dnf install,
00:00
and I'll just say -y so that we don't get prompted
00:00
to approve these because we know we want them,
00:00
and we'll just go ahead and kick that off.
00:00
Now, this is just always something important to do.
00:00
Always run that which command
00:00
>> when you land on a system to make sure
00:00
>> those tools are going to be there.
00:00
>> Because some tools, especially performance tools and
00:00
troubleshooting tools, aren't always
00:00
installed on every distribution,
00:00
but we're good to go there.
00:00
Everything has been installed. I'm just going to
00:00
type "Clear" to clear the screen.
00:00
Remember you can also always hit "Control L"
00:00
>> to clear the screen as well.
00:00
>> Now that we have them installed,
00:00
let's go ahead and run iftop first.
00:00
We'll do sudo iftop -i,
00:00
and then we'll use our Guinea pig, emp0S3,
00:00
>> and we'll just let this run for a while.
00:00
>> What we're going to see now is this goes through,
00:00
is it's going to display
00:00
the top network bandwidth usage for
00:00
the adapter in a continuous format
00:00
and update every one second.
00:00
We'll start seeing that on this left-hand side,
00:00
there'll be these bars that will start to climb,
00:00
and they're going to indicate the amount of
00:00
network bandwidth usage that is
00:00
used for each of these connections.
00:00
You can see right now the top thing it's talking to
00:00
is probably the broadcast network.
00:00
It's also sending information back to itself,
00:00
and just sending information all over the network.
00:00
Not super interesting to look at,
00:00
but there is cool information
00:00
>> you can see down here about
00:00
>> the transfer and receive rates,
00:00
as well as the rates of the transmit data,
00:00
and just information up here about the number
00:00
of bits that have been sent to various locations.
00:00
That's all, go ahead and hit Control C,
00:00
we can get out of here,
00:00
and we'll go take a look at iperf.
00:00
Now on this system, we have installed iperf.
00:00
If you're going to be setting up
00:00
iperf3 and using iperf3 for any testing,
00:00
you actually have to install it on
00:00
both ends of the connection.
00:00
Let's go ahead and cut over to
00:00
>> our Ubuntu system real quick,
00:00
>> and here we are in our Ubuntu system.
00:00
What we could do is we could do
00:00
an installation here of iperf3.
00:00
But I believe that I've already actually done so,
00:00
and we can see, as I said,
00:00
when you run which, if iperf3 is installed,
00:00
it will return the location of the binary.
00:00
We can see that it is there, it is installed.
00:00
One other thing that we should do here is make sure
00:00
that this is allowed through the firewall.
00:00
Remember, in Ubuntu system,
00:00
you're going to use the UFW,
00:00
>> the uncomplicated firewall.
00:00
>> For our purposes, we'll just use
00:00
5201 as our example port for our demo today,
00:00
and we can see that that is actually already there.
00:00
We see it says it's skipping adding existing rule,
00:00
so I've already set that up, so we're good to go.
00:00
Let's cut back over to CentOS and make sure we
00:00
have our firewall stuff in places over there as well.
00:00
Here we are in our CentOS system,
00:00
and what we'll do here is we'll run
00:00
a couple of firewall commands.
00:00
Let me copy this here and I'll just
00:00
paste it in to save us some time,
00:00
so that you guys won't have to suffer through
00:00
my terrible typing. But here we go.
00:00
What we're going to run is sudo firewall -cmd,
00:00
>> and then we're going to specify
00:00
>> we want to add that same port, 5201,
00:00
and we're going to add it for UDP,
00:00
and then if that command succeeds,
00:00
which is what this double ampersand means,
00:00
we're going to run the same command,
00:00
but now we're going to specify that we also
00:00
want to add the port for TCP.
00:00
I believe that I've also
00:00
>> already done this on this side,
00:00
>> but let's go ahead and run it, and
00:00
we can see that it's already enabled
00:00
and it's already set up.
00:00
Now we should be able to do what we want to do.
00:00
What we're going to have to do is cut
00:00
back over to the Ubuntu server,
00:00
and we can start that as
00:00
our iperf server to run our test.
00:00
Here we are back on our Ubuntu server,
00:00
and what we're going to do is we're going to start
00:00
the iperf server running on this side for our test.
00:00
When we do this with iperf3-s-p5201,
00:00
we can see that the server is listening
00:00
now on 5201 on that port.
00:00
What we'll do is we'll cut over to our CentOS system,
00:00
which will be the client for this test
00:00
and specify to connect to this Ubuntu system
00:00
>> on that port to start the iperf test.
00:00
>> Back here on our CentOS system again,
00:00
I'm going to copy and paste this real quickly just so
00:00
I don't have any fat finger issues here.
00:00
But what we're going to do is we're going
00:00
>> to run iperf3,
00:00
>> and we're going to specify that we want
00:00
to connect to Ubuntu,
00:00
we're going to specify a bit rate of 90 kilobits,
00:00
and we're going to specify 5 passes with port 5201,
00:00
and I believe that this is integral 10.
00:00
Let's go ahead and hit Enter,
00:00
and we'll let this run.
00:00
This will just take a few seconds here
00:00
to complete running,
00:00
and then you'll see at the very end of it,
00:00
we'll have some statistics
00:00
update and some summary
00:00
about what happened, and there we go.
00:00
We can see that this is completed,
00:00
we can see the intervals,
00:00
and we can also see the bit rate,
00:00
and then down here at the bottom we have
00:00
a summary on how long things took the run,
00:00
how many kilobits per second were
00:00
transferred, all that good stuff,
00:00
and this is not too bad for this connection,
00:00
it's just a little demo environment 2VM,
00:00
so not too terrible math.
00:00
Let's come back over to Ubuntu
00:00
real quick and take a look on that end.
00:00
>> Over here on the Ubuntu end,
00:00
>> we can see that the server is still
00:00
listening on port 5201,
00:00
that's because we haven't canceled out of it.
00:00
But we can see this side of
00:00
the connection and all the information
00:00
that it displays about what happened during our test.
00:00
We can see all the intervals and
00:00
the bit rate and so on and so forth.
00:00
For seeing any problems with network performance here,
00:00
we can try and detect it on both sides,
00:00
>> this connection, by looking at the transfer and
00:00
>> the [inaudible] and the throughput that I've gone through.
00:00
Once we're done, we just hit Control C and that
00:00
will cancel and interrupt this connection.
00:00
If we need to, we can also go back in and disable or
00:00
remove the firewall rules that we've put in
00:00
place to make sure that this port doesn't remain open.
00:00
With that, we've reached the end of this lesson,
00:00
and in this lesson, we covered using
00:00
iperf and iftop,
00:00
if you like, to view network performance.
00:00
Thanks so much for being here,
00:00
and I look forward to seeing you in the next lesson.
Up Next