CN113098704B - Network topology structure determination method and device and electronic equipment - Google Patents

Network topology structure determination method and device and electronic equipment Download PDF

Info

Publication number
CN113098704B
CN113098704B CN201911342671.5A CN201911342671A CN113098704B CN 113098704 B CN113098704 B CN 113098704B CN 201911342671 A CN201911342671 A CN 201911342671A CN 113098704 B CN113098704 B CN 113098704B
Authority
CN
China
Prior art keywords
optical modem
ttl
user terminal
data packet
determining
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201911342671.5A
Other languages
Chinese (zh)
Other versions
CN113098704A (en
Inventor
彭旦洲
梅建华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile Group Henan Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Group Henan Co Ltd
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 China Mobile Communications Group Co Ltd, China Mobile Group Henan Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201911342671.5A priority Critical patent/CN113098704B/en
Publication of CN113098704A publication Critical patent/CN113098704A/en
Application granted granted Critical
Publication of CN113098704B publication Critical patent/CN113098704B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/12Discovery or management of network topologies
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/20Hop count for routing purposes, e.g. TTL

Landscapes

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

Abstract

The embodiment of the invention discloses a method and a device for determining a network topology structure, wherein the method comprises the following steps: acquiring a first data packet sent to an optical modem by a user terminal and a second data packet sent to network operator equipment by the optical modem; acquiring target data from the first data packet or the second data packet according to the preset data size and/or the preset data generation time requirement; determining a user terminal system identification, an optical modem working mode and a Time To Live (TTL) value from target data; and determining a network topology structure between the user terminal and the optical modem according to the system identification of the user terminal, the working mode of the optical modem and the TTL. The embodiment of the invention can acquire the data packet received and sent by the optical modem, acquire the target data in the data packet, determine the system identification of the user terminal, the working mode of the optical modem and the TTL (time to live) value in the target data, and further remotely deduce the network topology structure between the user terminal and the optical modem.

Description

Network topology structure determination method and device and electronic equipment
Technical Field
The invention relates to the field of home broadband technology networks and quality, in particular to a method and a device for determining a network topology structure and electronic equipment.
Background
At present, with the increase of the number of users and the increase of the kinds of home network services, the quality requirement of home broadband is higher and higher. In the household broadband quality problem, the problems from the household network account for most, and the network operator is difficult to determine the network topology structure of the household network remotely, so that the root cause of the problems is difficult to find out, and effective treatment measures cannot be taken.
In the prior art, a network operator needs to send maintenance personnel to handle faults, determine a network topology structure of a family side by manpower, find out the root of a quality problem, and have long processing time, low efficiency and poor user sense. Therefore, a technical solution is urgently needed to solve the problem of remotely determining the network topology.
Disclosure of Invention
The embodiment of the invention aims to provide a method and a device for determining a network topology structure, electronic equipment and a computer readable storage medium, so as to solve the problem of remotely determining the network topology structure.
In order to solve the above technical problem, the embodiment of the present invention is implemented as follows:
in a first aspect, an embodiment of the present invention provides a method for determining a network topology, including: acquiring a first data packet sent to an optical modem by a user terminal and a second data packet sent to network operator equipment by the optical modem; acquiring target data from the first data packet or the second data packet, wherein the target data meets the preset data volume requirement and/or the preset data generation time requirement; analyzing the target data to obtain a system identifier of the user terminal, a working mode of the optical modem and a Time To Live (TTL) value; and determining a network topology structure between the user terminal and the optical modem according to the system identification of the user terminal, the working mode of the optical modem and the TTL.
In a second aspect, an embodiment of the present invention provides a network topology determining apparatus, including: the data packet acquisition module is used for acquiring a first data packet sent by the user terminal to the optical modem and a second data packet sent by the optical modem to the network operator equipment; the target data acquisition module is used for acquiring target data from the first data packet or the second data packet, and the target data meets the preset data volume requirement and/or the preset data generation time requirement; the data analysis module is used for analyzing and obtaining a system identifier of the user terminal, a working mode of the optical modem and a Time To Live (TTL) value from the target data; and the topology determining module is used for determining a network topology structure between the user terminal and the optical modem according to the system identification of the user terminal, the working mode of the optical modem and the TTL.
In a third aspect, an embodiment of the present invention provides an electronic device, including: a memory, a processor and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the network topology determination method according to the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the network topology determining method according to the first aspect.
According to the technical scheme of the embodiment of the invention, firstly, a first data packet and a second data packet are obtained, wherein the first data packet is a data packet sent to an optical modem from a user terminal, and the second data packet is a data packet sent to network operator equipment from the optical modem; secondly, acquiring target data from the first data packet or the second data packet according to a preset data volume or time requirement; then, according to the target data, determining the system identification of the user terminal, the working mode of the optical modem and the time-to-live value TTL; and finally, determining a network topology structure between the user terminal and the optical modem according to the system identification of the user terminal, the working mode of the optical modem and the TTL. The embodiment of the invention can acquire the data packet received and sent by the optical modem, acquire the target data in the data packet, determine the system identification of the user terminal, the working mode of the optical modem and the time-to-live value (TTL) in the target data, and further remotely deduce the network topology structure between the user terminal and the optical modem.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only some embodiments described in the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic flowchart of a method for determining a network topology according to an embodiment of the present invention;
fig. 2 is a schematic block diagram of a network topology determining apparatus according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solution of the present invention, the technical solution in the embodiment of the present invention will be clearly and completely described below with reference to the drawings in the embodiment of the present invention, and it is obvious that the described embodiment is only a part of the embodiment of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention provides a network topology structure determining method, a network topology structure determining device, electronic equipment and a computer readable storage medium. The network topology structure determination method can be applied to an electronic device side and executed by the electronic device, and the electronic device mentioned in the embodiment of the invention includes but is not limited to electronic devices such as mobile phones, tablet computers, wearable devices, optical modems and the like.
Fig. 1 is a schematic flow chart of a method for determining a network topology according to an embodiment of the present invention. Referring to fig. 1, the method includes step S110, step S120, step S130, and step S140. The network topology determining method in the exemplary embodiment of fig. 1 is explained in detail below.
Referring to fig. 1, in step S110, a first data packet sent by the user terminal to the optical modem and a second data packet sent by the optical modem to the network operator device are obtained.
In an example embodiment, an optical modem, also known as an optical modem, has a local Area network (lan) port and a wide Area network (wan) port. The WAN port is used for external network, the LAN port is used for internal network, for example, the LAN port of the optical modem can be connected with user terminal directly, can also be connected with user terminal through electronic equipment such as the router, etc.; the WAN port of the optical modem may be connected to a network operator device. The router also has a WAN port and a LAN port. The optical modem is connected with the user terminal through the router, specifically, a LAN port of the optical modem is connected with a WAN port of the router, and the LAN port of the router is connected with the user terminal. The user terminal may be a desktop computer, a notebook computer, or a mobile phone, which is not limited in this invention. More than one user terminal may be present in the home broadband network, such as a desktop computer a, a laptop computer B, and a mobile phone C. According to the user terminal identification in the data packet sent by the user terminal, which user terminal the data packet comes from can be distinguished. The network operator device may be an electronic device in a computer room established by the network operator in a different location.
In an exemplary embodiment, the user terminal sends a data packet to the optical modem, which enters the optical modem from its LAN port and exits the optical modem through its WAN port for transmission to the network operator device. The data packet passing through the LAN port of the optical modem is a first data packet, and the data packet passing through the WAN port of the optical modem is a second data packet. A first data packet and a second data packet are obtained in an optical modem. The first data packet and the second data packet may be the same data packet or different data packets from the same ue. One packet contains a plurality of IP packets. The packet head of the IP packet contains the data such as the time to live value TTL, the terminal identification of the IP packet sender, the system identification of the IP packet sender and the like.
In step S120, target data is obtained from the first data packet or the second data packet, and the target data meets a preset data size requirement and/or a preset data generation time requirement.
In an example embodiment, obtaining target data from the first data packet or the second data packet comprises: and acquiring target data from the first data packet or the second data packet in a mirror image copying mode through a soft probe installed in the optical modem.
In an exemplary embodiment, the soft probe is an application installed on the optical modem in the form of software. The optical modem with the soft probe installed can copy and acquire the data packet passing through the optical modem and transmit the data packet to the soft probe front-end processor platform corresponding to the soft probe.
In an exemplary embodiment, the acquired target data is stored in a buffer of the optical modem, and the target data in the buffer is written into a target file in real time, where the target file is used in step S130 and step S140.
In an exemplary embodiment, the preset data size requirement may be 20M or 50M, and may be set in a customized manner, for example, a soft probe in the optical modem starts copying a plurality of IP packets passing through the LAN port of the optical modem, and when the copied data size reaches 20M, the copying is stopped, and the copied IP packets are used as the target data in the first data packet. The preset data generation time requirement may be 20 minutes or 30 minutes, and may be set by a user, for example, by a soft probe in an optical modem, from 11: 00 to 11:20 mirror copies the plurality of IP packets passing through the WAN port of the optical modem, and the copied plurality of IP packets are used as target data in the second data packet. In addition, the data size requirement and the data generation time requirement may be preset at the same time, for example, when the soft probe starts to copy the IP packet passing through the LAN port of the optical modem at 10:00, and when the data amount of the copied IP packet reaches 20M but the time is not yet 10:10, or the time reaches 10:10 minutes but the copied IP packet does not yet reach 20M, the soft probe stops copying the IP packet, and acquires the target data by using the plurality of copied IP packets as the target data in the first data packet.
In an example embodiment, the target data meets the preset data size requirement and/or the preset data generation time requirement to control the size of the target data, so as to avoid that the copied data packet is too large to affect the normal client service.
It should be noted that in the exemplary embodiment, the data packet passing through the LAN port of the optical modem and the data packet passing through the WAN port of the optical modem may not be the same data packet, but both data packets are from the same user terminal, and therefore, a portion of the data in both data packets is the same, such as the user terminal identification, the system identification of the user terminal. The user terminal identifier can be used to identify which user terminal the data packet comes from, such as a desktop computer a, a notebook computer B, or a mobile phone C; the system identification of the user terminal may be used to identify the system of the user terminal that sent the data packet, e.g., a Windows 10 system, a Linux system, etc.
In step S130, the system identifier of the user terminal, the working mode of the optical modem, and the time-to-live value TTL are parsed from the target data.
In an exemplary embodiment, the target data in the target file is parsed, and the system identifier of the user terminal in the IP packet in the target data is obtained. It should be noted that whether the target data is from the first data packet or the second data packet, the system id of the ue in the target data is the same ue system id. The system of the user terminal sending out the data packet containing the target data, such as a Windows 10 system and a Linux system, can be identified according to the system identification of the user terminal.
In an exemplary embodiment, the target data in the target file is parsed to obtain the operating mode of the optical modem. The target data comprises the working mode identification of the optical modem, the target data is analyzed to obtain the working mode identification, and the working mode of the optical modem through which the target data passes is determined according to the working mode identification. The operation mode of the optical modem is divided into a routing mode and a bridge mode. When the optical modem is in a routing mode, the optical modem internally dials up to the Internet, and the router dialing or the dialing on a user terminal is not needed. When the optical modem is in the bridge mode, the optical modem cannot dial, and dial-up networking is needed through the router or dial-up networking is needed on the user terminal.
In an example embodiment, target data in a target file is parsed To obtain a time To live value, ttl, (time To live). The TTL and TTL values have the same meaning and can be represented by a TTL field and its field value. TTL specifies the maximum number of segments allowed to pass through before IP packets are dropped by the router, reflecting the time period of survival of the IP packets. The TTL field and its field value are set by the sender of the IP packet, and the electronic device may modify the field value of the TTL field every time it passes through an electronic device in the entire forwarding path of the IP packet from the source to the destination, and then forward the IP packet. Wherein the value of the field of the TTL field is modified, possibly the value of the field of the TTL field is decremented by 1, e.g., 128 is changed to 127. The electronic device may be a router or an optical modem. It should be noted that when an IP packet passes through an electronic device, whether the field value of the TTL field is modified is related to the operating mode of the electronic device. When the working mode of the electronic equipment is the routing mode, the TTL cannot be modified by the electronic equipment; when the operation mode of the electronic device is the bridge mode, the TTL is modified by the electronic device, i.e., the TTL value is decreased by 1. For example, if the router is in the bridge mode, the TTL of the IP packet is unchanged when entering the router and when leaving the router, the TTL is 127 when entering the router and 127 when leaving the router; if the router is in the routing mode, the TTL of the IP packet is 127 when the IP packet enters the router and 126 when the IP packet leaves the router.
In an example embodiment, the TTL field and its field value are set by the sender of the IP packet, meaning that the TTL in the IP packet corresponds to the sender's system when the sender sends out the IP packet. The sender of the IP packet in the destination data is the user terminal. And the initial value corresponding to the TTL in the target data is the TTL of the IP packet in the target data when the IP packet is in the user terminal. The initial value corresponding to the TTL in the target data corresponds to the system of the user terminal, for example, when the system of the user terminal is a Windows system, the initial value corresponding to the TTL is 128, that is, when the user terminal sends an IP packet, the TTL in the IP packet is 128. It should be noted that the initial value of TTL is 128, which is derived by the Windows system, and this value is merely an example. The corresponding relationship between the operating system and the initial value of the TTL can be obtained through empirical summary, for example, the initial value of the TTL corresponding to the android system is 100, and the initial value of the TTL corresponding to the Lunix system is 200.
In step S140, a network topology between the user terminal and the optical modem is determined according to the system identifier of the user terminal, the working mode of the optical modem, and the TTL.
In an exemplary embodiment, determining a network topology between the user terminal and the optical modem based on the system identification of the user terminal, the operating mode of the optical modem, and the time-to-live value contained in the target data comprises: determining an initial value corresponding to the TTL according to a system identifier of the user terminal; if the working mode of the optical modem is a routing mode, determining the number of router equipment between the user terminal and the optical modem according to the initial values corresponding to the TTL and the source of the target data; if the working mode of the optical modem is the bridge mode, determining the number of router equipment between the user terminal and the optical modem according to initial values corresponding to TTL and TTL; determining a network topology between the user terminal and the optical modem based on the number of router devices between the user terminal and the optical modem.
In an example embodiment, the initial value corresponding to the TTL, i.e., the TTL at the time of the target data user terminal, may be inferred from the operating system of the user terminal. The operating system of the user terminal may be determined according to the system identifier of the user terminal in the target data, for example, the system identifier of the user terminal obtained from the target data is X, and according to the system identifier X, the operating system of the user terminal is known to be a Windows system, and according to the Windows system, the user terminal sends out a data packet 1, and the TTL of the data packet 1 at the user terminal is 128.
In an exemplary embodiment, if the operation mode of the optical modem is the routing mode, determining the number of router devices between the user terminal and the optical modem according to the TTL, the initial value corresponding to the TTL, and the source of the target data, includes: if the source of the target data is a first data packet, calculating a difference value between an initial value corresponding to the TTL and the TTL, and determining the difference value as the number of router equipment between the user terminal and the optical modem; and if the source of the target data is the second data packet, calculating a difference value between an initial value corresponding to the TTL and the TTL, and determining the value obtained by subtracting 1 from the difference value as the number of router equipment between the user terminal and the optical modem.
In an example embodiment, the soft probe installed on the optical modem may obtain one piece of target data from the first data packet or the second data packet, or may obtain two pieces of target data from the first data packet and the second data packet. The TTL in the second data packet can be deduced according to the working mode of the optical modem only by acquiring the target data from the first data packet; the TTL in the first packet can be inferred from the mode of operation of the optical modem by simply obtaining the target data from the second packet. In addition, if two pieces of target data are obtained from the first data packet and the second data packet, the working mode of the optical modem can be deduced according to the TTL in the first data packet and the TTL in the second data packet.
In an example embodiment, when the operation mode of the optical modem is the routing mode, the TTL in the first packet obtained when the user terminal sends the packet to the optical modem differs from the value of the TTL in the second packet when the optical modem sends the packet to the network operator device by 1. When the target data comes from the first data packet, the TTL in the second data packet can be deduced according to the TTL in the target data; when the target data is from the second packet, the TTL in the first packet can be inferred from the TTL in the target data. For example, when the destination data is from the first packet of the LAN port of the optical modem, the TTL is 127 by analyzing the destination data, and it is inferred that the TTL is 126 in the second packet of the WAN port of the optical modem.
In an example embodiment, when the operating mode of the optical modem is the routing mode, if the source of the destination data is the first packet, the TTL in the destination data is the TTL in the packet acquired at the LAN port of the optical modem. The difference value between the TTL in the target data and the initial value corresponding to the TTL in the target data is the number of router devices between the user terminal and the optical modem. It should be noted that the router devices are in routing mode, not in bridging mode. The number of router devices may be 0, may also be 1, and may also be greater than 1.
In an example embodiment, scenario 1 is specifically as follows: the user terminal is a desktop computer A, an operating system of the desktop computer A is a windows system, TTL in a data packet before the desktop computer A sends a data packet is 128, the desktop computer A sends the data packet to a LAN port of an optical modem in a routing mode, TTL of the data packet is 128 at the moment, and TTL of the data packet is 127 when the data packet reaches a WAN port of the optical modem. In scenario 1, the target data is from the first packet, and the initial value corresponding to the TTL in the target data, that is, the TTL in the packet before desktop computer a sends the packet is 128, the TTL in the target data is 128, and the difference between the TTL and the TTL is 0, thereby determining that the number of router devices between desktop computer a and the optical modem is 0, that is, the networking is in the router-less mode. It should be noted that there may be a router device in bridge mode between the desktop computer a and the optical modem, or there may be no router device in bridge mode, but certainly there is no router device in router mode.
In an example embodiment, scenario 2 is specifically as follows: the user terminal is a notebook computer B, an operating system of the notebook computer B is a windows system, the TTL in a data packet before the data packet is sent by the notebook computer B is 128, the data packet is sent to a LAN port of an optical modem in a routing mode by the notebook computer B, the TTL of the data packet is 126 at the moment, and when the data packet reaches a WAN port of the optical modem, the TTL of the data packet is 125. In scenario 2, the target data is from the first data packet, and the initial value corresponding to the TTL in the target data, that is, the TTL in the data packet before the data packet is sent by the laptop B is 128, the TTL in the target data is 126, and the difference between the TTL and the TTL is 2, thereby determining that the number of router devices between the laptop B and the optical modem is 2, that is, networking is in a router mode. That is, the notebook computer B transmits a packet to the LAN port of the router 1 in the routing mode, the packet is transmitted from the WAN port of the router 1 to the LAN port of the router 2 in the routing mode via the router 1, and the packet is transmitted from the WAN port of the router 2 to the optical modem via the router 2. It should be noted that there may be a router device in the bridge mode between the notebook B and the optical modem, or there may not be a router device in the bridge mode, but there are certainly 2 router devices in the routing mode.
In an example embodiment, when the operating mode of the optical modem is the routing mode, if the source of the destination data is the second packet, the TTL in the destination data is the TTL in the packet acquired at the WAN port of the optical modem. And calculating a difference value between the initial value corresponding to the TTL and the TTL, and determining the value obtained by subtracting 1 from the difference value as the number of router equipment between the user terminal and the optical modem. It should be noted that the router devices are in routing mode, not in bridging mode. The number of router devices may be 0, 1, or greater than 1.
In the foregoing scenario 1, in the example embodiment, the target data is from the second packet, the initial value corresponding to the TTL in the target data, that is, the TTL in the packet before desktop computer a sends the packet is 128, the TTL in the target data is 127, and the difference between the two values is 1, thereby determining that the number of router devices between desktop computer a and the optical modem is 0, that is, the networking is in the router-less mode. It should be noted that there may be a router device in bridge mode between the desktop computer a and the optical modem, or there may be no router device in bridge mode, but certainly there is no router device in router mode.
In the foregoing scenario 2, in the example embodiment, the target data is from the second packet, the initial value corresponding to the TTL in the target data, that is, the TTL in the packet before the packet is sent out by the laptop B is 128, and the TTL in the target data is 125, and the difference between the two values is 3, thereby determining that the number of router devices between the laptop B and the optical modem is 2, that is, networking is in the router mode. That is, the notebook computer B transmits a packet to the LAN port of the router 1 in the routing mode, the packet is transmitted from the WAN port of the router 1 to the LAN port of the router 2 in the routing mode via the router 1, and the packet is transmitted from the WAN port of the router 2 to the optical modem via the router 2. It should be noted that there may be a router device in the bridge mode between the notebook B and the optical modem, or there may not be a router device in the bridge mode, but there are certainly 2 router devices in the routing mode.
In an exemplary embodiment, if the operation mode of the optical modem is the bridge mode, determining the number of router devices between the user terminal and the optical modem according to the initial values corresponding to the TTL and the TTL includes: and calculating a difference value between the initial value corresponding to the TTL and the TTL, and determining the difference value as the number of router equipment between the user terminal and the optical modem.
In an exemplary embodiment, if the operation mode of the optical modem is the bridge mode, whether the target data is from the first data packet or the second data packet, the TTL value in the target data is not different, i.e., the TTL in the first data packet is equal to the TTL in the second data packet. When the target data comes from the first data packet, the TTL in the second data packet can be deduced according to the TTL in the target data; when the target data is from the second packet, the TTL in the first packet can be inferred from the TTL in the target data. For example, when the destination data is from the first packet of the LAN port of the optical modem, the TTL is 127 by analyzing the destination data, and it can be inferred that the TTL is 127 in the second packet of the WAN port of the optical modem.
In an example embodiment, when the operation mode of the optical modem is the bridge mode, a difference between the TTL in the target data and an initial value corresponding to the TTL in the target data is the number of router devices between the user terminal and the optical modem. It should be noted that the router devices are in routing mode, not in bridging mode. The number of router devices may be 0, may also be 1, and may also be greater than 1.
In an example embodiment, scenario 3 is specifically as follows: the user terminal is a mobile phone C, an operating system of the mobile phone C is an android system, the TTL in a data packet before the mobile phone C sends out the data packet is 100, the mobile phone C sends the data packet to a LAN port of the optical modem in a bridge mode, the TTL of the data packet is 100 at the moment, and when the data packet reaches a WAN port of the optical modem, the TTL of the data packet is 100. In scenario 3, the initial value corresponding to the TTL in the target data, that is, the TTL in the data packet before the mobile phone C sends out the data packet is 100, the TTL in the target data is 100, and the difference between the TTL and the target data is 0, thereby determining that the number of router devices between the mobile phone C and the optical modem is 0. The number of 0 router devices refers to router devices in the routing mode. It should be noted that there may be a router device in the bridge mode between the handset C and the optical modem, or there may not be a router device in the bridge mode, but certainly there is no router device in the router mode. In case the optical modem is in bridge mode and there is no router in access routing mode between the optical modem and the user terminal, the networking is in terminal dialing mode.
In an example embodiment, scenario 4 is specifically as follows: the user terminal is a desktop computer D, an operating system of the desktop computer D is a Lunix system, TTL in a data packet before the desktop computer D sends out the data packet is 200, the desktop computer D sends the data packet to a LAN port of an optical modem in a bridge mode, the TTL of the data packet is 199 at the moment, and when the data packet reaches a WAN port of the optical modem, the TTL of the data packet is 199. In scenario 3, the initial value corresponding to the TTL in the target data, that is, the TTL in the data packet before the desktop computer D sends the data packet is 200, the TTL in the target data is 199, and the difference between the TTL and the TTL is 1, thereby determining that the number of router devices between the desktop computer D and the optical modem is 1. The number of 1 router devices refers to router devices in a routing mode. It should be noted that there may be a router device in bridge mode between the desktop computer D and the optical modem, or there may be no router device in bridge mode, but 1 router device in bridge mode is certainly accessed. When the optical modem is in bridge mode and there is a router device in route mode between the optical modem and the user terminal, the networking is in dial mode.
In an example embodiment, the network topology between the user terminal and the optical modem can be inferred from the number of router devices between the user terminal and the optical modem. For example, if the number of router devices for determining the routing mode between the user terminal and the optical modem is 2, the network topology between the user terminal and the optical modem is such that the user terminal transmits a packet to the LAN port of the router 1, the packet passes through the router 1 and is transmitted from the WAN port of the router 1 to the LAN port of the router 2, and the packet passes through the router 2 and is transmitted from the WAN port of the router 2 to the LAN port of the optical modem.
According to the network topology determining method in the exemplary embodiment of fig. 1, first, a first data packet and a second data packet are obtained, wherein the first data packet is a data packet sent from a user terminal to an optical modem, and the second data packet is a data packet sent from the optical modem to a network operator device; secondly, acquiring target data from the first data packet or the second data packet according to a preset data volume or time requirement; then, according to the target data, determining the system identification of the user terminal, the working mode of the optical modem and the time-to-live value TTL; and finally, determining a network topology structure between the user terminal and the optical modem according to the system identification of the user terminal, the working mode of the optical modem and the TTL. The embodiment of the invention can acquire the data packet received and sent by the optical modem, acquire the target data in the data packet, determine the system identification of the user terminal, the working mode of the optical modem and the time-to-live value (TTL) in the target data, and further remotely deduce the network topology structure between the user terminal and the optical modem.
It should be noted that, in the exemplary embodiment, if the optical modem in the network topology determining method shown in fig. 1 has good performance and strong computing capability, the network topology determining method may perform all the processes on the optical modem. If the performance of the optical modem is general or it is not desired to add more calculation load to the optical modem, the target data is written into the target file after the target data is obtained in step S120, the optical modem transmits the target file to the electronic device preset by the network operator, and the electronic device executes steps S130 and S140 to finally determine the network topology between the user terminal and the optical modem. The electronic device can be a soft probe front-end processor platform corresponding to a soft probe installed in the optical modem, and also can be an electronic device in a remote network operator machine room. The electronic device includes, but is not limited to, a mobile phone, a tablet computer, a wearable device, an optical modem, and other electronic devices.
In an example embodiment, the soft probe front-end processor platform is a part of a digital home system, and has functions of remotely managing a soft probe, receiving data acquired by the soft probe, performing operation according to the data acquired by the soft probe, and the like. For example, the preset data generation time requirement mentioned in step S120 may set a time parameter in the soft probe front-end processor platform.
Fig. 2 is a schematic block diagram of a network topology determining apparatus according to an embodiment of the present invention.
Referring to fig. 2, the network topology determining apparatus 200 includes: a packet acquisition module 210, a target data acquisition module 220, a data parsing module 230, and a topology determination module 240. The data packet obtaining module 210 is configured to obtain a first data packet sent by the user terminal to the optical modem and a second data packet sent by the optical modem to the network operator device; a target data obtaining module 220, configured to obtain target data from the first data packet or the second data packet, where the target data meets a preset data size requirement and/or a preset data generation time requirement; a data parsing module 230, configured to parse the target data to obtain a system identifier of the user terminal, a working mode of the optical modem, and a Time To Live (TTL) value; and a topology determining module 240, configured to determine a network topology between the user terminal and the optical modem according to the system identifier of the user terminal, the working mode of the optical modem, and the TTL.
In some embodiments of the present invention, based on the above scheme, the topology determining module 240 includes: an initial value determining unit, configured to determine an initial value corresponding to the TTL according to a system identifier of the user terminal; a first routing number determining unit, configured to determine, if the working mode of the optical modem is the routing mode, the number of router devices between the user terminal and the optical modem according to the TTL, an initial value corresponding to the TTL, and a source of the target data; a second route number determining unit, configured to determine, if the working mode of the optical modem is the bridge mode, the number of router devices between the user terminal and the optical modem according to initial values corresponding to the TTL and the TTL; and the topology structure determining unit is used for determining the network topology structure between the user terminal and the optical modem according to the number of the router devices between the user terminal and the optical modem.
In some embodiments of the present invention, based on the above scheme, the first route number determining unit is specifically configured to: if the source of the target data is a first data packet, calculating a difference value between an initial value corresponding to the TTL and the TTL, and determining the difference value as the number of router equipment between the user terminal and the optical modem; and if the source of the target data is the second data packet, calculating a difference value between an initial value corresponding to the TTL and the TTL, and determining the value obtained by subtracting 1 from the difference value as the number of router equipment between the user terminal and the optical modem.
In some embodiments of the present invention, based on the foregoing scheme, the second route number determining unit is specifically configured to: and calculating a difference value between the initial value corresponding to the TTL and the TTL, and determining the difference value as the number of router equipment between the user terminal and the optical modem.
In some embodiments of the present invention, based on the above scheme, the target data obtaining module 220 is specifically configured to: and acquiring target data from the first data packet or the second data packet in a mirror image copying mode through a soft probe installed in the optical modem.
According to the technical scheme provided by the embodiment of the invention, firstly, a first data packet and a second data packet are obtained, wherein the first data packet is a data packet sent to an optical modem from a user terminal, and the second data packet is a data packet sent to network operator equipment from the optical modem; secondly, acquiring target data from the first data packet or the second data packet according to a preset data volume or time requirement; then, according to the target data, determining the system identification of the user terminal, the working mode of the optical modem and the time-to-live value TTL; and finally, determining a network topology structure between the user terminal and the optical modem according to the system identification of the user terminal, the working mode of the optical modem and the TTL. The embodiment of the invention can acquire the data packet received and sent by the optical modem, acquire the target data in the data packet, determine the system identification of the user terminal, the working mode of the optical modem and the time-to-live value (TTL) in the target data, and further remotely deduce the network topology structure between the user terminal and the optical modem.
It should be noted that the network topology determining apparatus provided in the embodiment of the present invention can implement each process of the foregoing network topology determining method, and achieve the same function and effect, which is not repeated here.
Further, an embodiment of the present invention further provides an electronic device, and fig. 3 is a schematic structural diagram of the electronic device according to an embodiment of the present invention. As shown in fig. 3, the electronic apparatus includes: memory 301, processor 302, bus 303, and communication interface 304. The memory 301, processor 302, and communication interface 304 communicate via bus 303, and the communication interface 304 may include input and output interfaces including, but not limited to, a keyboard, mouse, display, microphone, and the like.
Referring to fig. 3, the memory 301 stores thereon computer-executable instructions executable on the processor 302, and when executed by the processor 302, implements the following process: acquiring a first data packet sent to an optical modem by a user terminal and a second data packet sent to network operator equipment by the optical modem; acquiring target data from the first data packet or the second data packet, wherein the target data meets the preset data volume requirement and/or the preset data generation time requirement; analyzing the target data to obtain a system identifier of the user terminal, a working mode of the optical modem and a Time To Live (TTL) value; and determining a network topology structure between the user terminal and the optical modem according to the system identification of the user terminal, the working mode of the optical modem and the TTL.
Optionally, when executed by the processor, the computer executable instructions determine a network topology between the user terminal and the optical modem according to the system identifier of the user terminal, the working mode of the optical modem, and the time-to-live value included in the target data, including: determining an initial value corresponding to the TTL according to a system identifier of the user terminal; if the working mode of the optical modem is a routing mode, determining the number of router equipment between the user terminal and the optical modem according to the TTL, the initial value corresponding to the TTL and the source of the target data; if the working mode of the optical modem is the bridge mode, determining the number of router equipment between the user terminal and the optical modem according to initial values corresponding to TTL and TTL; determining a network topology between the user terminal and the optical modem based on the number of router devices between the user terminal and the optical modem.
Optionally, the determining, by the processor, the number of router devices between the user terminal and the optical modem according to the TTL, the initial value corresponding to the TTL, and the source of the target data includes: if the source of the target data is a first data packet, calculating a difference value between an initial value corresponding to the TTL and the TTL, and determining the difference value as the number of router equipment between the user terminal and the optical modem; and if the source of the target data is the second data packet, calculating a difference value between an initial value corresponding to the TTL and the TTL, and determining the value obtained by subtracting 1 from the difference value as the number of router equipment between the user terminal and the optical modem.
Optionally, when executed by the processor, the computer executable instructions determine the number of router devices between the user terminal and the optical modem according to the initial values corresponding to the TTL and the TTL, and include: and calculating a difference value between the initial value corresponding to the TTL and the TTL, and determining the difference value as the number of router equipment between the user terminal and the optical modem.
Optionally, the computer executable instructions, when executed by the processor, obtain the target data from the first data packet or the second data packet, comprising: and acquiring target data from the first data packet or the second data packet in a mirror image copying mode through a soft probe installed in the optical modem.
According to the technical scheme provided by the embodiment of the invention, firstly, a first data packet and a second data packet are obtained, wherein the first data packet is a data packet sent to an optical modem from a user terminal, and the second data packet is a data packet sent to network operator equipment from the optical modem; secondly, acquiring target data from the first data packet or the second data packet according to a preset data volume or time requirement; then, according to the target data, determining the system identification of the user terminal, the working mode of the optical modem and the time-to-live value TTL; and finally, determining a network topology structure between the user terminal and the optical modem according to the system identification of the user terminal, the working mode of the optical modem and the TTL. By the embodiment of the invention, the data packet received and sent by the optical modem can be obtained, the target data in the data packet can be obtained, the system identification of the user terminal in the target data, the working mode of the optical modem and the TTL (time to live) value can be determined, and the network topology structure between the user terminal and the optical modem can be deduced remotely.
The mobile terminal in the embodiment of the invention can realize each process of the network topology structure determination method and achieve the same effect and function, and the process is not repeated.
Further, an embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the foregoing network topology determining method embodiment, and can achieve the same technical effect, and is not described herein again to avoid repetition. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the above-mentioned embodiment of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (8)

1. A method for determining a network topology, comprising:
acquiring a first data packet sent by a user terminal to an optical modem and a second data packet sent by the optical modem to network operator equipment;
acquiring target data from the first data packet or the second data packet; the target data meets the preset data volume requirement and/or the preset data generation time requirement;
analyzing the target data to obtain a system identifier of the user terminal, a working mode of the optical modem and a Time To Live (TTL) value;
and determining a network topology structure between the user terminal and the optical modem according to the system identification of the user terminal, the working mode of the optical modem and the TTL.
2. The method of claim 1, wherein determining the network topology between the user terminal and the optical modem based on the system identifier of the user terminal, the operating mode of the optical modem, and the time-to-live value included in the target data comprises:
determining an initial value corresponding to the TTL according to a system identifier of the user terminal;
if the working mode of the optical modem is a routing mode, determining the number of router equipment between the user terminal and the optical modem according to the TTL, the initial value corresponding to the TTL and the source of the target data;
if the working mode of the optical modem is a bridge mode, determining the number of router devices between the user terminal and the optical modem according to the TTL and the initial value corresponding to the TTL;
and determining a network topology structure between the user terminal and the optical modem according to the number of router devices between the user terminal and the optical modem.
3. The method as claimed in claim 2, wherein the determining the number of router devices between the user terminal and the optical modem according to the TTL, the initial value corresponding to the TTL and the source of the target data comprises:
if the source of the target data is the first data packet, calculating a difference value between an initial value corresponding to the TTL and the TTL, and determining the difference value as the number of router equipment between the user terminal and the optical modem;
and if the source of the target data is the second data packet, calculating a difference value between an initial value corresponding to the TTL and the TTL, and determining a value obtained by subtracting 1 from the difference value as the number of router equipment between the user terminal and the optical modem.
4. The method of claim 2, wherein the determining the number of router devices between the user terminal and the optical modem based on the TTL and the initial value corresponding to the TTL comprises:
and calculating a difference value between the initial value corresponding to the TTL and the TTL, and determining the difference value as the number of router equipment between the user terminal and the optical modem.
5. The method of claim 1, wherein obtaining target data from the first data packet or the second data packet comprises:
and acquiring the target data from the first data packet or the second data packet in a mirror image copying mode through a soft probe installed in the optical modem.
6. A network topology determining apparatus, comprising:
the data packet acquisition module is used for acquiring a first data packet sent by a user terminal to an optical modem and a second data packet sent by the optical modem to network operator equipment;
a target data obtaining module, configured to obtain target data from the first data packet or the second data packet; the target data meets the preset data volume requirement and/or the preset data generation time requirement;
the data analysis module is used for analyzing the target data to obtain a system identifier of the user terminal, a working mode of the optical modem and a Time To Live (TTL) value;
and the topology determining module is used for determining a network topology structure between the user terminal and the optical modem according to the system identification of the user terminal, the working mode of the optical modem and the TTL.
7. An electronic device, comprising: memory, processor and computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing a network topology determination method according to any of claims 1 to 5.
8. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program which, when being executed by a processor, implements the network topology determining method according to any one of claims 1 to 5.
CN201911342671.5A 2019-12-23 2019-12-23 Network topology structure determination method and device and electronic equipment Active CN113098704B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911342671.5A CN113098704B (en) 2019-12-23 2019-12-23 Network topology structure determination method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911342671.5A CN113098704B (en) 2019-12-23 2019-12-23 Network topology structure determination method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN113098704A CN113098704A (en) 2021-07-09
CN113098704B true CN113098704B (en) 2022-05-31

Family

ID=76663619

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911342671.5A Active CN113098704B (en) 2019-12-23 2019-12-23 Network topology structure determination method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN113098704B (en)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6778524B1 (en) * 2000-06-09 2004-08-17 Steven Augart Creating a geographic database for network devices
US7317693B1 (en) * 2003-05-12 2008-01-08 Sourcefire, Inc. Systems and methods for determining the network topology of a network
EP1729452B1 (en) * 2005-06-01 2008-10-01 THOMSON Licensing Method for determining connection topology of home network
US7889680B2 (en) * 2006-09-05 2011-02-15 The Hong Kong University Of Science And Technology Merging anonymous routers in end-to-end network topology inference
CN103117877B (en) * 2013-01-29 2016-05-18 四川大学 A kind of network topology automatically generating device based on iterative TTL-IPID packet classification
CN108494583A (en) * 2018-02-24 2018-09-04 广州西麦科技股份有限公司 A kind of method and device generating network topology based on sFlow

Also Published As

Publication number Publication date
CN113098704A (en) 2021-07-09

Similar Documents

Publication Publication Date Title
US8245266B2 (en) User interface
JP5093598B2 (en) Control relay program, control relay device, and control relay method
KR101619736B1 (en) Method, apparatus and system for manageing private network remotely using session initiation protocol
GB2533101A (en) Distributing a network access policy
CN101409654B (en) Method for processing SNMP information in network management system
CN114629822A (en) Link detection method and device, electronic equipment and storage medium
WO2019102811A1 (en) Control device and control system
US10158587B2 (en) Communication between a web application instance connected to a connection server and a calling entity other than said connection server
JP2006338417A (en) Proxy device
CN105323128B (en) method, device and system for accessing front-end equipment to server
CN113098704B (en) Network topology structure determination method and device and electronic equipment
CN110784375B (en) Network data monitoring method and device, electronic equipment and storage medium
US20230208890A1 (en) System and method for providing upstream directives based on upstream signal quality of wireless network in real-time communication
KR101491322B1 (en) Self-configuring local area network security
EP3971748A1 (en) Network connection request method and apparatus
CN114979073A (en) Address information acquisition system, method, electronic device, and storage medium
US7457855B2 (en) Network configuration management
CN101453396A (en) Method and system for multiple service provider device management
KR100641831B1 (en) System and method of oma device management for dynamic node management
CN113271305B (en) Attack detection method and device and web application level intrusion prevention system WAF
EP4120659A1 (en) Network device identification
CN111966510B (en) Method, system, device and medium for calculating data stream
US11470531B2 (en) System and method for automatically switching real-time communication device to new basic service set
WO2024027422A1 (en) Communication method and communication apparatus
CN114221819A (en) Network scanning method and device based on game theory

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant