also gives us a chance to view the route from the host to the target host. This is because, when the ICMP ping request datagram passes through a vro, The vro will put its own IP address in the report. The target host will copy the IP address list to the host in response to the ICMP packet. However, in any case, the list of routes that the IP header can record is very limited. To observe routing, we still n
echo and ICMP echo reply packets to detect the presence of the host, so the process of pinging is simple: sending ICMP echo packets----> receiving ICMP Echo reply packets)Ping gives us a chance to see the host's route to the destination host. This is because the ping request datagram for ICMP is reported by the router
, such as sf.net, if you are interested. Then you can see packet loss, the program runs for a longer time.Ping also gives us a chance to view the route from the host to the target host. This is because, when the ICMP ping request datagram passes through a vro, The vro will put its own IP address in the report. The target host will copy the IP address list to the host in response to the ICMP packet. However,
us a chance to view the route from the host to the target host. This is because, when the ICMP ping request datagram passes through a vro, The vro will put its own IP address in the report. The target host will copy the IP address list to the host in response to the ICMP packet. However, in any case, the list of routes that the IP header can record is very limited. To observe routing, we still need to use
from the host to the target host. This is because, when the ICMP ping request datagram passes through a vro, The vro will put its own ip address in the report. The target host will copy the ip address list to the host in response to the icmp packet. However, in any case, the list of routes that the ip header can record is very limited. To observe routing, we still need to use a better tool, that is,
reported by the router to put its own IP in the datagram every time it passes through a router. The destination host copies the IP list back to the host in response to the ICMP packet. However, in any case, the list of routes that the IP header can record is very limited. If we want to observe the route, we still need to use a better tool, that is, Traceroute (the name under Windows is called tracert).Appl
returns an ICMP inaccessibility packet, and sets the combination of the type and code in the packet to port inaccessibility. The Traceroute program generates ICMP error packets by using port unavailability.
In addition, in most cases, an ICMP error message is generated when an error occurs when an IP datagram is trans
the original IP header and data portion that caused the ICMP error message to be generated (such as UDP or TCP for the transport layer, which contains the port number). Here the original IP header of the Protocol field and the first 8 bytes of the port number, you can determine which protocol and which user process.In addition to the ICMP error message above, the ICMP
tcp-m tcp--dport 22-j DROP-A output-m conntrack--ctstate new-j ACCEPTCOMMIT# completed on Fri Dec 19 17:01:18 2014It has been noted that:-A input-j DROP--------------------------------------->ping is output;traceroute when each routing node returns the packet;The rule-a output-m conntrack--ctstate new-j Accept is the TCP protocol by default, whereas the Ping/traceroute uses the
troubleshooting function.-F sets the TTL value of the first detected data packet.-F: Do not disconnect the bits.-G: You can set up to eight source route gateways.-I uses the specified network interface to send data packets.-I replace UDP data with ICMP response.-M: sets the maximum TTL value of the packet to be detected.-N directly uses the IP address rather than the host name.-P: Set the communication port of UDP transmission protocol.-R ignores com
.bbnplanet.net (4.0.1.1) 70 MS 74 MS 70 MS13 p0-0-0.paloalto-cr18.bbnplanet.net (4.0.3.86) 70 MS 74 MS 74 MS14 h1-0.atteasylink.bbnplanet.net (4.1.142.254) 74 MS 74 MS 78 MS15 199.37.127.234 (199.37.127.234) 78 MS 74 MS 78 MS16 205.174.74.170 (205.174.74.170) 230 MS 238 MS 227 MS17 202.97.9.65 (202.97.9.65) 238 MS 231 MS 223 MS18*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 MS21 202.102.24.74 (202.102.24.74)
separate.Specific parameter format: traceroute [-dflnrvx][-f
3. Command parameters:
-D uses the socket-level debugging feature.-F Sets the size of the live value TTL for the first detection packet.-F setting does not leave the fault position.-G Sets the source routing gateway, up to 8.-I sends out packets using the specified network interface.-I replaces UDP data information with an ICMP response.-M sets
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-DSpecifies an invalid computer name resolution address.-H maximum_hopsSpecify the maximum number of jumps to the target.-Jcomputer-listLoose Source Route in computer-list.-W timeo
uses the socket-level troubleshooting feature.-F Sets the size of the live value TTL for the first instrumented packet.-F set do not leave the break.-G Sets the source routing gateway, which can be set to a maximum of 8.-I sends out the packet using the specified network interface.-I replaces UDP data information with an ICMP response.-M sets the size of the maximum surviving value TTL for the detection packet.-N uses the IP address directly instead
The Traceroute program allows us to see the route that an IP datagram passes from one host to another, and can use the IP source routing option. Traceroute replaces IP RR 1 not all routers support the IP RR option, and traceroute programs do not require intermediate routers to have any special or optional features. 2 logging routing is generally a one-way option.
In the analysis of the previous section, 3 questions were left:
Before parsing the ICMP packet processing process, I have the following questions:
1. Why to create a socket for each CPU only to send ICMP messages, do not use the socket can also send ICMP messages out.
2. What is the working principle of ping?
3. What is the working principle of
connected to the same network.
d) Packet timeout
Because each IP packet has a TTL counter, the hop count counter, when the value of the TTL in the packet is 0 o'clock, the packet is discarded and a packet-timed ICMP message is sent. The following is the format of the ICMP packet Hyper-times text
TYPE (11)
CODE (0-1)
Checksum
Not used (must set 0)
Option
"ICMP timeout" message in sequence. If the-d option is used, the Tracert utility does not query DNS on each IP address.
In the following example, data packets must pass through two routers (10.0.0.1 and 192.168.0.1) to reach host 172.16.0.99. The default gateway of the host is 10.0.0.1, and the IP address of the router on the 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 30 hops
1 2 s 3
Ping, tracert, traceroute, and netstat command to view the ubuntu running status command 1. route to view and set the route information for Linux 2. ping: network connectivity check example: ping 192.168.0.1 parameter:-c is used to specify the number of ping responses. Example: ping-c 4 192.168.0.1 the specified number of responses is 4 3. traceroute is used to analyze the network topology format:
In-depth analysis of traceroute by using the tcpdump command, tcpdumptracerouteYesterday, I was suddenly asked about the traceroute principle. I couldn't say it for a while. Although some commands are often used, I really don't know the actual principle. I will take this opportunity to sort it out.
Traceroute: indicates the routing commands used to analyze IP pac
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.