This application relates to the communication field, and to a method for determining an access device type, a device, and a system.
Home broadband services are a major type of service provided by operators for home users. Based on the service, the operators provide access devices for families to access the Internet. When locating faults on a home network or performing a targeted marketing promotion for the home network, an operator first needs to determine whether a third-party access device exists in the home network. Generally, when the third-party access device exists in the home network, a type of the access device may be determined by using a Media Access Control (MAC) address of the device. When a device manufacturer that provides the access device also produces terminal devices, such as mobile phones or tablet computers, the device type of the access device cannot be determined by using the MAC address. The manner of determining the type of the access device by using the MAC address requires O&M personnel of the operator to periodically trace and maintain the MAC address, which is complex. In addition, a MAC address of a related device may not be obtained due to user privacy and security concerns. This is complex in management and labor-intensive.
This application provides a method for determining an access device type, a device, and a system, to reduce maintenance manpower required for determining an access device type and reduce management complexity.
According to a first aspect, a method for determining an access device type is provided, and includes: obtaining one or more packet pairs, where each packet pair includes a first packet and a second packet, the second packet is a response to the first packet, and the one or more packet pairs pass through a same access device; and determining a type of the access device based on a time difference or time differences of the one or more packet pairs, where a time difference of any packet pair is a difference between receive time points of two packets in the packet pair.
Based on the foregoing method, the device type of the access device may be determined simply through the solution of using the time difference of the packet pair, and therefore management complexity and O&M personnel management complexity are reduced.
In an embodiment, the first packet is a synchronize sequence number acknowledgement packet of a Transmission Control Protocol (TCP) connection, and the second packet is an acknowledgement packet of the TCP connection.
Based on the foregoing method, information about a time difference from the access device to a network device can be obtained by obtaining a synchronize sequence number acknowledgement packet and an acknowledgment packet of a same TCP connection, to provide a calculation basis for determining the type of the access device based on the information about the time difference.
In an embodiment, the determining a type of the access device based on a time difference or time differences of the one or more packet pairs includes: determining the type of the access device based on a time difference threshold and the time difference or the time differences of the one or more packet pairs.
In an embodiment, the determining the type of the access device based on a time difference threshold and the time difference or the time differences of the one or more packet pairs includes: comparing a mean value or a median of the time differences of the plurality of packet pairs with the time difference threshold, to determine the type of the access device.
In an embodiment, the determining the type of the access device based on a time difference threshold and the time difference or the time differences of the one or more packet pairs includes: determining the type of the access device based on a proportion of a quantity of packet pairs that are greater than or less than the time difference threshold in the time differences of the plurality of packet pairs.
The type of the access device can be quickly and accurately determined by using the plurality of solutions of comparing the time differences of the packet pairs with the time difference threshold provided in the foregoing manners, which requires simple management.
In an embodiment, the obtaining one or more packet pairs includes: obtaining the first packet received by a physical interface that is of a packet capture device and that is far from the access device; and obtaining the second packet received by a physical interface that is of the packet capture device and that is close to the access device.
The first packet is obtained from the interface that is far from the access device and the second packet is obtained from the interface that is close to the access device, that is, the first packet and the second packet are obtained based on a sending direction of a data flow. In this way, accurate time difference information can be obtained, and accuracy of determining the type of the access device can be improved.
According to a second aspect, a network system is provided, and includes: a packet obtaining device, for obtaining one or more packet pairs, where each packet pair includes a first packet and a second packet, the second packet is a response to the first packet, and the one or more packet pairs pass through a same access device; and a type determining device, for determining a type of the access device based on a time difference or time differences of the one or more packet pairs, where a time difference of any packet pair is a difference between receive time points of two packets in the packet pair.
Based on the foregoing system, the device type of the access device may be determined simply through the solution of using the time difference of the packet pair, and therefore management complexity and O&M personnel management complexity are reduced.
In an embodiment, the first packet is a synchronize sequence number acknowledgement packet of a TCP connection, and the second packet is an acknowledgement packet of the TCP connection.
Based on the foregoing manner, information about a time difference from the access device to a network device can be obtained by obtaining a synchronize sequence number acknowledgement packet and an acknowledgment packet of a same TCP connection, to provide a calculation basis for determining the type of the access device based on the information about the time difference.
In an embodiment, that the type determining device determines the type of the access device based on the time difference or the time differences of the one or more packet pairs includes: The type determining device determines the type of the access device based on a time difference threshold and the time difference or the time differences of the one or more packet pairs.
In an embodiment, that the type determining device determines the type of the access device based on the time difference or the time differences of the one or more packet pairs includes: The type determining device compares a mean value or a median of the time differences of the plurality of packet pairs with the time difference threshold, to determine the type of the access device.
In an embodiment, that the type determining device determines the type of the access device based on the time difference or the time differences of the one or more packet pairs includes: The type determining device determines the type of the access device based on a proportion of a quantity of packet pairs that are greater than or less than the time difference threshold in the time differences of the plurality of packet pairs.
The type of the access device can be quickly and accurately determined by using the plurality of solutions of comparing the time differences of the packet pairs with the time difference threshold provided in the foregoing manners, which requires simple management.
In an embodiment, the network system includes a packet capture device, and obtaining the one or more packet pairs includes: obtaining the first packet received by a physical interface that is of the packet capture device and that is far from the access device; and obtaining the second packet received by a physical interface that is of the packet capture device and that is close to the access device.
The first packet is obtained from the interface that is far from the access device and the second packet is obtained from the interface that is close to the access device, that is, the first packet and the second packet are obtained based on a sending direction of a data flow. In this way, accurate time difference information can be obtained, and accuracy of determining the type of the access device can be improved.
According to a third aspect, a network device is provided, and includes: a processor and at least two communication interfaces.
The processor is configured to enable the network device to: capture a first packet received by a first communication interface in the at least two communication interfaces, capture a second packet received by a second communication interface in the at least two communication interfaces, and obtain receive time points of receiving the first packet and the second packet, where the second packet is a response to the first packet, and the first packet and the second packet pass through a same access device.
The network device may obtain the first packet and the second packet, so that it is possible to determine a device type of the access device simply based on a time difference of a packet pair, and therefore management complexity and O&M personnel management complexity are reduced.
In an embodiment, the first packet is a synchronize sequence number acknowledgement packet of a TCP connection, and the second packet is an acknowledgement packet of the TCP connection.
Based on the foregoing manner, information about a time difference from the access device to the network device can be obtained by obtaining a synchronize sequence number acknowledgement packet and an acknowledgment packet of a same TCP connection, to provide a calculation basis for determining the type of the access device based on the information about the time difference.
In an embodiment, the first communication interface is a communication interface that is of the network device and that is far from the access device, and the second communication interface is a communication interface that is of the network device and that is close to the access device.
The first packet is obtained from the interface that is far from the access device and the second packet is obtained from the interface that is close to the access device, that is, the first packet and the second packet are obtained based on a sending direction of a data flow. In this way, accurate time difference information can be obtained, and accuracy of determining the type of the access device can be improved.
In an embodiment, the network device further includes a memory.
The memory stores instructions, where the processor executes the instructions to enable the network device to: capture the first packet received by the first communication interface in the at least two communication interfaces, capture the second packet received by the second communication interface in the at least two communication interfaces, and obtain the receive time points of receiving the first packet and the second packet.
In an embodiment, the processor is further configured to: determine that the first packet and the second packet are a packet pair, and determine a time difference of the packet pair, where the time difference of the packet pair is a difference between the receive time point of the first packet and the receive time point of the second packet.
In an embodiment, the processor is further configured to determine a type of the access device based on the time difference of the packet pair.
In an embodiment, the processor is further configured to: obtain a first packet characteristic based on the first packet, and obtain a second packet characteristic based on the second packet. The first communication interface is further configured to forward the first packet or the first packet characteristic, and the second communication interface is further configured to forward the second packet or the second packet characteristic.
The network device sends the first packet and the second packet, so that another network device may determine the device type of the access device simply based on the time difference of the packet pair, and therefore management complexity and O&M personnel management complexity are reduced.
According to a fourth aspect, a network device is provided, and includes: a processor, a memory, and a communication interface. The communication interface is configured to receive a plurality of packets, where the plurality of packets pass through a same access device. The memory stores instructions, and the processor is configured to execute the instructions to determine one or more packet pairs based on the plurality of packets, where any packet pair in the one or more packet pairs includes a first packet and a second packet, and the second packet in the packet pair is a response to the first packet in the packet pair. The processor is further configured to obtain a time difference or time differences of the one or more packet pairs, where a time difference of any packet pair is a difference between receive time points of two packets in any packet pair.
In an embodiment, that the processor is configured to determine the one or more packet pairs based on the plurality of packets is: When the first packet carries a first packet characteristic, and the second packet carries a second packet characteristic, the processor determines, based on the first packet characteristic and the second packet characteristic, that the first packet and the second packet are a packet pair.
In an embodiment, the first packet is a synchronize sequence number acknowledgement packet of a TCP connection, and the second packet is an acknowledgement packet of the TCP connection.
In an embodiment, the processor is further configured to determine a type of the access device based on the time difference or the time differences of the one or more packet pairs.
In an embodiment, that the processor is configured to determine a type of the access device based on the time difference or the time differences of the one or more packet pairs is: The processor is configured to determine the type of the access device based on a time difference threshold and the time difference or the time differences of the one or more packet pairs.
In an embodiment, that the processor is configured to determine the type of the access device based on a time difference threshold and the time difference or the time differences of the one or more packet pairs is: comparing a mean value or a median of the time differences of the plurality of packet pairs with the time difference threshold, to determine the type of the access device.
In an embodiment, that the processor is configured to determine the type of the access device based on a time difference threshold and the time difference or the time differences of the one or more packet pairs is: determining the type of the access device based on a proportion of a quantity of packet pairs that are greater than or less than the time difference threshold in the time differences of the plurality of packet pairs.
According to a fifth aspect, a network device is provided, and includes: a processor and a memory. The memory stores instructions, and the processor is configured to execute the instructions in the memory to determine a type of an access device based on a time difference or time differences of one or more packet pairs. Any packet pair in the one or more packet pairs includes a first packet and a second packet, where the second packet is a response to the first packet, and the one or more packet pairs pass through a same access device.
In an embodiment, the first packet is a synchronize sequence number acknowledgement packet of a TCP connection, and the second packet is an acknowledgement packet of the TCP connection.
In an embodiment, that the processor is configured to determine the type of the access device based on the time difference or the time differences of the one or more packet pairs is: The processor is configured to determine the type of the access device based on a time difference threshold and the time difference or the time differences of the one or more packet pairs.
In an embodiment, that the processor is configured to determine the type of the access device based on a time difference threshold and the time difference or the time differences of the one or more packet pairs is: comparing a mean value or a median of the time differences of the plurality of packet pairs with the time difference threshold, to determine the type of the access device.
In an embodiment, that the processor is configured to determine the type of the access device based on a time difference threshold and the time difference or the time differences of the one or more packet pairs is: determining the type of the access device based on a proportion of a quantity of packet pairs that are greater than or less than the time difference threshold in the time differences of the plurality of packet pairs.
According to a sixth aspect, a network device is provided, and includes an obtaining unit and a transceiver unit. The obtaining unit is configured to: receive a first packet and a second packet from at least two communication interfaces, and obtain receive time points of receiving the first packet and the second packet. The second packet is a response to the first packet, and the first packet and the second packet pass through a same access device.
The network device may obtain the first packet and the second packet, so that it is possible to determine a device type of the access device simply based on a time difference of a packet pair, and therefore management complexity and O&M personnel management complexity are reduced.
In an embodiment, the first packet is a synchronize sequence number acknowledgement packet of a TCP connection, and the second packet is an acknowledgement packet of the TCP connection.
Based on the foregoing manner, time difference information that is from the access device to the network device can be obtained by obtaining a TCP synchronize sequence number acknowledgement packet and a TCP acknowledgment packet, to provide a calculation basis for determining the type of the access device based on the time difference information.
In an embodiment, a receiving interface of the first packet is a communication interface that is of the network device and that is far from the access device, and a receiving interface of the second packet is a communication interface that is of the network device and that is close to the access device.
The first packet is obtained from the interface that is far from the access device and the second packet is obtained from the interface that is close to the access device, that is, the first packet and the second packet are obtained based on a sending direction of a data flow. In this way, accurate time difference information can be obtained, and accuracy of determining the type of the access device can be improved.
In an embodiment, the transceiver unit is further configured to send the first packet and the second packet.
The network device sends the first packet and the second packet, so that another network device may determine the device type of the access device simply based on the time difference of the packet pair, and therefore management complexity and O&M personnel management complexity are reduced.
According to a seventh aspect, a network device is provided, and includes an obtaining unit and a transceiver unit. The obtaining unit is configured to receive one or more packet pairs. Each packet pair includes a first packet and a second packet, where the second packet is a response to the first packet, and the one or more packet pairs pass through a same access device. The obtaining unit is further configured to obtain receive time points of the first packet and the second packet. The obtaining unit is further configured to obtain a time difference or time differences of the one or more packet pairs.
In an embodiment, the obtaining unit is configured to obtain a time difference or time differences of the one or more packet pairs is: When the first packet carries a first packet characteristic, and the second packet carries a second packet characteristic, the obtaining unit is configured to determine, based on the first packet characteristic and the second packet characteristic, that the first packet and the second packet are a packet pair. The obtaining unit is configured to obtain a time difference of the first packet and the second packet.
In an embodiment, the first packet is a synchronize sequence number acknowledgement packet of a TCP, and the second packet is an acknowledgement packet of the TCP connection.
According to an eighth aspect, a network device is provided, and includes an obtaining unit and a determining unit. The obtaining unit is configured to obtain one or more packet pairs and a time difference or time differences of the one or more packet pairs, where any packet in the one or more packet pairs includes a first packet and a second packet, the second packet is a response to the first packet, and the one or more packet pairs pass through a same access device. The determining unit is configured to determine a type of the access device based on the time difference or the time differences of the one or more packet pairs.
In an embodiment, the first packet is a synchronize sequence number acknowledgement packet of a TCP connection, and the second packet is an acknowledgement packet of the TCP connection.
In an embodiment, that the determining unit is configured to determine a type of the access device based on the time difference or the time differences of the one or more packet pairs is: The determining unit is configured to determine the type of the access device based on a time difference threshold and the time difference or the time differences of the one or more packet pairs.
In an embodiment, the determining unit is configured to determine the type of the access device based on the time difference threshold and the time difference or the time differences of the one or more packet pairs.
In an embodiment, that the determining unit is configured to determine the type of the access device based on a time difference threshold and the time difference or the time differences of the one or more packet pairs is: The determining unit is configured to compare a mean value or a median of the time differences of the plurality of packet pairs with the time difference threshold, to determine the type of the access device.
In an embodiment, that the determining unit is configured to compare a mean value or a median of the time differences of the plurality of packet pairs with the time difference threshold, to determine the type of the access device is: The determining unit is configured to determine the type of the access device based on a proportion of a quantity of packet pairs that are greater than or less than the time difference threshold in the time differences of the plurality of packet pairs.
To describe technical solutions of the present application more clearly, the following briefly describes the accompanying drawings used in the embodiments. Apparently, the following accompanying drawings are merely accompanying drawings of some embodiments of the present application, and one of ordinary skilled in the art may derive other technical solutions and accompanying drawings of the present application from these accompanying drawings without creative efforts. These technical solutions and accompanying drawings shall also be considered as falling within the scope of the present application.
In order to enable one of ordinary skilled in the art to better understand solutions of the present application, the following further describes embodiments of the present application in detail with reference to the accompanying drawings and embodiments.
In this application, terms such as “first” and “second” are used to distinguish between same items or similar items that have basically same purposes or functions. It should be understood that there is no logical or time-sequential dependency between “first” and “second”, and a quantity and an execution sequence are not limited.
The following describes an application scenario of this application as an example.
In this scenario, the network device 101 may be an optical network terminal (ONT), or may be a network device such as a switch or a router. The access device 102 may be a wireless network access point (AP), or a device such as a switch or a router. The terminal device may be a device such as a mobile phone, a notebook computer, a personal computer, or a tablet computer.
In the scenario shown in
It should be understood that, this is merely an example. One of ordinary skilled in the art may also refer to an embodiment to perform a similar replacement and application. Examples are not provided one by one in this application.
The following describes a method for determining an access device type according to an embodiment of this application with reference to
The method may include the following operations.
S301. A packet capture device obtains a packet capture instruction, where the instruction indicates the packet capture device to obtain a packet that meets a condition and a receive time point of the packet. The packet capture instruction may be delivered by a network management system or manually configured by O&M personnel.
In an example, the packet capture instruction obtained by the packet capture device may be obtaining a TCP synchronize sequence number acknowledgement (SYNACK) packet and an acknowledgement (ACK) packet.
In an embodiment, the packet capture device may also be a device that is pre-defined or pre-configured before delivery and that can automatically capture a packet instead of having to obtain the packet capture instruction.
S303. The packet capture device obtains a first packet and a receive time point of the first packet.
The packet capture device matches the obtained instruction to obtain the first packet. When the packet capture instruction obtained by the packet capture device is obtaining a TCP SYNACK packet, the packet capture device captures a TCP SYNACK packet, and records a time point of receiving the TCP SYNACK packet. S305. The packet capture device sends the first packet and the receive time point of the first packet to a packet obtaining device.
In an example, the packet capture device sends the first packet and the receive time point of the first packet that are obtained by the packet capture device to the packet obtaining device within a specified time period.
S307. The packet capture device obtains a second packet and a receive time point of the second packet.
The first packet and the second packet pass through a same access device, that is, the first packet and the second packet may be sent by the same access device, or may be sent by different devices, but there is a same access device for forwarding or sending the first packet and the second packet on forwarding paths of the first packet and the second packet.
In another example, the first packet is a SYNACK packet sent by a service device in response to a TCP handshake synchronization packet sent by a terminal device, and the second packet is a TCP ACK packet sent by the terminal device in response to a TCP SYNACK packet sent by the service device.
In an embodiment, when the first packet and the second packet are a TCP SYNACK packet and/or a TCP ACK packet, the packet capture device receives the first packet from a physical interface that is of the packet capture device and that is far from the access device, for example, a wide area network (WAN) interface. That is, the first packet is a packet sent from a service side to an access device side. The packet capture device receives the second packet from a physical interface that is of the packet capture device and that is close to the access device, for example, a local area network (LAN) interface. That is, the second packet is a packet sent from the access device side to the service side.
S309. The packet capture device sends the second packet and the receive time point of the second packet to the packet obtaining device.
S305 and S309 may both be performed after S307. Alternatively, the packet capture device may generate one or two packets based on the captured first packet and second packet and the receive time points of the first packet and the second packet, to replace the packets in S305 and S309.
In an example, the two packets generated by the packet capture device to replace the packets in S305 and S309 include packet characteristic information of the first packet and the second packet and receive time point information of the two packets. The packet characteristic information may be IP 5-tuple information determined by the packet capture device based on a same TCP connection, including a destination IP address, a source IP address, a destination port number, a source port number, and a transport layer protocol. That is, when IP 5-tuples of the two packets can correspond to each other, the two packets are considered as a packet pair.
The packet characteristic information may alternatively be an identifier generated by the packet capture device to indicate a packet of the same TCP connection. For example, the identifier may be a packet identifier obtained by the packet capture device by performing a hash algorithm based on an IP 5-tuple. The packet may further include an identifier of the access device, and the identifier of the access device may be an IP address of the access device, an identifier of an interface through which the access device connects to the packet capture device, a MAC address of the access device, an access device name allocated by the packet capture device to the access device, or any combination thereof. It should be understood that when only the access device is connected to the packet capture device, the identifier of the access device is not mandatorily carried.
S311. The packet obtaining device obtains one or more packet pairs.
The packet obtaining device may obtain a plurality of packets, and determine, by matching information of the plurality of packets, that two packets are a packet pair. For example, the packet obtaining device determines that the first packet and the second packet are a packet pair by determining that the two packets are a TCP SYNACK packet and an ACK packet that are connected to a same TCP.
In an embodiment, when the packet obtaining device obtains the one or more packet pairs, the packet obtaining device further obtains an identifier of an access device that the packet pairs pass through, including an IP address of the access device, a MAC address of the access device, an identifier of an interface through which the packet capture device connects to the access device, a name of the access device, or the like.
In an embodiment, when the packet obtaining device obtains the one or more packet pairs, the packet obtaining device further obtains a manner of connecting the access device that the packet pairs pass through and the packet capture device, for example, a wired connection or a wireless connection.
In an example, the packet obtaining device obtains packet pair information shown in
S313. The packet obtaining device obtains a time difference or time differences of the one or more packet pairs.
In an example, the packet obtaining device obtains a time difference of one packet pair.
In an example, that the packet obtaining device obtains information about the time difference of the packet pair is shown in
The packet obtaining device and the packet capture device may be a same device, or may be different devices. When the packet capture device and the packet obtaining device are two devices, the packet capture device needs to perform the foregoing operations S305 and S309, and the foregoing operations S305 and S309 may be performed together or may be performed separately. For example, when the packet capture device needs to send 100 packets to the packet obtaining device, the packet capture device may send the 100 packets to the packet obtaining device at a time, or the packet capture device may send the 100 packets in a plurality of times, and send one or more packets to the packet obtaining device each time, until the packet capture device sends all of the 100 packets to the packet obtaining device. When the packet capture device and the packet obtaining device are a same device, operations S305 and S309 do not need to be performed.
S315. The packet obtaining device sends the time difference or the time differences of the one or more packet pairs to a type determining device.
In an embodiment, when the packet obtaining device sends the time difference or the time differences of the one or more packet pairs to the type determining device, the packet obtaining device further sends an identifier of the packet obtaining device to the type determining device.
In an example, the identifier of the packet obtaining device may be any one of the following identifiers: a home user number of the packet obtaining device, an IP address of the packet obtaining device, an ESN code of the packet obtaining device, a MAC address of the packet obtaining device, or the like. This is not limited in this application.
In an embodiment, when the packet obtaining device sends the time difference or the time differences of the one or more packet pairs to the type determining device, the packet obtaining device further sends, to the type determining device, an identifier of an access device that the packet pair passes through, including an IP address of the access device, a MAC address of the access device, information about an interface through which the access device accesses the packet capture device, and the like. Correspondingly, when the packet capture device is connected to only one access device, an identifier of the access device is also not mandatory.
In an embodiment, when the packet obtaining device sends the time difference or the time differences of the one or more packet pairs to the type determining device, the packet obtaining device further sends, to the type determining device, a manner in which the access device that the packet pair passes through accesses the packet capture device, for example, a wired connection or a wireless connection.
It should be understood that the foregoing packet obtaining device and the type determining device may be a same device, or may be different devices. When the packet obtaining device and the type determining device are a same device, the device does not perform operation S315.
S317. The type determining device obtains the time difference or the time differences of the one or more packet pairs.
A manner in which the type determining device obtains the time difference or the time differences of the one or more packet pairs may be: The packet obtaining device actively sends the one or more packet pairs to the type determining device within a time period; or the type determining device actively obtains the time difference or the time differences of the one or more packet pairs stored by the packet obtaining device.
In an embodiment, when the type determining device actively obtains the time difference or the time differences of the one or more packet pairs from the packet obtaining device, the type determining device may further obtain a time difference or time differences of one or more packet pairs related to a specified access device.
S319. The type determining device determines a type of the access device based on the time difference or the time differences of the one or more packet pairs.
In an example, the type determining device determines, based on an obtained time difference of a packet pair, the type of the access device that the packet pair passes through. For example, when a value of the time difference is 5 milliseconds, it is determined that the type of the access device is a switch.
When the type determining device obtains the time differences of the plurality of packet pairs, the type determining device may determine the type of the access device based on a result such as a mean value or a median of the time differences of the plurality of the packet pairs, or a mean value or a median obtained after a time difference with a relatively large deviation is removed.
In an embodiment, the type determining device determines the type of the access device based on a time difference threshold and the time difference or the time differences of the one or more packet pairs.
The time difference threshold may be a time difference threshold delivered by a network management system, a time difference threshold manually configured by O&M personnel, or a time difference threshold calculated by the type determining device. This is not limited in this application. The time difference threshold may alternatively be predefined or pre-configured before the type determining device is delivered from a factory, instead of a time difference threshold that has to be obtained additionally.
In an example, the time difference threshold is 4 milliseconds, and the time difference threshold indicates that when a time difference of a packet pair passing through an access device is greater than or equal to 4 milliseconds, the access device is an AP. The time difference threshold may further indicate that when a time difference of a packet pair passing through an access device is less than or equal to 4 milliseconds, the access device is a switch. For example, when a time difference of a packet pair obtained by the type determining device is 10 milliseconds, the access device is an AP. For example, when a time difference of a packet pair obtained by the type determining device is 2 milliseconds, the access device is a switch or a personal computer.
In an embodiment, the type determining device compares the mean value of the time differences of the plurality of packet pairs with the time difference threshold, to determine the type of the access device.
In an example, when the type determining device obtains the time differences of the plurality of packet pairs, the type determining device may determine the type of the access device based on a result of comparing the time difference threshold with the mean value or the median of the time differences of the plurality of packet pairs or the mean value or the median obtained after the time difference with the relatively large deviation is removed. For example, when the result is greater than or equal to 4 milliseconds, the type determining device considers that the access device is an AP; or when the result is less than or equal to 4 milliseconds, the type determining device considers that the access device is a switch or a personal computer.
In an embodiment, the type determining device determines the type of the access device based on a proportion of a quantity of packet pairs that are greater than or less than the time difference threshold in the time differences of the plurality of packet pairs.
It should be understood that the foregoing “greater than or less than” may be “greater than and equal to, or less than and equal to”, that is, a scenario of “equal to” is also taken into account.
The proportion may be a quantity of time differences greater than the time difference threshold divided by a total quantity of time differences, a quantity of time differences less than the time difference threshold divided by the total quantity of time differences, the quantity of time differences greater than the time difference threshold divided by the quantity of time differences less than the time difference threshold, or the like. This is not limited in this application.
In an example, assuming that the total quantity of time differences of the plurality of packet pairs received by the type determining device is 20. If the quantity of time differences that are greater than or equal to the time difference threshold is 18, the proportion may be 90%, and the proportion is a high-probability proportion. In this case, the type determining device determines that the access device is an AP. If the quantity of time differences that are less than or equal to the time difference threshold is 4, the proportion may be 20%, and the proportion is a low-probability proportion. In this case, the type determining device determines that the access device is a switch or a personal computer. Alternatively, if the quantity of time differences that are greater than or equal to the time difference threshold is 15, and the quantity of time differences that are less than the time difference threshold is 5, the proportion may be 3, which is greater than 1. In this case, the type determining device determines that the access device is an AP.
The foregoing describes the method for determining an access device type in the embodiments of this application. The following describes a network device provided in the embodiments of this application.
The network device 700 includes an obtaining unit 701 and a transceiver unit 702. The obtaining unit 701 may be configured to perform, for example, operations S301, S303, and S307 and related optional manners in the embodiment of
The network device 800 includes an obtaining unit 801 and a transceiver unit 802. The obtaining unit 801 may be configured to perform, for example, operations S311 and S313 and related optional manners in the embodiment of
The network device 900 includes an obtaining unit 901 and a determining unit 902. The obtaining unit 901 may be configured to perform, for example, operation S317 and related optional manners in the embodiment of
It should be understood that the methods corresponding to the network devices 700, 800, and 900 shown above may be performed by a plurality of network devices, or may be performed by one device. For example, a network device 101 may perform both methods performed by the network device 700 and the network device 800, a server may perform both methods performed by the network device 800 and the network device 900, and the network device 101 may perform all methods performed by the network device 700, the network device 800, and the network device 900. It should be noted that, when the network device 700 provided in the embodiment of
The foregoing describes the network devices in the embodiments of this application, and the following describes possible product forms of the network devices. It should be understood that any form of product that has features of the network device 700 in
The processor 1001 may be a general-purpose central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to control program execution of the solutions in this application. The processor may be configured to implement the method for determining an access device type provided in the embodiments of this application.
For example, when the packet capture device in the embodiment of
The communication bus 1002 is configured to transmit information between the processor 1001, the communication interface 1004, the communication interface 1005, and the memory 1003.
The memory 1003 may be a read-only memory (ROM), for example, an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM), or another compact disc or optical disc storage (including a compressed optical disc, a laser disc, an optical disc, a digital versatile disc, a Blu-ray disc, or the like). Alternatively, the memory 1003 may be a random access memory (RAM) or another type of dynamic storage device that can store information and instructions.
The memory 1003 may exist independently, and is connected to the processor 1001 by using the communication bus 1002. Alternatively, the memory 1003 may be integrated with the processor 1001.
In an embodiment, the memory 1003 is configured to store program code or instructions for executing the solutions of this application, and the processor 1001 controls the execution. The processor 1001 is configured to execute the program code stored in the memory 1003. The program code may include one or more software modules. In an embodiment, the processor 1001 may alternatively store program code or instructions for executing the solutions of this application.
The communication interface 1004 is any apparatus such as a transceiver, and is configured to communicate with another device or a communication network. The communication network may be the Ethernet, a radio access network (RAN), a WLAN, or the like. In an embodiment of the application, the communication interface 1004 may be configured to receive the first packet sent by another network device, or may send the first packet to an access network device or another network device. The communication interface 1004 may be an Ethernet interface, a Fast Ethernet (FE) interface, or a Gigabit Ethernet (GE) interface.
The communication interface 1005 is any apparatus such as a transceiver, and is configured to communicate with another device or a communication network. The communication network may be the Ethernet, a RAN, a WLAN, or the like. In an embodiment of the application, the communication interface 1005 may be configured to receive the second packet sent by the access device, or may send the second packet to another network device. The communication interface 1005 may be an Ethernet interface, a FE interface, or a GE interface.
In an embodiment, the device 1000 may include a plurality of processors, for example, the processor 1001 and a processor 1005 shown in
The processor 1101 may be a general-purpose CPU, an ASIC, or one or more integrated circuits configured to control program execution of the solutions in this application. The processor may be configured to implement the method for determining an access device type provided in the embodiments of this application.
For example, when the packet obtaining device in the embodiment of
The communication bus 1102 is configured to transmit information between the processor 1101, the communication interface 1104, and the memory 1103.
The memory 1103 may be a ROM, for example, an EEPROM, a CD-ROM, or another compact disc or optical disc storage (including a compressed optical disc, a laser disc, an optical disc, a digital versatile disc, a Blu-ray disc, or the like). Alternatively, the memory 1003 may be a RAM or another type of dynamic storage device that can store information and instructions.
The memory 1103 may exist independently, and is connected to the processor 1101 by using the communication bus 1102. Alternatively, the memory 1103 may be integrated with the processor 1101.
In an embodiment, the memory 1103 is configured to store program code or instructions for executing the solutions of this application, and the processor 1101 controls the execution. The processor 1101 is configured to execute the program code stored in the memory 1103. The program code may include one or more software modules. In an embodiment, the processor 1101 may alternatively store program code or instructions for executing the solutions of this application.
The communication interface 1104 is any apparatus such as a transceiver, and is configured to communicate with another device or a communication network. The communication network may be the Ethernet, a RAN, a WLAN, or the like. In an embodiment of the application, the communication interface 1104 may be configured to receive a first packet sent by another network device, or may send the first packet to an access network device or another network device. The communication interface 1104 may be an Ethernet interface, a FE interface, or a GE interface.
In an embodiment, the device 1100 may include a plurality of processors, for example, the processor 1101 and a processor 1105 shown in
It should be understood that the foregoing product forms of the network devices have any function of the network devices in the foregoing method embodiments for determining an access device type, and details are not described herein.
One of ordinary skilled in the art may be aware that, the method operations and units that are described with reference to the embodiments disclosed in this specification can be implemented by electronic hardware, computer software, or a combination thereof. To clearly describe interchangeability between the hardware and the software, the foregoing has generally described operations and compositions of each embodiment based on functions. Whether the functions are performed by hardware or software depends on particular applications and design constraints of the technical solutions. One of ordinary skilled in the art may use different methods to implement the described functions for each particular application, but it should not be considered that the implementation goes beyond the scope of this application.
It may be clearly understood by one of ordinary skilled in the art that, for a purpose of convenient and brief descriptions, for a detailed working process of the foregoing system, apparatus and unit, refer to a corresponding process in the foregoing method embodiments. Details are not described herein again.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in another manner. For example, the described apparatus embodiment is merely an example. For example, division into units is merely logical function division. In an embodiment, there may be another division manner. For example, a plurality of units or components may be combined or integrated into another system, or some features may be ignored or not performed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections may be implemented through some interfaces, and indirect couplings or communication connections between apparatuses or units may be implemented in an electrical form or another form.
Units described as separate components may or may not be physically separated, and components displayed as the units may or may not be physical units. That is, the units may be located at one location, or may be distributed to a plurality of network units. Some or all of the units may be selected based on an actual requirement to implement the objectives of the solutions in the embodiments of this application.
In addition, the processing units in the embodiments of this application may be dispersed in a plurality of function units, or may be integrated into one processing unit. Each of the units may exist alone physically, or two or more units may be integrated into one unit. The integrated unit may be implemented in a form of hardware, or may be implemented in a form of a software function unit.
All or some of the foregoing embodiments may be implemented by using software, hardware, firmware, or any combination thereof. When the software, the firmware or the combination of the software and the hardware is used to implement the embodiments, all or some of the embodiments may be implemented in a form of a computer program product. The computer program product includes one or more computer program instructions. When the computer program instructions are loaded and executed on a computer, the procedures or the functions according to the embodiments of this application are all or partially generated. The computer may be a general-purpose computer, a dedicated computer, a computer network, or another programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or may be transmitted from a computer-readable storage medium to another computer-readable storage medium. For example, the computer program instructions may be transmitted from a website, a computer, a server, or a data center to another website, computer, server, or data center in a wired or wireless manner. The computer-readable storage medium may be any medium accessible by a computer, or a data storage device, for example, a server or a data center, integrating one or more media. The medium may be a magnetic medium (for example, a floppy disk, a hard disk, or a magnetic tape), an optical medium (for example, an optical disc), a semiconductor medium (for example, a solid-state drive), or the like.
The objectives, technical solutions, and beneficial effects of the present application are further described in detail in the foregoing specific implementations. It should be understood that the foregoing descriptions are merely specific implementations of the present application, but are not intended to limit the protection scope of the present application. Any modification, equivalent replacement, or improvement made based on the technical solutions of the present application shall fall within the protection scope of the present application.
Number | Date | Country | Kind |
---|---|---|---|
201911071868.X | Nov 2019 | CN | national |
This application is a continuation of International Application No. PCT/CN2020/106483, filed on Aug. 1, 2020, which claims priority to Chinese Patent Application No. 201911071868.X, filed on Nov. 5, 2019. The disclosures of the aforementioned applications are hereby incorporated by reference in their entireties.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/CN2020/106483 | Aug 2020 | US |
Child | 17735330 | US |