CN111479308A - Route updating method, device, equipment and medium - Google Patents

Route updating method, device, equipment and medium Download PDF

Info

Publication number
CN111479308A
CN111479308A CN202010273382.0A CN202010273382A CN111479308A CN 111479308 A CN111479308 A CN 111479308A CN 202010273382 A CN202010273382 A CN 202010273382A CN 111479308 A CN111479308 A CN 111479308A
Authority
CN
China
Prior art keywords
address
target
mac layer
message
layer
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.)
Granted
Application number
CN202010273382.0A
Other languages
Chinese (zh)
Other versions
CN111479308B (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.)
Hangzhou Tuya Information Technology Co Ltd
Original Assignee
Hangzhou Tuya Information Technology 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 Hangzhou Tuya Information Technology Co Ltd filed Critical Hangzhou Tuya Information Technology Co Ltd
Priority to CN202010273382.0A priority Critical patent/CN111479308B/en
Publication of CN111479308A publication Critical patent/CN111479308A/en
Application granted granted Critical
Publication of CN111479308B publication Critical patent/CN111479308B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W40/00Communication routing or communication path finding
    • H04W40/24Connectivity information management, e.g. connectivity discovery or connectivity update
    • H04W40/246Connectivity information discovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W40/00Communication routing or communication path finding
    • H04W40/24Connectivity information management, e.g. connectivity discovery or connectivity update
    • H04W40/248Connectivity information update

Landscapes

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

Abstract

The application discloses a method, a device, equipment and a medium for updating a route, which comprise the following steps: removing the address filtering of the MAC layer so that the MAC layer receives any data in the network; selecting a target application layer message; the target application layer message comprises a first target message and a second target message, wherein the network layer source address of the first target message is the network layer destination address of the second target message, and the network layer destination address of the first target message is the network layer source address of the second target message; extracting a corresponding network layer source address, a network layer destination address, an MAC layer source address and an MAC layer destination address from the target application layer message; searching a corresponding target MAC layer address in a neighbor table; and if the target MAC layer address is found in the neighbor table, inserting the address information corresponding to the target MAC layer address into a routing table to update the routing table. Therefore, the route can be updated in time, and the times of route discovery are reduced, so that the network performance is improved.

Description

Route updating method, device, equipment and medium
Technical Field
The present application relates to the field of network technologies, and in particular, to a method, an apparatus, a device, and a medium for route update.
Background
In the prior art, the relationship between adjacent routes is maintained mainly through a neighbor table, and when the route of a remote device is changed, a new route is found through a route discovery algorithm. The disadvantage is that the route is not updated timely, the device maintains its own routing relation independently, and the route discovery of each device results in a large amount of broadcast messages, thereby affecting the wireless performance of the whole network.
Disclosure of Invention
In view of this, an object of the present application is to provide a method, an apparatus, a device, and a medium for updating a route, which can update the route in time and reduce the number of times of route discovery, thereby improving network performance. The specific scheme is as follows:
in a first aspect, the present application discloses a method for updating a route, including:
removing the address filtering of the MAC layer so that the MAC layer receives any data in the network;
selecting a target application layer message; the target application layer message comprises a first target message and a second target message, wherein the network layer source address of the first target message is the network layer destination address of the second target message, and the network layer destination address of the first target message is the network layer source address of the second target message;
extracting a corresponding network layer source address, a network layer destination address, an MAC layer source address and an MAC layer destination address from the target application layer message;
searching a corresponding target MAC layer address in a neighbor table;
and if the target MAC layer address is found in the neighbor table, inserting the address information corresponding to the target MAC layer address into a routing table to update the routing table.
Optionally, the searching for the corresponding target MAC layer address in the neighbor table includes:
looking up the MAC layer source address in a neighbor table;
correspondingly, if the target MAC layer address is found in the neighbor table, inserting the address information corresponding to the target MAC layer address into a routing table to update the routing table, including:
and if the MAC layer source address is found in the neighbor table, inserting the network layer source address, the network layer destination address and the MAC layer destination address corresponding to the MAC layer source address into a routing table so as to update the routing table.
Optionally, the searching for the corresponding target MAC layer address in the neighbor table includes:
looking up the MAC layer destination address in a neighbor table;
correspondingly, if the target MAC layer address is found in the neighbor table, inserting the address information corresponding to the target MAC layer address into a routing table to update the routing table, including:
and if the MAC layer destination address is found in the neighbor table, inserting the network layer source address, the network layer destination address and the MAC layer source address corresponding to the MAC layer destination address into a routing table so as to update the routing table.
Optionally, the selecting a target application layer packet includes:
selecting the first target message meeting preset conditions from the messages which are obtained in real time and analyzed by the network layer;
and selecting the second target message from historical data by using the first target message.
Optionally, the route updating method further includes:
and recording the message which meets the preset condition after the network layer is analyzed.
Optionally, the route updating method further includes:
judging whether the data received by the MAC layer is the data of the network or not through the network layer;
and selecting the target application layer message from the data of the network.
Optionally, the route updating method further includes:
triggering the step of removing the address filtering of the MAC layer at regular time, and correspondingly selecting a target application layer message; the target application layer message comprises a first target message and a second target message, wherein the network layer source address of the first target message is the network layer destination address of the second target message, and the network layer destination address of the first target message is the network layer source address of the second target message; extracting a corresponding network layer source address, a network layer destination address, an MAC layer source address and an MAC layer destination address from the target application layer message; searching a corresponding target MAC layer address in a neighbor table; and if the target MAC layer address is found in the neighbor table, inserting the address information corresponding to the target MAC layer address into a routing table so as to realize real-time updating of the routing table.
In a second aspect, the present application discloses a route updating apparatus, including:
the address filtering removal module is used for removing the address filtering of the MAC layer so that the MAC layer can receive any data in the network;
the target message selection module is used for selecting a target application layer message; the target application layer message comprises a first target message and a second target message, wherein the network layer source address of the first target message is the network layer destination address of the second target message, and the network layer destination address of the first target message is the network layer source address of the second target message;
the message address extraction module is used for extracting a corresponding network layer source address, a network layer destination address, an MAC layer source address and an MAC layer destination address from the target application layer message;
the target address searching module is used for searching a corresponding target MAC layer address in the neighbor table;
and the routing table updating module is used for inserting the address information corresponding to the target MAC layer address into the routing table to realize the updating of the routing table if the target MAC layer address is searched in the neighbor table by the target address searching module.
In a third aspect, the present application discloses a route updating device, comprising a processor and a memory; wherein the content of the first and second substances,
the memory is used for storing a computer program;
the processor is configured to execute the computer program to implement the aforementioned route updating method.
In a fourth aspect, the present application discloses a computer readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the aforementioned route update method.
Therefore, the address filtering of the MAC layer is removed firstly, so that the MAC layer receives any data in the network, and then a target application layer message is selected; the target application layer message comprises a first target message and a second target message, wherein a network layer source address of the first target message is a network layer destination address of the second target message, a network layer destination address of the first target message is a network layer source address of the second target message, then a corresponding network layer source address, a network layer destination address, an MAC layer source address and an MAC layer destination address are extracted from the target application layer message, the corresponding target MAC layer address is searched in a neighbor table, and if the target MAC layer address is searched in the neighbor table, address information corresponding to the target MAC layer address is inserted into a routing table so as to update the routing table. Therefore, the MAC layer is utilized to receive any data in the network, then messages which are successfully received and transmitted between the network layer source address and the network layer destination address are selected, the corresponding target MAC layer address is searched in the neighbor table, if the target MAC layer address is searched in the neighbor table, the address information corresponding to the target MAC layer address is inserted into the routing table, namely, the address which can be reached by neighbor equipment is added into the routing table, so that the routing table is updated, the routing can be updated in time, the number of times of route discovery is reduced, and the network performance is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flow chart of a route updating method disclosed in the present application;
fig. 2 is a flowchart of a specific route update method disclosed in the present application;
fig. 3 is a flow chart of a specific route update method disclosed in the present application;
fig. 4 is a schematic structural diagram of a route updating apparatus disclosed in the present application;
FIG. 5 is a block diagram of a route update device disclosed herein;
fig. 6 is a structural diagram of an electronic terminal disclosed in the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the prior art, the relationship between adjacent routes is maintained mainly through a neighbor table, and when the route of a remote device is changed, a new route is found through a route discovery algorithm. The disadvantage is that the route is not updated timely, the device maintains its own routing relation independently, and the route discovery of each device results in a large amount of broadcast messages, thereby affecting the wireless performance of the whole network. Therefore, the routing updating scheme is provided, the routing can be updated in time, the times of routing discovery are reduced, and the network performance is improved.
Referring to fig. 1, an embodiment of the present application discloses a method for updating a route, including:
step S11: address filtering of the MAC layer is removed so that the MAC layer receives any data in the network.
In the prior art, in order to reduce the overhead of the CPU, network data is generally processed strictly according to the hierarchy of the network, that is, data not addressed to the device is not processed by the device. But as the performance of the CPU becomes increasingly greater, such overhead has not affected the CPU performing other tasks. Therefore, data processing for devices other than the device can be increased, and useful routing information can be extracted. Therefore, the times of route discovery can be reduced, and the route information can be dynamically updated by utilizing the interactive data of other equipment in the network, so that the network performance is improved.
The present network refers to a network of the device, and the device may be a zigbee device, and the like, that is, the route updating method disclosed in this embodiment may be applied to the zigbee device.
Step S12: selecting a target application layer message; the target application layer message comprises a first target message and a second target message, wherein the network layer source address of the first target message is the network layer destination address of the second target message, and the network layer destination address of the first target message is the network layer source address of the second target message.
It is understood that the network layer source address of the first target packet is the network layer destination address of the second target packet, and the network layer destination address of the first target packet is the network layer source address of the second target packet. That is, the first target packet and the second target packet are packets transmitted and received between the corresponding network layer source address and the network layer destination address. That is, the two addresses may communicate with each other, for example, if the first target packet is a packet sent by the device a to the device B, and the second target packet is a corresponding packet returned by the device B to the device a, it is determined that the device a and the device B may communicate with each other, and the first target packet and the second target packet are selected.
In a specific embodiment, the process of selecting a target application layer packet includes: selecting the first target message meeting preset conditions from the messages which are obtained in real time and analyzed by the network layer; and selecting the second target message from historical data by using the first target message. Specifically, the first target packet may be a packet including a network layer source address, a network layer destination address, an MAC layer source address, and an MAC layer destination address, and then the second target packet is selected from the history data according to the network layer source address and the network layer destination address of the first target packet.
That is, in the embodiment of the present application, the message including the network layer source address, the network layer destination address, the MAC layer source address, and the MAC layer destination address may be selected, and the message not including the network layer source address, the network layer destination address, the MAC layer source address, and the MAC layer destination address may not be selected.
In addition, the embodiment can record the message which satisfies the preset condition after the network layer is analyzed. That is, the present embodiment may store, as the history data, a message that satisfies a condition including a network layer source address, a network layer destination address, an MAC layer source address, and an MAC layer destination address.
In addition, the embodiment can judge whether the data received by the MAC layer is the data of the network through the network layer; and selecting the target application layer message from the data of the network. That is, the data that is not the local network is filtered out, and only the subsequent processing is performed on the data of the local network.
Step S13: and extracting a corresponding network layer source address, a network layer destination address, an MAC layer source address and an MAC layer destination address from the target application layer message.
In a specific embodiment, after the first target packet is selected, the corresponding network layer source address, network layer destination address, MAC layer source address, and MAC layer destination address are extracted from the first target packet, then the second target packet is selected from the history data by using the extracted network layer source address and network layer destination address, and the corresponding network layer source address, network layer destination address, MAC layer source address, and MAC layer destination address are extracted from the second target packet. Of course, after the first target packet is selected, the corresponding network layer source address and the network layer destination address may be read, then the second target packet is selected from the historical data by using the read network layer source address and the network layer destination address, and finally the corresponding network layer source address, the network layer destination address, the MAC layer source address and the MAC layer destination address are extracted from the first target packet and the second target packet in a unified manner.
Step S14: the corresponding target MAC layer address is looked up in the neighbor table.
Step S15: and if the target MAC layer address is found in the neighbor table, inserting the address information corresponding to the target MAC layer address into a routing table to update the routing table.
It should be noted that there exists a message that the mutual transceiving between the network layer source address and the network layer destination address is successful, and the neighbor table looks up the corresponding destination MAC layer address, which indicates that the corresponding neighbor device can reach the address corresponding to the destination MAC layer address and the address that the neighbor device can reach.
That is, in this embodiment, the routing table of the present device may be updated by using the neighboring device of the present device and the interaction data of the device interacting with the neighboring device.
In addition, the step of removing the address filtering of the MAC layer may be triggered at regular time, and correspondingly, a target application layer packet is selected; the target application layer message comprises a first target message and a second target message, wherein the network layer source address of the first target message is the network layer destination address of the second target message, and the network layer destination address of the first target message is the network layer source address of the second target message; extracting a corresponding network layer source address, a network layer destination address, an MAC layer source address and an MAC layer destination address from the target application layer message; searching a corresponding target MAC layer address in a neighbor table; and if the target MAC layer address is found in the neighbor table, inserting the address information corresponding to the target MAC layer address into a routing table so as to realize real-time updating of the routing table. That is, the present embodiment may periodically update the routing table by using the foregoing method.
It can be seen that, in the embodiment of the application, the address filtering of the MAC layer is removed first, so that the MAC layer receives any data in the network, and then selects a target application layer message; the target application layer message comprises a first target message and a second target message, wherein a network layer source address of the first target message is a network layer destination address of the second target message, a network layer destination address of the first target message is a network layer source address of the second target message, then a corresponding network layer source address, a network layer destination address, an MAC layer source address and an MAC layer destination address are extracted from the target application layer message, the corresponding target MAC layer address is searched in a neighbor table, and if the target MAC layer address is searched in the neighbor table, address information corresponding to the target MAC layer address is inserted into a routing table so as to update the routing table. Therefore, the MAC layer is utilized to receive any data in the network, then messages which are successfully received and transmitted between the network layer source address and the network layer destination address are selected, the corresponding target MAC layer address is searched in the neighbor table, if the target MAC layer address is searched in the neighbor table, the address information corresponding to the target MAC layer address is inserted into the routing table, namely, the address which can be reached by neighbor equipment is added into the routing table, so that the routing table is updated, the routing can be updated in time, the number of times of route discovery is reduced, and the network performance is improved.
Referring to fig. 2, an embodiment of the present application discloses a specific route updating method, including:
step S21: address filtering of the MAC layer is removed so that the MAC layer receives any data in the network.
Step S22: selecting a target application layer message; the target application layer message comprises a first target message and a second target message, wherein the network layer source address of the first target message is the network layer destination address of the second target message, and the network layer destination address of the first target message is the network layer source address of the second target message.
Step S23: and extracting a corresponding network layer source address, a network layer destination address, an MAC layer source address and an MAC layer destination address from the target application layer message.
For the specific processes of the steps S21 to S23, reference may be made to the corresponding contents disclosed in the foregoing embodiments, and details are not repeated here.
Step S24: looking up the MAC layer source address in a neighbor table.
Step S25: and if the MAC layer source address is found in the neighbor table, inserting the network layer source address, the network layer destination address and the MAC layer destination address corresponding to the MAC layer source address into a routing table so as to update the routing table.
It can be understood that, if there is a message that the mutual transceiving between the network layer source address and the network layer destination address is successful, and the MAC layer source address is found in the neighbor table, it indicates that the neighbor device can reach the corresponding network layer source address, the network layer destination address, and the MAC layer destination address, that is, the device can reach the corresponding network layer source address, the network layer destination address, and the MAC layer destination address.
Step S26: and searching the MAC layer destination address in a neighbor table.
Step S27: and if the MAC layer destination address is found in the neighbor table, inserting the network layer source address, the network layer destination address and the MAC layer source address corresponding to the MAC layer destination address into a routing table so as to update the routing table.
It can be understood that, if there is a message that the mutual transceiving between the network layer source address and the network layer destination address is successful, and the MAC layer destination address is found in the neighbor table, it indicates that the neighbor device can reach the corresponding network layer source address, the network layer destination address, and the MAC layer source address, that is, the device can reach the corresponding network layer source address, the network layer destination address, and the MAC layer source address.
For example, referring to fig. 3, fig. 3 is a specific routing update method disclosed in the embodiment of the present application, data is received wirelessly, an MAC layer receives data of the network unconditionally, and a network layer determines whether the data received by the MAC layer is data of the same network, that is, data of the network. Selecting application layer messages from the data of the network, extracting corresponding network layer source addresses, network layer destination addresses, MAC layer source addresses and MAC layer destination addresses, searching corresponding target MAC layer addresses in a neighbor table, wherein the target MAC layer addresses comprise the MAC layer source addresses and the MAC layer destination addresses, and adding corresponding address information to a routing table after the target MAC layer addresses are searched. Specifically, if the MAC layer source address is found, three records are inserted into the routing table, which are: (MAC layer source address, MAC layer destination address); (MAC layer source address, network layer source address); (MAC layer source address, network layer destination address). If the destination address of the MAC layer is found, inserting three records into the routing table, wherein the three records are respectively as follows: (MAC layer destination address, MAC layer source address); (MAC layer destination address, network layer source address); (MAC layer destination address, network layer destination address).
Referring to fig. 4, an embodiment of the present application discloses a route updating apparatus, including:
an address filtering and removing module 11, configured to remove address filtering of the MAC layer, so that the MAC layer receives any data in the network;
a target message selection module 12, configured to select a target application layer message; the target application layer message comprises a first target message and a second target message, wherein the network layer source address of the first target message is the network layer destination address of the second target message, and the network layer destination address of the first target message is the network layer source address of the second target message;
a message address extracting module 13, configured to extract a corresponding network layer source address, a network layer destination address, an MAC layer source address, and an MAC layer destination address from the target application layer message;
a target address searching module 14, configured to search a corresponding target MAC layer address in the neighbor table;
a routing table updating module 15, configured to insert address information corresponding to the target MAC layer address into a routing table if the target address lookup module finds the target MAC layer address in the neighbor table, so as to update the routing table.
It can be seen that, in the embodiment of the application, the address filtering of the MAC layer is removed first, so that the MAC layer receives any data in the network, and then selects a target application layer message; the target application layer message comprises a first target message and a second target message, wherein a network layer source address of the first target message is a network layer destination address of the second target message, a network layer destination address of the first target message is a network layer source address of the second target message, then a corresponding network layer source address, a network layer destination address, an MAC layer source address and an MAC layer destination address are extracted from the target application layer message, the corresponding target MAC layer address is searched in a neighbor table, and if the target MAC layer address is searched in the neighbor table, address information corresponding to the target MAC layer address is inserted into a routing table so as to update the routing table. Therefore, the MAC layer is utilized to receive any data in the network, then messages which are successfully received and transmitted between the network layer source address and the network layer destination address are selected, the corresponding target MAC layer address is searched in the neighbor table, if the target MAC layer address is searched in the neighbor table, the address information corresponding to the target MAC layer address is inserted into the routing table, namely, the address which can be reached by neighbor equipment is added into the routing table, so that the routing table is updated, the routing can be updated in time, the number of times of route discovery is reduced, and the network performance is improved.
The target address lookup module 14 is specifically configured to lookup the MAC layer source address in a neighbor table; correspondingly, the routing table updating module 15 is specifically configured to insert the network layer source address, the network layer destination address, and the MAC layer destination address corresponding to the MAC layer source address into the routing table if the destination address searching module searches the MAC layer source address in the neighbor table, so as to update the routing table.
In a specific embodiment, the target address lookup module 14 may be further specifically configured to lookup the MAC layer destination address in a neighbor table; correspondingly, the routing table updating module is specifically configured to insert the network layer source address, the network layer destination address, and the MAC layer source address corresponding to the MAC layer destination address into a routing table if the destination address searching module searches the MAC layer destination address in the neighbor table, so as to update the routing table.
The target packet selecting module 12 is specifically configured to select the first target packet that meets a preset condition from the packets analyzed by the network layer acquired in real time; and selecting the second target message from historical data by using the first target message.
The routing update apparatus further includes:
and the message recording module is used for recording the message which meets the preset condition after the network layer is analyzed.
The routing update apparatus further includes:
the network data judging module is used for judging whether the data received by the MAC layer is the data of the network or not through the network layer.
The routing update apparatus further includes:
and the timing trigger module is used for triggering the address filtering and removing module 11, the target message selecting module 12, the message address extracting module 13, the target address searching module 14 and the routing table updating module 15 at a timing so as to realize real-time updating of the routing table.
Referring to fig. 5, fig. 5 is a routing update apparatus disclosed in the embodiment of the present application, including a processor 21 and a memory 22; wherein, the memory 22 is used for saving computer programs; the processor 21 is configured to execute the computer program to implement the following steps:
removing the address filtering of the MAC layer so that the MAC layer receives any data in the network; selecting a target application layer message; the target application layer message comprises a first target message and a second target message, wherein the network layer source address of the first target message is the network layer destination address of the second target message, and the network layer destination address of the first target message is the network layer source address of the second target message; extracting a corresponding network layer source address, a network layer destination address, an MAC layer source address and an MAC layer destination address from the target application layer message; searching a corresponding target MAC layer address in a neighbor table; and if the target MAC layer address is found in the neighbor table, inserting the address information corresponding to the target MAC layer address into a routing table to update the routing table.
It can be seen that, in the embodiment of the application, the address filtering of the MAC layer is removed first, so that the MAC layer receives any data in the network, and then selects a target application layer message; the target application layer message comprises a first target message and a second target message, wherein a network layer source address of the first target message is a network layer destination address of the second target message, a network layer destination address of the first target message is a network layer source address of the second target message, then a corresponding network layer source address, a network layer destination address, an MAC layer source address and an MAC layer destination address are extracted from the target application layer message, the corresponding target MAC layer address is searched in a neighbor table, and if the target MAC layer address is searched in the neighbor table, address information corresponding to the target MAC layer address is inserted into a routing table so as to update the routing table. Therefore, the MAC layer is utilized to receive any data in the network, then messages which are successfully received and transmitted between the network layer source address and the network layer destination address are selected, the corresponding target MAC layer address is searched in the neighbor table, if the target MAC layer address is searched in the neighbor table, the address information corresponding to the target MAC layer address is inserted into the routing table, namely, the address which can be reached by neighbor equipment is added into the routing table, so that the routing table is updated, the routing can be updated in time, the number of times of route discovery is reduced, and the network performance is improved.
In this embodiment, when the processor 21 executes the computer subprogram stored in the memory 22, the following steps may be specifically implemented: looking up the MAC layer source address in a neighbor table; correspondingly, if the target MAC layer address is found in the neighbor table, inserting the address information corresponding to the target MAC layer address into a routing table to update the routing table, including: and if the MAC layer source address is found in the neighbor table, inserting the network layer source address, the network layer destination address and the MAC layer destination address corresponding to the MAC layer source address into a routing table so as to update the routing table.
In this embodiment, when the processor 21 executes the computer subprogram stored in the memory 22, the following steps may be specifically implemented: looking up the MAC layer destination address in a neighbor table; correspondingly, if the target MAC layer address is found in the neighbor table, inserting the address information corresponding to the target MAC layer address into a routing table to update the routing table, including: and if the MAC layer destination address is found in the neighbor table, inserting the network layer source address, the network layer destination address and the MAC layer source address corresponding to the MAC layer destination address into a routing table so as to update the routing table.
In this embodiment, when the processor 21 executes the computer subprogram stored in the memory 22, the following steps may be specifically implemented: selecting the first target message meeting preset conditions from the messages which are obtained in real time and analyzed by the network layer; and selecting the second target message from historical data by using the first target message.
In this embodiment, when the processor 21 executes the computer subprogram stored in the memory 22, the following steps may be specifically implemented: and recording the message which meets the preset condition after the network layer is analyzed.
In this embodiment, when the processor 21 executes the computer subprogram stored in the memory 22, the following steps may be specifically implemented: judging whether the data received by the MAC layer is the data of the network or not through the network layer; and selecting the target application layer message from the data of the network.
In this embodiment, when the processor 21 executes the computer subprogram stored in the memory 22, the following steps may be specifically implemented: triggering the step of removing the address filtering of the MAC layer at regular time, and correspondingly selecting a target application layer message; the target application layer message comprises a first target message and a second target message, wherein the network layer source address of the first target message is the network layer destination address of the second target message, and the network layer destination address of the first target message is the network layer source address of the second target message; extracting a corresponding network layer source address, a network layer destination address, an MAC layer source address and an MAC layer destination address from the target application layer message; searching a corresponding target MAC layer address in a neighbor table; and if the target MAC layer address is found in the neighbor table, inserting the address information corresponding to the target MAC layer address into a routing table so as to realize real-time updating of the routing table.
The memory 22 is used as a carrier for resource storage, and may be a read-only memory, a random access memory, a magnetic disk or an optical disk, and the storage mode may be a transient storage mode or a permanent storage mode.
Referring to fig. 6, an embodiment of the present application discloses an electronic terminal 20, which includes a processor 21 and a memory 22 disclosed in the foregoing embodiments. For the steps that the processor 21 can specifically execute, reference may be made to corresponding contents disclosed in the foregoing embodiments, and details are not described herein again.
Further, the electronic terminal 20 in this embodiment may further specifically include a power supply 23, a communication interface 24, an input/output interface 25, and a communication bus 26; the power supply 23 is configured to provide a working voltage for each hardware device on the terminal 20; the communication interface 24 can create a data transmission channel with an external device for the terminal 20, and a communication protocol followed by the communication interface is any communication protocol applicable to the technical solution of the present application, and is not specifically limited herein; the input/output interface 25 is configured to obtain external input data or output data to the outside, and a specific interface type thereof may be selected according to a specific application requirement, which is not specifically limited herein.
Further, an embodiment of the present application also discloses a computer readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the following steps:
removing the address filtering of the MAC layer so that the MAC layer receives any data in the network; selecting a target application layer message; the target application layer message comprises a first target message and a second target message, wherein the network layer source address of the first target message is the network layer destination address of the second target message, and the network layer destination address of the first target message is the network layer source address of the second target message; extracting a corresponding network layer source address, a network layer destination address, an MAC layer source address and an MAC layer destination address from the target application layer message; searching a corresponding target MAC layer address in a neighbor table; and if the target MAC layer address is found in the neighbor table, inserting the address information corresponding to the target MAC layer address into a routing table to update the routing table.
It can be seen that, in the embodiment of the application, the address filtering of the MAC layer is removed first, so that the MAC layer receives any data in the network, and then selects a target application layer message; the target application layer message comprises a first target message and a second target message, wherein a network layer source address of the first target message is a network layer destination address of the second target message, a network layer destination address of the first target message is a network layer source address of the second target message, then a corresponding network layer source address, a network layer destination address, an MAC layer source address and an MAC layer destination address are extracted from the target application layer message, the corresponding target MAC layer address is searched in a neighbor table, and if the target MAC layer address is searched in the neighbor table, address information corresponding to the target MAC layer address is inserted into a routing table so as to update the routing table. Therefore, the MAC layer is utilized to receive any data in the network, then messages which are successfully received and transmitted between the network layer source address and the network layer destination address are selected, the corresponding target MAC layer address is searched in the neighbor table, if the target MAC layer address is searched in the neighbor table, the address information corresponding to the target MAC layer address is inserted into the routing table, namely, the address which can be reached by neighbor equipment is added into the routing table, so that the routing table is updated, the routing can be updated in time, the number of times of route discovery is reduced, and the network performance is improved.
In this embodiment, when the computer subprogram stored in the computer-readable storage medium is executed by the processor, the following steps may be specifically implemented: looking up the MAC layer source address in a neighbor table; correspondingly, if the target MAC layer address is found in the neighbor table, inserting the address information corresponding to the target MAC layer address into a routing table to update the routing table, including: and if the MAC layer source address is found in the neighbor table, inserting the network layer source address, the network layer destination address and the MAC layer destination address corresponding to the MAC layer source address into a routing table so as to update the routing table.
In this embodiment, when the computer subprogram stored in the computer-readable storage medium is executed by the processor, the following steps may be specifically implemented: looking up the MAC layer destination address in a neighbor table; correspondingly, if the target MAC layer address is found in the neighbor table, inserting the address information corresponding to the target MAC layer address into a routing table to update the routing table, including: and if the MAC layer destination address is found in the neighbor table, inserting the network layer source address, the network layer destination address and the MAC layer source address corresponding to the MAC layer destination address into a routing table so as to update the routing table.
In this embodiment, when the computer subprogram stored in the computer-readable storage medium is executed by the processor, the following steps may be specifically implemented: selecting the first target message meeting preset conditions from the messages which are obtained in real time and analyzed by the network layer; and selecting the second target message from historical data by using the first target message.
In this embodiment, when the computer subprogram stored in the computer-readable storage medium is executed by the processor, the following steps may be specifically implemented: and recording the message which meets the preset condition after the network layer is analyzed.
In this embodiment, when the computer subprogram stored in the computer-readable storage medium is executed by the processor, the following steps may be specifically implemented: judging whether the data received by the MAC layer is the data of the network or not through the network layer; and selecting the target application layer message from the data of the network.
In this embodiment, when the computer subprogram stored in the computer-readable storage medium is executed by the processor, the following steps may be specifically implemented: triggering the step of removing the address filtering of the MAC layer at regular time, and correspondingly selecting a target application layer message; the target application layer message comprises a first target message and a second target message, wherein the network layer source address of the first target message is the network layer destination address of the second target message, and the network layer destination address of the first target message is the network layer source address of the second target message; extracting a corresponding network layer source address, a network layer destination address, an MAC layer source address and an MAC layer destination address from the target application layer message; searching a corresponding target MAC layer address in a neighbor table; and if the target MAC layer address is found in the neighbor table, inserting the address information corresponding to the target MAC layer address into a routing table so as to realize real-time updating of the routing table.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The foregoing detailed description is directed to a method, an apparatus, a device, and a medium for route update provided by the present application, and a specific example is applied in the detailed description to explain the principles and embodiments of the present application, and the description of the foregoing embodiment is only used to help understand the method and the core idea of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A method for route update, comprising:
removing the address filtering of the MAC layer so that the MAC layer receives any data in the network;
selecting a target application layer message; the target application layer message comprises a first target message and a second target message, wherein the network layer source address of the first target message is the network layer destination address of the second target message, and the network layer destination address of the first target message is the network layer source address of the second target message;
extracting a corresponding network layer source address, a network layer destination address, an MAC layer source address and an MAC layer destination address from the target application layer message;
searching a corresponding target MAC layer address in a neighbor table;
and if the target MAC layer address is found in the neighbor table, inserting the address information corresponding to the target MAC layer address into a routing table to update the routing table.
2. The route update method according to claim 1, wherein the looking up the corresponding target MAC layer address in the neighbor table comprises:
looking up the MAC layer source address in a neighbor table;
correspondingly, if the target MAC layer address is found in the neighbor table, inserting the address information corresponding to the target MAC layer address into a routing table to update the routing table, including:
and if the MAC layer source address is found in the neighbor table, inserting the network layer source address, the network layer destination address and the MAC layer destination address corresponding to the MAC layer source address into a routing table so as to update the routing table.
3. The route update method according to claim 1, wherein the looking up the corresponding target MAC layer address in the neighbor table comprises:
looking up the MAC layer destination address in a neighbor table;
correspondingly, if the target MAC layer address is found in the neighbor table, inserting the address information corresponding to the target MAC layer address into a routing table to update the routing table, including:
and if the MAC layer destination address is found in the neighbor table, inserting the network layer source address, the network layer destination address and the MAC layer source address corresponding to the MAC layer destination address into a routing table so as to update the routing table.
4. The method of claim 1, wherein the selecting the target application layer packet comprises:
selecting the first target message meeting preset conditions from the messages which are obtained in real time and analyzed by the network layer;
and selecting the second target message from historical data by using the first target message.
5. The route updating method according to claim 1, further comprising:
and recording the message which meets the preset condition after the network layer is analyzed.
6. The route updating method according to claim 1, further comprising:
judging whether the data received by the MAC layer is the data of the network or not through the network layer;
and selecting the target application layer message from the data of the network.
7. The route updating method according to any one of claims 1 to 6, further comprising:
triggering the step of removing the address filtering of the MAC layer at regular time, and correspondingly selecting a target application layer message; the target application layer message comprises a first target message and a second target message, wherein the network layer source address of the first target message is the network layer destination address of the second target message, and the network layer destination address of the first target message is the network layer source address of the second target message; extracting a corresponding network layer source address, a network layer destination address, an MAC layer source address and an MAC layer destination address from the target application layer message; searching a corresponding target MAC layer address in a neighbor table; and if the target MAC layer address is found in the neighbor table, inserting the address information corresponding to the target MAC layer address into a routing table so as to realize real-time updating of the routing table.
8. A route update apparatus, comprising:
the address filtering removal module is used for removing the address filtering of the MAC layer so that the MAC layer can receive any data in the network;
the target message selection module is used for selecting a target application layer message; the target application layer message comprises a first target message and a second target message, wherein the network layer source address of the first target message is the network layer destination address of the second target message, and the network layer destination address of the first target message is the network layer source address of the second target message;
the message address extraction module is used for extracting a corresponding network layer source address, a network layer destination address, an MAC layer source address and an MAC layer destination address from the target application layer message;
the target address searching module is used for searching a corresponding target MAC layer address in the neighbor table;
and the routing table updating module is used for inserting the address information corresponding to the target MAC layer address into the routing table to realize the updating of the routing table if the target MAC layer address is searched in the neighbor table by the target address searching module.
9. A route update device comprising a processor and a memory; wherein the content of the first and second substances,
the memory is used for storing a computer program;
the processor for executing the computer program to implement the route update method of any one of claims 1 to 7.
10. A computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the route update method of any one of claims 1 to 7.
CN202010273382.0A 2020-04-09 2020-04-09 Route updating method, device, equipment and medium Active CN111479308B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010273382.0A CN111479308B (en) 2020-04-09 2020-04-09 Route updating method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010273382.0A CN111479308B (en) 2020-04-09 2020-04-09 Route updating method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN111479308A true CN111479308A (en) 2020-07-31
CN111479308B CN111479308B (en) 2022-07-26

Family

ID=71751338

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010273382.0A Active CN111479308B (en) 2020-04-09 2020-04-09 Route updating method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN111479308B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107147581A (en) * 2017-06-26 2017-09-08 杭州迪普科技股份有限公司 The maintaining method and device of route table items
WO2018166253A1 (en) * 2017-03-14 2018-09-20 华为技术有限公司 Evpn packet processing method, device and system
CN109639580A (en) * 2019-02-03 2019-04-16 新华三信息安全技术有限公司 A kind of message forwarding method and device
CN110581805A (en) * 2018-06-08 2019-12-17 杭州海康威视数字技术股份有限公司 Routing table updating method, device, switch and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018166253A1 (en) * 2017-03-14 2018-09-20 华为技术有限公司 Evpn packet processing method, device and system
CN107147581A (en) * 2017-06-26 2017-09-08 杭州迪普科技股份有限公司 The maintaining method and device of route table items
CN110581805A (en) * 2018-06-08 2019-12-17 杭州海康威视数字技术股份有限公司 Routing table updating method, device, switch and storage medium
CN109639580A (en) * 2019-02-03 2019-04-16 新华三信息安全技术有限公司 A kind of message forwarding method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
薄大户: "基于WLAN_Mesh路由算法的研究与实现", 《中国优秀硕士论文全文数据库》 *

Also Published As

Publication number Publication date
CN111479308B (en) 2022-07-26

Similar Documents

Publication Publication Date Title
US6968393B1 (en) Method and apparatus for an attribute oriented routing update
CN108259347B (en) Message transmission method and device
EP3179679B1 (en) Method and device for link state information announcement
US10791051B2 (en) System and method to bypass the forwarding information base (FIB) for interest packet forwarding in an information-centric networking (ICN) environment
CN106878072B (en) Message transmission method and device
CN110417683B (en) Message processing method and device and server
CN103634423A (en) Three-layered interface based MPLS-TP (multi-protocol label switching-transport profile) configuration method and device
CN103201987A (en) Prioritization of routing information updates
EP2916516A1 (en) Packet processing method and apparatus
CN110795029A (en) Cloud hard disk management method, device, server and medium
CN103763750A (en) Method for fast achieving packet forwarding in wireless ad hoc network of TDMA protocol
CN107070719B (en) Equipment management method and device
EP3484107A1 (en) Parameter notification and obtaining methods and devices, and storage medium
EP3166263A1 (en) Routing calculation method and device for trill isis
CN107547381B (en) Method and device for processing outgoing direction route filtering ORF (open reading frame)
CN111479308B (en) Route updating method, device, equipment and medium
CN103746768A (en) Data packet identification method and equipment thereof
EP4047889A1 (en) Method and apparatus for processing forwarding entry
US20230041395A1 (en) Method and Device for Processing Routing Table Entries
CN111010346B (en) Message processing method, device, storage medium and device based on dynamic routing
CN102263700A (en) Method, device and system for sending and receiving messages
CN101909005A (en) Method and device for processing forwarding table
CN106789674A (en) A kind of link state update method and device
CN108574637B (en) Address self-learning method and device and switch
CN108848033B (en) Method, device and storage medium for avoiding route conflict

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