0% found this document useful (0 votes)
21 views11 pages

Computer Network Experiment No3 0

The document discusses using various network tools like ping, ipconfig, tracert and netstat to test network connectivity and view network configuration and statistics. It provides details on how to use each tool and their various options.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views11 pages

Computer Network Experiment No3 0

The document discusses using various network tools like ping, ipconfig, tracert and netstat to test network connectivity and view network configuration and statistics. It provides details on how to use each tool and their various options.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

Name: Sonali Chaurasia Roll No: 2101330130128 IT-6th-A

Experiment No.- 3
AIM- Test the network connection using ping command and using ipconfig, netstat and trcert
command provided by TCP/IP.

Theory and Procedure-


(1) ping command

The ping command is a Command Prompt command used to test the ability of the source
computer to reach a specified destination computer. 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. How many of those
responses are returned, and how long it takes for them to return, are the two major pieces of
information that the ping command provides.

For example, you might find that there are no responses when pinging a network printer, only to
find out that the printer is offline and its cable needs replaced. Or maybe you need to ping a
router to verify that your computer can connect to it, to eliminate it as a possible cause for a
networking issue.

Ping Command Options


Item Explanation
-t Using this option will ping the target until you force it to stop by using Ctrl-C.
This ping command option will resolve, if possible, the hostname of an IP address
-a
target.
This option sets the number of ICMP Echo Requests to send, from 1 to 4294967295.
-ncount
The ping command will send 4 by default if -n isn't used.
Use this option to set the size, in bytes, of the echo request packet from 32 to 65,527.
-l size
The ping command will send a 32-byte echo request if you don't use the -l option.
Use this ping command option to prevent ICMP Echo Requests from being
-f fragmented by routers between you and the target. The -f option is most often used
totroubleshoot Path Maximum Transmission Unit (PMTU) issues.
-i TTL This option sets the Time to Live (TTL) value, the maximum of which is 255.
This option allows you to set a Type of Service (TOS) value. Beginning in Windows
-v TOS
7, this option no longer functions but still exists for compatibility reasons.
Use this ping command option to specify the number of hops between your computer
-rcount
and the target computer or device that you'd like to be recorded and displayed. The

Guide Teacher: Ms. Bhawna Khullar


Name: Sonali Chaurasia Roll No: 2101330130128 IT-6th-A

maximum value for count is 9, so use the tracert command instead if you're
interestedin viewing all the hops between two devices.
Use this option to report the time, in Internet Timestamp format, that each
-scount echorequest is received and echo reply is sent. The maximum value for
count is 4,
meaning that only the first four hops can be time stamped.
Specifying a timeout value when executing the ping command adjusts the amount
-wtimeout
of
time, in milliseconds, that ping waits for each reply. If you don't use the -w
option,the default timeout value of 4000 is used, which is 4 seconds.
-R This option tells the ping command to trace the round trip path.
-Ssrcaddr
Use this option to specify the source address.
-p Use this switch to ping a Hyper-V Network Virtualization provider address.
This forces the ping command to use IPv4 only but is only necessary if target
-4
is ahostname and not an IP address.
This forces the ping command to use IPv6 only but as with the -4option, is
-6
onlynecessary when pinging a hostname.
Target This is the destination you wish to ping, either an IP address or a hostname.
Use the help switch with the ping command to show detailed help about
/?
thecommand's several options.

ping 127.0.01

In the above example, we're pinging 127.0.0.1, also called the IPv4 localhost IP address or
IPv4 loopback IP address, without options.

Using the ping command to ping 127.0.0.1 is an excellent way to test that Windows' network
features are working properly but it says nothing about your own network hardware or your
connection to any other computer or device. The IPv6 version of this test would be ping::1.

(2) ipconfig command


This command details how IP is setup on the machine you are logged into. At the command
prompt, type: ipconfig

There are also a variety of switches for ipconfig that add functions. These are invoked by entering
"ipconfig /{switch}". To obtain a list of switches, enter "ipconfig /?" or "ipconfig -?".

These are shown in the figure below.

Guide Teacher: Ms. Bhawna Khullar


Name: Sonali Chaurasia Roll No: 2101330130128 IT-6th-A

ipconfig [/? | /all | /release [adapter] | /renew [adapter]]

/? Display this help message.

/all Display full configuration information.

/release Release the IP address for the specified adapter.

/renew Renew the IP address for the specified adapter.

For a detailed output of network parameters, use the command "ipconfig /all". Unless you are
experienced with networks, however, this may be more than we want to know.

(3) tracert command


This command shows you all the routers that your TCP/IP message goes through in order to
make a connection to another IP address.

At the command prompt, type: tracert xxx Where xxx is the IP address or URL of the machine
that we are trying to connect to.

Here is the result of tracert from college computer to yahoo.com ( DNS has resolved the name
“yahoo.com” to 129.64.99.33)

Other options available in tracert command

tracert [-d] [-h maximum_hops] [-j host-list] [-w timeout] target_name


-d Do not resolve addresses to hostnames.
-h maximum_hops Maximum number of hops to search for target.
-j host-list Loose source route along host-list.
-w timeout Wait timeout milliseconds for each reply

(4) netstat command


The netstat command is used to display the TCP/IP network protocol statistics and information

NETSTAT [-a] [-e] [-n] [-s] [-p proto] [-r] [interval]

-a Displays all connections and listening ports.


(Server-side connections are normally not
shown).

Guide Teacher: Ms. Bhawna Khullar


Name: Sonali Chaurasia Roll No: 2101330130128 IT-6th-A

-e Displays Ethernet statistics. This may be


combined with the -s option.

-n Displays addresses and port numbers in


numerical form.

-p proto Shows connections for the protocol specified


by proto; proto may be tcp or udp. If used
with the -s option to display per-protocol
statistics, proto may be tcp, udp, or ip.
-r Displays the contents of the routing table.
-s Displays per-protocol statistics. By default,
statistics are shown for TCP, UDP and IP; the
-p option may be used to specify a subset of
the default.
interval Redisplays selected statistics, pausing interval
seconds between each display. Press
CTRL+C to stop redisplaying statistics. If
omitted, netstat will print the current
configuration information once.

(5) nslookup command


Stands for “Name Server Lookup” is a useful command for getting information from DNS
server. It is a network administration tool for querying the Domain Name System (DNS) to
obtain domain name or IP address mapping or any other specific DNS record. It is also used to
troubleshoot DNS related problems.

nslookup google.com:
nslookup followed by the domain name will display the “A Record” (IP Address) of the domain.
Use this command to find the address record for a domain. It queries to domain name servers
and get the details.

nslookup 192.168.0.10:

Reverse DNS lookup you can also do the reverse DNS look-up by providing the IP Address as
argument to nslookup.
Guide Teacher: Ms. Bhawna Khullar
Name: Sonali Chaurasia Roll No: 2101330130128 IT-6th-A

nslookup -type=any google.com

Lookup for any record we can also view all the available DNS records using- type=any option.

nslookup -type=soa redhat.com:

Lookup for an soa record SOA record (start of authority), provides the authoritative information
about the domain, the e-mail address of the domain admin, the domain serial number, etc

nslookup -type=ns google.com

Lookup for an ns record NS (Name Server) record maps a domain name to a list of DNS
servers authoritative for that domain. It will output the name serves which are associated with
the given domain.

nslookup -type=a google.com

Lookup for an a record We can also view all the available DNS records for a particular record
using -type=a option.

nslookup -type=mx google.com:

Lookup for an mx record MX (Mail Exchange) record maps a domain name to a list of mail
exchange servers for that domain. The MX record tells that all the mails sent to “google.com”
should be routed to the Mail server in that domain.

nslookup -type=txt google.com:

Lookup for an txt record TXT records are useful for multiple types of records like DKIM, SPF,
etc. You can find all TXT records configured for any domain using below command.
Guide Teacher: Ms. Bhawna Khullar
Name: Sonali Chaurasia Roll No: 2101330130128 IT-6th-A

Outputs: -

Guide Teacher: Ms. Bhawna Khullar


Name: Sonali Chaurasia Roll No: 2101330130128 IT-6th-A

Guide Teacher: Ms. Bhawna Khullar


Name: Sonali Chaurasia Roll No: 2101330130128 IT-6th-A

Guide Teacher: Ms. Bhawna Khullar


Name: Sonali Chaurasia Roll No: 2101330130128 IT-6th-A

(1) ping command

Example:

>> ping www.google.com

>> ping www.niet.co.in

>> ping 192.168.4.1

(2) ipconfig command

>> ipconfig

>> ipconfig/all

(3) tracert

command

Example:
>> tracert 192.168.0.18

>>tracert yahoo.com

(4) netstat command

>> netstat-n
Guide Teacher: Ms. Bhawna Khullar
Name: Sonali Chaurasia Roll No: 2101330130128 IT-6th-A

>> netstat-a

>> netstat-?

(5) nslookup command

Example:

>> nslookup google.com

>> nslookup niet.co.in

Result: -

All the required network commands are studied and successfully test the network connection
using ping command and use of ipconfig, netstat and tracert command provided by TCP/IP.

Guide Teacher: Ms. Bhawna Khullar


Name: Sonali Chaurasia Roll No: 2101330130128 IT-6th-A

Guide Teacher: Ms. Bhawna Khullar

You might also like