0% found this document useful (0 votes)
40 views

Lab 1 Handout

The document discusses basic networking commands used in the Windows command prompt to test connectivity and network performance. It provides details on the ping, tracert, ipconfig and netstat commands, including their syntax and options. The ping command is used to test IP-level connectivity and calculate latency, while tracert determines the route to a destination. Ipconfig displays TCP/IP network settings and netstat shows active network connections and ports.

Uploaded by

Sumaira khan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views

Lab 1 Handout

The document discusses basic networking commands used in the Windows command prompt to test connectivity and network performance. It provides details on the ping, tracert, ipconfig and netstat commands, including their syntax and options. The ping command is used to test IP-level connectivity and calculate latency, while tracert determines the route to a destination. Ipconfig displays TCP/IP network settings and netstat shows active network connections and ports.

Uploaded by

Sumaira khan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Experiment No 1

BASIC NETWORKING COMMANDS ON COMMAND PROMPT


Objective:
 To study basic networking commands on windows command prompt.
 To check connectivity of the Internet and network intermediate devices.
 To calculate network performance in terms of Latency (delay) and throughput.
Tools:
Windows command prompt (cmd).
Simulation:
1. Ping
Verifies IP-level connectivity to another TCP/IP computer by sending Internet
Control Message Protocol (ICMP) Echo Request messages. The receipt of
corresponding Echo Reply messages are displayed, along with round-trip times.
Ping is the primary TCP/IP command used to troubleshoot connectivity,
reachability and name resolution.

Following table indicates ping command options:

Ping Command Options


Item Explanation
Using this option will ping the target until you force it to stop by using Ctrl-
-t
C.
This ping command option will resolve, if possible, the hostname of an IP
-a
address target.
This option sets the number of ICMP Echo Requests to send, from 1 to
-n count
4294967295. 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
-l size 65,527. 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 to troubleshoot Path Maximum Transmission Unit (PMTU) issues.
This option sets the Time to Live (TTL) value, the maximum of which is
-i TTL
255.
Ping Command Options
This option allows you to set a Type of Service (TOS) value. Beginning in
Windows 7, this option no longer functions but still exists for compatibility
-v TOS reasons.

Use this ping command option to specify the number of hops between your
computer and the target computer or device that you'd like to be recorded
and displayed. The maximum value for count is 9, so use the tracert
-r count command instead if you're interested in viewing all the hops between two
devices.

Use this option to report the time, in Internet Timestamp format, that each
echo request 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.
-s count

Specifying a timeout value when executing the ping command adjusts the
- amount of time, in milliseconds, that ping waits for each reply. If you don't
w timeout 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.
-
Use this option to specify the source address.
S srcaddr
-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
-4
if target is a hostname and not an IP address.
This forces the ping command to use IPv6 only but as with the -4 option, is
-6
only necessary 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 the
/?
command's several options.
To test a TCP/IP configuration by using the ping command:

 At the command prompt, ping the loopback address by typing ping


127.0.0.1

 To quickly obtain the TCP/IP configuration of a computer, open Command


Prompt and then type ipconfig . From the display of the ipconfig command, ensure
that the network adapter for the TCP/IP configuration you are testing is not in a
Media disconnected state.
 Ping the IP address of the computer (Obtained from ipconfig iPv4/iPv6
Address).
 Ping the IP address of the default gateway (Obtained from ipconfig default
gateway). If the ping command fails, verify that the default gateway IP address is
correct and that the gateway (router) is operational.
 Ping /? Command opens all ping command options.

 Ping google.com
This command on cmd sends four 32 bytes by default from your source to host
google.com
The above command is also used to calculate latency of the network (average
round trip time in ms).

 Ping –n 5 –l 1500 google.com

In this example, the ping command is used to ping the hostname google.com. The
-n option tells the ping command to send 5 ICMP Echo Requests instead of the
default of 4, and the -l option sets the packet size for each request to 1500 bytes
instead of the default of 32 bytes.

The result displayed in the Command Prompt window will look something like
this:

2. Tracert:
Tracert (Trace route) as the name indicates determines the path taken to a
destination by sending Internet Control Message Protocol (ICMP) Echo Request
messages to the destination with incrementally increasing Time to Live (TTL) field
values. The path displayed is the list of near-side router interfaces of the routers in
the path between a source host and a destination. The near-side interface is the
interface of the router that is closest to the sending host in the path.

Tracert Command Options


-d This option prevents tracert from resolving IP addresses to hostnames, often
resulting in much faster results.
-h This tracert option specifies the maximum number of hops in the search for
MaxHop the target. If you do not specify MaxHops, and a target has not been found
s by 30 hops, tracert will stop looking.
-w You can specify the time, in milliseconds, to allow each reply before
TimeOut timeout using this tracert option.
-4 This option forces tracert to use IPv4 only.
-6 This option forces tracert to use IPv6 only.
target This is the destination, either an IP address or hostname.
/? Use the help switch with the tracert command to show detailed help about the
command's several options.

 tracert google.com
The above command displays all routes from source to destination along
with their hostnames and ip addresses.
 tracert –d google.com
With this tracert command example, we are again requesting the path to a website
www.google.com, but now preventing tracert from resolving hostnames by using
the -d option. This speeds up the process and we get desired routes from source to
destination with relatively lesser time.

3. Ipconfig

Displays all current TCP/IP network configuration values and refreshes Dynamic
Host Configuration Protocol (DHCP) and Domain Name System (DNS) settings.
This command is most useful on computers that are configured to obtain an IP
address automatically. This enables users to determine which TCP/IP configuration
values have been configured by DHCP, Automatic Private IP Addressing (APIPA),
or an alternate configuration.

4. Netstat

Displays active TCP connections, ports on which the computer is listening,


Ethernet statistics, the IP routing table, IPv4 statistics (for the IP, ICMP, TCP, and
UDP protocols), and IPv6 statistics (for the IPv6, ICMPv6, TCP over IPv6, and
UDP over IPv6 protocols).

You might also like