Name: Shruti Kitukale Sec/semester:A-5 Course Name: Computer Networks Lab Roll No: 25 Enroll No.:19010243
Name: Shruti Kitukale Sec/semester:A-5 Course Name: Computer Networks Lab Roll No: 25 Enroll No.:19010243
PRACTICAL NO 2
Aim: Use Network Utility Command like ping, ipconfig, netstat, tracert to
observe the network details.
Theory:
1. Ping: The ping command helps to verify IP-level connectivity. When
troubleshooting, you can use ping to send an ICMP echo request to a target host
name or IP address. Use ping whenever you need to verify that a host computer
can connect to the TCP/IP network and network resources. You can also use ping
to isolate network hardware problems and incompatible configurations. It is
usually best to verify that a route exists between the local computer and a network
host by first using the ping command and the IP address of the network host to
which you want to connect. Try pinging the IP address of the target host to see if
it responds, as follows:
Ping IP_address
You should perform the following steps when using ping:
1. Ping the loopback address to verify that TCP/IP is installed and configured correctly on
the local computer.
ping 127.0.0.1
2. Ping the IP address of the local computer to verify that it was added to the network
correctly.
ping IP_address_of_local_host
3. Ping the IP address of the default gateway to verify that the default gateway is
functioning and that you can communicate with a local host on the local network.
ping IP_address_of_default_gateway
4. Ping the IP address of a remote host to verify that you can communicate through a
router.
ping IP_address_of_remote_host
The ping command uses Windows Sockets–style name resolution to resolve a computer
name to an IP address, so if pinging by address succeeds, but pinging by name fails, then
the problem lies in address or name resolution, not network connectivity.
If you cannot use ping successfully at any point, confirm that:
The computer was restarted after TCP/IP was installed and configured.
The IP address of the local computer is valid and appears correctly on the General
tab of the Internet Protocol (TCP/IP) Properties dialog box.
IP routing is enabled and the link between routers is operational.
2. Ipconfig: Ipconfig (short for interface configuration) is a system administration
utility in Unix-like operating systems to configure, control, and query TCP/IP
network interface parameters from a command line interface (CLI) or in system
configuration scripts. Ifconfig originally appeared in 4.2BSD as part of the BSD
TCP/IP suite. To run the Ipconfig.exe utility, at a command prompt, type ipconfig,
and then add any appropriate option.
SYNTAX
Examples
To display the statistics for only the TCP or UDP protocols, type one of the following
commands:- netstat -sp tcp
netstat -sp udp:- To display active TCP connections and the process IDs every 5
seconds, type the following command (On Microsoft Windows, works on XP and
2003 only, or Windows 2000 with hotfix):
netstat -o 5
Mac OS X version
netstat -w 5
To display active TCP connections and the process IDs using numerical form, type
the following command (On Microsoft Windows, works on XP and 2003 only, or
Windows 2000 with hotfix):
netstat –no
To display all ports open by a process with id pid
netstat -aop | grep "pid"
4. Trace route:
Trace route 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.
In Windows, select Start > Programs > Accessories > Command Prompt. This will
give you a window like the one below.
Conclusion: Thus in this practical we studied to use Network Utility Command like
ping, ipconfig, netstat, tracert to observe the network details.