WO2023016470A1 - 一种处理ping报文的方法、装置和系统 - Google Patents

一种处理ping报文的方法、装置和系统 Download PDF

Info

Publication number
WO2023016470A1
WO2023016470A1 PCT/CN2022/111259 CN2022111259W WO2023016470A1 WO 2023016470 A1 WO2023016470 A1 WO 2023016470A1 CN 2022111259 W CN2022111259 W CN 2022111259W WO 2023016470 A1 WO2023016470 A1 WO 2023016470A1
Authority
WO
WIPO (PCT)
Prior art keywords
address
ping
request message
proxy
response message
Prior art date
Application number
PCT/CN2022/111259
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 WO2023016470A1 publication Critical patent/WO2023016470A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks

Definitions

  • the present application relates to the communication field, and more specifically, relates to a method, device and system for processing ping messages.
  • the proxy gateway will transmit the transmission control protocol (transmission control protocol, TCP) message or user datagram protocol (user datagram protocol, UDP) message sent by the terminal device The message is sent to the proxy server. After the proxy server controls and registers the corresponding information, it sends the TCP or UDP message to the destination server. However, the proxy gateway will forward the ping message according to the original path, that is, it will not The ping message is sent to the proxy server, so the delay and packet loss rate of the information passing through the proxy server cannot be measured through the ping message.
  • TCP transmission control protocol
  • UDP user datagram protocol
  • the application provides a method, device and system for processing ping messages, so that when a user accesses the Internet through a proxy server, the time delay and packet loss rate of information passing through the proxy server can be measured through the ping message.
  • a method for processing a ping message including: obtaining a first ping request message, where the source Internet Protocol address SIP address of the first ping request message is the IP address of the terminal device, The destination Internet Protocol address DIP address of the first ping request message is the IP address of the destination server; according to the first ping request message, a second ping request message is generated, and the SIP address of the second ping request message is The address is the IP address of the proxy gateway, the DIP address of the second ping request message is the IP address of the proxy server, and the payload of the second ping request message includes the payload of the first ping request message and The IP address of the destination server; sending the second ping request packet to the proxy server.
  • proxy gateway may be independent of the terminal device, or may also be a software module in the terminal device.
  • the ping message is forwarded by the proxy gateway and sent to the proxy server, so that the ping message can pass through the proxy server, so that the time delay and packet loss rate of information passing through the proxy server can be measured through the ping message.
  • the method further includes: receiving a first ping response message sent by the proxy server, where the SIP address of the first ping response message is the The IP address of the proxy server, the DIP address of the first ping response message is the IP address of the proxy gateway, and the payload of the first ping response message is the same as the payload of the second ping request message ; Generate a second ping response message according to the first ping response message, the SIP address of the second ping response message is the IP address of the destination server, and the DIP address of the second ping response message is the IP address of the terminal device.
  • the payload of the second ping request message further includes authentication information of the proxy gateway.
  • the authentication information of the proxy gateway includes a magic number of the proxy gateway.
  • the magic number is determined through negotiation between the proxy gateway and the proxy server.
  • a method for processing a ping message comprising: the proxy server receives a second ping request message, the SIP address of the second ping request message is the IP address of the proxy gateway, and the The DIP address of the second ping request message is the IP address of the proxy server, and the payload of the second ping request message includes the IP address of the destination server; the proxy server determines that the database of the proxy server includes the After the IP address of the proxy gateway, according to the second ping request message, generate the third ping request message, the SIP address of the third ping request message is the IP address of the proxy server, the third ping request message The DIP address of the ping request message is the IP address of the destination server; the proxy server sends the third ping request message to the destination server.
  • the proxy server performs operations such as receiving and forwarding the ping message, so that the ping message passes through the proxy server, so that the time delay and packet loss rate of information passing through the proxy server can be measured through the ping message.
  • the method further includes: the proxy server receives a third ping response message, and the SIP address of the third ping response message is the destination server IP address, DIP address is the IP address of the proxy server, the payload of the third ping response message is the same as the payload of the third ping request message; the proxy server according to the third ping Response message, generate the first ping response message, the SIP address of the first ping response message is the IP address of the proxy server, and the DIP address of the first ping response message is the IP of the proxy gateway address, the payload of the first ping response message includes the payload of the third ping response message and the IP address of the destination server; the proxy server sends the first ping response message.
  • the payload of the second ping request message further includes authentication information of the proxy gateway
  • the payload of the first ping response message further includes Authentication information of the proxy gateway
  • the authentication information of the proxy gateway includes the magic number of the proxy gateway.
  • the magic number is determined through negotiation between the proxy gateway and the proxy server.
  • a device for processing ping messages includes a receiving module, a processing module and a sending module, the receiving module is used to obtain a first ping request message, and the first ping request message
  • the source Internet protocol address SIP address of the terminal device is the IP address of the terminal device
  • the destination Internet protocol address DIP address of the first ping request message is the IP address of the destination server
  • the processing module is configured to according to the first ping request message
  • the second ping request message is generated, the SIP address of the second ping request message is the IP address of the proxy gateway, the DIP address of the second ping request message is the IP address of the proxy server, and the second ping request message is the IP address of the proxy server.
  • the payload of the ping request message includes the payload of the first ping request message and the IP address of the destination server; the sending module is configured to send the second ping request message to the proxy server.
  • the receiving module is further configured to receive a first ping response message sent by the proxy server, where the SIP address of the first ping response message is the The IP address of the proxy server, the DIP address of the first ping response message is the IP address of the proxy gateway, the payload of the first ping response message and the payload of the second ping request message The same; the processing module is also used to generate a second ping response message according to the first ping response message, the SIP address of the second ping response message is the IP address of the destination server, and the second ping response message is the IP address of the destination server. Second, the DIP address of the ping response message is the IP address of the terminal device.
  • the payload of the second ping request message further includes authentication information of the proxy gateway.
  • the authentication information of the proxy gateway includes the magic number of the proxy gateway.
  • the magic number is determined through negotiation between the proxy gateway and the proxy server.
  • the beneficial effect of the third aspect and any possible implementation manner of the third aspect corresponds to the beneficial effect of the first aspect and any possible implementation manner of the first aspect, which will not be repeated here.
  • a device for processing ping messages includes a receiving module, a processing module and a sending module, the receiving module is used to receive a second ping request message, and the second ping request message
  • the SIP address of the second ping request message is the IP address of the proxy gateway
  • the DIP address of the second ping request message is the IP address of the proxy server
  • the payload of the second ping request message includes the IP address of the destination server
  • the processing module is configured to generate a third ping request message according to the second ping request message after determining that the database of the proxy server includes the IP address of the proxy gateway, and the SIP address of the third ping request message
  • the address is the IP address of the proxy server, and the DIP address of the third ping request message is the IP address of the destination server; the sending module is used to send the third ping request message to the destination server .
  • the receiving module is further configured to receive a third ping response message, where the SIP address of the third ping response message is the IP address of the destination server , the DIP address is the IP address of the proxy server, and the payload of the third ping response message is the same as the payload of the third ping request message; the processing module is also used for according to the third ping Response message, generate the first ping response message, the SIP address of the first ping response message is the IP address of the proxy server, and the DIP address of the first ping response message is the IP of the proxy gateway address, the payload of the first ping response message includes the payload of the third ping response message and the IP address of the destination server; the sending module is also used to send the first ping response message .
  • the payload of the second ping request message further includes authentication information of the proxy gateway
  • the payload of the first ping response message further includes Authentication information of the proxy gateway
  • the authentication information of the proxy gateway includes a magic number of the proxy gateway.
  • the magic number is determined through negotiation between the proxy gateway and the proxy server.
  • a proxy gateway has the functions of the apparatus for realizing the above third aspect.
  • the functions may be implemented based on hardware, or may be implemented by executing corresponding software based on hardware, and the hardware or software includes one or more modules corresponding to the above functions.
  • the structure of the agent gateway includes a processor, and the processor is configured to support the agent gateway to perform corresponding functions in the above methods.
  • the proxy gateway may also include a memory, which is used to be coupled with the processor, and stores necessary program instructions and data of the proxy gateway.
  • a proxy server has the functions of the apparatus for realizing the above fourth aspect.
  • the functions may be implemented based on hardware, or may be implemented by executing corresponding software based on hardware, and the hardware or software includes one or more modules corresponding to the above functions.
  • the structure of the proxy server includes a processor configured to support the proxy server to perform corresponding functions in the above method.
  • the proxy server may also include a memory, which is used to be coupled with the processor, and stores necessary program instructions and data of the proxy server.
  • the structure of the proxy server includes a network card driver module and a user space module, configured to execute the second aspect or any possible implementation manner of the second aspect.
  • a computer program product includes: computer program code, when the computer program code is run on a computer, it causes the computer to perform any one of the above-mentioned first aspect or any possible implementation of the first aspect. method, or causing a computer to execute the above-mentioned second aspect or any possible implementation method of the second aspect.
  • a computer-readable medium stores program codes, and when the computer program codes are run on a computer, the computer executes any one of the above-mentioned first aspect or the first aspect. Execute the method, or cause the computer to execute the second aspect or any possible execution method of the second aspect.
  • These computer-readable storages include, but are not limited to, one or more of the following: read-only memory (read-only memory, ROM), programmable ROM (programmable ROM, PROM), erasable PROM (erasable PROM, EPROM), Flash memory, electrical EPROM (electrically EPROM, EEPROM) and hard disk drive (harddrive).
  • a chip the chip includes a processor and a data interface, wherein the processor reads instructions stored in the memory through the data interface to execute the first aspect or any possible implementation of the first aspect The method in the method, or execute the method in the above second aspect or any possible implementation manner of the second aspect.
  • the chip can be based on a central processing unit (CPU), a microcontroller (microcontroller unit, MCU), a microprocessor (micro processing unit, MPU), a digital signal processor (digital signal processing, DSP) ), system on chip (SoC), application-specific integrated circuit (ASIC), field programmable gate array (field programmable gate array, FPGA) or programmable logic device (programmable logic device, PLD) form is realized.
  • CPU central processing unit
  • MCU microcontroller unit
  • MPU microprocessor
  • DSP digital signal processor
  • SoC system on chip
  • SoC system on chip
  • ASIC application-specific integrated circuit
  • FPGA field programmable gate array
  • PLD programmable logic device
  • a system for processing ping packets includes the third aspect or any possible implementation of the third aspect and the fourth aspect or any of the possible implementations of the fourth aspect
  • the device for processing ping packets includes the third aspect or any possible implementation of the third aspect and the fourth aspect or any of the possible implementations of the fourth aspect.
  • Fig. 1 is a schematic diagram of an application scenario applicable to the embodiment of the present application.
  • FIG. 2 is a schematic flow chart of a method for processing ping packets provided by an embodiment of the present application.
  • Fig. 3 is a schematic flow chart of an embodiment of a method for processing a ping packet provided by the embodiment of the present application.
  • Fig. 4 is a schematic flow chart of another embodiment of a method for processing a ping packet provided by the embodiment of the present application.
  • FIG. 5 is a schematic flowchart of an apparatus for processing ping packets provided by an embodiment of the present application.
  • FIG. 6 is a schematic flowchart of an apparatus for processing ping packets provided by an embodiment of the present application.
  • FIG. 7 is a schematic flowchart of an apparatus for processing ping packets provided by an embodiment of the present application.
  • the present application presents various aspects, embodiments or features in terms of a system that can include a number of devices, components, modules and the like. It is to be understood and appreciated that the various systems may include additional devices, components, modules, etc. and/or may not include all of the devices, components, modules etc. discussed in connection with the figures. In addition, combinations of these schemes can also be used.
  • the network architecture and business scenarios described in the embodiments of the present application are for more clearly illustrating the technical solutions of the embodiments of the present application, and do not constitute limitations on the technical solutions provided by the embodiments of the present application.
  • the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
  • references to "one embodiment” or “some embodiments” or the like in this specification means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application.
  • appearances of the phrases “in one embodiment,” “in some embodiments,” “in other embodiments,” “in other embodiments,” etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean “one or more but not all embodiments” unless specifically stated otherwise.
  • the terms “including”, “comprising”, “having” and variations thereof mean “including but not limited to”, unless specifically stated otherwise.
  • At least one means one or more, and “multiple” means two or more.
  • “And/or” describes the association relationship of associated objects, indicating that there can be three types of relationships, for example, A and/or B, which can mean: A exists alone, A and B exist at the same time, and B exists alone, where A, B can be singular or plural.
  • the character “/” generally indicates that the contextual objects are an “or” relationship.
  • “At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items.
  • At least one item (piece) of a, b, or c can represent: a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, c can be single or multiple .
  • FIG. 1 is a schematic diagram of an application scenario 100 applicable to the embodiment of the present application.
  • an application scenario 100 includes a terminal device 101 , a proxy gateway 102 , a proxy server 103 and a destination server 104 .
  • Messages can be exchanged between the terminal device and the destination server through a proxy gateway and a proxy server.
  • the proxy gateway and the proxy server forward the request message sent by the terminal device to the destination server, and then forward the response message sent by the destination server to the terminal device.
  • the proxy gateway may be a software module in the terminal device, or may be a device independent of the terminal device, which is not limited in this application. It should be understood that when the proxy gateway is a software module in the terminal device, the message exchange between the proxy gateway and the terminal device is message transfer between different software modules in the terminal device.
  • proxy server is used to proxy network users to obtain network information.
  • a proxy server can be vividly understood as a transfer station for network information, an intermediate agency between a personal network and an Internet service provider, responsible for forwarding legal network information, and controlling and registering forwarding.
  • the proxy server is mainly used to forward the network access request of the client system.
  • the proxy server does not simply forward the request to the real Internet server, it can also control the user's behavior, make decisions on the received client request, and filter the user's request according to the filtering rules.
  • proxy servers provide services for each required application on the proxy gateway. Install dedicated code (proxy service) to work. If the network administrator does not install the proxy service code for a particular service, the service will not be supported and corresponding client requests will not be forwarded through the firewall. Also, the proxy service code can be configured to support only those features that the network administrator of a service deems acceptable, and not others.
  • the terminal equipment in the embodiment of the present application may refer to user equipment, access terminal, subscriber unit, subscriber station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication device, user agent, or user device.
  • the terminal equipment can also be a cellular phone, a cordless phone, a Session Initiation Protocol (Session Initiation Protocol, SIP) phone, a wireless local loop (Wireless Local Loop, WLL) station, a personal digital processing (Personal Digital Assistant, PDA), a wireless communication Functional handheld devices, computing devices or other processing devices connected to wireless modems, vehicle-mounted devices, wearable devices, terminal devices in the fifth generation (5th Generation, 5G) network or future evolution of the public land mobile communication network (Public Land Mobile Network, PLMN) in the terminal equipment, etc., the embodiment of the present application is not limited to this.
  • 5G Fifth Generation
  • PLMN Public Land Mobile Network
  • Network diagnostic tool Packet internet groper, ping: It is a computer network tool used to determine whether the local host can successfully exchange (send and receive) data packets with another host, and then according to the returned information, you can Infer whether the transmission control protocol/internet protocol (transmission control protocol/internet protocol, TCP/IP) parameters are set correctly, whether the operation is normal, and whether the network is smooth.
  • the exchanged data packet may be called a ping message, and the ping message may include a request message (ping request message) and a response message (ping reply message). That is, according to the transmission time of the ping message and the number of successful responses, the lost data packet rate (packet loss rate) and the round-trip time of the data packet can be estimated.
  • Internet control message protocol Internet control message protocol
  • ICMP Internet control message protocol
  • UDP user datagram protocol
  • TCP etc.: all are sub-protocols of the TCP/IP protocol suite, among which ICMP is used to transmit control messages , not used to transmit user data, while TCP and UDP are used to transmit user data.
  • ICMP message includes two types of messages, ICMP error report message and ICMP inquiry message.
  • Ping packets are one type of ICMP query packets, which can be used to measure the delay and packet loss rate of information passing through a certain server.
  • Pushing the stack It can also be called pushing or pushing, which refers to inserting new elements into a stack.
  • the stack also known as the stack, is a linear table with limited operations. It is limited to insert and delete linear tables only at the end of the table. The tail of the table is called the top of the stack. Relatively, the other end is called the bottom of the stack. .
  • Pushing the stack is to put the new element on top of the top element of the stack, making it the new top element of the stack.
  • deleting elements from a stack is also called making a stack or unstacking, which is to delete the top element of the stack, so that the adjacent element is called the new top element of the stack.
  • NAT conversion table network address translation (network address translation, NAT) table, which can be understood as when the server processes and forwards the message, it will record the processing and forwarding process of the message in the NAT conversion table. For the processing of subsequent related messages. Or it can also be understood that the NAT translation table is mainly used to complete the mapping of the IP address and port number of the packet to another IP address and port number when the data packet is transferred from one network to another network.
  • NAT conversion table network address translation (network address translation, NAT) table, which can be understood as when the server processes and forwards the message, it will record the processing and forwarding process of the message in the NAT conversion table. For the processing of subsequent related messages. Or it can also be understood that the NAT translation table is mainly used to complete the mapping of the IP address and port number of the packet to another IP address and port number when the data packet is transferred from one network to another network.
  • This application proposes a method for processing ping messages by a proxy server, so that when a user accesses the Internet through the proxy server, the time delay and packet loss rate of information passing through the proxy server can also be measured through the ping message.
  • FIG. 2 shows a schematic flowchart of a method for processing ping messages proposed by the present application, and the method 200 includes:
  • the proxy gateway obtains the first ping request message, the source Internet protocol (source internet protocol, SIP) address of the first ping request message is the IP address of the terminal device, and the destination internet protocol (destination internet protocol, DIP) address is the IP address of the destination server IP address.
  • source internet protocol source internet protocol
  • DIP destination internet protocol
  • the proxy gateway when the proxy gateway is independent of the terminal device, the proxy gateway acquires the first ping request message in the following way: the terminal device sends the first ping request message to the proxy gateway, so that the proxy gateway receives the first ping request message.
  • the first ping request message when the proxy gateway is a software module in the terminal device, the way the proxy gateway obtains the first ping request message is: the proxy gateway obtains the first ping request message from other software modules of the terminal device.
  • the IP address of the proxy gateway is the same as the IP address of the terminal device.
  • the proxy gateway generates a second ping request message according to the first ping request message, the SIP address of the second ping request message is the IP address of the proxy gateway, the DIP address is the IP address of the proxy server, and the payload (payload) It includes the payload of the first ping request message and the IP address of the destination server.
  • the proxy gateway when the proxy gateway generates the second ping request message according to the first ping request message, it will push the IP address of the destination server into the payload of the first ping request message, thereby The generated payload of the second ping message includes the payload of the first ping request packet and the IP address of the destination server.
  • the second ping request message may also include authentication information of the proxy gateway.
  • the authentication information of the proxy gateway can be a magic number (magic num).
  • the proxy gateway sends a second ping request message to the proxy server, and correspondingly, the proxy server receives the second ping request message.
  • the proxy server After the proxy server determines that the database includes the IP address of the proxy gateway, it generates a third ping request message according to the second ping request message.
  • the SIP address of the third ping request message is the IP address of the proxy server, and the DIP address is IP address of the destination server.
  • the proxy server can query or match in the database of the proxy server according to the IP address of the proxy gateway in the second ping request message, and include the IP address of the proxy gateway in the database of the determined proxy server. After the IP address, generate the third ping request message according to the second ping request message. In addition, when the proxy server generates the third ping request message, it may determine the IP address of the destination server in the payload of the second ping request message as the DIP address of the third ping request message.
  • the payload of the third ping request message includes the authentication information of the proxy gateway and the IP address of the proxy gateway.
  • the proxy server can query or match the authentication information of the proxy gateway and the IP address of the proxy gateway in the database at the same time, and after determining that the database includes both the authentication information of the proxy gateway and the IP address of the proxy gateway, according to The second ping request message generates the third ping request message.
  • the database is database A of the proxy server. It should be understood that when the proxy gateway registers with the proxy server, the proxy server may record the authentication information of the proxy gateway and the IP address of the proxy gateway into the database A of the proxy server.
  • the authentication information of the proxy gateway may be a magic number (magic num) determined after negotiating with the proxy server. For example, when the proxy gateway registers with the proxy server, it negotiates with the proxy server to determine the magic number.
  • magic number magic num
  • the proxy server can also query or match the metadata of the second ping request message and the IP address of the proxy gateway in the database at the same time, and include the metadata of the second ping request message in the database and the IP address of the proxy gateway, generate the third ping request message according to the second ping request message.
  • the metadata of the above-mentioned second ping request message may be identification information of the terminal device, and the identification information of the terminal device is included in the ping message, for example, the first ping request message to the third ping request message and The payloads of the first ping response message to the third ping response message all include the identification information of the terminal device.
  • the identification information of the terminal device may be called a user identification.
  • the proxy server sends a third ping request message to the destination server, and correspondingly, the destination server receives the third ping request message.
  • the destination server generates a third ping response message according to the third ping request message, the SIP address of the third ping response message is the IP address of the destination server, the DIP address is the IP address of the proxy server, and the payload and the third The payloads of the ping request packets are the same.
  • the payload of the third ping request message when the payload of the third ping request message includes the authentication information of the proxy gateway and the IP address of the proxy gateway, the payload of the third ping response message also includes the authentication information of the proxy gateway and the IP address of the proxy gateway .
  • the destination server sends a third ping response message to the proxy server, and correspondingly, the proxy server receives the third ping response message.
  • the proxy server generates a first ping response message according to the third ping response message, the SIP address of the first ping response message is the IP address of the proxy server, the DIP address is the IP address of the proxy gateway, and the payload includes the third The payload of the ping response packet and the IP address of the destination server.
  • the proxy server before the proxy server generates the first ping response message according to the third ping response message, the proxy server can query the authentication information of the proxy gateway, or can query the NAT translation table to Determine whether the ping message can be forwarded.
  • the proxy server querying the authentication information of the proxy gateway may be that the proxy server queries the proxy gateway authentication information in the database, for example, when the payload of the third ping response message includes the proxy gateway authentication information and the IP address of the proxy gateway , the proxy server queries whether the authentication information of the proxy gateway is included in the database.
  • the proxy server querying the NAT translation table may be that the proxy server determines that the NAT translation table includes the translation information of the SIP address and the DIP address according to the SIP address and the DIP address of the third ping response message.
  • the first ping response message may also include authentication information of the proxy gateway.
  • the authentication information of the proxy gateway can be a magic number (magic num).
  • the proxy server sends the first ping response message to the proxy gateway, and correspondingly, the proxy gateway receives the first ping response message.
  • the payload of the first ping response packet is the same as the payload of the second ping request packet.
  • the proxy gateway generates a second ping response message according to the first ping response message, the SIP address of the second ping response message is the IP address of the destination server, and the DIP address is the IP address of the terminal device.
  • the proxy gateway when the proxy gateway is independent of the terminal device, it may send the second ping response message to the terminal device.
  • the proxy gateway is a software module in the terminal device, it may transmit the second ping response message to the corresponding software module in the terminal device. This application is not limited to this.
  • the ping message is forwarded through the proxy server, so that the time delay and packet loss rate of information passing through the proxy server can be measured through the ping message.
  • the proxy server may be a network service provider (point of presence, POP) point instead, and the POP point may be called a network presence point.
  • POP point of presence
  • sequence numbers of the above-mentioned processes do not mean the order of execution, and the execution order of the processes should be determined by their functions and internal logic, and should not be used in the embodiments of the present application.
  • the implementation process constitutes any limitation.
  • Fig. 3 is a schematic flow chart of an embodiment of a method for processing a ping packet provided by the embodiment of the present application.
  • the method 300 includes:
  • the terminal device generates a first ping request message, the SIP address of the first ping request message is the IP address of the terminal device, and the DIP address is the IP address of the destination server.
  • the above step S301 may be referred to as the terminal device initiating a ping operation to the destination server.
  • the terminal device sends a first ping request message to the proxy gateway, and correspondingly, the proxy gateway receives the first ping request message.
  • the proxy gateway generates a second ping request message according to the first ping request message, the SIP address of the second ping request message is the IP address of the proxy gateway, the DIP address is the IP address of the proxy server, and the payload (payload) It includes the payload of the first ping request message and the IP address of the destination server.
  • step S303 For a detailed description of step S303, reference may be made to S202 in the above-mentioned method 200, which will not be repeated here.
  • the proxy gateway sends the second ping request message to the proxy server, and correspondingly, the proxy server receives the second ping request message.
  • the proxy server After the proxy server determines that the IP address of the proxy gateway is included in the database, it generates a third ping request message according to the second ping request message.
  • the SIP address of the third ping request message is the IP address of the proxy server, and the DIP address is the IP address of the destination server; and record the process of converting the second ping request message into the third ping request message into the NAT conversion table.
  • step S305 For a detailed description of step S305, reference may be made to S204 in the above-mentioned method 200, which will not be repeated here.
  • the proxy server sends a third ping request message to the destination server, and correspondingly, the destination server receives the third ping request message.
  • the destination server generates a third ping response message according to the third ping request message
  • the SIP address of the third ping response message is the IP address of the destination server
  • the DIP address is the IP address of the proxy server
  • the payload and the third The payloads of the ping request packets are the same.
  • the destination server sends a third ping response message to the proxy server, and correspondingly, the proxy server receives the third ping response message.
  • the proxy server queries the NAT translation table, and after determining that the NAT translation table includes the translation information of the ping message, generates the first ping response message according to the third ping response message, and the SIP address of the first ping response message is the proxy
  • the IP address of the server, the DIP address is the IP address of the proxy gateway, and the payload includes the payload of the third ping response message and the IP address of the destination server.
  • step S309 For a more detailed description of step S309, reference may be made to S208 in the above-mentioned method 200, which will not be repeated here.
  • the proxy server sends a first ping response message to the proxy gateway, and correspondingly, the proxy gateway receives the first ping response message.
  • step S310 For a more detailed description of step S310, reference may be made to S209 in the above-mentioned method 200, which will not be repeated here.
  • the proxy gateway when the SIP address of the first ping response message is the IP address of the proxy server, the proxy gateway generates a second ping response message according to the first ping response message, and the SIP address of the second ping response message is the destination server
  • the IP address of the DIP address is the IP address of the terminal device.
  • the proxy gateway sends the second ping response message to the terminal device, and correspondingly, the terminal device receives the second ping response message.
  • Fig. 4 is a schematic flow chart of another embodiment of a method for processing a ping packet provided by the embodiment of the present application.
  • the method 400 includes:
  • the terminal device generates a first ping request message, the SIP address of the first ping request message is the IP address of the terminal device, and the DIP address is the IP address of the destination server.
  • the above step S401 may be referred to as the terminal device initiating a ping operation to the destination server.
  • the terminal device sends a first ping request message to the proxy gateway, and correspondingly, the proxy gateway receives the first ping request message.
  • the proxy gateway generates a second ping request message according to the first ping request message, the SIP address of the second ping request message is the IP address of the proxy gateway, the DIP address is the IP address of the proxy server, and the payload (payload) It includes the payload of the first ping request message and the IP address of the destination server.
  • step S403 For a detailed description of step S403, reference may be made to S202 in the above-mentioned method 200, and details are not repeated here.
  • the proxy gateway sends the second ping request message to the proxy server, and correspondingly, the proxy server receives the second ping request message.
  • the proxy server After the proxy server determines that the database includes the IP address of the proxy gateway, it generates a third ping request message according to the second ping request message.
  • the SIP address of the third ping request message is the IP address of the proxy server, and the DIP address is The IP address of the destination server; and pushing the authentication information of the proxy gateway and the IP address of the proxy gateway into the payload of the third ping request message.
  • step S405 For a more detailed description of step S405, reference may be made to S204 in the above-mentioned method 200, which will not be repeated here.
  • the proxy server sends a third ping request packet to the destination server, and correspondingly, the destination server receives the third ping request packet.
  • the destination server generates a third ping response message according to the third ping request message
  • the SIP address of the third ping response message is the IP address of the destination server
  • the DIP address is the IP address of the proxy server
  • the payload is the same as the third ping response message.
  • the payloads of the ping request packets are the same.
  • the destination server sends a third ping response message to the proxy server, and correspondingly, the proxy server receives the third ping response message.
  • the proxy server queries whether the authentication information of the proxy gateway is included in the database. After the query is found, a first ping response message is generated according to the third ping response message, and the SIP address of the first ping response message is the IP address of the proxy server , the DIP address is the IP address of the proxy gateway, and the payload includes the payload of the third ping response message and the IP address of the destination server.
  • step S409 For a more detailed description of step S409, reference may be made to S208 in the above-mentioned method 200, which will not be repeated here.
  • the proxy server sends a first ping response message to the proxy gateway, and correspondingly, the proxy gateway receives the first ping response message.
  • step S410 For a more detailed description of step S410, reference may be made to S209 in the above-mentioned method 200, which will not be repeated here.
  • the proxy gateway when the SIP address of the first ping response message is the IP address of the proxy server, the proxy gateway generates a second ping response message according to the first ping response message, and the SIP address of the second ping response message is the destination server
  • the IP address of the DIP address is the IP address of the terminal device.
  • the proxy gateway sends the second ping response message to the terminal device, and correspondingly, the terminal device receives the second ping response message.
  • FIG. 5 is a schematic structural diagram of an apparatus 500 for processing ping packets provided by an embodiment of the present application.
  • the device may be a proxy gateway, or a chip or component applied to a proxy gateway.
  • the device may be set on the terminal device, that is, the proxy gateway may be set on the terminal device.
  • the apparatus 500 shown in FIG. 5 may execute corresponding steps in the method for processing ping packets performed by the proxy gateway in the above embodiments.
  • the device 500 includes: a receiving module 510 , a processing module 520 , and a sending module 530 .
  • the receiving module is configured to obtain a first ping request message, the source Internet Protocol address SIP address of the first ping request message is the IP address of the terminal device, and the first ping request message
  • the destination Internet protocol address DIP address of a ping request message is the IP address of the destination server
  • the processing module is used to generate a second ping request message according to the first ping request message, and the second ping request message
  • the SIP address of the text is the IP address of the proxy gateway
  • the DIP address of the second ping request message is the IP address of the proxy server
  • the payload of the second ping request message includes the IP address of the first ping request message. Payload and the IP address of the destination server
  • the sending module is configured to send the second ping request message to the proxy server.
  • FIG. 6 is a schematic structural diagram of an apparatus 600 for processing ping packets provided by an embodiment of the present application.
  • the device may be a proxy server, or a chip or component applied to a proxy server.
  • the apparatus 600 shown in FIG. 6 may execute corresponding steps in the method for processing a ping packet performed by the proxy server in the foregoing embodiments.
  • the device 600 includes: a receiving module 610 , a processing module 620 , and a sending module 630 .
  • the receiving module is configured to receive a second ping request message, the SIP address of the second ping request message is the IP address of the proxy gateway, and the second ping request message
  • the DIP address of the text is the IP address of the proxy server, and the payload of the second ping request message includes the IP address of the destination server
  • the processing module is used to determine that the proxy gateway is included in the database of the proxy server After the IP address of the ping request message, generate a third ping request message according to the second ping request message, the SIP address of the third ping request message is the IP address of the proxy server, and the third ping request message
  • the DIP address of the message is the IP address of the destination server; the sending module is configured to send the third ping request message to the destination server.
  • FIG. 7 shows a schematic structural diagram of a device for processing ping messages according to an embodiment of the present application.
  • the device may be a terminal device or a proxy gateway or a proxy server or a destination server, including at least one processor 702 (such as a CPU), and at least A network interface 705 or other communication interface, and memory 706. Communication links between these components.
  • the processor 702 is used to execute executable modules, such as computer programs, stored in the memory 706 .
  • the memory 706 may include a high-speed random access memory (random access memory, RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
  • the communication connection with at least one other network element is realized through at least one network interface 705 (which may be wired or wireless).
  • the memory 706 stores a program 7061, and the processor 702 executes the program 7061, so as to execute the methods in various embodiments of the foregoing application.
  • all or part of them may be implemented by software, hardware, firmware or any combination thereof.
  • software When implemented using software, it may be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions according to the embodiments of the present application will be generated in whole or in part.
  • the computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server, or data center Transmission to another website site, computer, server, or data center by wired (eg, coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (eg, infrared, wireless, microwave, etc.).
  • the computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center integrated with one or more available media.
  • the available medium may be a magnetic medium (such as a floppy disk, a hard disk, or a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (solid state disk, SSD)), etc.
  • the embodiment of the present application also provides a computer-readable medium, the computer-readable medium stores program code, and when the computer program code is run on the computer, the computer is made to execute the corresponding method in the above-mentioned method embodiment.
  • These computer-readable storages include, but are not limited to, one or more of the following: read-only memory (read-only memory, ROM), programmable ROM (programmable ROM, PROM), erasable PROM (erasable PROM, EPROM), Flash memory, electrical EPROM (electrically EPROM, EEPROM) and hard disk drive (harddrive).
  • the embodiment of the present application also provides a chip, which is used in a terminal device, a proxy gateway, a proxy server or a destination server.
  • the chip includes: at least one processor, at least one memory, and an interface circuit, and the interface circuit is responsible for the Interacting with external information, the at least one memory, the interface circuit and the at least one processor are interconnected through lines, and instructions are stored in the at least one memory; the instructions are executed by the at least one processor to Perform corresponding operations in the methods described in the above aspects.
  • the chip can be based on a central processing unit (CPU), a microcontroller (microcontroller unit, MCU), a microprocessor (micro processing unit, MPU), a digital signal processor (digital signal processing, DSP) ), system on chip (SoC), application-specific integrated circuit (ASIC), field programmable gate array (field programmable gate array, FPGA) or programmable logic device (programmable logic device, PLD) form is realized.
  • CPU central processing unit
  • MCU microcontroller unit
  • MPU microprocessor
  • DSP digital signal processor
  • SoC system on chip
  • SoC system on chip
  • ASIC application-specific integrated circuit
  • FPGA field programmable gate array
  • PLD programmable logic device
  • the embodiment of the present application also provides a computer program product, where the computer program product includes a series of instructions, and when the instructions are executed, corresponding operations in the methods of the above aspects are performed.
  • the embodiment of the present application also provides a system for processing ping messages, including: the above proxy gateway and proxy server.
  • the system may also include a terminal device or a destination server.
  • the disclosed systems, devices and methods may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the functions described above are realized in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium.
  • the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (read-only memory, ROM), random access memory (random access memory, RAM), magnetic disk or optical disc and other media that can store program codes. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本申请提供了一种处理ping报文的方法、装置和系统,使得用户通过代理服务器上网时,能够通过ping报文来测量信息经过代理服务器的时延和丢包率。具体地,该方法包括:获取第一ping请求报文,所述第一ping请求报文的SIP地址为终端设备的IP地址,DIP地址为目的服务器的IP地址;根据所述第一ping请求报文,生成第二ping请求报文,所述第二ping请求报文的SIP地址为代理网关的IP地址,DIP地址为代理服务器的IP地址,所述第二ping请求报文的净荷包括所述第一ping请求报文的净荷和所述目的服务器的IP地址;向所述代理服务器发送所述第二ping请求报文。

Description

一种处理ping报文的方法、装置和系统
本申请要求于2021年8月10日提交中国国家知识产权局、申请号为202110911902.0、申请名称为“一种处理ping报文的方法、装置和系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信领域,并且更具体地,涉及一种处理ping报文的方法、装置和系统。
背景技术
对于通过代理服务器来实现终端设备和目的服务器之间的信息交换过程,代理网关会将终端设备发送的传输控制协议(transmission control protocol,TCP)报文或用户数据报协议(user datagram protocol,UDP)报文发送至代理服务器,代理服务器对相应的信息进行控制和登记后,将TCP报文或UDP报文发送至目的服务器,然而,代理网关会将ping报文按照原路径转发,即不会将ping报文发送至代理服务器,从而无法通过ping报文来测量信息经过代理服务器的时延和丢包率。
发明内容
本申请提供一种处理ping报文的方法、装置和系统,使得用户通过代理服务器上网时,能够通过ping报文来测量信息经过代理服务器的时延和丢包率。
第一方面,提供了一种处理ping报文的方法,所述方法包括:获取第一ping请求报文,所述第一ping请求报文的源因特网协议地址SIP地址为终端设备的IP地址,所述第一ping请求报文的目的因特网协议地址DIP地址为目的服务器的IP地址;根据所述第一ping请求报文,生成第二ping请求报文,所述第二ping请求报文的SIP地址为代理网关的IP地址,所述第二ping请求报文的DIP地址为代理服务器的IP地址,所述第二ping请求报文的净荷包括所述第一ping请求报文的净荷和所述目的服务器的IP地址;向所述代理服务器发送所述第二ping请求报文。
应理解,上述方法可以由代理网关执行。还应理解,代理网关可以独立于终端设备,或者也可以为终端设备中的一个软件模块。
上述技术方案中,通过代理网关对ping报文进行转发,并发送至代理服务器,使得ping报文可以通过代理服务器,从而能够通过ping报文来测量信息经过代理服务器的时延和丢包率。
结合第一方面,在第一方面的某些实现方式中,所述方法还包括:接收所述代理服务器发送的第一ping响应报文,所述第一ping响应报文的SIP地址为所述代理服务器的IP地址,所述第一ping响应报文的DIP地址为所述代理网关的IP地址,所述第一ping响应报文的净荷与所述第二ping请求报文的净荷相同;根据所述第一ping响应报文,生成第 二ping响应报文,所述第二ping响应报文的SIP地址为所述目的服务器的IP地址,所述第二ping响应报文的DIP地址为所述终端设备的IP地址。
结合第一方面,在第一方面的某些实现方式中,所述第二ping请求报文的净荷还包括所述代理网关的认证信息。
结合第一方面,在第一方面的某些实现方式中,所述代理网关的认证信息包括所述代理网关的魔数。
结合第一方面,在第一方面的某些实现方式中,所述魔数为所述代理网关与所述代理服务器协商确定的。
第二方面,提供了一种处理ping报文的方法,所述方法包括:代理服务器接收第二ping请求报文,所述第二ping请求报文的SIP地址为代理网关的IP地址,所述第二ping请求报文的DIP地址为所述代理服务器的IP地址,所述第二ping请求报文的净荷包括目的服务器的IP地址;所述代理服务器确定所述代理服务器的数据库中包括所述代理网关的IP地址后,根据所述第二ping请求报文,生成第三ping请求报文,所述第三ping请求报文的SIP地址为所述代理服务器的IP地址,所述第三ping请求报文的DIP地址为所述目的服务器的IP地址;所述代理服务器向所述目的服务器发送所述第三ping请求报文。
上述技术方案中,代理服务器对ping报文进行了接收、转发等操作,使得ping报文经过了代理服务器,从而能够通过ping报文来测量信息经过代理服务器的时延和丢包率。
结合第二方面,在第二方面的某些实现方式中,所述方法还包括:所述代理服务器接收第三ping响应报文,所述第三ping响应报文的SIP地址为所述目的服务器的IP地址,DIP地址为所述代理服务器的IP地址,所述第三ping响应报文的净荷与所述第三ping请求报文的净荷相同;所述代理服务器根据所述第三ping响应报文,生成第一ping响应报文,所述第一ping响应报文的SIP地址为所述代理服务器的IP地址,所述第一ping响应报文的DIP地址为所述代理网关的IP地址,所述第一ping响应报文的净荷包括所述第三ping响应报文的净荷和所述目的服务器的IP地址;所述代理服务器发送所述第一ping响应报文。
结合第二方面,在第二方面的某些实现方式中,所述第二ping请求报文的净荷还包括所述代理网关的认证信息,所述第一ping响应报文的净荷还包括所述代理网关的认证信息。
结合第二方面,在第二方面的某些实现方式中,所述代理网关的认证信息包括所述代理网关的魔数。
结合第二方面,在第二方面的某些实现方式中,所述魔数为所述代理网关与所述代理服务器协商确定的。
第三方面,提供了一种处理ping报文的装置,所述装置包括接收模块、处理模块和发送模块,所述接收模块用于获取第一ping请求报文,所述第一ping请求报文的源因特网协议地址SIP地址为终端设备的IP地址,所述第一ping请求报文的目的因特网协议地址DIP地址为目的服务器的IP地址;所述处理模块用于根据所述第一ping请求报文,生成第二ping请求报文,所述第二ping请求报文的SIP地址为代理网关的IP地址,所述第二ping请求报文的DIP地址为代理服务器的IP地址,所述第二ping请求报文的净荷包括所述第一ping请求报文的净荷和所述目的服务器的IP地址;所述发送模块用于向所述代 理服务器发送所述第二ping请求报文。
结合第三方面,在第三方面的某些实现方式中,所述接收模块还用于接收所述代理服务器发送的第一ping响应报文,所述第一ping响应报文的SIP地址为所述代理服务器的IP地址,所述第一ping响应报文的DIP地址为所述代理网关的IP地址,所述第一ping响应报文的净荷与所述第二ping请求报文的净荷相同;所述处理模块还用于根据所述第一ping响应报文,生成第二ping响应报文,所述第二ping响应报文的SIP地址为所述目的服务器的IP地址,所述第二ping响应报文的DIP地址为所述终端设备的IP地址。
结合第三方面,在第三方面的某些实现方式中,所述第二ping请求报文的净荷还包括所述代理网关的认证信息。
结合第三方面,在第三方面的某些实现方式中,所述代理网关的认证信息包括所述代理网关的魔数。
结合第三方面,在第三方面的某些实现方式中,所述魔数为所述代理网关与所述代理服务器协商确定的。
第三方面和第三方面的任意一个可能的实现方式的有益效果和第一方面以及第一方面的任意一个可能的实现方式的有益效果是对应的,对此,不再赘述。
第四方面,提供了一种处理ping报文的装置,所述装置包括接收模块、处理模块和发送模块,所述接收模块用于接收第二ping请求报文,所述第二ping请求报文的SIP地址为代理网关的IP地址,所述第二ping请求报文的DIP地址为所述代理服务器的IP地址,所述第二ping请求报文的净荷包括目的服务器的IP地址;所述处理模块用于确定所述代理服务器的数据库中包括所述代理网关的IP地址后,根据所述第二ping请求报文,生成第三ping请求报文,所述第三ping请求报文的SIP地址为所述代理服务器的IP地址,所述第三ping请求报文的DIP地址为所述目的服务器的IP地址;所述发送模块用于向所述目的服务器发送所述第三ping请求报文。
结合第四方面,在第四方面的某些实现方式中,所述接收模块还用于接收第三ping响应报文,所述第三ping响应报文的SIP地址为所述目的服务器的IP地址,DIP地址为所述代理服务器的IP地址,所述第三ping响应报文的净荷与所述第三ping请求报文的净荷相同;所述处理模块还用于根据所述第三ping响应报文,生成第一ping响应报文,所述第一ping响应报文的SIP地址为所述代理服务器的IP地址,所述第一ping响应报文的DIP地址为所述代理网关的IP地址,所述第一ping响应报文的净荷包括所述第三ping响应报文的净荷和所述目的服务器的IP地址;所述发送模块还用于发送所述第一ping响应报文。
结合第四方面,在第四方面的某些实现方式中,所述第二ping请求报文的净荷还包括所述代理网关的认证信息,所述第一ping响应报文的净荷还包括所述代理网关的认证信息。
结合第四方面,在第四方面的某些实现方式中,所述代理网关的认证信息包括所述代理网关的魔数。
结合第四方面,在第四方面的某些实现方式中,所述魔数为所述代理网关与所述代理服务器协商确定的。
第四方面和第四方面的任意一个可能的实现方式的有益效果和第二方面以及第二方 面的任意一个可能的实现方式的有益效果是对应的,对此,不再赘述。
第五方面,提供了一种代理网关,所述代理网关具有实现上述第三方面的装置的功能。所述功能可以基于硬件实现,也可以基于硬件执行相应的软件实现,所述硬件或软件包括一个或多个与上述功能相对应的模块。
在一个可能的设计中,代理网关的结构中包括处理器,所述处理器被配置为支持代理网关执行上述方法中相应的功能。
所述代理网关还可以包括存储器,所述存储器用于与处理器耦合,其保存代理网关必要的程序指令和数据。
第六方面,提供了一种代理服务器,所述代理服务器具有实现上述第四方面的装置的功能。所述功能可以基于硬件实现,也可以基于硬件执行相应的软件实现,所述硬件或软件包括一个或多个与上述功能相对应的模块。
在一个可能的设计中,代理服务器的结构中包括处理器,所述处理器被配置为支持代理服务器执行上述方法中相应的功能。
所述代理服务器还可以包括存储器,所述存储器用于与处理器耦合,其保存代理服务器必要的程序指令和数据。
在另一种可能的设计中,代理服务器的结构中包括网卡驱动模块和用户空间模块,用于执行上述第二方面或第二方面的任意一项可能的实现方式。
第七方面,提供了一种计算机程序产品,该计算机程序产品包括:计算机程序代码,当该计算机程序代码在计算机上运行时,使得计算机执行上述第一方面或第一方面的任一种可能执行的方法,或者使得计算机执行上述第二方面或第二方面的任一种可能执行的方法。
第八方面,提供了一种计算机可读介质,该计算机可读介质存储有程序代码,当该计算机程序代码在计算机上运行时,使得计算机执行上述第一方面或第一方面的任一种可能执行的方法,或者使得计算机执行上述第二方面或第二方面的任一种可能执行的方法。这些计算机可读存储包括但不限于如下的一个或者多个:只读存储器(read-only memory,ROM)、可编程ROM(programmable ROM,PROM)、可擦除的PROM(erasable PROM,EPROM)、Flash存储器、电EPROM(electrically EPROM,EEPROM)以及硬盘驱动器(harddrive)。
第九方面,提供一种芯片,该芯片包括处理器与数据接口,其中,处理器通过该数据接口读取存储器上存储的指令,以执行第一方面或第一方面任意一种可能的实现方式中的方法,或者执行上述第二方面或第二方面的任一种可能的实现方式中的方法。在具体实现过程中,该芯片可以以中央处理器(centralprocessingunit,CPU)、微控制器(microcontroller unit,MCU)、微处理器(micro processing unit,MPU)、数字信号处理器(digital signal processing,DSP)、片上系统(system on chip,SoC)、专用集成电路(application-specific integrated circuit,ASIC)、现场可编程门阵列(field programmable gate array,FPGA)或可编辑逻辑器件(programmable logic device,PLD)的形式实现。
第十方面,提供了一种处理ping报文的系统,该系统包括上述如第三方面或第三方面任意一种可能的实现方式以及第四方面或第四方面任意一种可能的实现方式中的处理ping报文的装置。
附图说明
图1是适用于本申请实施例的应用场景示意图。
图2是本申请实施例提供的一种处理ping报文的方法的示意性流程图。
图3是本申请实施例提供的一种处理ping报文的方法的一个实施例的示意性流程图。
图4是本申请实施例提供的一种处理ping报文的方法的另一个实施例的示意性流程图。
图5是本申请实施例提供的一种处理ping报文的装置的示意性流程图。
图6是本申请实施例提供的一种处理ping报文的装置的示意性流程图。
图7是本申请实施例提供的一种处理ping报文的装置的示意性流程图。
具体实施方式
下面将结合附图,对本申请中的技术方案进行描述。
本申请的实施方式部分使用的术语仅用于对本申请的具体实施例进行解释,而非旨在限定本申请。
本申请中术语“第一”“第二”“第三”等字样用于对作用和功能基本相同的相同项或相似项进行区分,“第一”、“第二”和“第三”之间不具有逻辑或时序上的依赖关系,也不对数量和执行顺序进行限定。
本申请将围绕可包括多个设备、组件、模块等的系统来呈现各个方面、实施例或特征。应当理解和明白的是,各个系统可以包括另外的设备、组件、模块等,并且/或者可以并不包括结合附图讨论的所有设备、组件、模块等。此外,还可以使用这些方案的组合。
另外,在本申请实施例中,“示例的”、“例如”等词用于表示作例子、例证或说明。本申请中被描述为“示例”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用示例的一词旨在以具体方式呈现概念。
本申请实施例描述的网络架构以及业务场景是为了更加清楚的说明本申请实施例的技术方案,并不构成对于本申请实施例提供的技术方案的限定,本领域普通技术人员可知,随着网络架构的演变和新业务场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。
在本说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。
本申请中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项(个)”或其类似表 达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b,或c中的至少一项(个),可以表示:a,b,c,a-b,a-c,b-c,或a-b-c,其中a,b,c可以是单个,也可以是多个。
本申请实施例中,“相应的(corresponding,relevant)”和“对应的(corresponding)”有时可以混用,应当指出的是,在不强调其区别时,其所要表达的含义是一致的。
下面结合图1,对适用于本申请实施例的场景进行详细描述。
图1是适用于本申请实施例的应用场景100的示意图。如图1所述,应用场景100中包括终端设备101、代理网关102、代理服务器103和目的服务器104。终端设备与目的服务器之间可以通过代理网关和代理服务器进行报文的交互。例如,代理网关和代理服务器将终端设备发送的请求报文转发至目的服务器,然后将目的服务器发送的响应报文转发至终端设备。其中,代理网关可以为终端设备中的一个软件模块,或者也可以为独立于终端设备的装置,本申请对此不作限定。应理解,当代理网关为终端设备中的一个软件模块时,代理网关与终端设备之间的报文交互为终端设备中的不同软件模块之间的报文传递。
应理解,代理服务器(proxy server)用于代理网络用户去取得网络信息。可以形象的将代理服务器理解为网络信息的中转站,是个人网络和互联网服务商之间的中间代理机构,负责转发合法的网络信息,对转发进行控制和登记。代理服务器作为一种既是服务器又是客户机的中间程序,主要用于转发客户系统的网络访问请求。但是,代理服务器不只是简单地向真正的因特网服务器转发请求,它还可以控制用户的行为,对接收到的客户请求进行决策,并根据过滤规则对用户的请求进行过滤。
通过代理服务器,网络管理员可以实现比用包过滤路由器更严格的安全策略,不同于使用通用的包过滤路由器来管理通过防火墙的因特网服务流向,代理服务器通过在代理网关上为每项需要的应用安装专用的代码(代理服务)来工作。如果网络管理员没有为某一特殊服务安装代理服务代码,该服务就不会被支持,也不会通过防火墙转发相应的客户请求。并且,这种代理服务代码能被配置称仅支持某项服务的网络管理员认为可以接受的那部分特征,而不支持其他特征。
本申请实施例中的终端设备可以指用户设备、接入终端、用户单元、用户站、移动站、移动台、远方站、远程终端、移动设备、用户终端、终端、无线通信设备、用户代理或用户装置。终端设备还可以是蜂窝电话、无绳电话、会话启动协议(Session Initiation Protocol,SIP)电话、无线本地环路(Wireless Local Loop,WLL)站、个人数字处理(Personal Digital Assistant,PDA)、具有无线通信功能的手持设备、计算设备或连接到无线调制解调器的其它处理设备、车载设备、可穿戴设备,第五代(5th Generation,5G)网络中的终端设备或者未来演进的公用陆地移动通信网络(Public Land Mobile Network,PLMN)中的终端设备等,本申请实施例对此并不限定。
为了便于更好地理解本申请技术方案,下面将对本申请技术方案涉及相关技术进行介绍。
1、网络诊断工具(packet internet groper,ping):是一种计算机网络工具,用来确定本地主机是否能与另一台主机成功交换(发送与接收)数据包,再根据返回的信息,就可以推断传输控制协议/互联协议(transmission control protocol/internet protocol,TCP/IP)参数是否设置正确,以及运行是否正常、网络是否通畅。其中,交换的数据包可以称为ping 报文,而ping报文又可以包括请求报文(ping request报文)和响应报文(ping reply报文)。即根据ping报文的传输时间和成功响应的次数,可以估算出丢失数据包率(丢包率)和数据包往返时间。
2、互联网控制报文协议(internet control message protocol,ICMP)、用户数据报协议(user datagram protocol,UDP)、TCP等:均是TCP/IP协议簇的子协议,其中,ICMP用来传递控制消息,不用来传输用户数据,而TCP和UDP是用来传输用户数据的。
3、ICMP报文:包括两种类型的报文,为ICMP差错报告报文和ICMP询问报文。ping报文属于ICMP询问报文中的一种,可以用来测量信息经过某个服务器的时延和丢包率。
4、压栈:也可以称为进栈或入栈,是指将新元素插入一个栈。而栈(stack)又名堆栈,是一种运算受限的线性表,限定仅在表尾进行插入和删除操作的线性表,表尾被称为栈顶,相对地,另一端称为栈低。压栈就是把新元素放到栈顶元素的上面,使之成为新的栈顶元素。此外,从一个栈删除元素又称作出栈或退栈,是把栈顶元素删除掉,使其相邻的元素称为新的栈顶元素。
5、NAT转换表:网络地址转换协议(network address translation,NAT)表,可以理解为服务器在对报文进行处理、转发时,将会在NAT转换表中记录报文的处理、转发过程,用于后续相关报文的处理。或者还可以理解,NAT转换表主要用于完成数据报文从一个网络到另一个网络时,报文的IP地址和端口号映射到另外的IP地址和端口号。
本申请提出了一种代理服务器处理ping报文的方法,使得用户在通过代理服务器上网时,也能够通过ping报文来测量信息经过代理服务器的时延和丢包率。
图2示出了本申请提出的一种处理ping报文的方法的示意性流程图,该方法200包括:
S201,代理网关获取第一ping请求报文,第一ping请求报文的源因特网协议(sourceinternet protocol,SIP)地址为终端设备的IP地址,目的因特网协议(destinationinternet protocol,DIP)地址为目的服务器的IP地址。
具体地,在本申请实施例中,当代理网关独立于终端设备时,代理网关获取第一ping请求报文的方式为:终端设备向代理网关发送第一ping请求报文,从而代理网关接收该第一ping请求报文。可选的,当代理网关为终端设备中的一个软件模块时,代理网关获取第一ping请求报文的方式为:代理网关从终端设备的其他软件模块获取第一ping请求报文。
应理解,当代理网关为终端设备中的一个软件模块时,代理网关的IP地址与终端设备的IP地址相同。
S202,代理网关根据第一ping请求报文,生成第二ping请求报文,第二ping请求报文的SIP地址为代理网关的IP地址,DIP地址为代理服务器的IP地址,净荷(payload)包括第一ping请求报文的净荷和目的服务器的IP地址。
具体地,在本申请实施例中,代理网关根据第一ping请求报文,生成第二ping请求报文时,会将目的服务器的IP地址压栈到第一ping请求报文净荷中,从而使得生成的第二ping报文的净荷包括第一ping请求报文的净荷和目的服务器的IP地址。
可选的,第二ping请求报文还可以包括代理网关的认证信息。代理网关的认证信息可以是魔数(magic num)。
S203,代理网关向代理服务器发送第二ping请求报文,相应的,代理服务器接收第二ping请求报文。
S204,代理服务器确定数据库中包括代理网关的IP地址后,根据第二ping请求报文,生成第三ping请求报文,第三ping请求报文的SIP地址为代理服务器的IP地址,DIP地址为目的服务器的IP地址。
具体地,在本申请实施例中,代理服务器可以根据第二ping请求报文中的代理网关的IP地址,在代理服务器的数据库中进行查询或匹配,在确定代理服务器的数据库中包括代理网关的IP地址后,根据第二ping请求报文,生成上述第三ping请求报文。此外,代理服务器在生成第三ping请求报文时,可以将第二ping请求报文的净荷中的目的服务器的IP地址确定为第三ping请求报文DIP地址。
可选的,第三ping请求报文的净荷包括代理网关的认证信息和代理网关的IP地址。
一种可能的实现方式中,代理服务器可以同时在数据库中查询或匹配代理网关的认证信息和代理网关的IP地址,在确定数据库中同时包括代理网关的认证信息和代理网关的IP地址后,根据第二ping请求报文,生成上述第三ping请求报文。
可选的,数据库为代理服务器的数据库A。应理解,在代理网关注册到代理服务器时,代理服务器可以将代理网关的认证信息和代理网关的IP地址记录到代理服务器的数据库A中。
可选的,代理网关的认证信息可以是通过与代理服务器协商后,确定的魔数(magic num)。例如,在代理网关注册到代理服务器时,与代理服务器进行协商,确定了魔数。
另一种可能的实现方式中,代理服务器也可以同时在数据库中查询或匹配第二ping请求报文的元数据以及代理网关的IP地址,在确定数据库中包括第二ping请求报文的元数据以及代理网关的IP地址后,根据第二ping请求报文,生成上述第三ping请求报文。
应理解,上述第二ping请求报文的元数据可以为终端设备的标识信息,该终端设备的标识信息包括于ping报文中,例如,第一ping请求报文至第三ping请求报文以及第一ping响应报文至第三ping响应报文的净荷中均包括该终端设备的标识信息。可选的,终端设备的标识信息可以称为用户标识。
S205,代理服务器向目的服务器发送第三ping请求报文,相应的,目的服务器接收该第三ping请求报文。
S206,目的服务器根据第三ping请求报文,生成第三ping响应报文,第三ping响应报文的SIP地址为目的服务器的IP地址,DIP地址为代理服务器的IP地址,净荷与第三ping请求报文的净荷相同。
可选的,当第三ping请求报文的净荷包括代理网关的认证信息和代理网关的IP地址时,第三ping响应报文的净荷也包括代理网关的认证信息和代理网关的IP地址。
S207,目的服务器向代理服务器发送第三ping响应报文,相应的,代理服务器接收第三ping响应报文。
S208,代理服务器根据第三ping响应报文,生成第一ping响应报文,第一ping响应报文的SIP地址为代理服务器的IP地址,DIP地址为代理网关的IP地址,净荷包括第三ping响应报文的净荷和目的服务器的IP地址。
可选的,在本申请实施例中,在代理服务器根据第三ping响应报文,生成第一ping 响应报文之前,代理服务器可以查询代理网关的认证信息,或者也可以查询NAT转换表,来确定是否可以转发该ping报文。
应理解,代理服务器查询代理网关的认证信息可以是,代理服务器在数据库中查询代理网关的认证信息,例如,当第三ping响应报文的净荷包括代理网关的认证信息和代理网关的IP地址时,代理服务器查询数据库中是否包括代理网关的认证信息。
还应理解,代理服务器查询NAT转换表可以是,代理服务器根据第三ping响应报文的SIP地址和DIP地址,确定NAT转换表中包括该SIP地址和DIP地址的转换信息。
可选的,第一ping响应报文还可以包括代理网关的认证信息。代理网关的认证信息可以是魔数(magic num)。
S209,代理服务器向代理网关发送第一ping响应报文,相应的,代理网关接收该第一ping响应报文。
应理解,第一ping响应报文的净荷与第二ping请求报文的净荷相同。
S210,代理网关根据第一ping响应报文,生成第二ping响应报文,第二ping响应报文的SIP地址为目的服务器的IP地址,DIP地址为终端设备的IP地址。
具体地,在本申请实施例中,当代理网关独立于终端设备时,可以向终端设备发送第二ping响应报文。当代理网关为终端设备中的软件模块时,可以向终端设备中相应的软件模块传递第二ping响应报文。本申请对此不作限定。
因此,通过上述代理服务器对ping报文进行转发,从而能够通过ping报文来测量信息经过代理服务器的时延和丢包率。
可选的,在本申请实施例中,代理服务器可以为替换为网络服务提供(point of presence,POP)点,POP点可以称为入网点。
应理解,在本申请的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
以下,结合图3至图4,示例性地,以代理网关独立于终端设备为例,对本申请实施例提出的一种处理ping报文的方法进行具体介绍。
需要说明的是,下述图3至图4中的方法300-400中的部分步骤与上述方法200相同,此处不再赘述。
图3是本申请实施例提供的一种处理ping报文的方法的一个实施例的示意性流程图。该方法300包括:
S301,终端设备生成第一ping请求报文,第一ping请求报文的SIP地址为终端设备的IP地址,DIP地址为目的服务器的IP地址。
具体地,在本申请实施例中,上述步骤S301可以称为终端设备向目的服务器发起ping操作。
S302,终端设备向代理网关发送第一ping请求报文,相应的,代理网关接收第一ping请求报文。
S303,代理网关根据第一ping请求报文,生成第二ping请求报文,第二ping请求报文的SIP地址为代理网关的IP地址,DIP地址为代理服务器的IP地址,净荷(payload)包括第一ping请求报文的净荷和目的服务器的IP地址。
关于步骤S303的详细描述可参考上述方法200中的S202,此处不再赘述。
S304,代理网关向代理服务器发送第二ping请求报文,相应的,代理服务器接收第二ping请求报文。
S305,代理服务器确定数据库中包括代理网关的IP地址后,根据第二ping请求报文,生成第三ping请求报文,第三ping请求报文的SIP地址为代理服务器的IP地址,DIP地址为目的服务器的IP地址;并将第二ping请求报文转换为第三ping请求报文的过程记录至NAT转换表中。
关于步骤S305的详细描述可参考上述方法200中的S204,此处不再赘述。
S306,代理服务器向目的服务器发送第三ping请求报文,相应的,目的服务器接收该第三ping请求报文。
S307,目的服务器根据第三ping请求报文,生成第三ping响应报文,第三ping响应报文的SIP地址为目的服务器的IP地址,DIP地址为代理服务器的IP地址,净荷与第三ping请求报文的净荷相同。
S308,目的服务器向代理服务器发送第三ping响应报文,相应的,代理服务器接收第三ping响应报文。
S309,代理服务器查询NAT转换表,确定NAT转换表中包括ping报文的转换信息后,根据第三ping响应报文,生成第一ping响应报文,第一ping响应报文的SIP地址为代理服务器的IP地址,DIP地址为代理网关的IP地址,净荷包括第三ping响应报文的净荷和目的服务器的IP地址。
关于步骤S309的更详细描述可参考上述方法200中的S208,此处不再赘述。
S310,代理服务器向代理网关发送第一ping响应报文,相应的,代理网关接收该第一ping响应报文。
关于步骤S310的更详细描述可参考上述方法200中的S209,此处不再赘述。
S311,当第一ping响应报文的SIP地址为代理服务器的IP地址时,代理网关根据第一ping响应报文,生成第二ping响应报文,第二ping响应报文的SIP地址为目的服务器的IP地址,DIP地址为终端设备的IP地址。
S312,代理网关向终端设备发送第二ping响应报文,相应的,终端设备接收第二ping响应报文。
图4是本申请实施例提供的一种处理ping报文的方法的另一个实施例的示意性流程图。该方法400包括:
S401,终端设备生成第一ping请求报文,第一ping请求报文的SIP地址为终端设备的IP地址,DIP地址为目的服务器的IP地址。
具体地,在本申请实施例中,上述步骤S401可以称为终端设备向目的服务器发起ping操作。
S402,终端设备向代理网关发送第一ping请求报文,相应的,代理网关接收第一ping请求报文。
S403,代理网关根据第一ping请求报文,生成第二ping请求报文,第二ping请求报文的SIP地址为代理网关的IP地址,DIP地址为代理服务器的IP地址,净荷(payload)包括第一ping请求报文的净荷和目的服务器的IP地址。
关于步骤S403的详细描述可参考上述方法200中的S202,此处不再赘述。
S404,代理网关向代理服务器发送第二ping请求报文,相应的,代理服务器接收第二ping请求报文。
S405,代理服务器确定数据库中包括代理网关的IP地址后,根据第二ping请求报文,生成第三ping请求报文,第三ping请求报文的SIP地址为代理服务器的IP地址,DIP地址为目的服务器的IP地址;并将代理网关的认证信息和代理网关的IP地址压栈到第三ping请求报文的净荷中。
关于步骤S405的更详细描述可参考上述方法200中的S204,此处不再赘述。
S406,代理服务器向目的服务器发送第三ping请求报文,相应的,目的服务器接收该第三ping请求报文。
S407,目的服务器根据第三ping请求报文,生成第三ping响应报文,第三ping响应报文的SIP地址为目的服务器的IP地址,DIP地址为代理服务器的IP地址,净荷与第三ping请求报文的净荷相同。
S408,目的服务器向代理服务器发送第三ping响应报文,相应的,代理服务器接收第三ping响应报文。
S409,代理服务器查询数据库中是否包括代理网关的认证信息,查询到后,根据第三ping响应报文,生成第一ping响应报文,第一ping响应报文的SIP地址为代理服务器的IP地址,DIP地址为代理网关的IP地址,净荷包括第三ping响应报文的净荷和目的服务器的IP地址。
关于步骤S409的更详细描述可参考上述方法200中的S208,此处不再赘述。
S410,代理服务器向代理网关发送第一ping响应报文,相应的,代理网关接收该第一ping响应报文。
关于步骤S410的更详细描述可参考上述方法200中的S209,此处不再赘述。
S411,当第一ping响应报文的SIP地址为代理服务器的IP地址时,代理网关根据第一ping响应报文,生成第二ping响应报文,第二ping响应报文的SIP地址为目的服务器的IP地址,DIP地址为终端设备的IP地址。
S412,代理网关向终端设备发送第二ping响应报文,相应的,终端设备接收第二ping响应报文。
上文结合图1至图4,详细介绍了本申请实施例提供的处理ping报文的方法,下面将结合图5至图7,详细描述本申请的装置的实施例。应理解,方法实施例的描述与装置实施例的描述相互对应,因此,未详细描述的部分可以参见前面方法实施例。
图5是本申请实施例提供的一种处理ping报文的装置500的示意性结构图。该装置可以为代理网关,也可以为应用于代理网关的芯片或组件。可选的,该装置可以设置于终端设备,即代理网关可以设置于终端设备。图5所示的装置500可以执行上述实施例中代理网关执行的,处理ping报文的方法的相应步骤。如图5所示,装置500包括:接收模块510,处理模块520,发送模块530。
其中,在一种可能的实现方式中,所述接收模块用于获取第一ping请求报文,所述第一ping请求报文的源因特网协议地址SIP地址为终端设备的IP地址,所述第一ping请求报文的目的因特网协议地址DIP地址为目的服务器的IP地址;所述处理模块用于根据 所述第一ping请求报文,生成第二ping请求报文,所述第二ping请求报文的SIP地址为代理网关的IP地址,所述第二ping请求报文的DIP地址为代理服务器的IP地址,所述第二ping请求报文的净荷包括所述第一ping请求报文的净荷和所述目的服务器的IP地址;所述发送模块用于向所述代理服务器发送所述第二ping请求报文。
关于该装置所执行功能的更详细的描述,可参考上述方法实施例中的相应介绍,此处不再赘述。
图6是本申请实施例提供的一种处理ping报文的装置600的示意性结构图。该装置可以为代理服务器,也可以为应用于代理服务器的芯片或组件。图6所示的装置600可以执行上述实施例中代理服务器执行的,处理ping报文的方法的相应步骤。如图6所示,装置600包括:接收模块610,处理模块620,发送模块630。
其中,在一种可能的实现方式中,所述接收模块用于接收第二ping请求报文,所述第二ping请求报文的SIP地址为代理网关的IP地址,所述第二ping请求报文的DIP地址为所述代理服务器的IP地址,所述第二ping请求报文的净荷包括目的服务器的IP地址;所述处理模块用于确定所述代理服务器的数据库中包括所述代理网关的IP地址后,根据所述第二ping请求报文,生成第三ping请求报文,所述第三ping请求报文的SIP地址为所述代理服务器的IP地址,所述第三ping请求报文的DIP地址为所述目的服务器的IP地址;所述发送模块用于向所述目的服务器发送所述第三ping请求报文。
图7示出了本申请实施例的一种处理ping报文的装置的结构示意图,该设备可以为终端设备或代理网关或代理服务器或目的服务器,包括至少一个处理器702(例如CPU),至少一个网络接口705或者其他通信接口,和存储器706。这些部件之间的通信连接。处理器702用于执行存储器706中存储的可执行模块,例如计算机程序。存储器706可能包含高速随机存取存储器(random access memory,RAM),也可能还包括非不稳定的存储器(non-volatile memory),例如至少一个磁盘存储器。通过至少一个网络接口705(可以是有线或者无线)实现与至少一个其他网元之间的通信连接。
在一些实施方式中,存储器706存储了程序7061,处理器702执行程序7061,用于执行前述本申请各种实施例中的方法。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。
关于该装置所执行功能的更详细的描述,可参考上述方法实施例中的相应介绍,此处 不再赘述。
本申请实施例还提供了一种计算机可读介质,该计算机可读介质存储有程序代码,当该计算机程序代码在计算机上运行时,使得计算机执行上述方法实施例中的相应方法。这些计算机可读存储包括但不限于如下的一个或者多个:只读存储器(read-only memory,ROM)、可编程ROM(programmable ROM,PROM)、可擦除的PROM(erasable PROM,EPROM)、Flash存储器、电EPROM(electrically EPROM,EEPROM)以及硬盘驱动器(harddrive)。
本申请实施例还提供了一种芯片,应用于终端设备、代理网关、代理服务器或目的服务器中,该芯片包括:至少一个处理器、至少一个存储器和接口电路,所述接口电路负责所述芯片与外界的信息交互,所述至少一个存储器、所述接口电路和所述至少一个处理器通过线路互联,所述至少一个存储器中存储有指令;所述指令被所述至少一个处理器执行,以进行上述各个方面的所述的方法中相应的操作。在具体实现过程中,该芯片可以以中央处理器(centralprocessingunit,CPU)、微控制器(microcontroller unit,MCU)、微处理器(micro processing unit,MPU)、数字信号处理器(digital signal processing,DSP)、片上系统(system on chip,SoC)、专用集成电路(application-specific integrated circuit,ASIC)、现场可编程门阵列(field programmable gate array,FPGA)或可编辑逻辑器件(programmable logic device,PLD)的形式实现。
本申请实施例还提供了一种计算机程序产品,所述计算机程序产品包括一系列指令,当所述指令被运行时,以进行上述各个方面的所述的方法中相应的操作。
本申请实施例还提供了一种处理ping报文的系统,包括:上述代理网关和代理服务器。可选的,该系统还可以包括终端设备或目的服务器。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (23)

  1. 一种处理ping报文的方法,其特征在于,包括:
    获取第一ping请求报文,所述第一ping请求报文的源因特网协议地址SIP地址为终端设备的IP地址,所述第一ping请求报文的目的因特网协议地址DIP地址为目的服务器的IP地址;
    根据所述第一ping请求报文,生成第二ping请求报文,所述第二ping请求报文的SIP地址为代理网关的IP地址,所述第二ping请求报文的DIP地址为代理服务器的IP地址,所述第二ping请求报文的净荷包括所述第一ping请求报文的净荷和所述目的服务器的IP地址;
    向所述代理服务器发送所述第二ping请求报文。
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    接收所述代理服务器发送的第一ping响应报文,所述第一ping响应报文的SIP地址为所述代理服务器的IP地址,所述第一ping响应报文的DIP地址为所述代理网关的IP地址,所述第一ping响应报文的净荷与所述第二ping请求报文的净荷相同;
    根据所述第一ping响应报文,生成第二ping响应报文,所述第二ping响应报文的SIP地址为所述目的服务器的IP地址,所述第二ping响应报文的DIP地址为所述终端设备的IP地址。
  3. 根据权利要求1或2所述的方法,其特征在于,所述第二ping请求报文的净荷还包括所述代理网关的认证信息。
  4. 根据权利要求1-3任一项所述的方法,其特征在于,所述代理网关的认证信息包括所述代理网关的魔数。
  5. 根据权利要求4所述的方法,其特征在于,所述魔数为所述代理网关与所述代理服务器协商确定的。
  6. 一种处理ping报文的方法,其特征在于,包括:
    代理服务器接收第二ping请求报文,所述第二ping请求报文的SIP地址为代理网关的IP地址,所述第二ping请求报文的DIP地址为所述代理服务器的IP地址,所述第二ping请求报文的净荷包括目的服务器的IP地址;
    所述代理服务器确定所述代理服务器的数据库中包括所述代理网关的IP地址后,根据所述第二ping请求报文,生成第三ping请求报文,所述第三ping请求报文的SIP地址为所述代理服务器的IP地址,所述第三ping请求报文的DIP地址为所述目的服务器的IP地址;
    所述代理服务器向所述目的服务器发送所述第三ping请求报文。
  7. 根据权利要求6所述的方法,其特征在于,所述方法还包括:
    所述代理服务器接收第三ping响应报文,所述第三ping响应报文的SIP地址为所述目的服务器的IP地址,DIP地址为所述代理服务器的IP地址,所述第三ping响应报文的净荷与所述第三ping请求报文的净荷相同;
    所述代理服务器根据所述第三ping响应报文,生成第一ping响应报文,所述第一ping 响应报文的SIP地址为所述代理服务器的IP地址,所述第一ping响应报文的DIP地址为所述代理网关的IP地址,所述第一ping响应报文的净荷包括所述第三ping响应报文的净荷和所述目的服务器的IP地址;
    所述代理服务器发送所述第一ping响应报文。
  8. 根据权利要求6或7所述的方法,其特征在于,所述第二ping请求报文的净荷还包括所述代理网关的认证信息,所述第一ping响应报文的净荷还包括所述代理网关的认证信息。
  9. 根据权利要求6-8任一项所述的方法,其特征在于,所述代理网关的认证信息包括所述代理网关的魔数。
  10. 根据权利要求9所述的方法,其特征在于,所述魔数为所述代理网关与所述代理服务器协商确定的。
  11. 一种处理ping报文的装置,其特征在于,包括:
    接收模块,用于获取第一ping请求报文,所述第一ping请求报文的源因特网协议地址SIP地址为终端设备的IP地址,所述第一ping请求报文的目的因特网协议地址DIP地址为目的服务器的IP地址;
    处理模块:用于根据所述第一ping请求报文,生成第二ping请求报文,所述第二ping请求报文的SIP地址为代理网关的IP地址,所述第二ping请求报文的DIP地址为代理服务器的IP地址,所述第二ping请求报文的净荷包括所述第一ping请求报文的净荷和所述目的服务器的IP地址;
    发送模块,用于向所述代理服务器发送所述第二ping请求报文。
  12. 根据权利要求11所述的装置,其特征在于,所述接收模块还用于接收所述代理服务器发送的第一ping响应报文,所述第一ping响应报文的SIP地址为所述代理服务器的IP地址,所述第一ping响应报文的DIP地址为所述代理网关的IP地址,所述第一ping响应报文的净荷与所述第二ping请求报文的净荷相同;
    所述处理模块还用于根据所述第一ping响应报文,生成第二ping响应报文,所述第二ping响应报文的SIP地址为所述目的服务器的IP地址,所述第二ping响应报文的DIP地址为所述终端设备的IP地址。
  13. 根据权利要求11或12所述的装置,其特征在于,所述第二ping请求报文的净荷还包括所述代理网关的认证信息。
  14. 根据权利要求11-13任一项所述的装置,其特征在于,所述代理网关的认证信息包括所述代理网关的魔数。
  15. 根据权利要求14所述的装置,其特征在于,所述魔数为所述代理网关与所述代理服务器协商确定的。
  16. 一种处理ping报文的装置,其特征在于,包括:
    接收模块,用于接收第二ping请求报文,所述第二ping请求报文的SIP地址为代理网关的IP地址,所述第二ping请求报文的DIP地址为所述代理服务器的IP地址,所述第二ping请求报文的净荷包括目的服务器的IP地址;
    处理模块,用于确定所述代理服务器的数据库中包括所述代理网关的IP地址后,根据所述第二ping请求报文,生成第三ping请求报文,所述第三ping请求报文的SIP地址 为所述代理服务器的IP地址,所述第三ping请求报文的DIP地址为所述目的服务器的IP地址;
    发送模块,用于向所述目的服务器发送所述第三ping请求报文。
  17. 根据权利要求16所述的装置,其特征在于,所述接收模块还用于接收第三ping响应报文,所述第三ping响应报文的SIP地址为所述目的服务器的IP地址,DIP地址为所述代理服务器的IP地址,所述第三ping响应报文的净荷与所述第三ping请求报文的净荷相同;
    所述处理模块还用于根据所述第三ping响应报文,生成第一ping响应报文,所述第一ping响应报文的SIP地址为所述代理服务器的IP地址,所述第一ping响应报文的DIP地址为所述代理网关的IP地址,所述第一ping响应报文的净荷包括所述第三ping响应报文的净荷和所述目的服务器的IP地址;
    所述发送模块还用于发送所述第一ping响应报文。
  18. 根据权利要求16或17所述的装置,其特征在于,所述第二ping请求报文的净荷还包括所述代理网关的认证信息,所述第一ping响应报文的净荷还包括所述代理网关的认证信息。
  19. 根据权利要求16-18任一项所述的装置,其特征在于,所述代理网关的认证信息包括所述代理网关的魔数。
  20. 根据权利要求19所述的装置,其特征在于,所述魔数为所述代理网关与所述代理服务器协商确定的。
  21. 一种代理网关,其特征在于,包括:处理器和存储器,所述存储器用于存储程序或代码,所述处理器用于从存储器中调用并运行所述程序以执行权利要求1-5任一项所述的方法。
  22. 一种代理服务器,其特征在于,包括:处理器和存储器,所述存储器用于存储程序或代码,所述处理器用于从存储器中调用并运行所述程序以执行权利要求6-10任一项所述的方法。
  23. 一种处理ping报文的系统,其特征在于,包括如权利要求11-20任一项所述的装置。
PCT/CN2022/111259 2021-08-10 2022-08-09 一种处理ping报文的方法、装置和系统 WO2023016470A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110911902.0A CN115941547A (zh) 2021-08-10 2021-08-10 一种处理ping报文的方法、装置和系统
CN202110911902.0 2021-08-10

Publications (1)

Publication Number Publication Date
WO2023016470A1 true WO2023016470A1 (zh) 2023-02-16

Family

ID=85199883

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/111259 WO2023016470A1 (zh) 2021-08-10 2022-08-09 一种处理ping报文的方法、装置和系统

Country Status (2)

Country Link
CN (1) CN115941547A (zh)
WO (1) WO2023016470A1 (zh)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1866880A (zh) * 2005-08-05 2006-11-22 华为技术有限公司 下一代网络中的故障检测方法
CN105471596A (zh) * 2014-08-04 2016-04-06 杭州华三通信技术有限公司 网络管理的方法和装置
CN106060134A (zh) * 2016-05-30 2016-10-26 乐视控股(北京)有限公司 数据传输方法及系统
US20170366437A1 (en) * 2016-06-21 2017-12-21 Juniper Networks, Inc. Extended ping protocol for determining status for remote interfaces without requiring network reachability
CN109803030A (zh) * 2018-12-20 2019-05-24 深圳市任子行科技开发有限公司 一种匿名中间代理服务器及其通信方法
US20190306111A1 (en) * 2018-03-29 2019-10-03 Akamai Technologies, Inc. High precision mapping with intermediary dns filtering

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1866880A (zh) * 2005-08-05 2006-11-22 华为技术有限公司 下一代网络中的故障检测方法
CN105471596A (zh) * 2014-08-04 2016-04-06 杭州华三通信技术有限公司 网络管理的方法和装置
CN106060134A (zh) * 2016-05-30 2016-10-26 乐视控股(北京)有限公司 数据传输方法及系统
US20170366437A1 (en) * 2016-06-21 2017-12-21 Juniper Networks, Inc. Extended ping protocol for determining status for remote interfaces without requiring network reachability
US20190306111A1 (en) * 2018-03-29 2019-10-03 Akamai Technologies, Inc. High precision mapping with intermediary dns filtering
CN109803030A (zh) * 2018-12-20 2019-05-24 深圳市任子行科技开发有限公司 一种匿名中间代理服务器及其通信方法

Also Published As

Publication number Publication date
CN115941547A (zh) 2023-04-07

Similar Documents

Publication Publication Date Title
US9054952B2 (en) Automated passive discovery of applications
US8576847B2 (en) Mechanisms for discovering path maximum transmission unit
CN109889618B (zh) 用于处理dns请求的方法和系统
US8650326B2 (en) Smart client routing
US20140149580A1 (en) Techniques for accounting for multiple transactions in a transport control protocol (tcp) payload
KR20040107424A (ko) 네트워크 토폴로지의 결정을 위한 장치 및 방법
CN102148767A (zh) 一种基于nat的数据路由方法及其装置
WO2019227891A1 (zh) 一种实现节点间通讯的方法、装置及电子设备
US11888653B2 (en) Managing network packet flows based on device information
CN107124483A (zh) 域名解析方法及服务器
US9473402B2 (en) Methods and systems for receiving and transmitting internet protocol (IP) data packets
JP2017208797A (ja) 不均一ネットワークにまたがる統合されたデータ・ネットワーキング
CN108737413B (zh) 传输层的数据处理方法、装置及计算机可读存储介质
US20120246274A1 (en) Method and computer program product utilizing multiple udp data packets to transfer a quantity of data otherwise in excess of a single udp packet
WO2023016470A1 (zh) 一种处理ping报文的方法、装置和系统
CN108848202B (zh) 电子装置、数据传输方法及相关产品
CN110519282A (zh) 一种报文处理的方法及装置
CN110289979B (zh) 桥接器及网络的管理方法
WO2022070348A1 (ja) 転送装置、転送方法および転送プログラム
EP3176986A1 (en) Method, device and system for remote desktop protocol gateway to conduct routing and switching
US20120047271A1 (en) Network address translation device and method of passing data packets through the network address translation device
JP2013126219A (ja) 転送サーバおよび転送プログラム
WO2016184079A1 (zh) 一种处理系统日志报文的方法和装置
CN109150726A (zh) 一种报文处理方法和装置
CN110798542A (zh) 一种获取ip地址的方法及系统

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: 22855451

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: 22855451

Country of ref document: EP

Kind code of ref document: A1