The difference between traceroute and tracert _php tutorial

Source: Internet
Author: User

The difference between traceroute and tracert


Recently in the view of TCP/IP detailed Volume 1 o'clock was traceroute and tracert command to a small hole, the original two is a difference.
I grabbed the bag under windows, and I couldn't catch the UDP packet ....
Also give yourself a wake up reading to move brain Ah!!!

Both are used to probe packets from the source to the destination routed IP, but the two methods are different.
Different points:
First, the application environment is different
TRACERT is applied under Windows.
The traceroute is applied under Linux/bsd/router/unix.
Tracert is a common command-line tool under Windows, and under Unix is traceroute. Are route detection based on UDP protocol.
Tracert (Trace routing) is a route trace utility that determines the path taken by the IP datagram access target. The Tracert command uses the IP time-to-Live (TTL) field and the ICMP error message to determine the route from one host to another host on the network.
Working principle and process:
By sending an Internet Control Message Protocol (ICMP) response packet with a different IP time-to-live (TTL) value to the target, the Tracert diagnostics determines the route taken to the destination. Each router on the path is required to decrement at least 1 of the TTL on the packet before forwarding the packet. The TTL on the packet is reduced to 0 o'clock, and the router should send the "ICMP timed out" message back to the source system.
The Tracert sends a response packet with a TTL of 1 and increments the TTL by 1 for each subsequent send process until the target response or TTL reaches the maximum value to determine the route. The route is determined by checking the "ICMP timed out" message sent back by the intermediate router. Some routers discard TTL-expired packets without asking directly, which is not visible in the Tracert utility.
The Tracert command prints the list of near-end router interfaces in the path that returns the "ICMP timed out" message in order. If you use the-D option, the Tracert utility does not query DNS on each IP address.
In the following example, a packet must pass through two routers (10.0.0.1 and 192.168.0.1) to reach the host 172.16.0.99. The default gateway for the host is the IP address of the router on the 10.0.0.1,192.168.0.0 network is 192.168.0.1.
C:\>tracert 172.16.0.99-d
Tracing route to 172.16.0.99 over a maximum of hops
1 2s 3s 2s 10,0.0,1
2 ms, MS, Ms 192.168.0.1
3 ms, MS, Ms 172.16.0.99
Trace complete.
The Traceroute program is designed to utilize the TTL (Time to Live) field (field) of the ICMP and IP header. First, Traceroute sends out a TTL of 1 IP datagram (in fact, each sent out for 3 40-byte packets, including the source address, destination address and Packet issued time label) to the destination, when the path on the first router (router) received this datagram, It decrements the TTL by 1. At this point, the TTL becomes 0, so the router will discard this datagram, and send back a "icmp time exceeded" message (including the source address of the IP packet, all the contents of the IP packet and the IP address of the router), Traceroute received this message, Then know that this router exists on this path, then traceroute another TTL is 2 datagram, found the 2nd router ... traceroute each time the TTL of the datagram to be sent is added to discover another router, This repetitive action continues until a certain datagram arrives at the destination. When datagram arrives at the destination, the host does not send back the ICMP Time exceeded message because it is already a destination, so how does traceroute know where the destination has arrived?
When Traceroute sends out a UDP datagrams to its destination, the port number it chooses to deliver is the one that the general application will not use (more than 30000), so when this UDP datagram arrives at the destination, the host sends back a "ICMP Port unreachable"the message, and when Traceroute receives the message, it knows that the destination has arrived. So traceroute on the server side is also no so-called daemon program.
traceroute extracts the IP address of the ICMP TTL expiry message device and makes the domain name resolution. Each time, traceroute prints out a series of data, including the domain name and IP address of the routed device that was passed, and the time it takes each three packets to go back and forth.
The Traceroute has a fixed time waiting for a response (ICMP TTL expiration message). If this time is over, it will print out a series of * numbers indicating that the device cannot emit an ICMP TTL expiration message response within a given time. The traceroute then adds 1 to the TTL register and continues.
Second, the detection method and the detection of different data types
By default, tracert is sending an ICMP request echo packet to the destination address, while the traceroute sends a UDP datagram to a port (greater than 30000) of the destination address.
Same point:
One, both are used to detect packets from the source to the destination routed IP.
Two, both are detected by setting the value of the TTL of the sending packet starting from 1 and increasing by 1.

Finally, Tcptracetroute is sending a TCP SYN packet to the 80 port to the target, penetrating stronger.

http://www.bkjia.com/PHPjc/1117251.html www.bkjia.com true http://www.bkjia.com/PHPjc/1117251.html techarticle the difference between traceroute and tracert recently in the view of TCP/IP detailed Volume 1 o'clock was traceroute and tracert command to a small pit, the original two is a difference. I grabbed the bag under windows, ...

  • 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.