Вы находитесь на странице: 1из 17

Multimedia Network

Lab-3

Network Diagnostics
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. Used without parameters, ping displays help.

Syntax of Ping Command


To write a ping command correctly, you should follow the syntax bellow:
ping [-t] [-a] [-n Count] [-l Size] [-f] [-i TTL] [-v TOS] [-r Count] [-s Count] [{-j HostList | -k HostList}] [-w Timeout] <Target_Name>

To understand the Parameters listed above, here is a list of them and their advantages:
Switch

Description

-t

Specifies that ping continue sending Echo Request messages to the


destination until interrupted. To interrupt and display statistics, press
CTRL-BREAK. To interrupt and quit ping, press CTRL-C.

-a

Specifies that reverse name resolution is performed on the destination


IP address. If this is successful, ping displays the corresponding host
name.

-n Count

Specifies the number of Echo Request messages sent. The default is 4.

-l Size

Specifies the length, in bytes, of the Data field in the Echo Request
messages sent. The default is 32. The maximum size is 65,527.

-f

Specifies that Echo Request messages are sent with the Don't
Fragment flag in the IP header set to 1. The Echo Request message
cannot be fragmented by routers in the path to the destination. This
parameter is useful for troubleshooting path Maximum Transmission
Unit (PMTU) problems.

-i TTL

Specifies the value of the TTL field in the IP header for Echo Request
messages sent. The default is the default TTL
value for the host. For Windows XP hosts, this is typically 128. The
maximum TTL is 255.

-v TOS

Specifies the value of the Type of Service (TOS) field in the IP header
for Echo Request messages sent. The default is 0. TOS is specified as a
decimal value from 0 to 255.

-r Count

Specifies that the Record Route option in the IP header is used to


record the path taken by the Echo Request message and corresponding
Echo Reply message. Each hop in the path uses an entry in the Record
Route option. If possible, specify a Count that is equal to or greater
than the number of hops between the source and destination. The
Count must be a minimum of 1 and a maximum of 9.

-s Count

Specifies that the Internet Timestamp option in the IP header is used to


record the time of arrival for the Echo Request message and
corresponding Echo Reply message for each hop. The Count must be a
minimum of 1 and a maximum of 4.

-j HostList

Specifies that the Echo Request messages use the Loose Source Route
option in the IP header with the set of intermediate destinations
specified in HostList. With loose source routing, successive
intermediate destinations can be separated by one or multiple routers.
The maximum number of addresses or names in the host list is 9. The
host list is a series of IP addresses (in dotted decimal notation)
separated by spaces.

-k HostList

Specifies that the Echo Request messages use the Strict Source Route

option in the IP header with the set of intermediate destinations


specified in HostList. With strict source routing, the next intermediate
destination must be directly reachable (it must be a neighbor on an
interface of the router). The maximum number of addresses or names
in the host list is 9. The host list is a series of IP addresses (in dotted
decimal notation) separated by spaces.
-w Timeout

Specifies the amount of time, in milliseconds, to wait for the Echo


Reply message that corresponds to a given Echo Request message to
be received. If the Echo Reply message is not received within the timeout, the "Request timed out" error message is displayed. The default
time-out is 4000 (4 seconds).

TargetName

Specifies the destination, which is identified either by IP address or


host name.

/?

Displays help at the command prompt.

Remarks

You can use ping to test both the computer name and the IP address of the computer. If pinging the IP address is successful, but
pinging the computer name is not, you might have a name resolution problem. In this case, ensure that the computer name you are
specifying can be resolved through the local Hosts file, by using Domain Name System (DNS) queries, or through NetBIOS name
resolution techniques.

This command is available only if the Internet Protocol (TCP/IP) protocol is installed as a component in the properties of a network
adapter in Network Connections

Examples
The following example shows ping command output:
C:\>ping example.microsoft.com
Pinging example.microsoft.com [192.168.239.132] with 32 bytes of data:
Reply from 192.168.239.132: bytes=32 time=101ms TTL=124
Reply from 192.168.239.132: bytes=32 time=100ms TTL=124
Reply from 192.168.239.132: bytes=32 time=120ms TTL=124
Reply from 192.168.239.132: bytes=32 time=120ms TTL=124
To ping the destination 10.0.99.221 and resolve 10.0.99.221 to its host name, type:
ping -a 10.0.99.221
To ping the destination 10.0.99.221 with 10 Echo Request messages, each of which has a Data field of 1000 bytes, type:
ping -n 10 -l 1000 10.0.99.221
To ping the destination 10.0.99.221 and record the route for 4 hops, type:
ping -r 4 10.0.99.221
To ping the destination 10.0.99.221 and specify the loose source route of 10.12.0.1-10.29.3.1-10.1.44.1, type:
ping -j 10.12.0.1 10.29.3.1 10.1.44.1 10.0.99.221

Ping Exercise:
1) Log into your PC as administrator.
2) Follow:

Start Run Cmd Press OK

3) Now Answer the following questions:


a) Can we ping any of the Labs PCs? How?

b)

Can we
ping the
UTP
Proxy?
How?

c) Can we Ping Google Webpage? How? Can we get the Google webpage IP from
the Ping Command? How?

d) What is TTL? And can we change its value with ping command? How?
TTL Time to Live

e) Which switch we have to use to ping a PC infinitely? Give a scenario in which we


need to use the infinite ping.
Switch t

f) What would the following syntax do? What does the pinged IP mean?
Ping 127.0.0.1
It is the localhost which is the PC itself. The reason for the ping is to
check whether the PC is able to do pinging command.

g) What would the following syntax do?


Ping n -1 <Next PC IP>
It pings infinitely.

h) Ping the PC next to you with 7 requests command. What would be the reply?

i) Unplug the Networking Adapter from the PC next to you then ping its IP. What
would be the output?

j) Ping the PC next to you infinitely. While its sending and receiving echoes and
replies, unplug the network adapter. What would be the output?

k) Log Off the PC next to you then ping its IP. What would be the output?

l) Shutdown the PC next to you then ping its IP. What would be the output?

4) Use command exit to close the command prompt.

IpConfig
Displays all current TCP/IP network configuration values and refreshes Dynamic Host Configuration Protocol
(DHCP) and Domain Name System (DNS) settings. Used without parameters, ipconfig displays the IP
address, subnet mask, and default gateway for all adapters.

Syntax
ipconfig [/all] [/renew [Adapter]] [/release [Adapter]] [/flushdns] [/displaydns] [/registerdns]
[/showclassid Adapter] [/setclassid Adapter [ClassID]]

Parameters
/all

Displays the full TCP/IP configuration for all


adapters. Without this parameter, ipconfig displays
only the IP address, subnet mask, and default
gateway values for each adapter. Adapters can
represent physical interfaces, such as installed
network adapters, or logical interfaces, such as dial-

/renew [Adapter]

up connections.
Renews DHCP configuration for all adapters (if an
adapter is not specified) or for a specific adapter if
the Adapter parameter is included. This parameter is
available only on computers with adapters that are
configured to obtain an IP address automatically. To
specify an adapter name, type the adapter name
that appears when you use ipconfig without

/release [Adapter]

parameters.
Sends a DHCPRELEASE message to the DHCP server
to release the current DHCP configuration and
discard the IP address configuration for either all
adapters (if an adapter is not specified) or for a
specific adapter if the Adapter parameter is included.
This parameter disables TCP/IP for adapters
configured to obtain an IP address automatically. To
specify an adapter name, type the adapter name
that appears when you use ipconfig without

/flushdns

parameters.
Flushes and resets the contents of the DNS client
resolver cache. During DNS troubleshooting, you can
use this procedure to discard negative cache entries
from the cache, as well as any other entries that

/displaydns

have been added dynamically.


Displays the contents of the DNS client resolver
cache, which includes both entries preloaded from
the local Hosts file and any recently obtained
resource records for name queries resolved by the
computer. The DNS Client service uses this
information to resolve frequently queried names

/registerdns

quickly, before querying its configured DNS servers.


Initiates manual dynamic registration for the DNS
names and IP addresses that are configured at a
computer. You can use this parameter to
troubleshoot a failed DNS name registration or
resolve a dynamic update problem between a client
and the DNS server without rebooting the client
computer. The DNS settings in the advanced
properties of the TCP/IP protocol determine which

/showclassid Adapter

names are registered in DNS.


Displays the DHCP class ID for a specified adapter.
To see the DHCP class ID for all adapters, use the
asterisk (*) wildcard character in place of Adapter.
This parameter is available only on computers with
adapters that are configured to obtain an IP address

/setclassid Adapter
[ClassID]

automatically.
Configures the DHCP class ID for a specified
adapter. To set the DHCP class ID for all adapters,
use the asterisk (*) wildcard character in place of
Adapter. This parameter is available only on
computers with adapters that are configured to
obtain an IP address automatically. If a DHCP class

/?

ID is not specified, the current class ID is removed.


Displays help at the command prompt.

Remarks

The ipconfig command is the command-line equivalent to the winipcfg command, which is available in
Windows Millennium Edition, Windows 98, and Windows 95. Although Windows XP does not include a
graphical equivalent to the winipcfg command, you can use Network Connections to view and renew an
IP address. To do this, open Network Connections, right-click a network connection, click Status, and

then click the Support tab.


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.
If the Adapter name contains any spaces, use quotation marks around the adapter name (that is,
"Adapter Name").
For adapter names, ipconfig supports the use of the asterisk (*) wildcard character to specify either
adapters with names that begin with a specified string or adapters with names that contain a specified
string. For example, Local* matches all adapters that start with the string Local and *Con* matches all

adapters that contain the string Con.


This command is available only if the Internet Protocol (TCP/IP) protocol is installed as a component
in the properties of a network adapter in Network Connections

Examples
To display the basic TCP/IP configuration for all adapters, type:
ipconfig
To display the full TCP/IP configuration for all adapters, type:
ipconfig /all
To renew a DHCP-assigned IP address configuration for only the Local Area Connection adapter, type:
ipconfig /renew "Local Area Connection"
To flush the DNS resolver cache when troubleshooting DNS name resolution problems, type:
ipconfig /flushdns
To display the DHCP class ID for all adapters with names that start with Local, type:
ipconfig /showclassid Local*
To set the DHCP class ID for the Local Area Connection adapter to TEST, type:
ipconfig /setclassid "Local Area Connection" TEST

IpConfig Excercises:
5) Log into your PC as administrator.
6) Follow:

Start Run Cmd Press OK

7) Now Answer the following questions:


a) Can we get the IP of your PC using ipconfig command? How?

b) Can we get the MAC Address using ipconfig command? How?


Get from physical address

c) Can we get the computer Name using ipconfig command? How?

d) If we want to know the MAC address of a remote PC, can we get it using ipconfig
command? How?
no

e) If we want to know the Computer Name of a remote PC, can we get it using
ipconfig command ONLY? How?
No

f) What does the following syntex do (Explain the results):

Ipconfig /displaydns
Display protocol within the set of standard for how computers exchange data on
the internet and many private network known as TCP/IP protocol suites.
g) Follow this procedure:
i. Run Ipconfig /displaydns observe the result.

ii. Run

Ipconfig /flushdns observe the result.

iii. Run

Ipconfig /displaydns observe the result.

iv. What is the difference between the two results (Step i and iii)?
The address cache which have no information in step (i) has been flushed
or deleted so in step (iii), there are no caches present except for address
with information.
h) If we want to know the current full TCP configuration for our host, what would be
the full statement to be used?
ipconfig/all
8) Exit command prompt.

Arp
Displays and modifies entries in the Address Resolution Protocol (ARP) cache, which contains one or more tables
that are used to store IP addresses and their resolved Ethernet or Token Ring physical addresses. There is a separate
table for each Ethernet or Token Ring network adapter installed on your computer. Used without parameters, arp
displays help.

Syntax
arp [-a [InetAddr] [-N IfaceAddr]] [-g [InetAddr] [-N IfaceAddr]] [-d InetAddr [IfaceAddr]] [-s InetAddr EtherAddr
[IfaceAddr]]

Parameters
-a [ InetAddr ] [ -N IfaceAddr ]

Displays current ARP cache tables for all interfaces. To


display the ARP cache entry for a specific IP address, use arp
-a with the InetAddr parameter, where InetAddr is an IP
address. To display the ARP cache table for a specific
interface, use the -N IfaceAddr parameter where IfaceAddr is
the IP address assigned to the interface. The -N parameter is
case-sensitive.

-g [ InetAddr ] [ -N IfaceAddr ]

Identical to -a.

-d InetAddr [ IfaceAddr ]

Deletes an entry with a specific IP address, where InetAddr


is the IP address. To delete an entry in a table for a specific
interface, use the IfaceAddr parameter where IfaceAddr is the
IP address assigned to the interface. To delete all entries, use
the asterisk (*) wildcard character in place of InetAddr.

-s InetAddr EtherAddr [ IfaceAddr ]

Adds a static entry to the ARP cache that resolves the IP


address InetAddr to the physical address EtherAddr. To add a
static ARP cache entry to the table for a specific interface,
use the IfaceAddr parameter where IfaceAddr is an IP address
assigned to the interface.

/?

Displays help at the command prompt.

Remarks

The IP addresses for InetAddr and IfaceAddr are expressed in dotted decimal notation.

The physical address for EtherAddr consists of six bytes expressed in hexadecimal notation and separated
by hyphens (for example, 00-AA-00-4F-2A-9C).

Entries added with the -s parameter are static and do not time out of the ARP cache. The entries are
removed if the TCP/IP protocol is stopped and started. To create permanent static ARP cache entries, place
the appropriate arp commands in a batch file and use Scheduled Tasks to run the batch file at startup.

This command is available only if the Internet Protocol (TCP/IP) protocol is installed as a component in
the properties of a network adapter in Network Connections

Examples
To display the ARP cache tables for all interfaces, type:
arp -a
To display the ARP cache table for the interface that is assigned the IP address 10.0.0.99, type:
arp -a -N 10.0.0.99
To add a static ARP cache entry that resolves the IP address 10.0.0.80 to the physical address 00-AA-00-4F-2A-9C,
type:
arp -s 10.0.0.80 00-AA-00-4F-2A-9C

the command prompt.

Remarks

If you indicate a major and minor reason code, you must first define these reason codes on each computer
for which you plan to use the particular reason. If the reason codes are not defined on the target computer,
Event Viewer cannot log the correct reason text.

ARP Exercise:
1) Log into your PC as administrator.
2) Follow:

Start Run Cmd Press OK

3) Now follow the procedure and observe the results:


a) Ping <next PC IP>

b) Run arp a

c) Run arp d <next PC IP>

d) Run arp a

e) What is the difference between the results of step b and step d?


Different ip and mac address
f) Run arp d <next PC IP>

g) Run arp s <next PC IP><next PC MAC>

h) Run arp a

i) What is the difference between the results of step b and previous step?
The address of next PC becomes invalid as stated above.
j) How can we delete all the arp entries?

4) Exit command prompt.

Вам также может понравиться