CN LAB EX4
CN LAB EX4
NO:1 Learn to use commands like tcpdump, netstat, ifconfig, nslookup and
traceroute. Capture ping and traceroute PDUs using a network protocol analyzer and
examine.
AIM: To Learn to use commands like tcpdump, netstat, ifconfig, nslookup and traceroute ping.
# tcpdump protocol
For example to display traffic only for the tcp traffic :
# tcpdump tcp
Filtering based on source or destination port
To filter based on a source or destination port:
# tcpdump src
port ftp #
tcpdump dst
port http
2.Netstat
Netstat is a common command line TCP/IP networking available in most versions of
Windows, Linux, UNIX and other operatingsystems.
Netstat provides information and statistics about protocols in use and current TCP/IP
network connections. The Windows help screen (analogous to a Linux or UNIX for netstat
reads as follows: displays protocol statistics and current TCP/IP network connections.
3. ipconfig/ifconfig
In Windows, ipconfig is a console application designed to run from the Windows command
prompt. This utility allows you to get the IP address information of a Windows computer.
Using ipconfig
From the command prompt, type ipconfig to run the utility with default options. The output
of the default command contains the IP address, network mask, and gateway for all physical
and virtual network adapter. Every device has an IP address with two pieces: the client or
host address and the server or network address
#ipconfig
Ifconfig:
4.nslookup
The nslookup (which stands for name server lookup) command is a network utility program used to
obtain information about internet servers. It finds name server information for domains by querying the
Domain Name System.
The nslookup command is a powerful tool for diagnosing DNS problems. You know you're
experiencing a DNS problem when you can access a resource by specifying its IP address but not its
DNS name.
#nslookup
5.Traceroute:
Traceroute uses Internet Control Message Protocol (ICMP) echo packets with variable time to live
(TTL) values. The response time of each hop is calculated. To guarantee accuracy, each hop is queried
multiple times (usually three times) to better measure the response of that particular hop.
Traceroute is a network diagnostic tool used to track the pathway taken by a packet on an IP network
from source to destination. Traceroute also records the time taken for each hop the packet makes
during its route to the destination. Traceroute uses Internet Control Message Protocol (ICMP) echo
packets with variable time to live (TTL)values.
The response time of each hop is calculated. To guarantee accuracy, each hop is queried multiple times
(usually three times) to better measure the response of that particular hop. Traceroute sends packets
with TTL values that gradually increase from packet to packet, starting with TTL value of one. Routers
decrement TTL values of packets by one when routing and discard packets whoseTTL value has
reached zero, returning the ICMP error message ICMP TimeExceeded.
For the first set of packets, the first router receives the packet, decrements the TTL value and drops the
packet because it then has TTL value zero. The router sends an ICMP Time Exceeded message back to
the source. The next set of packets are given a TTL value of two, so the first router forwards the
packets, but the second router drops them and replies with ICMP Time Exceeded.
Proceeding in this way, traceroute uses the returned ICMP Time Exceeded messages to build a list of
routers that packets traverse, until the destination is reached and returns an ICMP Echo
Replymessage. With the tracert command shown above, we're asking tracert to show us the path from
the local computer all the way to the network device with the hostname
Output1:
Command: tracert mobiledevice IPAddress
Hop Number – This is the first column and is simply the number of the hop along the route. In this case, it
is the tenth hop.
RTT Columns – The next three columns display the round trip time (RTT) for your packet to reach that
point and return to your computer. This is listed in milliseconds. There are three columns because the
traceroute sends three separate signal packets. This is to display consistency, or a lack thereof, in the route.
Domain/IP column – The last column has the IP address of the router. If it is available, the domain name
will also be listed.
6. Ping:
The full form of PING is the Packet InterNet Groper. It is a computer network management system
software or utility software used to test the network communication between two devices.
The ping command sends an echo request to a host available on the network. Using this command, you
can check if your remote host is responding well or not. Tracking and isolating hardware and software
problems. Determining the status of the network and various foreign hosts. The ping command is
usually used as a simple way to verify that a computer can communicate over the network with another
computer or network device. The ping command operates by sending Internet Control Message
Protocol (ICMP) Echo Request messages to the destination computer and waiting for a response
Command: ping IPADDRESS
Ubuntu/Linux
Windows :