CN111083055B - Client device management method and device, router and storage medium - Google Patents

Client device management method and device, router and storage medium Download PDF

Info

Publication number
CN111083055B
CN111083055B CN201911172813.8A CN201911172813A CN111083055B CN 111083055 B CN111083055 B CN 111083055B CN 201911172813 A CN201911172813 A CN 201911172813A CN 111083055 B CN111083055 B CN 111083055B
Authority
CN
China
Prior art keywords
client
client devices
client device
list
router
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
CN201911172813.8A
Other languages
Chinese (zh)
Other versions
CN111083055A (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.)
Shenzhen Gongjin Electronics Co Ltd
Original Assignee
Shenzhen Gongjin Electronics 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 Shenzhen Gongjin Electronics Co Ltd filed Critical Shenzhen Gongjin Electronics Co Ltd
Priority to CN201911172813.8A priority Critical patent/CN111083055B/en
Publication of CN111083055A publication Critical patent/CN111083055A/en
Application granted granted Critical
Publication of CN111083055B publication Critical patent/CN111083055B/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
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/10Mapping addresses of different types
    • H04L61/103Mapping addresses of different types across network layers, e.g. resolution of network layer into physical layer addresses or address resolution protocol [ARP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • H04L61/5014Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/618Details of network addresses
    • H04L2101/622Layer-2 addresses, e.g. medium access control [MAC] addresses

Landscapes

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

Abstract

The application is applicable to the technical field of data communication, and provides a client management method, a device, a router and a storage medium applied to Mesh networking, wherein the client management method, the device, the router and the storage medium comprise: sending first ARP request messages to M pieces of client equipment according to IP addresses of the M pieces of client equipment recorded in a pre-stored temporary client equipment list; when first ARP response messages sent by N client devices in the M client devices are received, inquiring MAC addresses of the N client devices recorded in the temporary client device list from a Forwarding Database (FDB) table of the router, and determining K client devices which are directly connected with the router in the N client devices; and generating an online direct connection client device list according to the IP addresses and the MAC addresses of the K client devices. The method and the device can solve the problem that the client equipment list of the router cannot be updated in time due to the change of the network topology and the roaming switching of the client terminal equipment.

Description

Client device management method and device, router and storage medium
Technical Field
The present application belongs to the technical field of data communication, and in particular, to a method, an apparatus, a router, and a storage medium for managing devices by a client.
Background
In order to know the condition of the client devices connected to the network, the existing router maintains a list of client devices for displaying basic information of the client devices currently connected to the router. In order to accurately know the condition of the currently connected client device in real time, each router periodically maintains the client device list. For example, the IP Address is allocated by monitoring a Dynamic Host Configuration Protocol (DHCP) process or an Address Resolution Protocol (ARP) message process, so as to update the client device list.
However, in a wireless Mesh network (Mesh networking), a plurality of routers, such as one master device (master) and at least one slave device (slave), are included. When a client device (host) is connected to any router in the Mesh network, the main device allocates an IP address to the client device. The IP address does not change when the client device is handed off roamingly between the various routers. Therefore, when the client device roams among the routers, the routers in the Mesh network often cannot timely know which client devices have been switched to other routers or offline, so that the routers cannot timely update the client device list.
Disclosure of Invention
The embodiment of the application provides a client device management method, a client device management device, a router and a storage medium, and aims to solve the problem that a client device list cannot be updated in time in the prior art.
In a first aspect, an embodiment of the present application provides a client device management method, which is applied to a router in a Mesh networking, and is characterized in that the method includes:
sending a first Address Resolution Protocol (ARP) request message to M client devices according to IP addresses of the M client devices recorded in a pre-stored temporary client device list, wherein the first ARP request message is used for requesting the M client devices to feed back first ARP response messages, M is greater than or equal to 1 and is a natural number;
when first ARP response messages sent by N client devices in the M client devices are received, the MAC addresses of the N client devices recorded in the temporary client device list are inquired from a Forwarding Database (FDB) table of the router, K client devices which are directly connected with the router in the N client devices are determined, wherein M is not less than N and not less than 0, N is not less than K and not less than 0, K is a natural number, and N is a natural number;
and generating an online direct connection client device list according to the IP addresses and the MAC addresses of the K client devices.
In a second aspect, an embodiment of the present application provides a client device management apparatus, where the apparatus includes:
the message sending module is used for sending first ARP request messages to the M client devices according to IP addresses of the M client devices recorded in a pre-stored temporary client device list, wherein the first ARP request messages are used for requesting the M client devices to feed back first ARP response messages, M is greater than or equal to 1, and M is a natural number;
an address query module, configured to, when receiving first ARP reply messages sent by N client devices of the M client devices, query, from a forwarding database FDB table of the client device management apparatus, MAC addresses of the N client devices recorded in the temporary client device list, and determine K client devices of the N client devices that are directly connected to the client device management apparatus, where M is greater than or equal to N and greater than or equal to 0, N is greater than or equal to J and greater than or equal to 0, J is a natural number, and N is a natural number;
and the list generating module is used for generating an online direct connection client device list according to the IP addresses and the MAC addresses of the K client devices.
In a third aspect, an embodiment of the present application provides a router, including: comprising a memory, a processor and a computer program stored in said memory and executable on said processor, said processor implementing said client management method when executing said computer program.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, including: the computer-readable storage medium stores a computer program that, when executed by a processor, implements the client management method.
In a fifth aspect, an embodiment of the present application provides a computer program product, which when running on a router, causes a processor to execute the client management method according to any one of the first aspect.
It is understood that the beneficial effects of the second aspect to the fifth aspect can be referred to the related description of the first aspect, and are not described herein again.
Compared with the prior art, the embodiment of the application has the advantages that: the router monitors whether M pieces of client equipment recorded in the temporary client equipment list are online or not through the first ARP request message; and performing FDB table query on the MAC addresses of the online N clients, thereby effectively eliminating the client devices which are offline and the client devices which are online but not directly connected with the router in the temporary client device list. Therefore, the correctness of the finally generated online directly-connected client device list is ensured, and managers can conveniently and clearly know the client devices which are online in the Mesh networking and directly connected with the router.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic diagram of a Mesh networking architecture according to an embodiment of the present application;
fig. 2 is a schematic diagram illustrating a connection change of a wireless client in a Mesh networking according to an embodiment of the present application;
fig. 3 is a schematic flowchart of a client management method according to another embodiment of the present application;
FIG. 4 is a flowchart illustrating a method for updating a list of temporary client devices according to an embodiment of the present application;
fig. 5 is a flow chart illustrating a method for querying an association list of a wireless client according to an embodiment of the present application;
fig. 6 is a flow chart illustrating a method for querying an association list of a wireless client according to another embodiment of the present application;
fig. 7 is a schematic structural diagram of a client management device according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a router according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to" determining "or" in response to detecting ". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise.
The client device management method is suitable for Mesh networking. To explain the technical solution of the present application, first, referring to fig. 1 to fig. 2, a Mesh networking related to a client device management method provided by the present application is exemplarily explained.
The Mesh networking comprises a master device (master), at least one slave device (slave) and at least one client device (host). The master device and the slave device are both routers in Mesh networking and are used for providing network coverage for the client device. The master device is a device connected with the Internet in the Mesh networking, can be connected with the slave device in a wired or wireless mode, and can also be directly connected by the client device; the slave device is a device for extending the coverage of the master device in the Mesh networking, and can be connected to the master device or the slave device at the upper level in a wired or wireless manner, and can be directly connected by the client device. Specifically, no matter the client device is directly connected with the master device or the slave device, the IP address of each client device is directly or indirectly allocated by the DHCP server of the master device, and each master device or the slave device forms a respective client device list according to the client device directly connected with the master device or the slave device, and maintains and updates the client device list.
Exemplarily, referring to fig. 1, fig. 1 is a schematic diagram of a system architecture of a Mesh networking provided in the present application. The client-side equipment list comprises master equipment, slave equipment 1, slave equipment 2, slave equipment 3, client-side equipment 1, client-side equipment 2, client-side equipment 3, client-side equipment 4 and client-side equipment 5, wherein both the client-side equipment 1 and the client-side equipment 2 are directly connected with the master equipment, and therefore only information of the client-side equipment 1 and the client-side equipment 2 is recorded and displayed in the client-side equipment list of the master equipment. Both the client device 3 and the client device 4 are directly connected to the slave device 1, and therefore, only the information showing the client device 3 and the client device 4 is recorded in the client device list of the slave device 1. Similarly, the client device 5 is directly connected to the slave device 3, and only the information indicating the client device 5 is recorded in the client device list of the slave device 3. For slave 2, however, the client device list is empty because it has no client device directly connected to it.
When the client devices move between the master device and each slave device in the Mesh networking, the master device or the slave devices need to maintain and update the respective client device lists. For example, the location of the wireless client device 3 changes the connection situation in Mesh networking as shown in fig. 2. In Mesh networking, a master device and each slave device are distributed within a certain distance range, wireless client devices in the networking move along with the positions, and Mesh networking access points of the client devices also change between the master device and the slave devices. For example, when the client device 3 is connected to the master device from the slave device 1, the client device lists of both the slave device 1 and the master device need to be updated. Similarly, if the client device moves from the master device to the slave device 2, or even moves to the slave device 3, the client device information in the corresponding client device list needs to be updated and maintained in time. For example, taking the master device as an example, according to the movement of the client device 3, the client list of the master device should be changed according to the records of the following tables 1 to 3:
table 1 client device 3 before movement
Figure BDA0002289183690000061
Table 2 client device 3 moves 1 time later
Figure BDA0002289183690000062
Table 3 client device 3 moves 2 times later
Figure BDA0002289183690000063
However, in the prior art, since the master device does not know the change of the direct connection position of the online client device in the Mesh networking, the client device list of the master device cannot be updated in time. For example, when the client device 3 moves from the slave device 1 to the master device, the client device list of the master device still displays table 1, so that the situation of the client devices which are actually connected to the master device directly online is inconsistent with the display of the client device list of the master device, and the management difficulty of the client devices in Mesh networking is greatly increased.
Therefore, the client device management method provided by the application can enable a router (which may be a master device or a slave device) in the Mesh networking to timely determine the client devices which are online and directly connected with the router, and timely maintain and update the client device list managed by the router.
The following describes an exemplary client device management method according to an embodiment.
Referring to fig. 3, a schematic flowchart of a client device management method provided in an embodiment of the present application is shown. In this embodiment, the execution subject of the client device management method is a router in the Mesh networking. The method comprises the following steps:
s101: sending a first Address Resolution Protocol (ARP) request message to the M client devices according to IP addresses of the M client devices recorded in a pre-stored temporary client device list, where the first ARP request message is used to request the M client devices to feed back a first ARP reply message, where M is greater than or equal to 1 and is a natural number.
In this embodiment, a temporary client device list is maintained in the router, and is used to record information of the client devices that have established connection in the Mesh networking, including information of the client devices that have been directly connected to the router in the past and information of the client devices that have been directly connected to any router in the Mesh networking in the past. The client device information includes: an Internet Protocol Address (IP Address), a physical Address (MAC Address), and a host name of the client device.
In order to ensure the accuracy in the maintained client device list, the routers in the Mesh networking need to be updated in real time, that is, the first ARP request packet is sent according to the IP addresses of the client devices recorded in the temporary client device lists maintained by the routers, so as to determine whether the client devices are online (i.e., whether the client devices are connected in the Mesh networking). Wherein, ARP is a TCP/IP protocol for obtaining MAC address according to IP address. When the client device is online, the client device receives the first ARP request message and feeds back a first ARP reply message no matter which router in the Mesh network the client device is currently connected to.
Therefore, when the router receives a first ARP reply message sent by a certain client device, the router can confirm that the client device is online.
In addition, according to the fed back first ARP response message, the IP address and the physical address recorded in the response message are stored in the local ARP cache and are reserved for a certain time, and the ARP cache can be directly queried when online query is performed next time so as to save resources.
S102: when first ARP response messages sent by N client devices in the M client devices are received, the MAC addresses of the N client devices recorded in the temporary client device list are inquired from a Forwarding Database (FDB) table of the router, K client devices in the N client devices, which are directly connected with the router, are determined, wherein M is not less than N and not less than 0, N is not less than K and not less than 0, K is a natural number, and N is a natural number.
In this embodiment, the router receives the MAC address information from all its ports, forms a MAC address table and maintains the table, that is, the MAC address table maintained by the router is the FDB table. The FDB table records MAC address information of clients directly connected to the router.
Each FDB table includes a MAC address, a Port number (Port) associated with the MAC address, a name (VLAN name) of a VLAN associated with the MAC address, and a flag (Flags) of the FDB table.
Specifically, in this step S102, the MAC addresses of N client devices returning the first ARP reply packet in the temporary client device list are queried from the FDB table, so that it can be determined whether the N client devices are directly connected to the router. If the MAC addresses of K client devices are recorded in the FDB address table of the router, the fact that the K client devices are directly connected with the router in the Mesh networking is indicated.
S103: and generating an online direct connection client device list according to the IP addresses and the MAC addresses of the K client devices.
For example, the IP addresses and MAC address information of 4 client devices in the temporary client device list are extracted, sorted and summarized to generate a new client device list, and the new client device list is used as an online direct connection client device list of the master device or the slave device, thereby completing maintenance and update of the client device list of the router.
Optionally, for step 103, when the router generates the online direct connection client device list, the host names of the K client devices may be obtained according to the IP addresses and MAC addresses of the K client devices; and then generating the online direct connection client device list according to the IP addresses, the MAC addresses and the host names of the K client devices.
In order to ensure that the list information of the online direct connection client devices generated by the router is accurate, one or more methods of Dynamic Host Configuration Protocol (DHCP) monitoring, server protocol (NBNS) query, and multicast dns (mdns) query may be used to determine the host names of different types of client devices in the K client devices. For example, the K client devices may include a device that loads a Windows system, a device that employs an ios apple operating system and a device that employs an android operating system, and the like. The NBNS query method is only effective for devices supporting the NBNS protocol, such as most devices that load a Windows system. Or the MDNS query mode is only valid for devices supporting the MDNS protocol, such as devices of the ios apple operating system and devices using the android operating system.
Specifically, the DHCP monitoring is implemented, where the DHCP message carries the host name of the client device, and the MAC address, the IP address, and the host name information of the client device are obtained and recorded by analyzing the DHCP message, and are queried according to the MAC address information in the temporary client device list, and the host name of the client device corresponding to the temporary client device list is updated according to the DHCP query monitoring result.
The NBNS query is realized by generating an NBNS query message according to the MAC address and IP address information of the client device in the temporary client device list, trying to query the host name of the corresponding device through a response message, and updating the host name of the corresponding device in the temporary client device list.
The MDNS query is realized by transplanting a third-party MDNS open source tool, sending and monitoring an MDNS message and acquiring equipment MAC, IP and host name information; and inquiring the result of MDNS monitoring, and updating the host name of the corresponding equipment in the temporary client equipment list.
It should be noted that, the specific implementation process of the several query modes in the prior art may be specifically referred to in the process of querying the host name of the client device by using several modes, such as DHCP monitoring, NBNS query, MDNS query, etc., and will not be described herein again.
The following describes, by taking the slave master device as an example, an exemplary process of S101-103 in conjunction with fig. 1.
It is assumed that, at the present time, MAC addresses and IP addresses of 10 client devices, that is, the client device 1, the client device 2, the client device 3, the client device 4, the client device 5, the client device 6, the client device 7, the client device 8, the client device 9, and the client device 10 are recorded in the temporary client device list of the master device. After the first ARP request packet is queried in step S101, the master device receives the first ARP reply packet fed back by 6 client devices, that is, the client device 1, the client device 2, the client device 4, the client device 6, the client device 7, and the client device 10. Therefore, the master device determines that 6 client devices in the temporary client device list are online, which are client device 1, client device 2, client device 4, client device 6, client device 7, and client device 10, respectively. Next, based on the process of step S102, the master device performs FDB table query on the 6 client devices, and determines that the MAC addresses of 3 client devices are recorded in the FDB table of the router by comparing the MAC addresses of the 6 client devices recorded in the temporary client device list with the MAC addresses recorded in the FDB table of the router one by one, and the client devices are client device 1, client device 7, and client device 10, respectively.
For example, local-host and host-active tags may be set in the temporary client device list. The online mark is used for marking whether the client is online or not, when the client device is online, the mark is 1, and when the client device is not online, the mark is 0. The direct connection mark is used for marking whether the client device is directly connected with the router or not, when the client device is directly connected with the main device, the mark is 1, and when the client device is not directly connected with the main device, the mark is 0.
Then, after the main device goes through the operations of steps S101 to S102, the list of the subsequent temporary client devices is as follows:
table 4 master temporary client device list
Client device name IP address MAC address local-host host-active
Client device 1 113.70.101.201 00:90:4c:1d:a0:61 1 1
Client device 2 113.70.101.202 00:90:4c:24:d4:51 1 0
Client device 3 113.70.101.203 02:90:4c:1d:a0:61 0 0
Client device 4 113.70.101.204 02:90:4c:24:d4:61 1 0
Client device 5 113.70.101.205 00:90:4c:13:a5:41 0 0
Client device 6 113.70.101.206 00:90:4c:1d:a0:61 1 0
Client device 7 113.70.101.207 00:90:4c:1d:a0:61 1 1
Client device 8 113.70.101.208 d8:cb:8a:62:b4:e4 0 0
Client device 9 113.70.101.209 d8:cb:8a:1d:a0:61 0 0
Client device 10 113.70.101.210 00:90:4c:1d:a0:61 1 1
Based on table 4, when the master device generates the online-direct connection client device list according to the IP addresses and MAC addresses of the 3 client devices in step S103, the master device may extract the IP addresses and MAC addresses of the client devices with local-host-1 and host-active-1 from the temporary client list, and generate the online-direct connection client device list. For example, the online direct connection client device list generated by the master device through step S103 is as follows:
table 5 master device online direct connection client device list
Client device name IP address MAC address
Client device 1 113.70.101.201 00:90:4c:1d:a0:61
Client device 7 113.70.101.207 00:90:4c:1d:a0:61
Client device 10 113.70.101.210 00:90:4c:1d:a0:61
Optionally, the master device may further generate a current offline list, that is, an offline client device list is generated according to the IP addresses and MAC addresses of M-K client devices, except the K client devices, in the M client devices.
For example, the master device may extract IP addresses and MAC addresses of 7 client devices of the 10 client devices, except for the client device 1, the client device 7, and the client device 10, from the temporary client device list to generate an offline client device list. That is, the master device may extract client device information of local-host-1 and host-active-1 from the temporary client device list, and generate a current online direct connection client device list; and extracting client device information with local-host-0 and host-active-0, or local-host-1 and host-active-0, and generating a current offline client device list. Examples are shown in table 6 below:
table 6 master device current offline client device list
Client device name IP address MAC address
Client device 2 113.70.101.202 00:90:4c:24:d4:51
Client device 3 113.70.101.203 02:90:4c:1d:a0:61
Client device 4 113.70.101.204 02:90:4c:24:d4:61
Client device 5 113.70.101.205 00:90:4c:13:a5:41
Client device 6 113.70.101.206 00:90:4c:1d:a0:61
Client device 8 113.70.101.208 d8:cb:8a:62:b4:e4
Client device 9 113.70.101.209 d8:cb:8a:1d:a0:61
In one embodiment, the router may update the temporary client device list in real-time based on monitoring the second ARP packet. For example, in a possible scenario with reference to fig. 1, a client device 1 and a client device 2 are connected to a master device respectively, and when the client device 1 sends information to the client device 2 and lacks an MAC address of the client device 2, the client device 1 needs to send a second ARP request packet according to the IP address of the client device 1 via the master device to obtain the IP address and the MAC address of the client device 2, so as to form an effective ARP mapping table entry of the client device 2. When the client device 1 sends a second ARP request message via the master device, the slave device 1, the slave device 2, and the slave device 3 in the Mesh networking may all receive the second ARP request message, but only the client device 2 may return a second ARP reply message according to the second ARP request message, and the master device, the slave device 1, the slave device 2, and the slave device 3 in the same Mesh networking may record an IP address and an MAC address carried in the ARP message according to the second ARP request message and the second ARP reply message, and record the IP address and the MAC address in their respective temporary client device lists.
In another possible scenario, for example, for a new client device a and an old client device B that are already connected to the master device in the Mesh network, both IP addresses have been obtained by assignment, but no data transmission and exchange has been performed in the Mesh network. Therefore, the IP address and the MAC address of the new client device a are not yet recorded by the old client device B, and when the new client device a sends a data exchange request to the old client device B, the new client device a needs to perform a second ARP packet broadcast in the Mesh networking first to find the MAC address of the information receiver, that is, broadcast the second ARP request packet according to the IP address of the old client device B in the Mesh networking.
Then the router may update its maintained temporary client device list based on the second ARP request message.
Fig. 4 is a schematic flowchart of a client device management method according to another embodiment of the present application, and mainly relates to a process of updating a temporary client device list when a second ARP request message flow occurs. The method comprises the following steps:
s201: and sending a second ARP request message to the client equipment according to the IP address of the client equipment, wherein the second ARP request message is used for requesting the client equipment to report the MAC address.
S202: and receiving a second ARP response message sent by the client equipment, wherein the second ARP response message carries the MAC address of the client equipment.
S203: adding the MAC address and the IP address of the client device to the temporary client device list.
In another embodiment, the router may also update the temporary list of client devices based on the wireless association list. The wireless association list is an association list of wireless clients in a wireless driver layer of the router, and client equipment connected with the router in a wireless mode is recorded in the wireless association list.
Fig. 5 is a schematic flow chart of a client device management method according to another embodiment of the present application, and mainly relates to a process of updating a temporary client device list based on a wireless association list. The method comprises the following steps:
s301: and periodically inquiring whether the MAC address of the client device which is recorded in the wireless association list and completes wireless driving with the router device is recorded in the current temporary client device list.
And the current temporary client equipment list is a temporary client equipment list at the moment when the router is to be maintained and updated. The wireless association list at least comprises information of host names, IP addresses, MAC addresses and the like of the client devices.
In a possible scenario, before the wireless router a sends the first ARP request packet to the M client devices according to the IP addresses of the M client devices recorded in the current temporary client device list, that is, after the wireless router a sends the first ARP request packet according to the IP addresses of the client devices in the temporary client device list at the previous time, until the wireless router a sends the first ARP request packet according to the IP addresses of the client devices in the current temporary client device list, a new client device C connected to the wireless router a in the Mesh networking exists in the period. During this period, no ARP packet related to the client device C exists, that is, the IP address and the MAC address of the client device C are not recorded in the current temporary client device list, and the current temporary client device list is incomplete at this time. Therefore, the wireless router a needs to periodically query the wireless association list to determine whether the MAC address of the client device C is recorded in the current temporary client device list. In another possible scenario, a client device is roaming and jumping from one router to another router, during which a second ARP request message sent by another client device cannot be replied in time, and the wireless association list of the router can be periodically queried to learn that the client device cannot be replied in time.
For example, in connection with fig. 2, the client device 3 is connected to the slave device 1 at a first time and roams to the master device at a second time. Meanwhile, the slave device 1 performs maintenance operation on the maintained client device list at the second time, and sends a second ARP request message according to the IP address of the client device 3 recorded in the temporary client device list at the second time, because the client device 3 is in a roaming state, the client device 3 cannot respond to the second ARP request message, and needs to query and confirm by querying the client device 3 in combination with the wireless association list.
S302: if the MAC address which is not recorded in the current temporary client device list exists in the wireless association list, recording the MAC address and the IP address corresponding to the MAC address in the current temporary client device list.
Through step 302, the client device connected to the Mesh networking in a wireless manner, that is, the wireless connection client device that has acquired the IP address through the DHCP request may not send the second ARP request packet or receive the second ARP request packet because data information has not been sent to the devices in the Mesh networking, and the IP address and the MAC address of the client device have not been monitored by other devices, so that the MAC address that is not recorded in the current temporary client device list exists in the wireless association list.
In this example, the effect that can be achieved is: the method can effectively prevent the situation that when the client equipment in the Mesh networking is in a roaming stage, the client equipment cannot receive the ARP request message and carries out message response, but is judged not to be on-line; or the IP address and the MAC address of the client device are not recorded by other devices, are not monitored and acquired by the ARP message, and need to be updated to a temporary client device list in time so as to prevent the update omission of the router device.
In an embodiment, after sending the first ARP request packet to the M client devices according to the IP addresses of the M client devices recorded in the temporary client device list, since there may be M-N client devices that do not feed back the first ARP reply packet, and J client devices among the M-N client devices are actually in the Mesh network but cannot construct the first ARP reply packet in the process of roaming to other master devices or slave devices, it is necessary to perform query and confirmation again on the M-N client devices after receiving the first ARP reply packets sent by the N client devices among the M client devices.
Fig. 6 is a schematic flowchart of a client device management method according to another embodiment of the present application, and mainly relates to a process of updating a temporary client device list based on a wireless association list. The method comprises the following steps:
s401: and inquiring the MAC address of the client device which is recorded in the wireless association list and completes wireless driving with the router device, and whether M-N client device MAC addresses except the N client devices in the M client devices are recorded.
S402: when J client device MAC addresses in the M-N client devices are recorded in the wireless association list, J is more than or equal to 1 and is a natural number; the querying, from the FDB table of the router, the MAC addresses of the N client devices recorded in the temporary client device list to determine K client devices directly connected to the router from the N client devices includes:
and inquiring MAC addresses of the N client devices and the J client devices from an FDB table of the router, and determining K client devices which are directly connected with the router in the N client devices and the J client devices.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Fig. 7 shows a block diagram of a client device management apparatus provided in the embodiment of the present application, corresponding to the method described in the above embodiment, and only shows the relevant parts in the embodiment of the present application for convenience of description.
Referring to fig. 7, the apparatus includes: a message sending module 100, an address query module 200, and a list generation module 300.
The message sending module 100 is configured to send a first ARP request message to M client devices according to IP addresses of the M client devices recorded in a pre-stored temporary client device list, where the first ARP request message is used to request the M client devices to feed back a first ARP reply message, M is greater than or equal to 1, and M is a natural number.
The address query module 200 is configured to, when receiving first ARP reply messages sent by N client devices of the M client devices, query MAC addresses of the N client devices recorded in the temporary client device list from a forwarding database FDB table of the client device management apparatus, and determine K client devices of the N client devices that are directly connected to the client device management apparatus, where M is greater than or equal to N and greater than or equal to 0, N is greater than or equal to K and greater than or equal to 0, K is a natural number, and N is a natural number.
The list generating module 300 is configured to generate an online direct connection client list according to the IP addresses and the MAC addresses of the K pieces of client devices.
In an embodiment, the apparatus further includes a wireless association list query module, configured to periodically query, before the packet sending module sends the first ARP request packet, whether an MAC address of a client device that completes wireless driving with the router device, which is recorded in a wireless association list, is recorded in a current temporary client list; and when the MAC address which is not recorded in the current temporary client list exists in the wireless association list, recording the MAC address and the IP address corresponding to the MAC address in the current temporary client list.
In another embodiment, the apparatus further includes a hostname query module, configured to obtain hostnames of the K client devices according to the IP addresses and MAC addresses of the K client devices. And the client equipment host names inquired by the host name inquiry module are updated to the temporary client equipment list. The list generating module 300 generates the online direct connection client device list according to the IP addresses, MAC addresses, and host names of the K client devices.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/modules, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and reference may be made to the part of the embodiment of the method specifically, and details are not described here.
Referring to fig. 8, an embodiment of the present application further provides a router 8, including: at least one processor 80, a memory 81, and a computer program 82 stored in the memory 81 and operable on the at least one processor 82, the processor 80 implementing the steps in any of the method embodiments described above when executing the computer program 82, such as the steps S101 to S103 described in fig. 3. Alternatively, the processor 80, when executing the computer program 82, implements the functions of the modules in the device embodiments, such as the functions of the modules 100 to 300 shown in fig. 7.
Illustratively, the computer program 82 may be partitioned into one or more modules/units that are stored in the memory 81 and executed by the processor 80 to accomplish the present application. The one or more modules/units may be a series of computer program instruction segments capable of performing certain functions, which are used to describe the execution of the computer program 82 in the router 8.
Those skilled in the art will appreciate that fig. 8 is merely an example of a router, does not constitute a limitation of a router, and may include more or fewer components than those shown, or some components in combination, or different components, e.g., the router may also include input-output devices, buses, etc.
The Processor 80 may be a Central Processing Unit (CPU), and the Processor 80 may also be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 81 may be an internal storage unit of the router 8 in some embodiments, such as a hard disk or a memory of the router 8. The memory 81 may also be an external storage device of the router 8 in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the router 8. Further, the memory 81 may also include both an internal storage unit of the router 8 and an external storage device. The memory 81 is used for storing an operating system, an application program, a Boot Loader (Boot Loader), data, and other programs, such as program codes of the computer programs. The memory 81 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of each functional module is illustrated, and in practical applications, the above-mentioned functional allocation may be performed by different functional units or modules according to requirements, that is, the internal structure of the apparatus is divided into different functional units or modules, so as to perform all or part of the above-mentioned functions. Each functional module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional modules are only used for distinguishing one functional module from another, and are not used for limiting the protection scope of the application. The specific working process of the modules in the apparatus may refer to the corresponding process in the foregoing method embodiment, and is not described herein again.
The embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps in the above-mentioned method embodiments.
Embodiments of the present application provide a computer program product, which when running on a router, enables a processor to implement the steps in the above method embodiments when executed.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium and can implement the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a photographing apparatus/terminal apparatus, a recording medium, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), an electrical carrier signal, a telecommunications signal, and a software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/network device and method may be implemented in other ways. For example, the above-described apparatus/network device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implementing, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (9)

1. A client device management method is applied to a router in a Mesh networking, and is characterized by comprising the following steps:
sending first ARP request messages to the M client devices according to IP addresses of the M client devices recorded in a pre-stored temporary client device list, wherein the first ARP request messages are used for requesting the M client devices to feed back first ARP response messages, M is more than or equal to 1, and M is a natural number;
when first ARP response messages sent by N client devices in the M client devices are received, the MAC addresses of the N client devices recorded in the temporary client device list are inquired from a Forwarding Database (FDB) table of the router, K client devices which are directly connected with the router in the N client devices are determined, wherein M is not less than N and not less than 0, N is not less than K and not less than 0, K is a natural number, and N is a natural number;
generating an online direct connection client device list according to the IP addresses and the MAC addresses of the K client devices;
before sending the first ARP request packet to the M client devices according to the IP addresses of the M client devices recorded in the pre-stored temporary client device list, the method further includes:
periodically inquiring whether the MAC address of the client equipment which is recorded in the wireless association list and completes wireless driving with the router equipment is recorded in a current temporary client equipment list, wherein the current temporary client equipment list is a temporary client equipment list at the moment when the router is to be maintained and updated;
if the MAC address which is not recorded in the current temporary client device list exists in the wireless association list, recording the MAC address and the IP address corresponding to the MAC address in the current temporary client device list.
2. The method of claim 1, wherein generating a list of online-direct client devices according to the IP addresses and MAC addresses of the K client devices comprises:
acquiring host names of the K pieces of client equipment according to the IP addresses and the MAC addresses of the K pieces of client equipment;
and generating the online direct connection client device list according to the IP addresses, the MAC addresses and the host names of the K client devices.
3. The method according to claim 2, wherein the obtaining the host names of the K client devices according to the IP addresses and the MAC addresses of the K client devices comprises:
and acquiring host names of the K client devices by utilizing one or more modes of DHCP monitoring, NBNS inquiry and MDNS inquiry according to the IP addresses and the MAC addresses of the K client devices.
4. The method according to claim 1, wherein before sending the first ARP request message to the M client devices according to the IP addresses of the M client devices recorded in the pre-stored temporary client device list, the method further comprises:
sending a second ARP request message to the client equipment according to the IP address of the client equipment, wherein the second ARP request message is used for requesting the client equipment to report an MAC address;
receiving a second ARP response message sent by the client equipment, wherein the second ARP response message carries the MAC address of the client equipment;
adding the MAC address and the IP address of the client device to the temporary client device list.
5. The method according to claim 1, wherein after receiving first ARP reply messages sent by N of the M client devices, the method further comprises:
inquiring MAC addresses of client devices which are recorded in a wireless association list and complete wireless driving with the router device, and whether M-N client device MAC addresses except the N client devices in the M client devices are recorded;
when J MAC addresses of the N client devices recorded in the temporary client device list are recorded in the wireless association list, where J is greater than or equal to 1 and J is a natural number, the MAC addresses of the N client devices recorded in the temporary client device list are queried from an FDB table of the router, and K client devices directly connected to the router among the N client devices are determined, including:
and inquiring MAC addresses of the N client devices and the J client devices from an FDB table of the router, and determining K client devices which are directly connected with the router in the N client devices and the J client devices.
6. The method according to any one of claims 1-5, further comprising:
and generating an offline client device list according to the IP addresses and the MAC addresses of M-K client devices except the K client devices in the M client devices.
7. An apparatus for client device management, the apparatus comprising:
the message sending module is used for sending first ARP request messages to the M client devices according to IP addresses of the M client devices recorded in a pre-stored temporary client device list, wherein the first ARP request messages are used for requesting the M client devices to feed back first ARP response messages, M is greater than or equal to 1, and M is a natural number;
an address query module, configured to, when receiving first ARP reply messages sent by N client devices of the M client devices, query, from a forwarding database FDB table of the client device management apparatus, MAC addresses of the N client devices recorded in the temporary client device list, and determine K client devices of the N client devices that are directly connected to the client device management apparatus, where M is greater than or equal to N and greater than or equal to 0, N is greater than or equal to J and greater than or equal to 0, J is a natural number, and N is a natural number;
the list generating module is used for generating an online direct connection client device list according to the IP addresses and the MAC addresses of the K client devices;
the apparatus also includes a wireless association list query module;
the wireless association list query module is used for periodically querying the MAC address of the client equipment which is recorded in the wireless association list and is wirelessly driven by the router equipment before the message sending module sends the first ARP request message, and whether the MAC address is recorded in the current temporary client equipment list; and when the MAC address which is not recorded in the current temporary client device list exists in the wireless association list, recording the MAC address and the IP address corresponding to the MAC address in the current temporary client device list, wherein the current temporary client device list is a temporary client device list at the moment when the router is to be maintained and updated.
8. A router comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the client device management method of any one of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the client device management method according to any one of claims 1 to 6.
CN201911172813.8A 2019-11-26 2019-11-26 Client device management method and device, router and storage medium Active CN111083055B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911172813.8A CN111083055B (en) 2019-11-26 2019-11-26 Client device management method and device, router and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911172813.8A CN111083055B (en) 2019-11-26 2019-11-26 Client device management method and device, router and storage medium

Publications (2)

Publication Number Publication Date
CN111083055A CN111083055A (en) 2020-04-28
CN111083055B true CN111083055B (en) 2022-03-22

Family

ID=70311847

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911172813.8A Active CN111083055B (en) 2019-11-26 2019-11-26 Client device management method and device, router and storage medium

Country Status (1)

Country Link
CN (1) CN111083055B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112511402B (en) * 2020-12-02 2022-04-08 深圳创维数字技术有限公司 Role mode adjusting method and device, wireless mesh network equipment and storage medium
CN114158036B (en) * 2021-12-06 2024-01-23 成都飞鱼星科技股份有限公司 Method, equipment, system and medium for configuration management of AP
CN115002067A (en) * 2022-04-19 2022-09-02 深圳市共进电子股份有限公司 Client host name processing method, device, system, equipment and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103560962A (en) * 2013-11-04 2014-02-05 神州数码网络(北京)有限公司 Method for automatically updating host routing table entries of Ethernet switch and switch
CN103560961A (en) * 2013-11-04 2014-02-05 神州数码网络(北京)有限公司 Method for dynamically updating host routing table entries of Ethernet switch and switch
CN104468280A (en) * 2014-12-19 2015-03-25 上海市共进通信技术有限公司 Method for achieving fast detection of online and offline states of mount device in intelligent gateway
CN105188103A (en) * 2015-08-10 2015-12-23 尚一民 Rapid roaming optimization method for use in MESH network routing protocol
CN105376163A (en) * 2015-10-14 2016-03-02 山东超越数控电子有限公司 Discovery method and device of network topological structure

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104158917B (en) * 2013-05-14 2017-12-15 新华三技术有限公司 Reclaim the method and apparatus of the IP address at dhcp client end

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103560962A (en) * 2013-11-04 2014-02-05 神州数码网络(北京)有限公司 Method for automatically updating host routing table entries of Ethernet switch and switch
CN103560961A (en) * 2013-11-04 2014-02-05 神州数码网络(北京)有限公司 Method for dynamically updating host routing table entries of Ethernet switch and switch
CN104468280A (en) * 2014-12-19 2015-03-25 上海市共进通信技术有限公司 Method for achieving fast detection of online and offline states of mount device in intelligent gateway
CN105188103A (en) * 2015-08-10 2015-12-23 尚一民 Rapid roaming optimization method for use in MESH network routing protocol
CN105376163A (en) * 2015-10-14 2016-03-02 山东超越数控电子有限公司 Discovery method and device of network topological structure

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"PARP-S:A secure piggybacking-based ARP for IEEE 802.11s-based Smart Grid AMI networks";Nico Saputro等;《ELSEVIER》;20150301;全文 *
"基于ARP和SNMP的网络拓扑自动发现算法";凌军等;《武汉大学学报(理学版)》;20040108;第47卷(第1期);全文 *

Also Published As

Publication number Publication date
CN111083055A (en) 2020-04-28

Similar Documents

Publication Publication Date Title
CN111083055B (en) Client device management method and device, router and storage medium
CN103814554B (en) A kind of communication means of virtual easily extensible local area network (LAN), device and system
US9536007B2 (en) Method for location-based asset management
CN101361322B (en) The discovery of network node and routable address
US10931549B2 (en) Communication device of an industrial automation system and method for configurating the communication device
US20170289033A1 (en) Address cache for tunnel endpoint associated with an overlay network
CN110493366B (en) Method and device for adding access point into network management
KR20040065643A (en) Method for performing automatic registration of IP address and IP domain name in IP protocol version 6
CN112840601B (en) Method, apparatus and computer readable medium for configuring an apparatus to be named
CN108965036B (en) Method, system, server and storage medium for configuring cross-public network equipment mutual access
CN107959613B (en) Message forwarding method and device
CN105245629A (en) DHCP-based host communication method and device
US20060253611A1 (en) Network address transition methods and systems
US20090024761A1 (en) Method, system and application for service addressing
US7958220B2 (en) Apparatus, method and system for acquiring IPV6 address
CN101567908A (en) Address distribution method and device
US10536432B2 (en) Method for determining an address of a component of a vehicle
US9450909B2 (en) Method of and a processing device handling a protocol address in a network
CN108429641A (en) A kind of network device management method and device
GB2397970A (en) Discovering topology information in a network
CN110958124B (en) Multicast group management method, device, readable storage medium and computer
CN111164953B (en) Method and switch for providing name service in industrial automation system
CN109842692B (en) VxLAN switch, system and method for obtaining host information in physical network
CN109819059B (en) Method, device, equipment and storage medium for managing network equipment
CN110769462A (en) Network access control method and device

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