"Linux" about route trace Directive traceroute

Source: Internet
Author: User
Tags traceroute command traceroute command in linux

The premise of all the commands in this article is: You can surf the internet now.

People with a little computer knowledge know that the ping command is used to check whether their host is connected to the destination address, the communication packet communication rate of their host and destination address, the so-called communication packet, which is what TCP/IP,UDP package, here is a bit more popular, for example, Take this it website csdn to test, then get the following effect:


But the route trace directive traceroute, in Windows is tracert, for non-computer network insiders, do not know what this is.

In fact, the route tracking command, more can show their host and destination address of the communication details.

In Ubuntu12.04, ctrl+alt+t open the terminal, enter Traceroute if the prompt is not installed as shown.


Then, enter the following command, first install Traceroute,linux in addition to the necessary things, there is really nothing to install!

sudo apt-get install traceroute
As shown, quickly after the screen is brushed, because this route tracking component is only 51KB, you can officially use the traceroute command in Linux


At this point, enter the following command to test the communication details of my Ubuntu12.04 and www.csdn.net,

Traceroute-n www.csdn.net

Where-n represents, only to look at the IP address, do not display the hostname, the domain name of those things, that is to say do not show me the URL, then get the following effect:


After the first record can be found, it's a bunch of unreachable, that's because my Ubuntu12.04 is in a virtual machine, bridged to my host Windows 7, the virtual machine Ubuntu12.04 all network states directly inherit the host Windows 7 network, There is no idea what Windows 7 does, so you can only do this experiment with the same tracert routing trace command in Windows 7 cmd.

First, run cmd, enter tracert, and find the CMD prompt, which is not a running program or command or batch file, that is, you cannot find tracert. This is because my Windows 7x64 does not have a global variable that sets the contents of the Windows/system32 folder to CMD.


Like configuring Java, MySQL, as shown, right-click "My Computer or computer", select "Properties or Management", select "Advanced" tab, open "Environment variables", find path in "System Variables" column, edit, fill up a c:\windows\system32 Then there are various "OK".


After that, run cmd, enter tracert, this time show the description of the TRACERT command, finally can happily play.


Enter the following instructions, request to display, if the host to and www.csdn.net this URL communication, the entire communication packet flow.

Tracert-d-H-www.csdn.net

Which, requires only to show the IP, do not show me the URL, tracking 15 times, anyway, interrupted.

So, get the following result. What do you think of this result?

First column, that is, the left column of the 1,2,3,4,5 ... is the communication package section 1,2,3,4,5 ... station, that is, the communication packet ... jump on the router. The last column, the last column, is the station of a communication packet, the legendary router. The middle of the 3 time, respectively, represents 3 experimental communication packets, each other does not affect each other, station and station communication time, that is, the last router to the next router communication time.

Where the IP of this router, you can open a search engine, direct input, you can immediately display its IP corresponding location.

In summary, the following results correspond to the actual situation:

1, the beginning of the communication packet from the host, that is, from a university in Guangzhou, a unit of the host set off,

2, came to the gateway, that is, a university in Guangzhou, a unit of the total router

3-7, then according to the university's network settings, to find the university's external network exports, to Guangzhou Telecom router.

8-10, Guangzhou Telecom received this communication packet, help me to find www.csdn.net this address Ip,ip can obviously see from 183.63.96.129 quickly jump to 61.144.3.53, it is clear from the district-level units of the router to jump to the provincial unit of the router. Although these are the IP of Guangzhou Telecom, but who is the capital of Guangzhou, if I do this experiment in a non-provincial capital city. I have a hunch. The communication packet must be thrown to the provincial-level unit of the router.

11, because csdn in Guangdong did not match their own server, so Guangzhou Telecom has been unable to help me find its server address. So Guangzhou Telecom just threw me this bag to China's total router, looking for its location.

12-13, after the state-level router, engaged in "a long time", more than 100ms for the fiber is "a long time", did not give me feedback results, and then my host has been waiting.

14-15, after the national router does not know why the first to detect Australia IP, and then did not find to throw me to the Beijing headquarters router. It's probably 14-15 at the same time. That is, state-level routers in the detection of domestic IP at the same time, in the detection of foreign IP.


Since I set the trace 15 times, I interrupt anyway, so the route stops here. Of course I am not, this communication packet came to Beijing has not been lost, so enter the following instructions, do not limit the number of tracking, measured again.

Tracert-d www.csdn.net

Obviously the first 15 times, apart from the time, there will be no difference at all. Just like how you usually go to work, how do you get to work today, unless you are just at work, have not found a commuter route, or have something. The following results are followed:


16, came to Beijing Unicom, found CSDN server is a telecommunications server, then thrown into the telecommunications. In fact, the integration of 15 and 162 steps can be speculated to the Beijing area of the total server is actually a unicom server? Telecom's package actually to Unicom to handle only to telecommunications? Don't know why?

17, after more interesting is, came to Beijing Telecom, found this package, there are so-called "263 network Communications" handle, with a search engine, found that the "263 network communication" is to provide network support, cloud services and other companies. I began to speculate that CSDN should be using the cloud to serve our vast program of apes.

18, the last to reach the 114.112.73.194,csdn.net router.

This is consistent with the ping result above:


Although we people seem, this seems to be a very long process, after all, we people, now from Guangzhou to Beijing, the fastest also to 3 hours, not counting the city communication time, but also to spend Sengo ocean up and down ... However, for a network of communication packets, it is only within 1s. This must first She Guojia, let us 2000 kilometers outside the netizen can in 1s, almost did not spend a few money to be able to communicate.

Next to one of your Web site tracert experiment ended this article, for example, I said to my host, I want to communicate with WWW.GOOGLE.COM.HK this site what will happen?

The results are as follows:


To Guangzhou Telecom provincial route, or good, with the above and www.csdn.net happy to play, Shun smoothly came to Canton provincial route.

Then, do not know why immediately throw to Nepal disaster area?

This......

Estimate this IP is disguised, if go to this IP, the communication packet can no longer find any communication router, was locked into the small black room ...

What's the reason you know

"Linux" about route trace Directive traceroute

Related Article

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.