WO2016202066A1 - 信息获取方法、客户端设备和服务端设备 - Google Patents

信息获取方法、客户端设备和服务端设备 Download PDF

Info

Publication number
WO2016202066A1
WO2016202066A1 PCT/CN2016/079062 CN2016079062W WO2016202066A1 WO 2016202066 A1 WO2016202066 A1 WO 2016202066A1 CN 2016079062 W CN2016079062 W CN 2016079062W WO 2016202066 A1 WO2016202066 A1 WO 2016202066A1
Authority
WO
WIPO (PCT)
Prior art keywords
icmp
message
field
user input
packet
Prior art date
Application number
PCT/CN2016/079062
Other languages
English (en)
French (fr)
Inventor
朱靖飞
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2016202066A1 publication Critical patent/WO2016202066A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/34Signalling channels for network management communication

Definitions

  • This document refers to, but is not limited to, the field of communication, especially an information acquisition method, a client device, and a server device.
  • the home gateway has become the link between the computer and the mobile terminal in the home.
  • the software system in the home gateway device is a very complicated system, which is mainly composed of the underlying operating system and the upper application protocol. The complexity of the system will inevitably lead to the complexity of fault diagnosis.
  • the shell command mode refers to the way of inputting commands through the command line tool of the operating system.
  • the developer inputs a diagnostic command from the serial port of the gateway device by using a shell command, and the gateway device processes and responds to the diagnostic command, and outputs the context of the current device as a response message through the serial port according to the needs of the developer. Therefore, the developer can learn the context of the current gateway device through the serial port to diagnose the fault.
  • the gateway device may be stuck in the serial port. In this case, the developer cannot understand the context of the current device operation through the shell command, which brings difficulties to the fault diagnosis.
  • gateway devices do not have a serial port.
  • a gateway device used in an ordinary home does not have a serial port. If these gateway devices fail, the maintenance personnel cannot understand the context of the current device through the serial port, which makes it difficult to complete the gateway device fault diagnosis. .
  • the embodiment of the invention provides an information acquisition method, a client device, and a server device, which can obtain the response information corresponding to the user input command in the gateway fault diagnosis when the serial port is stuck or cannot be used, thereby ensuring the gateway.
  • the diagnosis is proceeding smoothly.
  • An embodiment of the present invention provides an information acquiring method, where the method includes:
  • the response information of the user input command carried in the data area of the ICMP Reply message is parsed.
  • it also includes:
  • the response information for the user input command carried in the data area of the ICMP Reply message is parsed, the response information for the user input command is displayed to the user.
  • the ICMP Echo message and the ICMP Reply message are both ICMP messages;
  • the ICMP message includes a message header and a data area, where the message header includes a message type identifier and a code field; and the data area Including: Magic field, length field, and information bearing field;
  • the data area for configuring the ICMP Echo message and setting the user input command to the ICMP Echo message includes:
  • the user input command is filled in the information bearer field of the ICMP Echo message.
  • the response information for the user input command carried in the data area of the ICMP Reply packet is:
  • the response information carried in the information bearer field of the ICMP Reply message is read according to the length field of the ICMP Reply message.
  • the sending the ICMP Echo message to the server includes:
  • An embodiment of the present invention further provides an information acquiring method, where the method includes:
  • the user input command carried in the parsing the ICMP Echo packet includes:
  • the Magic field of the ICMP Echo packet is the specified Magic field
  • the user input command carried in the information bearer field of the ICMP Echo packet is read according to the length field of the ICMP Echo packet.
  • the constructing an ICMP Reply message, and setting the response information for the user input command in the data area of the ICMP packet includes:
  • the response information is filled in the information bearer field of the ICMP Reply message.
  • the embodiment of the present invention further provides a client device, which is disposed on the terminal, where the client device includes:
  • a first construction unit configured to construct an ICMP Echo message, and set a user input command in a data area of the ICMP Echo message
  • the first sending unit is configured to send the ICMP Echo message to the server
  • the first receiving unit is configured to receive an ICMP Reply message corresponding to the ICMP Echo message sent by the server;
  • the first parsing unit is configured to parse the response information for the user input command carried in the data area of the ICMP Reply message.
  • it also includes:
  • a display unit configured to present the response information for the user input command to the user.
  • the ICMP Echo message and the ICMP Reply message are both ICMP messages;
  • the ICMP message includes a message header and a data area, where the message header includes a message type identifier and a code field; and the data area Including: Magic field, length field, and information bearing field;
  • the first construction unit is set to:
  • the user input command is filled in the information bearer field of the ICMP Echo message.
  • the first parsing unit includes:
  • the first detecting module is configured to detect whether the Magic field of the ICMP Echo message matches the Magic field in the ICMP Reply message;
  • the first reading module is configured to: when the detection result is a match, read the response information carried in the information bearer field of the ICMP Reply message according to the length field of the ICMP Reply message.
  • the first sending unit is configured to send an ICMP Echo message to the server by using a network connection port.
  • the embodiment of the present invention further provides a server device, which is disposed on a gateway device, where the server device includes:
  • a second receiving unit configured to receive an ICMP Echo message sent by the client
  • a second parsing unit configured to parse a user input command carried in the ICMP Echo packet
  • a processing unit configured to process a user input command and generate response information for the user input command
  • the second construction unit is configured to construct an ICMP Reply message, which will input a command for the user.
  • the information should be set in the data area of the ICMP message;
  • the second sending unit is configured to send an ICMP Reply message to the client.
  • the second parsing unit includes:
  • a second detection module configured to detect whether a Magic field of the ICMP Echo message is a specified Magic field
  • the second reading module is configured to: when the Magic field of the ICMP Echo packet is the specified Magic field, read the user input command carried in the information bearer field of the ICMP Echo packet according to the length field of the ICMP Echo packet;
  • the second structural unit is configured to:
  • the response information is filled in the information bearer field of the ICMP Reply message.
  • the technical solution provided by the embodiment of the present invention includes: constructing an ICMP Echo message, setting a user input command in a data area of an ICMP Echo message; sending an ICMP Echo message to the server; and receiving the server to send The ICMP Reply message corresponding to the ICMP Echo message; the response information carried by the data area of the ICMP Reply message for the user input command.
  • the device in the communication network will respond to the ICMP Reply message when receiving the ICMP Echo message.
  • the Reply and Echo messages based on the ICMP protocol are used.
  • the user input command is carried in the data area of the ICMP Echo packet.
  • the response information of the user input command is carried in the data area of the ICMP Reply message, thereby utilizing the network.
  • the transmitted ICMP message implements the transmission of the response information corresponding to the user input command, thereby completing the gateway fault diagnosis through the response information.
  • FIG. 1A is a schematic diagram of a format definition of an ICMP message in the related art
  • FIG. 1B is a schematic diagram of a format definition of an ICMP packet according to an embodiment of the present invention.
  • FIG. 2 is a schematic flowchart of a method for acquiring information according to an embodiment of the present invention
  • FIG. 3 is a schematic flowchart of another method for acquiring information according to an embodiment of the present invention.
  • 4A is a schematic structural diagram of an IP packet constructed according to an ICMP Echo packet in an application example
  • 4B is a schematic structural diagram of an IP packet constructed according to an ICMP Reply packet in an application example
  • FIG. 5 is a schematic structural diagram of a client device according to an embodiment of the present invention.
  • FIG. 6 is a schematic structural diagram of a server device according to an embodiment of the present invention.
  • the ICMP protocol is a sub-protocol of the TCP (Transmission Control Protocol)/IP (Internet Protocol) protocol suite for transmitting control messages between IP hosts and routers.
  • the control message refers to the network itself, such as the network is unreachable, the host is reachable, and the route is available. These control messages do not transmit user data.
  • the device in the communication network will respond to the ICMP Reply message when receiving the ICMP Echo message.
  • a typical application is the Ping diagnosis. You can use the Ping command to check whether the network is connected. Specifically, to determine the device A and Network connectivity between device B.
  • device A After device A sends an ICMP echo message to device B, if device A can receive the ICMP Reply packet sent by device B, it indicates that the device is connected to device B and device B.
  • the ICMP Echo packet and the ICMP Reply packet are the same as the other types of ICMP packets.
  • the data area of the ICMP Echo packet and the ICMP Reply packet is random data.
  • FIG. 1A is a schematic diagram of a format definition of an ICMP message in the related art.
  • the ICMP message includes a message header and a data area (ICMP data), where the message header includes a message type identifier (ie, an 8-bit type in FIG. 1) and a code field (ie, FIG. 1). The 8-bit code in the middle), and the 16-bit checksum.
  • the packet type identifier and the code field of the packet header of the ICMP packet are set to 0, the ICMP packet is an ICMP Echo packet or an ICMP Reply packet.
  • the data area is random data and does not contain valid information.
  • an embodiment of the present invention provides an information acquisition method, including:
  • Step 110 The client constructs an ICMP Echo message, and sets a user input command in a data area of the ICMP Echo message.
  • the ICMP Echo packet is a type of ICMP packet. See FIG. 1B, which is a schematic diagram of an ICMP packet format definition according to an embodiment of the present invention.
  • an ICMP message according to an embodiment of the present invention includes a packet header and a data area (ICMP data), where the ICMP message includes a packet header and a data area, where the packet header includes a packet type.
  • the identification and code fields also include a 16-bit checksum; the data area includes: a Magic field, a length field, and an information bearing field.
  • the message type identifier is an 8-bit type
  • the code field is an 8-bit code.
  • the information bearer field carries a corresponding diagnostic command.
  • the IP header is added to the ICMP packet to form an IP packet.
  • step 110 the ICMP Echo message is configured, and the user input command is set to the data area of the ICMP Echo message, including:
  • the user input command is filled in the information bearer field of the ICMP Echo message.
  • the packet type identifier and the code field of the ICMP Echo packet are set to: set the packet type identifier and the code field to 0.
  • step 110 is used to set the user input command to the data area of the ICMP Echo message.
  • the Magic field enables the server to know that the ICMP Echo message is carried.
  • a user input instruction passes the length field, so that the server can correctly parse the user input instruction carried in the ICMP Echo message.
  • the client can pre-agreed a specified Magic field with the server before performing the gateway fault diagnosis.
  • the specified Magic field is set in the Magic field of the ICMP Echo packet.
  • the server determines whether the Magic field of the ICMP Echo packet is the specified Magic field, and determines whether the user input command in the data area needs to be parsed. If there is no Magic field, the normal ICMP Echo is used. The message can be processed.
  • the user input command in this embodiment refers in particular to a diagnostic command for fault diagnosis.
  • the information acquisition method further includes receiving a user input command input by the user.
  • Step 120 The client sends an ICMP Echo packet to the server.
  • Step 130 The client receives an ICMP Reply packet corresponding to the ICMP Echo packet sent by the server.
  • Step 140 The client parses the response information for the user input command carried in the data area of the ICMP Reply message.
  • the ICMP Reply packet is one of the ICMP packets.
  • the response information for the user input command carried in the data area of the ICMP Reply packet is:
  • the response information carried in the information bearer field of the ICMP Reply message is read according to the length field of the ICMP Reply message.
  • the received ICMP Reply packet is discarded.
  • the user when the user receives the ICMP Reply message, the user can know that the ICMP Reply message carries the response information corresponding to the user input command through the Magic field in the ICMP Reply message.
  • the length field allows the server to be correct.
  • the response information corresponding to the user input instruction carried in the ICMP Echo message is parsed.
  • the information obtaining method further includes:
  • step 150 the client presents the response information for the user input command to the user.
  • the sending, by the client, the ICMP Echo packet to the server includes:
  • the client sends the ICMP Echo packet to the server through the network connection port.
  • the embodiment of the present invention further provides an information obtaining method.
  • FIG. 3 it is a schematic flowchart of the information obtaining method according to the present invention. As shown in FIG. 3, the information is obtained. Methods include:
  • Step 210 The server receives the ICMP Echo packet sent by the client.
  • Step 220 The server parses a user input command carried in the ICMP Echo packet.
  • step 220 the user input command carried in the ICMP Echo packet is:
  • the magic field of the ICMP Echo packet is the specified Magic field
  • the user input command carried in the information bearer field of the ICMP Echo packet is read according to the length field of the ICMP Echo packet.
  • the client can pre-agreed a specified Magic field with the server before performing the gateway fault diagnosis.
  • the specified Magic field is set in the Magic field of the ICMP Echo packet.
  • the server determines whether the Magic field of the ICMP Echo packet is the specified Magic field, and determines whether the user input command in the data area needs to be parsed. If there is no Magic field, the normal ICMP Echo is used. The message can be processed.
  • Step 230 The server processes the user input command and generates response information for the user input command. This step processes the user input command according to the processing method of the related art.
  • Step 240 The server constructs an ICMP Reply message, and sets the response information for the user input command in the data area of the ICMP Reply message.
  • step 240 the constructing an ICMP Reply message, and setting the response information for the user input command in the data area of the ICMP message includes:
  • the response information is filled in the information bearer field of the ICMP Reply message.
  • the information bearer field carries the response information corresponding to the diagnostic command.
  • the packet type identifier and the code field of the ICMP Reply packet are set to 0 for both the packet type identifier and the code field.
  • Step 250 The server sends an ICMP Reply message to the client.
  • the ICMP Reply packet is sent to the client through the network connection port.
  • the scenario simulation system of the network management device will restart the system after running some services for a period of time. It is speculated that the system may have insufficient memory. Therefore, the developer wants to know the memory usage of each process in the gateway device, which can be passed by the client.
  • the information acquisition method provided by the embodiment of the present invention is used to understand the memory usage of each process in the system.
  • the convention for the diagnostic command is that the user enters the PS and the server responds to the current list of system processes and status.
  • FIG. 4A is a schematic structural diagram of an IP packet constructed according to an ICMP Echo packet according to the above application example.
  • the message type identifier and code field of the ICMP Echo packet are set to 0, the Magic field is filled with 33448899, and the length field of the ICMP Echo packet is set to 2 to represent 1 Byte, the diagnostic command ps is filled into the rest of the data area, and the remaining area of the data area is less than 0, the ICMP Echo message is constructed, and then the IP packet is constructed according to the ICMP Echo message, and the ICMP Echo will be constructed.
  • the packet is carried to the data part of the IP packet and sent.
  • the content of the IP packet constructed according to the ICMP Echo packet is as shown in FIG. 4A.
  • 33448899 is the specified Magic field
  • the value is an exemplary description
  • the Magic field can also be other values.
  • the server After receiving the ICMP Echo packet, the server parses and processes the ICMP Echo packet. Specifically, it checks whether the Magic field is the specified Magic field 33448899. If it is inconsistent with the specified Magic field, the protocol stack is normal ICMP flow. Otherwise, The user input command is extracted, and the corresponding user input command is extracted according to the command length field. In this example, the length field is 2, the user input command extracted according to the length field is ps, and then the service registered to the system according to the query.
  • the command processing function if found, directly invokes the command processing function (traversing the kernel process table, recording the context information of each task, including memory usage, process identifier, name, etc.) to process the user input command ps, and the processing result is treated as
  • the server constructs an ICMP Reply message, in which the Magic field of the ICMP Reply message is filled with the specified Magic field 33448899, and the length of the command execution result is calculated, in this example, 512, and saved to the length field, and copied. Process the result to the ICMP data area command output section.
  • the content of the constructed ICMP Reply packet is as shown in Figure 4B. Similarly, the constructed ICMP Reply packet is carried in the data part of the IP packet and sent.
  • the client After receiving the ICMP Reply packet sent by the server, the client checks whether the Magic field is 33448899. If the packet is inconsistent, the packet is discarded. Otherwise, the length field of the ICMP Reply packet is extracted.
  • the ICMP Reply packet is read according to the length field of the ICMP Reply packet.
  • the message carries the response information carried in the field and is formatted and displayed on the command line tool for the user to view. The user analyzes the process information output by the PS command, checks each process vmsize, checks whether there is an abnormal data value, and can roughly analyze which process is not performing normally.
  • the information acquisition method based on the ICMP protocol provided by the embodiment of the present invention is simple to implement.
  • the extension of the command can further understand the operation of the internal system of the gateway, and has good practicability for diagnosing the operation of the gateway device.
  • Embodiments of the present invention also provide a computer readable storage medium storing computer executable instructions for performing any of the methods described above.
  • the embodiment of the present invention further provides a client device, which is disposed on the terminal and used for gateway fault diagnosis.
  • a client device which is disposed on the terminal and used for gateway fault diagnosis.
  • the client device according to the embodiment of the present invention is provided. Schematic diagram of the structure, as shown in FIG. 5, the client device includes:
  • the first constructing unit 11 is configured to construct an ICMP Echo message, and set a user input command in a data area of the ICMP Echo message;
  • the first sending unit 12 is configured to send an ICMP Echo message to the server.
  • the first receiving unit 13 is configured to receive an ICMP Reply message corresponding to the ICMP Echo message sent by the server;
  • the first parsing unit 14 is configured to parse the data area carried by the ICMP Reply message. The user enters the response information of the command.
  • the client device further includes:
  • the display unit 15 is arranged to present the response information for the user input command to the user.
  • the ICMP Echo message and the ICMP Reply message are both ICMP messages;
  • the ICMP message includes a message header and a data area, where the message header includes a message type identifier and a code field;
  • the data area includes: a Magic field, a length field, and an information bearing field;
  • the first construction unit 11 is arranged to:
  • the user input command is filled in the information bearer field of the ICMP Echo message.
  • the first parsing unit 14 includes:
  • the first detecting module 141 is configured to detect whether the Magic field of the ICMP Echo message matches the Magic field in the ICMP Reply message;
  • the first reading module 142 is configured to: when the detection result is a match, read the response information carried in the information bearer field of the ICMP Reply message according to the length field of the ICMP Reply message.
  • the first sending unit 12 is configured to: send an ICMP Echo message to the server through a network connection port.
  • the embodiment of the present invention further provides a server device, which is configured on a gateway device, and is used for gateway fault diagnosis.
  • the server device is provided in the embodiment of the present invention.
  • the schematic diagram of the structure, as shown in FIG. 6, the server device includes:
  • the second receiving unit 21 is configured to receive an ICMP Echo message sent by the client.
  • the second parsing unit 22 is configured to parse the user input command carried in the ICMP Echo message
  • the processing unit 23 is configured to process the user input command and generate response information for the user input command
  • the second constructing unit 24 is configured to construct an ICMP Reply message, and the command is input for the user.
  • the response information is set in the data area of the ICMP message;
  • the second sending unit 25 is configured to send an ICMP Reply message to the client.
  • the second parsing unit 22 includes:
  • the second detecting module 221 is configured to detect whether the Magic field of the ICMP Echo message is a specified Magic field
  • the second reading module 222 is configured to: when the Magic field of the ICMP Echo packet is the specified Magic field, read the user input command carried in the information bearer field of the ICMP Echo packet according to the length field of the ICMP Echo packet. ;
  • the second construction unit 24 is configured to:
  • the response information is filled in the information bearer field of the ICMP Reply message.
  • the second sending unit 25 is configured to send an ICMP Reply message to the client through the network connection port.
  • each module/unit in the foregoing embodiment may be implemented in the form of hardware, for example, by implementing an integrated circuit to implement its corresponding function, or may be implemented in the form of a software function module, for example, executing a program in a storage and a memory by a processor. / instruction to achieve its corresponding function.
  • the invention is not limited to any specific form of combination of hardware and software.
  • the above technical solution realizes the acquisition of the response information corresponding to the user input command in the gateway fault diagnosis in the case that the serial port is stuck or unable to use the serial port, thereby ensuring the smooth progress of the gateway fault diagnosis.

Abstract

一种信息获取方法、客户端设备和服务端设备,包括:构造ICMP Echo报文,将用户输入命令设置在ICMP Echo报文的数据区;将ICMP Echo报文发送给服务端;接收服务端发送的与所述ICMP Echo报文对应的ICMP Reply报文;解析ICMP Reply报文的数据区携带的针对用户输入命令的响应信息。

Description

信息获取方法、客户端设备和服务端设备 技术领域
本文涉及但不限于通信领域,尤指一种信息获取方法、客户端设备和服务端设备。
背景技术
互联网时代下,家庭网关依然已成为家庭内计算机和移动终端联系的纽带,然而,家庭网关设备中的软件系统是一个非常复杂的系统,主要由底层操作系统和上层应用协议组成。系统的复杂性必然带来故障诊断的复杂性。
在网关设备的开发过程中,如果网关设备的调试运行出现故障,开发人员通常通过shell命令方式对设备故障进行诊断,shell命令方式是指通过操作系统的命令行工具输入指令的方式。
具体地,开发人员从网关设备的串口以shell命令的方式输入诊断命令,网关设备对诊断命令进行处理和响应,并根据开发人员的需要,将当前设备的上下文情况作为响应信息通过串口进行输出,因此,开发人员可以通过串口了解当前网关设备运行的上下文情况,从而进行故障诊断。
然而,网关设备可能会出现串口卡死的情况,在这种情况下,开发人员无法通过shell命令方式了解当前设备运行的上下文情况,给故障诊断带来了困难。
此外,有些网关设备没有设置串口,例如,普通家庭使用的网关设备普遍没有设置串口,如果这些网关设备出现故障,维修人员也无法通过串口了解当前设备运行的上下文情况,从而难以完成网关设备故障诊断。
发明内容
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。
本发明实施例提出了一种信息获取方法、客户端设备和服务端设备,能够实现串口卡死或无法使用串口的情况下的网关故障诊断中用户输入命令对应的响应信息的获取,从而保证网关故障诊断的顺利进行。
本发明实施例提出了一种信息获取方法,所述方法包括:
构造ICMP Echo报文,将用户输入命令设置在ICMP Echo报文的数据区;
将ICMP Echo报文发送给服务端;
接收服务端发送的与所述ICMP Echo报文对应的ICMP Reply报文;
解析ICMP Reply报文的数据区携带的针对用户输入命令的响应信息。
可选地,还包括:
在所述解析ICMP Reply报文的数据区携带的针对用户输入命令的响应信息之后,将所述针对用户输入命令的响应信息展示给用户。
可选地,所述ICMP Echo报文和ICMP Reply报文均为ICMP报文;ICMP报文包括报文头部和数据区,其中,报文头部包括报文类型标识和代码字段;数据区包括:Magic字段、长度字段和信息承载字段;
所述构造ICMP Echo报文,将用户输入命令设置到ICMP Echo报文的数据区包括:
设置ICMP Echo报文的报文类型标识和代码字段;
填充ICMP Echo报文的Magic字段;
计算用户输入命令的长度,将计算得到的长度填充到ICMP Echo报文的长度字段,
将用户输入命令填充到ICMP Echo报文的信息承载字段。
可选地,所述解析ICMP Reply报文的数据区携带的针对用户输入命令的响应信息包括:
检测ICMP Echo报文的Magic字段与ICMP Reply报文中的Magic字段是否匹配;
当检测结果为匹配时,根据ICMP Reply报文的长度字段,读取ICMP Reply报文的信息承载字段中携带的响应信息。
可选地,所述将ICMP Echo报文发送给服务端包括:
通过网络连接端口将ICMP Echo报文发送给服务端。
本发明实施例还提出了一种信息获取方法,所述方法包括:
接收客户端发送的ICMP Echo报文;
解析ICMP Echo报文中携带的用户输入命令;
对用户输入命令进行处理,并生成针对用户输入命令的响应信息;
构造ICMP Reply报文,将针对用户输入命令的响应信息设置在ICMP报文的数据区;
将ICMP Reply报文发送给客户端。
可选地,所述解析ICMP Echo报文中携带的用户输入命令包括:
检测ICMP Echo报文的Magic字段是否为指定的Magic字段;
当测ICMP Echo报文的Magic字段是指定的Magic字段时,根据ICMP Echo报文的长度字段,读取ICMP Echo报文的信息承载字段中携带的用户输入命令;
所述构造ICMP Reply报文,将针对用户输入命令的响应信息设置在ICMP报文的数据区具体包括:
设置ICMP Reply报文的报文类型标识和代码字段;
填充ICMP Reply报文的Magic字段;
计算响应信息的长度,将计算得到的长度填充到ICMP Reply报文的长度字段,
将响应信息填充到ICMP Reply报文的信息承载字段。
本发明实施例还提出了一种客户端设备,设置在终端上,所述客户端设备包括:
第一构造单元,设置为构造ICMP Echo报文,将用户输入命令设置在ICMP Echo报文的数据区;
第一发送单元,设置为将ICMP Echo报文发送给服务端;
第一接收单元,设置为接收服务端发送的与所述ICMP Echo报文对应的ICMP Reply报文;
第一解析单元,设置为解析ICMP Reply报文的数据区携带的针对用户输入命令的响应信息。
可选地,还包括:
展示单元,设置为将所述针对用户输入命令的响应信息展示给用户。
可选地,所述ICMP Echo报文和ICMP Reply报文均为ICMP报文;ICMP报文包括报文头部和数据区,其中,报文头部包括报文类型标识和代码字段;数据区包括:Magic字段、长度字段和信息承载字段;
所述第一构造单元是设置为:
设置ICMP Echo报文的报文类型标识和代码字段;
填充ICMP Echo报文的Magic字段;
计算用户输入命令的长度,将计算得到的长度填充到ICMP Echo报文的长度字段,
将用户输入命令填充到ICMP Echo报文的信息承载字段。
可选地,所述第一解析单元包括:
第一检测模块,设置为检测ICMP Echo报文的Magic字段与ICMP Reply报文中的Magic字段是否匹配;
第一读取模块,设置为当检测结果为匹配时,根据ICMP Reply报文的长度字段,读取ICMP Reply报文的信息承载字段中携带的响应信息。
可选地,所述第一发送单元是设置为:通过网络连接端口将ICMP Echo报文发送给服务端。
本发明实施例还提出了一种服务端设备,设置在网关设备上,其特征在于,所述服务端设备包括:
第二接收单元,设置为接收客户端发送的ICMP Echo报文;
第二解析单元,设置为解析ICMP Echo报文中携带的用户输入命令;
处理单元,设置为对用户输入命令进行处理,并生成针对用户输入命令的响应信息;
第二构造单元,设置为构造ICMP Reply报文,将针对用户输入命令的响 应信息设置在ICMP报文的数据区;
第二发送单元,设置为将ICMP Reply报文发送给客户端。
可选地,所述第二解析单元包括:
第二检测模块,设置为检测ICMP Echo报文的Magic字段是否为指定的Magic字段;
第二读取模块,设置为当测ICMP Echo报文的Magic字段是指定的Magic字段时,根据ICMP Echo报文的长度字段,读取ICMP Echo报文的信息承载字段中携带的用户输入命令;
所述第二构造单元是设置为:
设置ICMP Reply报文的报文类型标识和代码字段;
填充ICMP Reply报文的Magic字段;
计算响应信息的长度,将计算得到的长度填充到ICMP Reply报文的长度字段,
将响应信息填充到ICMP Reply报文的信息承载字段。
与相关技术相比,本发明实施例提供的技术方案包括:构造ICMP Echo报文,将用户输入命令设置在ICMP Echo报文的数据区;将ICMP Echo报文发送给服务端;接收服务端发送的与所述ICMP Echo报文对应的ICMP Reply报文;解析ICMP Reply报文的数据区携带的针对用户输入命令的响应信息。通过本发明实施例的方案,根据ICMP协议,通信网络中的设备在收到ICMP Echo报文时,将对应回复ICMP Reply报文,本发明实施例方案中,基于ICMP协议的Reply和Echo报文的交互方式,将用户输入命令承载到ICMP Echo报文的数据区中,在网关的服务器解析完诊断命令后,将用户输入命令的响应信息承载到ICMP Reply报文的数据区,从而利用通过网络传输的ICMP报文实现用户输入命令对应的响应信息的传输,从而能够通过响应信息完成网关故障诊断,通过上述技术方案,提供了一种在串口卡死或无法使用串口的情况下的网关故障诊断中用户输入命令对应的响应信息的获取方法,从而保证了网关故障诊断的顺利进行。
在阅读并理解了附图和详细描述后,可以明白其他方面。
附图概述
图1A为相关技术中ICMP报文格式定义示意图;
图1B为本发明实施例中ICMP报文格式定义示意图;
图2为本发明实施例一种信息获取方法的流程示意图;
图3为本发明实施例另一种信息获取方法的流程示意图;
图4A为应用实例中根据ICMP Echo报文据构造的IP报文的结构示意图;
图4B为应用实例中根据ICMP Reply报文据构造的IP报文的结构示意图;
图5为本发明实施例提出的客户端设备的结构示意图;
图6为本发明实施例提出的服务端设备的结构示意图。
本发明的实施方式
为了便于本领域技术人员的理解,下面结合附图对本发明作进一步的描述,并不能用来限制本发明的保护范围。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的各种方式可以相互组合。
在介绍本发明实施例提出的信息获取方法之前,首先对ICMP(Internet Control Message Protocol,Internet控制报文协议)报文进行简单介绍。ICMP协议是TCP(Transmission Control Protocol,传输控制协议)/IP(Internet Protocol,网络互联协议)协议族的一个子协议,用于在IP主机、路由器之间传递控制消息。控制消息是指网络通不通、主机是否可达、路由是否可用等网络本身的消息,这些控制消息并不传输用户数据。根据ICMP,通信网络中的设备在收到ICMP Echo报文时,将对应回复ICMP Reply报文,其中一个典型应用就是Ping诊断,通过Ping命令可以查看网络是否联通,具体地,为了判断设备A和设备B之间的网络联通性,设备A向设备B发送ICMP Echo报文之后,如果设备A能够收到设备B发送的ICMP Reply报文,则说明判断设备A和设备B之间的网络联通。ICMP Echo报文和ICMP Reply报文都是ICMP报文中的一种,和其他类型的ICMP报文不同的是,ICMP Echo报文和ICMP Reply报文的数据区为随机数据。
参见图1A,为相关技术中ICMP报文格式定义示意图。如图1所示,ICMP报文包括报文头部和数据区(ICMP数据),其中,报文头部包括报文类型标识(即图1中的8位类型)、代码字段(即图1中的8位代码),以及16位的校验和。当ICMP报文的报文头部的报文类型标识和代码字段均设置为0时,ICMP报文为ICMP Echo报文或ICMP Reply报文。当ICMP报文为ICMP Echo报文或ICMP Reply报文时,其数据区为随机数据,不包含有效信息。
参见图2,本发明实施例提出了一种信息获取方法,包括:
步骤110,客户端构造ICMP Echo报文,将用户输入命令设置在ICMP Echo报文的数据区;
其中,ICMP Echo报文为ICMP报文的一种;参见图1B,为本发明实施例提供的ICMP报文格式定义示意图。如图1B所示,本发明实施例提供的ICMP报文包括报文头部和数据区(ICMP数据),ICMP报文包括报文头部和数据区,其中,报文头部包括报文类型标识和代码字段,还包括16位的校验和;数据区包括:魔数(Magic)字段、长度字段和信息承载字段。在图1B中示例性的,报文类型标识为8位类型,代码字段为8位代码,对于用于诊断命令请求的ICMP Echo报文,信息承载字段中携带相应的诊断命令。ICMP报文前加上IP首部构成IP报文。
步骤110中,构造ICMP Echo报文,将用户输入命令设置到ICMP Echo报文的数据区包括:
设置ICMP Echo报文的报文类型标识和代码字段;
填充ICMP Echo报文的Magic字段;
计算用户输入命令的长度,将计算得到的长度填充到ICMP Echo报文的长度字段,
将用户输入命令填充到ICMP Echo报文的信息承载字段。
其中,设置ICMP Echo报文的报文类型标识和代码字段包括:将报文类型标识和代码字段均设置为0。
通过步骤110上述过程,实现了将用户输入命令设置到ICMP Echo报文的数据区中,通过Magic字段,使得服务端能够获知该ICMP Echo报文携带 有用户输入指令,通过长度字段,使得服务端能够正确地解析ICMP Echo报文携带的用户输入指令。
其中,在执行网关故障诊断之前,客户端可以和服务端事先约定一个指定的Magic字段,在客户端构造ICMP Echo报文时,将指定的Magic字段设置在ICMP Echo报文的Magic字段位置,在服务端接收到ICMP Echo报文时,通过判断ICMP Echo报文的Magic字段是否为指定的Magic字段,来判断是否需要解析数据区中的用户输入命令,如果没有Magic字段,则按照普通的ICMP Echo报文进行处理即可。
本实施例中的用户输入命令尤其指用于故障诊断的诊断命令。在步骤110之前,信息获取方法还包括,接收用户输入的用户输入命令。
步骤120,客户端将ICMP Echo报文发送给服务端;
步骤130,客户端接收服务端发送的与ICMP Echo报文对应的ICMP Reply报文;
步骤140,客户端解析ICMP回复(Reply)报文的数据区携带的针对用户输入命令的响应信息。
步骤140中,ICMP Reply报文为ICMP报文的一种。解析ICMP Reply报文的数据区携带的针对用户输入命令的响应信息包括:
检测ICMP Echo报文的Magic字段与ICMP Reply报文中的Magic字段是否匹配;
当检测结果为匹配时,根据ICMP Reply报文的长度字段,读取ICMP Reply报文的信息承载字段中携带的响应信息。
当检测结果为不匹配时,将接收的ICMP Reply报文丢弃。
同样地,当用户接收到ICMP Reply报文时,通过ICMP Reply报文中的Magic字段,能够获知该ICMP Reply报文中携带有用户输入指令对应的响应信息,通过长度字段,使得服务端能够正确地解析ICMP Echo报文携带的用户输入指令对应的响应信息。
可选的,在步骤140之后,该信息获取方法还包括:
步骤150,客户端将针对用户输入命令的响应信息展示给用户。
本发明实施例中,上述客户端将ICMP Echo报文发送给服务端包括:
客户端通过网络连接端口将ICMP Echo报文发送给服务端。
基于与上述方法实施例相同或相似的构思,本发明实施例还提供一种信息获取方法,参见图3,为本发明提出的信息获取方法的流程示意图,如图3所示,所述信息获取方法包括:
步骤210,服务端接收客户端发送的ICMP Echo报文;
步骤220,服务端解析ICMP Echo报文中携带的用户输入命令;
步骤220中,所述解析ICMP Echo报文中携带的用户输入命令包括:
检测ICMP Echo报文的Magic字段是否为指定的Magic字段;
当测ICMP Echo报文的Magic字段是指定的Magic字段时,根据ICMP Echo报文的长度字段,读取ICMP Echo报文的信息承载字段中携带的用户输入命令。
其中,在执行网关故障诊断之前,客户端可以和服务端事先约定一个指定的Magic字段,在客户端构造ICMP Echo报文时,将指定的Magic字段设置在ICMP Echo报文的Magic字段位置,在服务端接收到ICMP Echo报文时,通过判断ICMP Echo报文的Magic字段是否为指定的Magic字段,来判断是否需要解析数据区中的用户输入命令,如果没有Magic字段,则按照普通的ICMP Echo报文进行处理即可。
步骤230,服务端对用户输入命令进行处理,并生成针对用户输入命令的响应信息;本步骤根据相关技术的处理方法对用户输入命令进行处理。
步骤240,服务端构造ICMP Reply报文,将针对用户输入命令的响应信息设置在ICMP Reply报文的数据区;
步骤240中,所述构造ICMP Reply报文,将针对用户输入命令的响应信息设置在ICMP报文的数据区包括:
设置ICMP Reply报文的报文类型标识和代码字段;
填充ICMP Reply报文的Magic字段;
计算响应信息的长度,将计算得到的长度填充到ICMP Reply报文的长度 字段,
将响应信息填充到ICMP Reply报文的信息承载字段。
在图1B中,示例性的,对于用于实现诊断命令输出的ICMP Reply报文,信息承载字段中携带有诊断命令对应的响应信息。
其中,设置ICMP Reply报文的报文类型标识和代码字段具体为将报文类型标识和代码字段均设置为0。
步骤250,服务端将ICMP Reply报文发送给客户端。
其中,通过网络连接端口将ICMP Reply报文发送给客户端。
下面,结合一个具体的示例进行说明。
网管设备的场景模拟系统在运行某些业务一段时间后,会出系统重启的情况,推测可能系统内存不足导致,因此开发人员希望了解网关设备中系统每一个进程内存占用情况,可以由客户端通过本发明实施例提供的信息获取方法来了解系统每一个进程内存占用情况。诊断命令的约定为,用户输入PS,服务端回应当前系统进程列表以及状态。
参见图4A,为上述应用实例中根据ICMP Echo报文据构造的IP报文的结构示意图。如图4A所示,将ICMP Echo报文的报文类型标识和代码字段均设置为0,将Magic字段填充为33448899共两个字节,将ICMP Echo报文的长度字段设置为2表示1个字节,将诊断命令ps填充到数据区的剩余部分,数据区剩余不足的补0,就完成了ICMP Echo报文的构造,然后根据ICMP Echo报文据构造IP报文,即将构造的ICMP Echo报文承载到IP报文的数据部分并发送。根据ICMP Echo报文据构造的IP报文的内容如图4A所示。其中,33448899即为指定的Magic字段,该数值为示例性说明,Magic字段也可以是其他的数值。
服务端收到ICMP Echo报文之后,解析并处理ICMP Echo报文,具体地,检查Magic字段是否为指定的Magic字段33448899,如果与指定的Magic字段不一致,则走协议栈正常ICMP流程,否则,对用户输入命令进行提取,根据命令长度字段,提取对应的用户输入命令,本示例中,长度字段为2,根据长度字段提取的用户输入命令为ps,然后,根据查询注册到系统的服务 端命令处理函数,如果找到,直接调用命令处理函数(遍历内核进程表,记录每个任务的上下文信息,包含内存占用、进程标识符、名称等)对用户输入命令ps进行处理,将处理结果作为响应信息,然后,服务端构造ICMP Reply报文,其中,将ICMP Reply报文的Magic字段填充为指定的Magic字段33448899,计算命令执行结果长度,本示例中为512,并保存到长度字段,拷贝处理结果到ICMP数据区命令输出部分。构造的ICMP Reply报文内容如图4B所示,同样,将构造的ICMP Reply报文承载到IP报文的数据部分并发送。
客户端接收到服务端发送的ICMP Reply报文之后,检查Magic字段是否33448899,如果不一致,则丢弃,否则,提取ICMP Reply报文的长度字段,根据ICMP Reply报文的长度字段,读取ICMP Reply报文的信息承载字段中携带的响应信息,并格式化显示到命令行工具上供用户查看。用户分析PS命令输出的进程信息,查看每一个进程vmsize,检查是否有异常数据值,即可大致分析出哪个进程执行不太正常。
本发明实施例提供的基于ICMP协议的信息获取方法实现简单,通过对命令的扩展可以更多的了解网关内部系统的运行情况,对于诊断网关设备的运行情况有很好的实用性。
本发明实施例还提出了一种计算机可读存储介质,存储有计算机可执行指令,计算机可执行指令用于执行上述描述的任意一个方法。
基于与上述方法实施例相同或相似的构思,本发明实施例还提供一种客户端设备,设置在终端上,用于网关故障诊断,参见图5,为本发明实施例提出的客户端设备的结构示意图,如图5所示,该客户端设备包括:
第一构造单元11,设置为构造ICMP Echo报文,将用户输入命令设置在ICMP Echo报文的数据区;
第一发送单元12,设置为将ICMP Echo报文发送给服务端;
第一接收单元13,设置为接收服务端发送的与所述ICMP Echo报文对应的ICMP Reply报文;
第一解析单元14,设置为解析ICMP Reply报文的数据区携带的针对用 户输入命令的响应信息。
本发明实施例中,所述客户端设备还包括:
展示单元15,设置为将所述针对用户输入命令的响应信息展示给用户。
本发明实施例中,所述ICMP Echo报文和ICMP Reply报文均为ICMP报文;ICMP报文包括报文头部和数据区,其中,报文头部包括报文类型标识和代码字段;数据区包括:Magic字段、长度字段和信息承载字段;
第一构造单元11是设置为:
设置ICMP Echo报文的报文类型标识和代码字段;
填充ICMP Echo报文的Magic字段;
计算用户输入命令的长度,将计算得到的长度填充到ICMP Echo报文的长度字段,
将用户输入命令填充到ICMP Echo报文的信息承载字段。
本发明实施例中,所述第一解析单元14包括:
第一检测模块141,设置为检测ICMP Echo报文的Magic字段与ICMP Reply报文中的Magic字段是否匹配;
第一读取模块142,设置为当检测结果为匹配时,根据ICMP Reply报文的长度字段,读取ICMP Reply报文的信息承载字段中携带的响应信息。
本发明实施例中,所述第一发送单元12是设置为:通过网络连接端口将ICMP Echo报文发送给服务端。
基于与上述方法实施例相同或相似的构思,本发明实施例还提供一种服务端设备,设置在网关设备上,用于网关故障诊断,参见图6,为本发明实施例提出的服务端设备的结构示意图,如图6所示,该服务端设备包括:
第二接收单元21,设置为接收客户端发送的ICMP Echo报文;
第二解析单元22,设置为解析ICMP Echo报文中携带的用户输入命令;
处理单元23,设置为对用户输入命令进行处理,并生成针对用户输入命令的响应信息;
第二构造单元24,设置为构造ICMP Reply报文,将针对用户输入命令 的响应信息设置在ICMP报文的数据区;
第二发送单元25,设置为将ICMP Reply报文发送给客户端。
本发明实施例中,所述第二解析单元22包括:
第二检测模块221,设置为检测ICMP Echo报文的Magic字段是否为指定的Magic字段;
第二读取模块222,设置为当测ICMP Echo报文的Magic字段是指定的Magic字段时,根据ICMP Echo报文的长度字段,读取ICMP Echo报文的信息承载字段中携带的用户输入命令;
所述第二构造单元24是设置为:
设置ICMP Reply报文的报文类型标识和代码字段;
填充ICMP Reply报文的Magic字段;
计算响应信息的长度,将计算得到的长度填充到ICMP Reply报文的长度字段,
将响应信息填充到ICMP Reply报文的信息承载字段。
其中,第二发送单元25是设置为:通过网络连接端口将ICMP Reply报文发送给客户端。
本领域普通技术人员可以理解上述方法中的全部或部分步骤可通过程序来指令相关硬件(例如处理器)完成,所述程序可以存储于计算机可读存储介质中,如只读存储器、磁盘或光盘等。可选地,上述实施例的全部或部分步骤也可以使用一个或多个集成电路来实现。相应地,上述实施例中的各模块/单元可以采用硬件的形式实现,例如通过集成电路来实现其相应功能,也可以采用软件功能模块的形式实现,例如通过处理器执行存储与存储器中的程序/指令来实现其相应功能。本发明不限于任何特定形式的硬件和软件的结合。
需要说明的是,以上所述的实施例仅是为了便于本领域的技术人员理解 而已,并不用于限制本发明的保护范围,在不脱离本发明的发明构思的前提下,本领域技术人员对本发明所做出的任何显而易见的替换和改进等均在本发明的保护范围之内。
工业实用性
上述技术方案实现了在串口卡死或无法使用串口的情况下的网关故障诊断中用户输入命令对应的响应信息的获取,从而保证了网关故障诊断的顺利进行。

Claims (14)

  1. 一种信息获取方法,包括:
    构造控制报文协议ICMP Echo报文,将用户输入命令设置在ICMP Echo报文的数据区;
    将ICMP Echo报文发送给服务端;
    接收服务端发送的与所述ICMP Echo报文对应的ICMP回复Reply报文;
    解析ICMP Reply报文的数据区携带的针对用户输入命令的响应信息。
  2. 根据权利要求1所述的信息获取方法,还包括:
    在所述解析ICMP Reply报文的数据区携带的针对用户输入命令的响应信息之后,将所述针对用户输入命令的响应信息展示给用户。
  3. 根据权利要求1或2所述的信息获取方法,其中,所述ICMP Echo报文和ICMP Reply报文均为ICMP报文;ICMP报文包括报文头部和数据区,其中,报文头部包括报文类型标识和代码字段;数据区包括:魔数Magic字段、长度字段和信息承载字段;
    所述构造ICMP Echo报文,将用户输入命令设置到ICMP Echo报文的数据区包括:
    设置ICMP Echo报文的报文类型标识和代码字段;
    填充ICMP Echo报文的Magic字段;
    计算用户输入命令的长度,将计算得到的长度填充到ICMP Echo报文的长度字段,
    将用户输入命令填充到ICMP Echo报文的信息承载字段。
  4. 根据权利要求3所述的信息获取方法,其中,
    所述解析ICMP Reply报文的数据区携带的针对用户输入命令的响应信息包括:
    检测ICMP Echo报文的Magic字段与ICMP Reply报文中的Magic字段是否匹配;
    当检测结果为匹配时,根据ICMP Reply报文的长度字段,读取ICMP Reply报文的信息承载字段中携带的响应信息。
  5. 根据权利要求1或2所述的信息获取方法,其中,所述将ICMP Echo报文发送给服务端包括:
    通过网络连接端口将ICMP Echo报文发送给服务端。
  6. 一种信息获取方法,包括:
    接收客户端发送的控制报文协议ICMP Echo报文;
    解析ICMP Echo报文中携带的用户输入命令;
    对用户输入命令进行处理,并生成针对用户输入命令的响应信息;
    构造ICMP回复Reply报文,将针对用户输入命令的响应信息设置在ICMP报文的数据区;
    将ICMP Reply报文发送给客户端。
  7. 根据权利要求6所述的信息获取方法,其中,所述解析ICMP Echo报文中携带的用户输入命令包括:
    检测ICMP Echo报文的魔数Magic字段是否为指定的Magic字段;
    当测ICMP Echo报文的Magic字段是指定的Magic字段时,根据ICMP Echo报文的长度字段,读取ICMP Echo报文的信息承载字段中携带的用户输入命令;
    所述构造ICMP Reply报文,将针对用户输入命令的响应信息设置在ICMP报文的数据区包括:
    设置ICMP Reply报文的报文类型标识和代码字段;
    填充ICMP Reply报文的Magic字段;
    计算响应信息的长度,将计算得到的长度填充到ICMP Reply报文的长度字段,
    将响应信息填充到ICMP Reply报文的信息承载字段。
  8. 一种客户端设备,设置在终端上,包括:
    第一构造单元,设置为构造控制报文协议ICMP Echo报文,将用户输入命令设置在ICMP Echo报文的数据区;
    第一发送单元,设置为将ICMP Echo报文发送给服务端;
    第一接收单元,设置为接收服务端发送的与所述ICMP Echo报文对应的ICMP Reply报文;
    第一解析单元,设置为解析ICMP回复Reply报文的数据区携带的针对用户输入命令的响应信息。
  9. 根据权利要求8所述的客户端设备,还包括:
    展示单元,设置为将所述针对用户输入命令的响应信息展示给用户。
  10. 根据权利要求8或9所述的客户端设备,其中,所述ICMP Echo报文和ICMP Reply报文均为ICMP报文;ICMP报文包括报文头部和数据区,其中,报文头部包括报文类型标识和代码字段;数据区包括:魔数Magic字段、长度字段和信息承载字段;
    所述第一构造单元是设置为:
    设置ICMP Echo报文的报文类型标识和代码字段;
    填充ICMP Echo报文的Magic字段;
    计算用户输入命令的长度,将计算得到的长度填充到ICMP Echo报文的长度字段,
    将用户输入命令填充到ICMP Echo报文的信息承载字段。
  11. 根据权利要求10所述的客户端设备,其中,
    所述第一解析单元包括:
    第一检测模块,设置为检测ICMP Echo报文的Magic字段与ICMP Reply报文中的Magic字段是否匹配;
    第一读取模块,设置为当检测结果为匹配时,根据ICMP Reply报文的长度字段,读取ICMP Reply报文的信息承载字段中携带的响应信息。
  12. 根据权利要求8所述的客户端设备,其中,所述第一发送单元是设置为:通过网络连接端口将ICMP Echo报文发送给服务端。
  13. 一种服务端设备,设置在网关设备上,包括:
    第二接收单元,设置为接收客户端发送的控制报文协议ICMP Echo报文;
    第二解析单元,设置为解析ICMP Echo报文中携带的用户输入命令;
    处理单元,设置为对用户输入命令进行处理,并生成针对用户输入命令的响应信息;
    第二构造单元,设置为构造ICMP回复Reply报文,将针对用户输入命令的响应信息设置在ICMP报文的数据区;
    第二发送单元,设置为将ICMP Reply报文发送给客户端。
  14. 根据权利要求13所述的服务端设备,其中,所述第二解析单元包括:
    第二检测模块,设置为检测ICMP Echo报文的魔数Magic字段是否为指定的Magic字段;
    第二读取模块,设置为当测ICMP Echo报文的Magic字段是指定的Magic字段时,根据ICMP Echo报文的长度字段,读取ICMP Echo报文的信息承载字段中携带的用户输入命令;
    所述第二构造单元是设置为:
    设置ICMP Reply报文的报文类型标识和代码字段;
    填充ICMP Reply报文的Magic字段;
    计算响应信息的长度,将计算得到的长度填充到ICMP Reply报文的长度字段,将响应信息填充到ICMP Reply报文的信息承载字段。
PCT/CN2016/079062 2015-06-18 2016-04-12 信息获取方法、客户端设备和服务端设备 WO2016202066A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510341069.5A CN106330483B (zh) 2015-06-18 2015-06-18 信息获取方法、客户端设备和服务端设备
CN201510341069.5 2015-06-18

Publications (1)

Publication Number Publication Date
WO2016202066A1 true WO2016202066A1 (zh) 2016-12-22

Family

ID=57544824

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/079062 WO2016202066A1 (zh) 2015-06-18 2016-04-12 信息获取方法、客户端设备和服务端设备

Country Status (2)

Country Link
CN (1) CN106330483B (zh)
WO (1) WO2016202066A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110414651A (zh) * 2019-07-03 2019-11-05 阿里巴巴集团控股有限公司 调试智能卡的方法及装置
CN112491554A (zh) * 2020-11-19 2021-03-12 北京天融信网络安全技术有限公司 一种信息隐藏方法、装置,ip主机以及网络节点
CN113364793A (zh) * 2021-06-17 2021-09-07 北京天融信网络安全技术有限公司 一种icmp隐蔽隧道检测方法、装置及存储介质
US11824753B2 (en) 2021-09-05 2023-11-21 Cisco Technology, Inc. Network node-to-node connectivity verification including data path processing of packets within a packet switching device

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107547505B (zh) * 2017-06-21 2020-04-03 新华三技术有限公司 一种报文处理方法及装置
CN110061926A (zh) * 2019-04-26 2019-07-26 武汉思创易控科技有限公司 一种多路复用的ping方法、存储介质、终端和服务器
CN112714200A (zh) * 2019-10-24 2021-04-27 中国移动通信有限公司研究院 一种设备定位、设备显示位置的方法、设备及介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5872847A (en) * 1996-07-30 1999-02-16 Itt Industries, Inc. Using trusted associations to establish trust in a computer network
CN103237071A (zh) * 2013-04-19 2013-08-07 江苏亿通高科技股份有限公司 一种无线EoC终端集中管理的方法
CN104038553A (zh) * 2010-09-21 2014-09-10 华为终端有限公司 一种控制方法、装置和系统

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100344117C (zh) * 2004-06-28 2007-10-17 华为技术有限公司 一种基于rfn时间戳进行时延测试的方法
CN1794718A (zh) * 2005-12-31 2006-06-28 西安交大捷普网络科技有限公司 一种网络安全设备联动协议
CN103840976B (zh) * 2014-02-28 2017-06-20 华为技术有限公司 通信方法、光设备和网络设备

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5872847A (en) * 1996-07-30 1999-02-16 Itt Industries, Inc. Using trusted associations to establish trust in a computer network
CN104038553A (zh) * 2010-09-21 2014-09-10 华为终端有限公司 一种控制方法、装置和系统
CN103237071A (zh) * 2013-04-19 2013-08-07 江苏亿通高科技股份有限公司 一种无线EoC终端集中管理的方法

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110414651A (zh) * 2019-07-03 2019-11-05 阿里巴巴集团控股有限公司 调试智能卡的方法及装置
CN110414651B (zh) * 2019-07-03 2023-01-17 创新先进技术有限公司 调试智能卡的方法及装置
CN112491554A (zh) * 2020-11-19 2021-03-12 北京天融信网络安全技术有限公司 一种信息隐藏方法、装置,ip主机以及网络节点
CN113364793A (zh) * 2021-06-17 2021-09-07 北京天融信网络安全技术有限公司 一种icmp隐蔽隧道检测方法、装置及存储介质
US11824753B2 (en) 2021-09-05 2023-11-21 Cisco Technology, Inc. Network node-to-node connectivity verification including data path processing of packets within a packet switching device

Also Published As

Publication number Publication date
CN106330483A (zh) 2017-01-11
CN106330483B (zh) 2021-04-06

Similar Documents

Publication Publication Date Title
WO2016202066A1 (zh) 信息获取方法、客户端设备和服务端设备
JP6513813B2 (ja) 仮想拡張可能ローカルエリアネットワーク上での双方向フォワーディング検出
KR101770498B1 (ko) 링크의 건전성을 점검하는 방법 및 장치
CN110430100B (zh) 网络连通性探测方法和装置
US10863386B1 (en) State machine handling at a proxy node in an ethernet-based fronthaul network
CN111083161A (zh) 数据传输的处理方法及装置、物联网设备
US9825855B2 (en) Information processing apparatus and route setting method
WO2019019864A1 (zh) 嵌入式自助终端的通信系统、方法及装置
CN112202635B (zh) 链路的监控方法、装置、存储介质以及电子装置
US20080028034A1 (en) Method for mapping an iscsi target name to a storage resource based on an initiator hardware class identifier
US20170272339A1 (en) Method and apparatus for detecting connectivity
US20170280410A1 (en) Method, device and system for implementing information self-registration, and computer storage medium
US8972543B1 (en) Managing clients utilizing reverse transactions
CN109039687A (zh) 请求的负载均衡方法、装置、系统、设备以及存储介质
US20210006607A1 (en) Communications apparatus, systems, and methods for preventing and/or minimizing session data clipping
CN106936608B (zh) 一种建立ssh连接的方法、相关设备及系统
CN116418567A (zh) 一种网络协议安全性测试系统
CN115396529A (zh) 多通道通信方法、装置、终端设备及存储介质
CN112769845B (zh) 漏洞测试方法、装置、电子装置和计算机设备
CN110771117A (zh) 一种采用面向id的网络的会话层通信
KR20120121202A (ko) 데이터 분산 서비스 네트워크 과부하 방지 방법
CN112910910A (zh) Opcda协议报文处理方法、装置、设备以及存储介质
KR102021333B1 (ko) 시험 자동화 방법 및 장치
CN109274530B (zh) 基于tcp协议的网络数据包零误差场景再现方法和装置
EP4319094A1 (en) Control method and apparatus, and computing device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16810807

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16810807

Country of ref document: EP

Kind code of ref document: A1