Home > Articles

This chapter is from the book

TCP/IP Troubleshooting

Windows XP Professional and Windows Server 2003 offer several native programs that an administrator can use to troubleshoot TCP/IP issues. Some are full-fledged tools in their own right, such as FTP, but they can help in determining what might be affecting a TCP/IP network. Many of these TCP/IP troubleshooting tools are discussed in the sections that follow.

The PING Command

The PING command can be used to test network connectivity from a local system by sending an ICMP message to a remote host or gateway. On external networks such as the Internet, the use of PING might be somewhat limited, depending on how routers and firewalls are configured; many do not allow ICMP traffic. If the remote host receives the message, it responds with a reply message. PING notes the IP address, the number of bytes in the message, how long it took to reply (in milliseconds –], and the length of Time to Live (TTL) in seconds and shows any packet loss in terms of percentages, as shown here:

Pinging with 32 bytes of data:
Reply from bytes=32 time<10ms TTL=128
Reply from bytes=32 time<10ms TTL=128
Reply from bytes=32 time<10ms TTL=128
Reply from bytes=32 time<10ms TTL=128
Ping statistics for
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milliseconds:
  Minimum = 0ms, Maximum = 0ms, Average = 0ms 
Usage: ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS]
[-r count] [-s count] [[-j host-list] | [-k host-list]]
[-w timeout] target_name

The following list describes the switches available for use with PING:

  • -t—Ping the specified host until stopped. To see statistics and to continue, type Ctrl+Break; to stop, type Ctrl+C.

  • -a—Resolve addresses to hostnames.

  • -n count—The number of echo requests to send.

  • -l size—Send buffer size.

  • -f—Set the Don't Fragment flag in the packet.

  • -i TTL—Time to Live.

  • -v TOS—Type of Service.

  • -r count—Record route for count hops.

  • -s count—Timestamp for count hops.

  • -j host-list—Loose source route along host list.

  • -k host-list—Strict source route along host list.

  • -w timeout—Time in milliseconds to wait for each reply.

The ARP Command

The ARP command displays and modifies the IP-to-physical address translation tables used by Address Resolution Protocol (ARP), as shown here:

ARP -s inet_addr eth_addr [if_addr]
ARP -d inet_addr [if_addr]
ARP -a [inet_addr] [-N if_addr]

The following list describes the switches available for use with ARP:

  • -a—Displays current ARP entries by referencing the current protocol data. If inet_addr is specified, the IP and physical addresses for only the specified computer are displayed. If more than one network interface uses ARP, entries for each ARP table are displayed.

  • -g—Same as -a.

  • inet_addr—Specifies an Internet address.

  • -N if_addr—Displays ARP entries for the network interface specified by if_addr.

  • -d—Deletes the host specified by inet_addr. You can use * as a wildcard with inet_addr to delete all hosts.

  • -s—Adds the host and associates the Internet address inet_addr with the physical (MAC) address.

  • eth_addr—Uses the physical (MAC) address and is given as six hexadecimal bytes separated by hyphens.

  • if_addr—Specifies the Internet address of the interface that should have its address translation table modified. If if_addr is not entered, the first applicable interface is used.

For example, the following code adds a static entry:

> arp -s 00-aa-00-62-c6-09 .... 

The following displays the ARP table:

> arp -a 

The IPCONFIG Command

IPCONFIG is a command-line tool for getting basic IP configuration information, including the IP address, subnet mask, and default gateway. The IPCONFIG /all switch produces a detailed configuration report for all interfaces on a system, including any configured remote access adapters, as shown here:

ipconfig [/? | /all | /renew [adapter] | /release [adapter] 
| /flushdns | /displaydns | /registerdns | /showclassid adapter 
| /setclassid adapter [classid] ]

The following list describes the switches available for use with IPCONFIG:

  • /all—Display full configuration information.

  • /release—Releases the IP address for the specified adapter.

  • /renew—Renews the IP address for the specified adapter.

  • /flushdns—Purges the DNS Resolver cache.

  • /registerdns—Reregisters DNS names.

  • /displaydns—Displays the contents of the DNS Resolver Cache.

  • /showclassid—Displays all the DHCP class IDs allowed for adapter.

  • /setclassid—Modifies the DHCP class ID.

The default is to display only the IP address, subnet mask, and default gateway for each adapter bound to TCP/IP. For /release and /renew, if no adapter name is specified, the IP address leases for all adapters bound to TCP/IP are released or renewed.

The NBTSTAT Command

NetBT Statistics (Nbtstat.exe) is a command-line tool that can be used to view and troubleshoot network NetBIOS over TCP/IP (NetBT) name resolution. It displays protocol statistics and current TCP/IP connections that are using NetBT.

NetBT resolves NetBIOS names to IP addresses by using several options for NetBIOS name resolution, including local cache lookup, WINS server query, broadcast, LMHOSTS and HOSTS file lookup, and DNS server query. It also displays protocol statistics and current TCP/IP connections using NetBT.

NBTSTAT [ [-a RemoteName] [-A IP address] [-c] [-n] 
[-r] [-R] [-RR] [-s] [-S] [interval] ]

The following list describes the switches available for use with NBTSTAT:

  • -a (adapter status)—Lists the remote machine's name table given its name.

  • -A (adapter status)—Lists the remote machine's name table given its IP address.

  • -c (cache)—Lists NBT's cache of remote (machine) names and their IP addresses.

  • -n (names)—Lists local NetBIOS names.

  • -r (resolved)—Lists names resolved by broadcast and via WINS.

  • -R (Reload)—Purges and reloads the cache name table and reloads the #PRE tagged entries from the LMHOST file if any are present.

  • -S (Sessions)—Lists the sessions table with the destination IP addresses.

  • -s (sessions)—Lists the sessions table, converting destination IP addresses to computer NetBIOS names.

  • -RR (ReleaseRefresh)—Sends Name Release packets to WINS and then starts Refresh.

  • RemoteName—Remote host machine name.

  • IP address—Dotted decimal representation of the IP address.

  • interval—Redisplays selected statistics, pausing the number of seconds specified by interval between each display. Press Ctrl+C to stop redisplaying statistics.

The NETSTAT Command

NETSTAT (Netstat.exe) is a command-line tool that displays TCP/IP statistics and active connections to and from the local system. It can also display all connections and listening ports and has an option to display the number of bytes sent and received and any network packets dropped (if applicable).

NETSTAT [-a] [-e] [-n] [-o] [-s] [-p protocol] [-r] [interval]

The following list describes the switches available for use with NETSTAT:

  • -a—Displays all connections and listening ports.

  • -e—Displays ethernet statistics. Can be combined with the -s option.

  • -n—Displays addresses and port numbers in numerical form.

  • -o—Displays the owning process ID associated with each connection.

  • -p protocol—Shows connections for the protocol specified by protocol, which can be TCP, UDP, TCPv6, or UDPv6. If used with the –s option to display per-protocol statistics, protocol can be any of the following: IP, IPv6, ICMP, ICMPv6, TCP, TCPv6, UDP, or UDPv6.

  • -r—Displays the routing table.

  • -s—Displays per-protocol statistics. By default, statistics are shown for IP, IPv6, ICMP, ICMPv6, TCP, TCPv6, UDP, and UDPv6; the -p option can be used to specify a subset of the default.

  • interval—Redisplays selected statistics, pausing the number of seconds specified by interval between each display. Press Ctrl+C to stop redisplaying statistics. If this switch is omitted, NETSTAT prints the current configuration information once.

The ROUTE Command

The ROUTE command-line tool displays the current IP routing table for the local system, and it can be used to add or delete IP routes and to add persistent routes.

ROUTE [-f] [-p] [command] [destination] [MASK netmask]
[gateway] [METRIC metric] [IF interface]

The following list describes the switches available for use with ROUTE:

  • -f—Clears the routing tables of all gateway entries. If it is used with one of the ROUTE commands (see the following list), the routing tables are cleared before running the command.

  • -p—When used with the ADD command, it makes a route persistent across boots of the system. By default, routes are not preserved when the system is restarted. Ignored for all other commands, which always affect the appropriate persistent routes.

The following list describes the commands available for use with ROUTE:

  • PRINT—Prints a route.

  • ADD—Adds a route.

  • DELETE—Deletes a route.

  • CHANGE—Modifies an existing route.

  • destination—Specifies the host.

  • MASK—Specifies that the next parameter is the netmask value.

  • netmask—Specifies a subnet mask value for this route entry. If not specified, it defaults to

  • gateway—Specifies the gateway.

  • interface—Specifies the interface number for the specified route.

  • METRIC—Specifies the metric—that is, the cost for the destination.

Names used for the destination command are looked up in the NETWORKS file on the local system. Names used for the gateway command are looked up in the HOSTS file on the local system. If the command is PRINT or DELETE, the destination or gateway can be a wildcard (*), or the gateway entry can be left blank. Invalid MASK entries, such as (DEST & MASK) != DEST, generate an error.

The HOSTNAME Command

HOSTNAME is a command-line tool for showing the local computer's hostname. It can be used for authentication purposes by the Remote Copy Protocol (RCP), Remote Shell (RSH), and Remote Execution (REXEC) tools.

The TRACERT Command

TRACERT is sometimes used to verify that IP addressing has been correctly configured on a client. It basically shows the route taken to reach a remote system.

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

Here is a list of available switches for the TRACERT command:

  • -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 the number of milliseconds specified by timeout for each reply.

The PATHPING Command

Like TRACERT, PATHPING shows the route taken to reach a remote system, but PATHPING does so with more detail and offers more functionality.

pathping [-g host-list] [-h maximum_hops] 
[-i address] [-n] [-p period] [-q num_queries] 
[-w timeout] [-P] [-R] [-T] [-4] [-6] target_name

Here is a list of available switches for the PATHPING command:

  • -g host-list—Loose source route along the host list.

  • -h maximum_hops—Maximum number of hops to search for target.

  • -i address—Use the specified source address.

  • -n—Do not resolve addresses to hostnames.

  • -p period—Wait the number of milliseconds specified by period between pings.

  • -q num_queries—Number of queries per hop.

  • -w timeout—Wait the number of milliseconds specified by timeout for each reply.

  • -P—Test for RSVP PATH connectivity.

  • -R—Test if each hop is RSVP aware.

  • -T—Test connectivity to each hop with layer-2 priority tags.

  • -4—Force using IPv4.

  • -6—Force using IPv6.

The FTP Command

FTP is used to transfer files from system to system over TCP ports 20 and 21 (by default), but it can also help you diagnose problems on your TCP/IP network. By using Internet Explorer with FTP, users experience a Windows Explorer–type of GUI environment for the FTP file transfer by having features such as file and folder views, drag-and-drop, and copy-and-paste available.

The command-line FTP allows for more functionality. FTP is considered a connected session that uses TCP. FTP commands are as follows: !, delete, literal, prompt, send ?, debug, ls, put, status append, dir, mdelete, pwd, trace ascii, disconnect, mdir, quit, type, bell, get, mget, quote, user, binary, glob, mkdir, recv, verbose, bye, hash, mls, remotehelp, cd, help, mput, rename, close, lcd, open, and rmdir. Here is an example of the syntax:

FTP [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a] [-w:windowsize] [-A] [host]

The following list explains the options you can use with the FTP command:

  • -v—Suppresses display of remote server responses.

  • -n—Suppresses auto-login at initial connection.

  • -i—Turns off interactive prompting during multiple file transfers.

  • -d—Enables debugging.

  • -g—Disables filename globing.

  • -s:filename—Specifies a text file containing FTP commands; the commands automatically run after FTP starts.

  • -a—Use any local interface when binding a data connection.

  • -A—Log in as anonymous.

  • -w:buffersize—Overrides the default transfer buffer size of 4,096.

  • host—Specifies the hostname or IP address of the remote host to connect to.

The TFTP Command

Trivial File Transfer Protocol allows for connectionless transfer of files to and from systems using UDP. Although TFTP is limited in functionality, there are still some command-line switches that can be used to tailor its performance:

TFTP [-i] host [GET | PUT] source [destination]

Definitions for these switches are as follows:

  • -i—Specifies binary image transfer mode (also called octet). In binary image mode, the file is moved literally byte by byte.

  • host—Specifies the local or remote host by name.

  • GET—Transfers the file destination on the remote host to the file source on the local host.

  • PUT—Transfers the file source on the local host to the file destination on the remote host.

  • source—Specifies the file to transfer.

  • destination—Specifies where to transfer the file.

The TELNET Command

Telnet is a command-line terminal emulation program that enables an administrator to perform commands on a remote computer from a command window on a local system. Here is an example of the syntax:

telnet [-a] [-e char] [-f filename] [-l user] [-t term] [host] [port]

Definitions for TELNET switches are as follows:

  • -a—Attempts automatic logon. Same as -l option, except it uses the currently logged on user's name.

  • -e char—Escape character to enter Telnet client prompt.

  • -f filename—Filename for client-side logging.

  • -l user—Specifies the username to log in with on the remote system. Requires that the remote system support the TELNET ENVIRON option.

  • -t term—Specifies terminal type. Supported term types are vt100, vt52, ansi, and vtnt only.

  • host—Specifies the hostname or IP address of the remote computer to connect to.

  • port—Specifies a port number or service name.

The RCP Command

Remote Copy Protocol (RCP) uses TCP to copy files to and from systems running the RCP service. It can be scripted in a batch file and does not require a password. The remote host must be running the Remote Shell Daemon (RSHD) service, and the user's username must be configured in the remote host's .rhosts file. Microsoft's implementation of TCP/IP includes the RCP client software but not RSHD services. RCP is one of the r- commands available on all Unix systems.

RCP [-a | -b] [-h] [-r] [host][.user:]source [host][.user:] path\destination

The following list explains the options you can use with the RCP command:

  • -a—This is the default transfer mode that specifies ASCII transfer mode. This mode converts the end-of-line (EOL) characters to a carriage return for Unix and a carriage return/line feed for personal computers.

  • -b—Specifies binary image transfer mode.

  • -h—Transfers hidden files.

  • -r—Copies the contents of all subdirectories; destination must be a directory.

  • host—Specifies the local or remote host. If the host is specified as an IP address or if the hostname contains dots, you must specify the user.

  • .user:—Specifies a username to use instead of the current username.

  • source—Specifies the files to copy.

  • path\destination—Specifies the path to the logon directory on the remote host.

The RSH Command

Remote Shell (RSH) enables clients to run commands directly on remote hosts running the RSH service without having to log on to the remote host. Microsoft's implementation of TCP/IP includes the RSH client software but not the RSH service. If a user on a computer running in a Windows domain tries to use RSH to run a command on a remote Unix server running RSH, the domain controller is required by the RSH client to resolve the user's username. RSH is one of the Unix r-commands that is available on all Unix systems.

The REXEC Command

Remote Execution (REXEC) runs commands on remote hosts running the REXEC service and authenticates the username on the remote host before executing the specified command.

REXEC host [-l username] [-n] command

The following list defines options to use with the REXEC command:

  • host—Specifies the remote host on which to run the command.

  • -l username—Specifies the username on the remote host.

  • -n—Redirects the input of REXEC to NULL.

  • command—Specifies the command to run.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information

To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.


Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.


If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information

Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.


This site is not directed to children under the age of 13.


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information

If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information

Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents

California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure

Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact

Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice

We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020