This article is a mirror article of machine translation, please click here to jump to the original article.

View: 6569|Reply: 0

[Router] [Practical Training] Network Link Detection Tracert and TraceRoute tutorials

[Copy link]
Posted on 2/26/2022 3:37:34 PM | | | |
Requirements: The server that pings the LAN from the local network is not connected, and the server and route do not disable ping detection, and the server that logs in to the ping target of other services is open.

If the target server cannot be connected to the machine, you can use tracert and traceroute to detect the router it passes through and troubleshoot at which layer it is blocked.

tracetcp link-related node probe
https://www.itsvse.com/thread-3984-1-1.html
Introduction to tracert and traceroute

Similarities: Both are used to track routes and help troubleshoot problems, focusing on the process and pinging on the result.

Differences: Tracert requests are ICMP echo packets; The traceroute request is a UDP packet, and the destination port is a random port of 30,000 or more.

Tracert

The Tracert command uses the IP Time to Live (TTL) field and an ICMP error message to determine the route from one host to another host on the network.

First, tracert sends an IP packet with a TTL of 1 to the destination, and when the first router in the path receives this packet, it subtracts the TTL by 1. At this time, the TTL becomes 0, so the router will throw away the packet and send back an "ICMP time exceeded" message (including the source address of the sending IP packet, all the contents of the IP packet and the IP address of the router), after receiving this message, tracert knows that the router exists on this path, and then tracert sends another packet with a TTL of 2 to find the second router...... tracert each time the TTL of the outgoing packet is added by 1 to discover another router, and this repetition continues until a packet reaches its destination. Once the packet reaches its destination, the host will not send back an ICMP time exceeded message, and once it reaches its destination, it will receive an "ICMP port unreachable" message because the tracert sends packets to uncommon ports (more than 30,000) through UDP packets, so it can be judged that it has reached its destination.

Traceroute

traceroute is a tool used to detect the number of gateways that pass between the host sending the packet and the destination host. The principle of traceroute is to try to send out probe packets with minimal TTL (time to live) to track the packets to the gateway through which the destination host passes, and then listen for a response from the gateway ICMP. The size of the sent packet is 38 bytes by default.

Principle: The program utilizes increased time to live (TTL) to achieve its function. Whenever a packet (3 packets including source address, destination address, and time tag from which the packet was issued) passes through a router, its survival time is reduced by 1. When its survival time is 0, the host cancels the packet and transmits an ICMP (Internet Control Packet Protocol). It is a subprotocol of the TCP/IP protocol family that is used to pass control messages between IP hosts and routers. Control messages refer to messages about the network itself, such as whether the network is unreachable, whether the host is reachable, and whether the route is available. Although these control messages do not transmit user data, they play an important role in the transmission of user data. TTL packet to the original packet sender.

The complete process of the traceroute program: First, it sends an IP packet with a TTL field of 1 to the destination host, the first router that processes this packet subtracts the TTL value by 1, then discards the datagram, and sends an ICMP packet to the source host ("timeout" message, this packet contains the IP address of the router, so that the address of the first router is obtained), Then traceroute sends a datagram with a TTL of 2 to get the IP address of the second router, and continues the process until the datagram reaches the destination host.

Install the traceroute tool on your Linux server with the following command:


This article is usedThe Windows system comes with a tracert to test it, the command is as follows:



After passing through 192.168.3.253, there was no corresponding response, and when I accessed the IP address through the browser, I found that it was a Huawei network device. (Suspect that certain security policies are set or that certain rules are triggered)。 ultimatelySwitch the network environment and use other WiFi networks, and find that the target server can be connected normally without 192.168.3.253





Previous:Linux uses lookbusy to simulate CPU usage
Next:Java about overriding toString() methods
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com