NMT Lab 4 - 20-21
NMT Lab 4 - 20-21
Practical 4
Aim: To use Network traffic monitoring and routing tools (commands) and
interpret the findings
1] bing
2] tcpdump
3] netstat
4] arp
5] traceroute
6] top
7] bmon
1] bing
The command line program bing measures bandwidth between two point to
point locations. This is an excellent tool for testing throughput or interfaces.
install bing:
2] tcpdump
tcpdump command is also called as packet analyzer.
tcpdump command will work on most flavors of unix operating system. tcpdump allows us to save
the packets that are captured, so that we can use it for future analysis. The saved file can be viewed
by the same tcpdump command. We can also use open source software like wireshark to read the
tcpdump pcap files.
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
17 packets captured
3.1] netstat -a
The above command shows all connections from different protocols like tcp, udp and
unix sockets. However this is not quite useful. Administrators often want to pick out
specific connections based on protocols or port numbers for example.
3.2] netstat -at
3.3] netstat -i
extc@standby4:~$ netstat -i
Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR
we see that all the network information related to individual interfaces was displayed in the output.
The RX and TX columns are described as follows :
Similar definition is for the TX columns that describe the transmitted packets
3.4] Print statistics
The netstat command can also print out network statistics like total number of packets received and
transmitted by protocol type and so on.
To list out statistics of all packet types
extc@standby4:~$ netstat -s
Ip:
0 forwarded
Icmp:
IcmpMsg:
InType3: 4
InType9: 41
Tcp:
2695 active connections openings
0 passive connection openings
4 failed connection attempts
1 connection resets received
0 connections established
77757 segments received
62716 segments send out
0 segments retransmited
0 bad segments received.
24 resets sent
Udp:
22025 packets received
0 packets to unknown port received.
0 packet receive errors
3213 packets sent
UdpLite:
TcpExt:
TCPRcvCoalesce: 4971
TCPOFOQueue: 221
IpExt:
InNoRoutes: 2
InMcastPkts: 14268
OutMcastPkts: 93
InBcastPkts: 129612
OutBcastPkts: 7
InOctets: 118459338
OutOctets: 11223188
InMcastOctets: 3891519
OutMcastOctets: 10694
InBcastOctets: 20682035
OutBcastOctets: 328
4] arp
arp-scan is a commandline utility for linux that can be used to scan the network
of a certain interface for alive hosts. It shows the ip address and mac addresses
of all the hosts/nodes found.
dbit@tejas-21:~$ arp
Address HWtype HWaddress Flags Mask Iface
10.0.3.248 ether 50:46:5d:de:28:4e C eth0
10.0.3.185 ether d4:3d:7e:aa:40:18 C eth0
10.0.5.180 ether 8c:89:a5:23:56:46 C eth0
dbitwin ether 00:13:3b:0e:01:0b C eth0
10.0.3.246 ether 00:13:3b:0e:01:7b C eth0
newipcop.lan.dbit.in ether 00:10:b5:12:cf:1e C eth0
10.0.4.128 ether d8:cb:8a:46:1c:16 C eth0
10.0.2.211 ether 44:37:e6:e4:9f:63 C eth0
dbitlin ether 00:09:6b:98:48:cd C eth0
10.0.3.184 ether d4:3d:7e:aa:43:f6 C eth0
10.0.2.202 ether 44:37:e6:e4:68:a5 C eth0
5] traceroute
Traceroute is a command which can show you the path a packet of information
takes from your computer to one you specify. It will list all the routers it passes
through until it reaches its destination, or fails to and is discarded. In addition to
this, it will tell you how long each 'hop' from router to router takes.
extc@standby4:~$ traceroute
Usage:
Options:
-4 Use IPv4
-6 Use IPv6
-f first_ttl --first=first_ttl
-i device --interface=device
-m max_ttl --max-hops=max_ttl
be reached). Default is 30
-N squeries --sim-queries=squeries
-l flow_label --flowlabel=flow_label
-w waittime --wait=waittime
-q nqueries --queries=nqueries
-s src_addr --source=src_addr
-z sendwait --sendwait=sendwait
addresses
-O OPTS,... --options=OPTS,...
`-N 1'
is 53)
`-F -N 1'
print if it differs
-V --version Print version info and exit
Arguments:
allowed value
6] TOP
Linux Top command is a performance monitoring program which is used frequently by many
system administrators to monitor Linux performance and it is available under many Linux/Unix
like operating systems. The top command used to dipslay all the running and active real-time
processes in ordered list and updates it regularly. It display CPU usage, Memory usage, Swap
Memory, Cache Size, Buffer Size, Process PID, User, Commands and much more. It also shows
high memory and cpu utilization of a running processess. The top command is much userful for
system administrator to monitor and take correct action when required.
Top command displays all the running process in the system ordered by certain columns.
This displays the information real-time.
extc@standby4:~$ top
7] bmon
bmon is a simple yet powerful, text-based network monitoring and debugging tool for Unix-like
systems, which captures networking related statistics and displays them visually in a human friendly
format. It is a reliable and effective real-time bandwidth monitor and rate estimator.
It can read input using an assortment of input modules and presents output in various output modes,
including an interactive curses user interface as well as a programmable text output for scripting
purposes.
$ sudo apt-get install bmon
────────────────────────────────────────────────────────────────────────────────
0 lo 0.00B 0 0.00B 0
^ prev interface, v next interface, <- prev node, -> next node, ? help
CONCLUSIONS