In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
After the configuration of the network is completed according to the initial goal, the first understanding is to check the connectivity of the network. Network connectivity refers to the reachability from one IP address on one host or device to an IP address on another host or device. This chapter describes common commands for detecting network connectivity.
In order to achieve network connectivity, various protocols or interactive control information are run between a single network device and a network device at the same time. Sometimes, in order to determine whether these protocols or modules are functioning properly, you need to use debugging tools. This chapter also introduces how to use debugging tools and how to control the output and display of debugging information.
Network connectivity test
Use ping to test network connectivity
The realization principle of ping
Ping is actually an application program based on ICMP protocol. It is a common tool for testing network connectivity, which is widely used in various operating systems or network devices of computers. By using the ping command, the user can check whether the host or device at the specified address is reachable and test whether the network connection has failed.
ICMP defines different types of protocol messages, and ping mainly uses two kinds of messages: Echo Request (echo request) and Echo Reply (echo response). As shown in the figure, enter the ping 192.168.3.1 command in the RTA command line interface, and the source device RTA sends an ICMP Echo Request message to the destination device RTC; if the network is working properly, the destination device responds to the ICMP Echo Reply message to the source device R (such as this example) after receiving the message; if the network is abnormal, the source device RTA will display messages such as the destination address is unreachable or timed out. Through this interaction, the source device RTA can know the relevant state of the IP layer of the destination device.
Output of the ping command
The figure above shows the actual output of the ping command.
In this example, RTA receives a response from the destination device RTC to each ICMP Echo Request message during the timeout, so the number of bytes of the response message, the message sequence number, TTL (Time To Live) and response time are output on the RTA.
In the last few lines of the figure, the statistical information of ping process messages is output, including the number of messages sent, the number of response messages received, the percentage of unresponded messages, the minimum, average and maximum response time.
Use the ping command
The ping command provides a wealth of optional parameters, as follows:
-a source-ip: specifies the source IP address in the ICMP Echo Request message.
-c count: specifies the number of ICMP Echo Request messages to be sent. The value range is 1: 4294967295, and the default value is 5.
-f: discards messages whose length is larger than the interface MTU directly, that is, slicing of ICMP Echo Request messages sent is not allowed.
-h ttl: specifies the TTL value in the ICMP Echo Request message, with a range of 1mm 255 and a default value of 255.
-I interface-type interface-number: specifies the type and number of the interface that sends the message.
-m interval: specifies the time interval for sending ICMP Echo Request messages. The value range is 1mm 65535 (in milliseconds). The default value is 200ms. If the response message of the destination host is received within the timeout time, the next time interval of the ICMP Echo Request message is the sum of the actual response time of the message and the interval; if the response message of the destination host is not received within the timeout time, the next time interval of the ICMP Echo Request message is the sum of timeout and interval.
-n: no domain name resolution. By default, the system resolves the domain name of hostname.
-p pad: specifies the fill bytes of the ICMP Echo Request message in hexadecimal format. For example, if "pad" is set to ff, the message will all be filled with ff. By default, the populated bytes start at 0x01, increment gradually to 0x09, and then cycle from 0x01.
-Q: no details are displayed except for statistics. By default, the system displays all information, including statistics.
-r: record the route. By default, the system does not record routes.
-s packet-size: specifies the length of the ICMP Echo Request message sent (excluding IP and ICMP headers). The value range is 20cm 8100, in bytes. The default value is 56 bytes.
-t timeout: specifies the timeout of ICMP Echo Reply messages. The value range is 1mm 65535 (in milliseconds). The default value is 2000 milliseconds.
-tos tos: specifies the value of the ToS (Type of Service, service type) field in the ICMP Echo Request message. The value range is 0room255, and the default value is 0.
-v: displays non-Echo Reply ICMP messages received. By default, the system does not display non-Echo Reply ICMP messages.
Use tracert to detect network connectivity
The realization principle of tracert
By using the tracert command, the user can view the router through which the message is sent from the source device to the destination device. When the network fails, users can use this command to analyze the failed network nodes.
This figure illustrates the working process of executing the tracert 192.168.3.1 command on RTA:
The source device RTA sends a UDP message with a TTL of 1 to a larger port of the destination device
Because the network device processes the TTL value in the IP message, it decreases hop by hop, so when the message reaches the first hop RTB, the TTL becomes zero ICMP and responds to a TTL timeout ICMP message containing the IP address of the first hop, so the remote device gets the RTB address of the first hop router.
The source device resends a message with a TTL of 2 to the destination device
The ICMP message with TTL 2 is first passed to RTB,TTL to reduce to 1. When the ICMP message arrives at RTC, TTL will be reduced to 0. Because RTC is the destination of ICMP, RTC will respond to RTA with an ICMP message whose port is unreachable. When RTA receives this message, it will know that it has tracked to the destination, so it will stop sending messages.
If the RTC is multiple hops from the RTA, the above process continues until the destination device is finally reached, and the source device gets the address of all routers that pass from it to the destination device.
Output of the tracert command
The top half of this figure shows the output of RTA after executing the tracert command. RTA repeats each TTL increment message three times, so the output result shows the delay of receiving the response at each hop. The last hop is the tracking destination.
The bottom half of the figure shows the debugging information after RTA executes the tracert command (the later section explains in detail how to obtain the debugging information), which shows the different ways in which the intermediate hop router and the final destination hop router respond to RTA.
Use the tracert command
The optional parameters used by the tracert command have the following meanings:
-a source-ip: indicates the source IP address of the tracert message.
-f first-ttl: specify an initial TTL, that is, the number of hops allowed for the first message. The range of values is 1-255 and is less than the maximum TTL, and the default value is 1.
-m max-ttl: specify a maximum TTL, that is, the maximum number of hops allowed for a message. The range of values is 1mm 255 and is larger than the initial TTL. The default value is 30.
-p port: indicates the UDP port number of the destination device, with a value range of 1mm 65535 and a default value of 33434. Users generally do not need to change this option.
-Q packet-num: indicates the number of probe messages sent each time. The value range is 1mm 65535, and the default value is 3.
-w timeout: specifies the timeout period for messages waiting for a probe message to respond. The value range is 1mm 65535 (in milliseconds). The default value is 5000 milliseconds.
Remote-system: the IP address or hostname of the destination device (hostname is a string of length 1x20).
System debugging
Overview of system debugging
Introduction to system debugging
For most of the protocols and functions supported by network equipment, the system provides corresponding debugging functions to help users diagnose and locate errors.
The output of debugging information is controlled by two switches.
For various protocols and features supported by the equipment, the system basically provides corresponding debugging functions to help users diagnose and locate errors.
The output of debugging information can be controlled by two switches:
Protocol debug switch: also known as module debug switch, which controls whether to output debugging information of a protocol module.
Screen output switch: controls whether debugging information is displayed on a user screen.
The relationship between the protocol debug switch and the screen output switch is shown in the figure. Only when the user turns on both switches, the debugging information will be displayed on the terminal.
System debugging operation
The function of the terminal debugging command is to turn on the screen output switch of debug information to control whether debug information is displayed on a user screen.
The debugging command turns on the protocol debug switch. Therefore, the command is followed by specifying the relevant protocol module names, such as ATM, ARP. Of course, the module name may have more than one parameter, such as the debugging ip packet command when it relates to how the IP layer handles messages.
The terminal monitor command is used to enable the console to monitor system information, and debugging information is a kind of system information, so this is a higher-level switch command, except that it is optional when you need to observe debugging information, because the monitoring function of the console is turned on by default.
Finally, through the display debugging command, you can see which protocol debugging information switches are currently on on the system.
Debug information output example
Here is an example of turning on the debug ip packet protocol debug switch to observe the execution of ping commands. This example shows the detailed process of the IP protocol layer processing when RTA sends out an ICMP ECHO-REQUEST message and receives an ICMP ECHO-REPLY message.
In this example, the-c parameter is used when the ping command is executed, so only one ICMP request response message is issued. "Oct 1 1716 Oct 21 Oct 648 2008 RTA IPFWD/7/debug_case:" the system information printed on the bit screen indicates that the following will be the output of the debug information, and describes the output time of the debug information, and the associated module name IPFWD--IP forwarding module.
The message is divided into three paragraphs. The first paragraph describes the actual content of the ICMP header carrying the IP message, including message length, message ID, offset, protocol number, source address and destination address, etc. After looking up the routing table / forwarding table, the ICMP message will be forwarded out the local serial interface Serial 6max 0. The second paragraph states that RTA received a message from Serial 6amp0. Similar to the first paragraph, RTA prints out the relevant contents of the IP header of the message. As you can see, this message is a response to the ICMP echo request message that has just been sent. The last paragraph and the second paragraph describe the same message. Because RTA is the destination of this message, it will be submitted to the upper layer of the local IP forwarding layer for processing. Therefore, the system can print out "Reply from 192.168.1.2:" to prove that it is reachable.
The statistical information of ping process messages is shown in the last columns of the figure, including: a message was sent and a response message was received. Since there is no unanswered message, the packet loss rate is 0%. Here, the minimum, aPCge and maximum ping response time is 26 milliseconds (because only one ICMP request and reply has been made).
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
Vlan batch is used to create VLAN in batch
© 2024 shulou.com SLNews company. All rights reserved.