Ping, tracert, and traceroute commands

Source: Internet
Author: User

Ping Command details

Ping can be used to test the computer name and computer ip address, verify the connection with the remote computer, verify the connection to one or more remote computers by sending icmp echo data packets to the computer and listening for echo response data packets. This command can only be used after the TCP/IP protocol is installed. Open your ms-dos(open the Startup Program ms-dos.pdf, and use win2000's example to open cmd.exe (this is ms-dos in win2000, start → program → attachment → "command prompt" or start → search for files or folders → "fill in cmd.exe ", find it and double-click it to run it .) Let's take a look at his command:

Ping [-t] [-a] [-n count] [-l length] [-f] [-I ttl] [-v tos] [-r count] [- s count] [[-j computer-list] | [-k computer-list] [-w timeout] destination-list

Parameters

-T

Ping the specified computer until it is interrupted. Ctrl + c stop

-

Resolve the address to the computer name. Example: c: //> ping-a 127.0.0.1

Pinging china-hacker [127.0.0.1] with 32 bytes of data :( china-hacker is his computer name)

Reply from 127.0.0.1: bytes = 32 time <10 ms ttl = 128 reply from 127.0.0.1: bytes = 32 time <10 ms ttl = 128 reply from 127.0.0.1: bytes = 32 time <10 ms ttl = 128 reply from 127.0.0.1: bytes = 32 time <10 ms ttl = 128

Ping statistics for 127.0.0.1: packets: sent = 4, stored ED = 4, lost = 0 (0% loss), approximate round trip times in milli-seconds: minimum = 0 ms, maximum = 0 ms, average = 0 ms

-N count

Number of echo data packets sent by count. The default value is 4.

-L length

Sends an echo packet containing the data volume specified by length. The default value is 32 bytes. The maximum value is 65,527.

-F

Send the "Do Not segment" flag in the data packet. Packets are not segmented by the gateway on the route.

-I ttl

Set the "survival time" field to the value specified by ttl.

-V tos

Set the "service type" field to the value specified by tos.

-R count

Record the routes of outgoing and returned data packets in the "Record Route" field. Count can specify at least one computer and a maximum of nine computers.

-S count

Specifies the timestamp of the number of hops specified by count.

-J computer-list

Route data packets using the computer list specified by computer-list. The maximum number of consecutive computers that can be separated by the Intermediate Gateway (routing sparse source) ip addresses is 9.

-K computer-list

Route data packets using the computer list specified by computer-list. The maximum number of ip addresses allowed by consecutive computers to be separated by intermediate gateways (strictly source routes) is 9.

-W timeout

Specify the timeout interval, in milliseconds.

Destination-list

Specify the remote computer to be pinged.

C: //> ping ds.internic.net

Pinging ds.internic.net [192.20.239.132] with 32 bytes of data: (192.20.239.132 his IP address)

Reply from 192.20.239.132: bytes = 32 time = 101 ms ttl = 243

Reply from 192.20.239.132: bytes = 32 time = 100 ms ttl = 243

Reply from 192.20.239.132: bytes = 32 time = 120 ms ttl = 243

Reply from 192.20.239.132: bytes = 32 time = 120 ms ttl = 243

* ***** # *** Use of TRACERT

Traceroute Usage Details

 

Internet, the international Internet, is the world's largest computer network, more specifically the network. It consists of tens of thousands of local networks and millions of computers all over the world, and implements inter-network communication through TCP/IP protocol for heterogeneous networks. In the Internet, information is transmitted from one end to the other through transmission media and devices (routers, switches, servers, gateways, etc.) in many segments in the network. Each device connected to the Internet, such as a host, router, or access server, usually has an independent IP address. With Traceroute, we can know the path from your computer to the host on the other end of the Internet. Of course, the path for each packet to arrive at the same destination from a certain source may be different, however, most of the time the routes are the same. In UNIX systems, we call Traceroute, Which is Tracert in MS Windows. Traceroute sends a small packet to the target device until it returns, to measure how long it takes. Traceroute of each device in a path must be tested three times. The output results contain the time (MS) of each test, the name of the device (if any), and its IP address.
In most cases, as a network engineering technician or system administrator, you can directly execute the command line on a UNIX host system:
Traceroute hostname
In Windows, the Tracert command is executed:
Tracerert hostname
For example, use a windows NT host in the Beijing region (after a point-to-point connection has been established with Beijing 163)
Run the Tracert command in the NT System: (available to the user: Start-> Run. Enter "command" to bring up the command window and use this command)
C: //> tracertwww.yahoo.com
Tracing route towww.yahoo.com [204.71.200.75]
Over a maximum of 30 hops:

1 161 MS 150 MS 160 MS 202.99.38.67
2 151 MS 160 MS 160 MS 202.99.38.65
3 151 MS 160 MS 150 MS 202.97.16.170
4 151 MS 150 MS 150 MS 202.97.17.90
5 151 MS 150 MS 150 MS 202.97.10.5
6 151 MS 150 MS 150 MS 202.97.9.9
7 761 MS 761 MS 752 MS border7-serial3-0-0.Sacramento.cw.net [204.70.122.69]
8 751 MS 751 MS * core2-fddi-0.Sacramento.cw.net [204.70.164.49]
9 762 MS 771 MS 751 MS border8-fddi-0.Sacramento.cw.net [204.70.164.67]
10 721 MS * 741 MS globalcenter.Sacramento.cw.net [204.70.123.6]
11*761 MS 751 MS pos4-2-155M.cr2.SNV.globalcenter.net [206.132.150.237]
12 771 MS * 771 MS pos1-0-2488M.hr8.SNV.globalcenter.net [206.132.254.41]
13 731 MS 741 MS 751 MS bas1r-ge3-0-hr8.snv.yahoo.com [208.178.103.62]
14 781 MS 771 MS 781 MS www10.yahoo.com [204.71.200.75]

Trace complete.
If you are in the ONLINE status, try it.
Parameter description:
Tracert [-d] [-h maximum_hops] [-j computer-list] [-w timeout] target_name
The diagnostic utility determines the route to the destination by sending an Internet Control Information Protocol (CMP) response packet with different TTL (TL) to the destination. Each vro on the path must reduce the TTL value by at least 1 before forwarding the ICMP Response Message. Therefore, TTL is a valid redirect count. When the TTL value of the packet is reduced to 0, the router sends the ICMP timeout message to the source system. Tracert can determine the route by sending the first response packet whose TTL is 1 and adding the TTL value to 1 each time in subsequent sending until the target response or the maximum TTL value is reached. Check the ICMP timeout (ime Exceeded) Information sent back by the Intermediate router to determine the router. Note that some routers "quietly" discard the expired packets of the time-to-live (TLS) and are invalid for tracert.
Parameters
-D
Specifies an invalid computer name resolution address.
-H maximum_hops
Specify the maximum number of jumps to the target.
-Jcomputer-list
Loose Source Route in computer-list.
-W timeout
Wait for the number of milliseconds specified by timeout for each response.
Target_name
The name of the target computer.
2. What is Traceroute Gateway -- Traceroute Gateway?
Generally, Traceroute (or Tracert) is based on a single host, however, you can only know the routing quality and data transmission efficiency of any online host on the Internet from the host at hand as the source address. Instead, you can use a WEB-based approach, as long as a host is installed with a specific CGI program, you can run the relevant program on this host to execute the Traceroute function. This host is called the Traceroute gateway. The Traceroute gateway helps you understand the topology of the physical and logical connections of the network and the efficiency of data transmission. If there are enough gateways, we can easily understand the connection between hosts.
3. Why Traceroute?
1. Almost everyone on the Internet (especially Webmaster) cares about the connection, routing, connection time, and speed between their computers (or other devices) and the Internet. The Traceroute gateway service provided by the regional webmasters organized by ChianNetMap will give you a satisfactory answer. From your computer to any other place, ChinaNetMap (Traceroute) can provide each device (IP address) and its connection time. It allows you to draw a path through the network.
2. Many companies and organizations have or are setting up their own servers-especially Web servers. Once you have your own Web servers, as the number of Internet users increases (including potential Internet users that cannot be counted), you must be wondering if they can connect to you. How your ISP connects to one or more NAP and their connection efficiency will directly affect your connection quality.
3. when you select ISP, backbone network connection, and the host of your Site, most knowledgeable netizens like to check the connection performance of the Site and how other websites can be connected exactly to and where they are connected. ChinaNetMap (Traceroute) will give you a perfect answer.
Iv. Traceroute features:
Traceroute was first written by Van Jacob son in 1988. At that time, he mainly solved some network problems he encountered. Traceroute is an important tool to correctly understand the IP network and the routing principle. They are a convenient program for the Webmaster responsible for network engineering technology and system management.
For ISP, the establishment of Traceroute gateway will enable network service providers to help users establish and maintain confidence in the service quality of service providers. ISP with high service quality can set up Traceroute gateway to help users understand the efficiency of network connection and data transmission. Of course, ISPs with poor infrastructure and low service quality are afraid of providing such services. As a result, you can use this tool to understand the current network connection status of the service provider.
After a host has installed the relevant Traceroute CGI program, you can enter the IP address or name of the target host to obtain the relevant data:
For example: in the United States host http://bs.mit.edu: 8001/cgi-bin/traceroute
Query the data transmission path of the Polaris site www.lodesoft.com (a partner of the China Webmaster Alliance) in Nanjing, China.
The query interface is:
Traceroute Hack
--------------------------------------------------------------------------------

You can search for this index. Enter a keyword:
The query result is:
Traceroute Hack
1 E40-RTR-E40SERVER72-ETHER.MIT.EDU (18.72.0.1) 4 MS 4 MS
2 EXTERNAL-RTR-FDDI.MIT.EDU (18.168.0.12) 4 MS 4 MS
3 f1-0.cambridge2-br2.bbnplanet.net (192.233.33.6) 4 MS 4 MS
4 s11-0-1.cambridge1-br1.bbnplanet.net (4.0.1.201) 8 MS 4 MS 4 MS
5 p1-0.cambridge1-nbr2.bbnplanet.net (4.0.1.45) 4 MS 4 MS 4 MS
6 p4-1.bstnma1-ba1.bbnplanet.net (4.0.2.170) 4 MS 4 MS 4 MS
7 p1-0.bstnma1-ba2.bbnplanet.net (4.24.4.194) 4 MS 8 MS
8 p2-1.nyc4-nbr3.bbnplanet.net (4.24.4.238) 8 MS 12 MS 12 MS
9 p1-0.nyc4-nbr2.bbnplanet.net (4.0.5.25) 8 MS 12 MS 8 MS
10 p4-0.sanjose1-nbr2.bbnplanet.net (4.0.5.97) 70 MS 70 MS 70 MS
11 p1-0.sanjose1-nbr1.bbnplanet.net (4.0.5.85) 70 MS 70 MS 70 MS
12 p4-0.paloalto-nbr2.bbnplanet.net (4.0.1.1) 70 MS 74 MS 70 MS
13 p0-0-0.paloalto-cr18.bbnplanet.net (4.0.3.86) 70 MS 74 MS 74 MS
14 h1-0.atteasylink.bbnplanet.net (4.1.142.254) 74 MS 74 MS 78 MS
15 199.37.127.234 (199.37.127.234) 78 MS 74 MS 78 MS
16 205.174.74.170 (205.174.74.170) 230 MS 238 MS 227 MS
17 202.97.9.65 (202.97.9.65) 238 MS 231 MS 223 MS
18*202.97.9.49 (202.97.9.49) 234 MS *
19 202.97.10.110 (202.97.10.110) 246 MS 250 MS *
20 202.97.24.178 (202.97.24.178) 234 MS 238 MS 238 MS
21 202.102.24.74 (202.102.24.74) 234 MS 254 MS *
V. Command Parameters of Traceroute:
Traceroute usage: Traceroute [options] <IP-address or domain-name> [data size]
[Options:
[-N]: The displayed address is represented by numbers rather than symbols.
[-V]: Long output
[-P]: UDP port settings (33434 by default)
[-Q]: set the number of TTL tests (3 by default)
[-T]: Set the service type of the test package.
[Data size]: The data byte length of each test package (38 by default)

6. How Traceroute works:
Traceroute: traceroute hostname
The Traceroute program is designed To use the TTL (Time To Live) field of ICMP and IP header ). First, traceroute sends an IP datasync whose TTL is 1 (in fact, three 40-byte packets are sent each time, including the source address, destination address, and time tag sent by the package) to the destination, when the first router in the path receives the datax, it will reduce the TTL by 1. At this time, the TTL is changed to 0, so the vro will discard the datax and send back an "ICMP time exceeded" message (including the source address of the IP packet, all the content of the IP packet and the IP address of the router). After receiving the message, traceroute will know that the router exists in this path, and then traceroute will send a data packet whose TTL is 2, 2nd vrouters found ...... traceroute adds the TTL of the sent dataphin to 1 to find another vro. This repeated action continues until a dataphin reaches its destination. When datax arrives at the destination, the host does not return the ICMP time exceeded message because it is already the destination. How does traceroute know that the destination has arrived?
When Traceroute sends a UDP batch Rams to the destination, the port number it chooses to deliver is a number that is not used by general applications (more than 30000 ), therefore, when the UDP datax arrives at the destination, the host will return an "ICMP port unreachable" message. When traceroute receives the message, it will know that the destination has arrived. Therefore, traceroute does not have a Daemon program on the Server.
Traceroute extracts the IP address of the device that sends the icmp ttl expired message for domain name resolution. Each time, Traceroute prints a series of data, including the domain name and IP address of the route device that passes through, and it takes time for three packets to go back and forth.
Traceroute face = "" has a fixed waiting time for response (icmp ttl expired message ). If this time expires, it prints a series of * numbers indicating that the device cannot send an icmp ttl expiration message response within the specified time on this path. Then, Traceroute adds 1 to the TTL recorder and continues.

* ****** Common network test commands

 

 

The network is disconnected. When you turn to the network management, you will often see the network management to detect and handle network faults. Using some commands, understanding and understanding the following commands will help you detect network faults more quickly, this saves time and improves efficiency.

Ping
Ping is a useful tool for testing network connectivity and packet sending and receiving conditions. It is the most common command for network testing. Ping sends a send-back request packet to the target host (address), and requests the target host to reply after receiving the request to determine the network response time and whether the host is connected to the target host (address.

If Ping fails, you can predict that the fault may occur in the following aspects: network cable failure, incorrect network adapter configuration, and incorrect IP address. If the Ping is successful and the network is still unavailable, the problem may be caused by the software configuration of the network system. If the Ping is successful, only a physical path connecting the local host to the target host can be guaranteed.

Command Format:
Ping the IP address or host name [-t] [-a] [-n count] [-l size]

Parameter description:
-T continuously sends data to the target host;

-A displays the network address of the target host in the IP address format;

-N count: the number of Ping attempts. The count parameter specifies the number of Ping attempts;

-L size indicates the size of the data packet sent to the target host.

For example, if your machine cannot access the Internet, you must first check whether the local area network is faulty.
. Assuming that the IP address of the proxy server on the LAN is 202.160.1, you can run the Ping command to avoid 202.160.1 to check whether the local host is connected to the proxy server. For example, the common command to test whether the local Nic is correctly installed is ping 127.0.0.1.

Tracert
The Tracert command is used to display the path through which data packets arrive at the target host and the time when data packets arrive at each node. The command function is similar to the Ping command, but the information obtained is much more detailed than the Ping command. It displays all the paths of data packets, the IP addresses of nodes, and the time spent. This command is applicable to large networks.

Command Format:
Tracert IP address or host name [-d] [-h maximumhops] [-j host_list] [-w timeout]

Parameter description:
-D does not parse the name of the target host;

-H maximum_hops specifies the maximum number of hops that can be found for the target address;

-J host_list: Release the source route based on the address in the host list;

-W timeout specifies the timeout interval. The default time unit of the program is milliseconds.

For example, if you want to know the detailed transfer path information between your computer and the target host www.cce.com.cn, you can enter tracertwww.ccidnet.com in MS-DOS mode.

If we add some parameters after the Tracert command, we can also detect other more detailed information. For example, we can use the-d parameter to specify the path information of the host when the program tracks the host, the domain name of the target host is also resolved.

Netstat
The Netstat command helps the network administrator understand the overall network usage. It displays the details of the currently active network connection, such as network connection, route table, and network interface information. It can calculate which network connections are currently running.

Using command parameters, the command can display the usage status of all protocols, including TCP, UDP, and IP. In addition, you can select a specific protocol and view its specific information, the port numbers of all hosts and Detailed Routing Information of the current host are displayed.

Command Format:
Netstat [-r] [-s] [-n] [-a]

Parameter description:
-R: displays the content of the local route table;

-S: displays the usage status of each Protocol (including TCP, UDP, and IP );

-N: the address and port are displayed in a digital table;

-A: displays the port numbers of all hosts.

Winipcfg
The Winipcfg command displays the specific configuration information of the IP protocol in a window. The command displays the physical address of the network adapter, the IP address of the host, the subnet mask, and the default gateway, you can also view the host name, DNS server, node type, and other information. The physical address of the network adapter is useful when detecting network errors.

Command Format:
Winipcfg [/?] [/All]

Parameter description:
/All: displays all IP address configurations;

/Batch writes command results to the specified file;

/Renew _ all retry all network adapters;

/Release_all release all network adapters;

/Renew N reset network adapter N;

/Release N release network adapter N.

You can run the preceding commands in Microsoft Windows 95 and later operating systems.
* ****************** Xiang Jie IPCONFIG

Ipconfig details

 

Ipconfig is a common command for debugging computer networks. Generally, you can use it to display the IP addresses, subnet masks, and default gateways of network adapters in your computer. In fact, this is only the use of Ipconfig without parameters, and its use with parameters is quite good in network applications.

1. parameter description

1./all

Displays the complete TCP/IP configuration information for all network adapters (network adapters, dial-up connections, etc. Compared with the usage without parameters, it provides more information, such as whether the IP address is dynamically allocated and the physical address of the NIC is displayed.

2./batch file name

Write the information displayed in Ipconfig to the specified file in text format. This parameter can be used to back up the network configuration of the local machine.

3./release_all and/release N

Releases Dynamic IP addresses allocated by DHCP for all (or specified) adapters. This parameter is applicable to non-static Nic IP addresses. It is usually used in combination with the following renew parameter.

4. ipconfig/renew_all or ipconfig/renew N

Assign IP addresses to all (or specified) adapters. This parameter is also applicable only to non-static Nic IP addresses. It is usually used in combination with the preceding release parameter.

II. Application Instances

1. Backup network settings

Ipconfig/batch bak-netcfg

Note: Back up network configuration information to the bak-netcfg file.

2. dynamically allocate a new address for the NIC

Ipconfig/release 1

Remove the dynamic IP address of the network adapter (adapter 1.

Ipconfig/renew 1

Redynamically allocates IP addresses for NICs.

 

Reprinted statement:This article from http://hi.baidu.com/goodlucklytimes/blog/item/2b22b6d1e01207309a50276f.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.