High-dynamic mobile ad hoc network adaptive MAC protocol switching method and device, equipment and storage medium
Through distributed decision-making and consensus mechanism, the network status is sensed in real time, the master node is elected, and the MAC protocol switching is used to use the PBFT consensus mechanism to perform communication instability caused by network topology changes in high-dynamic mobile ad hoc networks, and efficient and reliable adaptive protocol switching is achieved, optimizing network performance and stability.
Patent Information
- Application Number
- CN202510564009.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2025-08-15
AI Technical Summary
In high dynamic mobile ad hoc network, existing MAC protocols are difficult to effectively deal with communication instability caused by frequent changes in network topology and node mobility. The traditional protocol switching mechanism has problems such as high collision rate, delay and insufficient adaptability to the network environment.
The distributed decision-making mechanism is adopted, and through the topology perception module and consensus decision-making module, the network status is sensed in real time, the master node is elected, and the MAC protocol switching is used to ensure network consistency and reliability, avoid single point of failure, and adapt to a highly dynamic environment.
Adaptive MAC protocol switching is realized, reducing the switching complexity and overhead, improving network performance and stability, and is suitable for large-scale high-dynamic mobile ad hoc networks, especially drone formations, vehicle ad hoc networks and emergency communication networks.
Smart Images

Figure CN120499282A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of wireless communication and network technology, and particularly relates to a method, device, equipment and storage medium for adaptive Media Access Control (MAC) protocol switching in a highly dynamic mobile ad hoc network. Background Art
[0002] The present invention mainly relates to mobile ad hoc network technology, mobile ad hoc network protocol stack architecture and Byzantine fault-tolerant decision-making technologies.
[0003] (1) Mobile Ad-hoc Network Technology. A Mobile Ad-hoc Network (MANET) is a distributed wireless network that is self-organized by mobile nodes through wireless links without relying on fixed infrastructure. These nodes can be either terminal devices or routers, and can independently complete data forwarding and routing selection, thereby realizing multi-hop communication. Since nodes can move freely, the network topology will be dynamically adjusted as nodes join, leave, or change positions, resulting in highly dynamic and unstable communication links. In addition, MANET relies on wireless channels for communication, and the limited nature of wireless resources further exacerbates the complexity of network management.
[0004] The core advantages of MANETs lie in their flexibility and rapid deployment. In scenarios where traditional networks are unable to reach or temporarily fail, MANETs can quickly establish communication networks to meet immediate needs. This makes them valuable for applications such as emergency communications (such as natural disaster relief), military deployments (such as battlefield communications), ad hoc meetings (such as mobile device connectivity), and the Internet of Things (such as intelligent transportation systems). However, the frequent topology changes caused by node mobility and the resource limitations of wireless channels also pose significant challenges to network resource scheduling, access protocol optimization, and communication stability. To address these challenges, MANETs require efficient dynamic access mechanisms and topology-aware technologies to ensure network reliability and performance in highly dynamic environments.
[0005] (2) Mobile ad hoc network protocol stack architecture. The ad hoc network protocol stack architecture is an important framework used to describe the hierarchical structure of communication protocols in mobile ad hoc networks. The architecture consists of multiple layers, such as Figure 1As shown in Figure 1, each layer has its own specific function and optimizes overall network performance through cross-layer information exchange. The application layer primarily handles specific application tasks, such as remote control, video transmission, and voice communication. This layer provides user interfaces and network services, ensuring that applications can effectively utilize network resources. The transport layer is responsible for providing end-to-end communication services. Its main protocols include the Transmission Control Protocol (TCP) and the User Datagram Protocol (UDP). TCP provides reliable, connection-oriented services suitable for applications requiring high reliability, while UDP provides connectionless, unreliable services suitable for applications with high real-time requirements. The core function of the network layer is packet routing and forwarding. It is responsible for ensuring that data is correctly transmitted from the source node to the destination node. Specific functions include routing forwarding, packet forwarding, and congestion control. This layer adapts to changes in network topology through dynamic routing protocols, ensuring efficient and reliable data transmission. The MAC layer manages node access to the shared medium. Its main functions include multiple access, traffic scheduling, and error checking. Through effective medium access control, the MAC layer ensures that multiple nodes can share the communication channel fairly and efficiently, reducing conflicts and interference. The physical layer is responsible for the physical transmission of data, with key functions including modulation, demodulation, encoding, and decoding. It converts digital data into signals suitable for transmission over physical media and processes the sending and receiving of signals, ensuring reliable data transmission in wireless environments.
[0006] Cross-layer information refers to the exchange and collaboration of information between different protocol layers. Through cross-layer design, networks can optimize performance, such as improving energy efficiency, reducing latency, and enhancing reliability. Cross-layer information exchange enables each layer to dynamically adjust its behavior based on network status and needs, thereby improving the adaptability and efficiency of the entire network.
[0007] In summary, the MANET protocol stack architecture achieves efficient and reliable communication in mobile ad hoc networks through layered design and cross-layer collaboration. Close collaboration and optimization at each layer ensure stable network operation in a variety of complex environments.
[0008] (3) Byzantine Fault Tolerance. Byzantine Fault Tolerance (BFT) is a fault-tolerant algorithm in distributed systems that aims to solve the Byzantine Generals' Problem, which is how to ensure the consistency and correctness of the system in the presence of malicious or faulty nodes. BFT coordinates decisions between nodes through multiple rounds of voting and consensus mechanisms. Its core idea is to allow nodes in the system to reach consensus through four stages: pre-preparation, preparation, submission, and reply. As long as the number of normal nodes N in the system exceeds two-thirds of the total nodes, that is, N ≥ 3f + 1, where f is the maximum number of Byzantine nodes, BFT can ensure that the system can still operate normally when some nodes fail or behave maliciously, while ensuring strong consistency and activity.
[0009] BFT's advantages lie in its efficiency and strong consistency, making it suitable for small and medium-sized distributed systems, such as blockchains and financial systems. However, its message complexity increases significantly with the number of nodes, limiting its application in large-scale systems. Furthermore, BFT relies on the assumption that the network is synchronized most of the time, which may not be fully met in real-world scenarios. Despite this, BFT remains one of the classic algorithms for solving the Byzantine fault tolerance problem in distributed systems, providing reliable technical support for many scenarios with high consistency requirements.
[0010] Over the past few years, researchers have conducted in-depth research on various MAC protocols for MANETs. These protocols have achieved varying degrees of optimization in reducing latency, increasing transmission speed, controlling energy consumption, and enhancing anti-interference capabilities. However, in highly dynamic MANETs, the continuous high-speed mobility of network nodes and the rapid changes in network topology make the entire network environment full of uncertainty and high dynamism. In such complex and rapidly changing network scenarios, traditional MAC protocols, due to their static access mechanisms and fixed scheduling strategies, often struggle to effectively cope with frequent changes in inter-node connections, fluctuations in network load, and increased communication latency. Despite the existence of a large number of different MAC protocols, no single protocol can simultaneously provide optimal performance across multiple key performance indicators, especially when the network environment and node topology are frequently changing. Therefore, there is an urgent need to design a MAC protocol that can adaptively switch based on network topology changes and node status to ensure continuous, efficient, and stable network operation in highly dynamic scenarios.
[0011] Despite significant progress in existing multiple access technologies, challenges remain in highly dynamic MANET environments. For example, contention-based protocols are prone to high collision rates and communication delays, while scheduling-based protocols can struggle to adapt to frequent topology changes, thus impacting communication efficiency. Therefore, achieving both efficient and reliable multiple access mechanisms in highly dynamic MANETs remains a worthy research topic.
[0012] Existing Solution 1: A Chinese invention patent with publication number CN115767785A, published on March 7, 2023, discloses a MAC protocol switching method based on deep reinforcement learning in self-organizing networks. This method aims to address issues such as the large network state space, high voting overhead, and long decision-making time in self-organizing networks. A Deep Q-learning Network (DQN) agent is introduced to evaluate node status information in real time, including load, latency, packet loss rate, throughput, and node motion status. The agent generates guidance information based on the evaluation results to decide whether to switch protocols or adjust parameters. The protocol switching methods mainly include switching between ALOHA (Additive Links Online Hawaii Area), CSMA / CA (Carrier Sense Multiple Access / Collision Avoidance), and TDMA (Time Division Multiple Access). Distributed smooth protocol switching is achieved by modifying the existing request frame (RTS) and clear frame (CTS) structure and the single-hop neighbor node voting mechanism. Compared with centralized decision-making methods, this solution significantly reduces the decision-making time and overhead during the switching process, and significantly reduces the maintenance cost of clock synchronization by maintaining clock synchronization on demand. However, this solution has the following disadvantages: 1) The operation of deep reinforcement learning models requires high computing and storage resources, which places high demands on the hardware performance of node devices and may limit its application on resource-constrained devices. 2) When the network environment changes drastically, the real-time performance of DQN may not be able to fully meet the demand, resulting in a certain lag in decision-making, affecting the timely optimization of network performance. 3) The training process of the DQN agent requires a large amount of sample data, and the training efficiency may be affected by the complexity of the network environment. This may lead to high training costs and low efficiency in practical applications.
[0013] Existing Solution 2: Chinese invention patent application publication number CN117938979A, published on April 26, 2024, discloses a MAC protocol switching method and system for tactical UAV networks. This method addresses the problem of interference affecting UAVs in complex environments, leading to communication and mission interruptions. Dynamically adjusting communication protocols is necessary to ensure network stability and efficiency. This solution employs a centralized algorithm, selecting a UAV within a cluster as the cluster head and collecting status information from other nodes. The cluster head calculates the current network traffic load and determines the appropriate MAC protocol based on the load and a preset threshold. If the load exceeds a first threshold, the TDMA protocol is selected; if it is below a second threshold, the CSMA protocol is selected; if it is between the two, the original protocol is retained. The UAV system dynamically switches protocols by broadcasting protocol switching instructions, improving the network's interference resistance and communication efficiency. However, this solution has the following drawbacks: 1) Centralized decision-making poses a single point of failure risk: As the centralized control node, a failure or attack on the cluster head UAV can severely impact the stability and reliability of the entire system. 2) This method's switching strategy relies heavily on preset traffic load thresholds, lacks an adaptive dynamic optimization mechanism, and may not be able to flexibly adapt to dynamic changes in the network environment. 3) This solution primarily targets intra-cluster single-hop communication scenarios. Its applicability and scalability are limited for more complex multi-hop network structures, and may not meet the requirements of multi-hop networks. Summary of the Invention
[0014] To address the problem of MAC protocol inadaptability caused by frequent changes in network topology in a highly dynamic environment, the present invention proposes a method, device, equipment and storage medium for adaptive MAC protocol switching in a highly dynamic mobile ad hoc network. Through distributed decision-making and adaptive mechanisms, it ensures that the network can select the optimal MAC protocol according to real-time topology changes, thereby improving network performance and stability.
[0015] The present invention provides a highly dynamic mobile ad hoc network adaptive MAC protocol switching method, comprising:
[0016] Step 1) All mobile communication nodes in the network perform initialization operations at startup and establish a neighbor node information table, which stores neighbor node information, including location, speed, and movement direction;
[0017] Step 2) Each node regularly broadcasts information exchange packets to obtain real-time information of neighboring nodes;
[0018] Step 3) If a node requests to start MAC protocol switching voting, the node is used as the starting node, and the other nodes in the network are used as replica nodes. One node is elected from the replica nodes as the master node, and the remaining replica nodes are used as backup nodes;
[0019] The master node election method is as follows: each node determines whether it is closest to the centroid of the network. If so, the node is selected as the master node. If the number of nodes closest to the centroid is greater than one, the node with the largest number of neighboring nodes is selected as the master node.
[0020] Step 4) Each node periodically senses the current network status and executes a pre-selection mechanism to determine whether the current MAC protocol is suitable for the current network environment. If a node determines that the current MAC protocol is no longer suitable, it selects the currently optimal MAC protocol from the MAC protocol library, and then the node proceeds to step 5.
[0021] The pre-selection mechanism is as follows: the node quantitatively calculates the comprehensive score of the current MAC protocol based on the currently perceived network performance indicators. If the comprehensive score is lower than a preset threshold, the protocol is determined to be unsuitable for the current network environment. The obtained network performance indicators include network throughput T, delay D, packet loss rate P, and channel utilization C. The comprehensive score is obtained by weighted summation of the scores of each indicator currently obtained by the node.
[0022] Step 5) If a node determines that the current MAC protocol is no longer applicable and the switching timer expires, the node becomes the starting node, starts the MAC protocol switching voting program, and makes a consensus decision with the replica nodes in the network; the consensus decision means that the nodes in the network calculate the comprehensive score of the current MAC protocol based on the currently perceived network status, and vote to decide whether to switch the MAC protocol. If the vote passes, all nodes start to use the new MAC protocol synchronously. If the vote fails, the nodes continue to use the current MAC protocol and continue to execute step 4.
[0023] In the method of the present invention, the backup node periodically detects the existence of the master node. When the master node fails and the backup node receives a message timeout notification, it sends the master node failure message to all backup nodes in the cluster and starts the process of re-electing the master node.
[0024] Correspondingly, the present invention also provides a highly dynamic mobile ad hoc network adaptive MAC protocol switching device, which is deployed on all nodes of the network. The device includes a topology perception module, a pre-selection module and a consensus decision module between the upper application module and the underlying communication module.
[0025] The nodes periodically perceive the network topology structure through the topology perception module, including the connection relationship between nodes and the node's neighbor node information; perceive the network status and obtain network performance indicators including network throughput, delay, packet loss rate and channel utilization.
[0026] Each node periodically senses the current network status and determines whether the current MAC protocol is suitable for the current network environment through the pre-selection module. If it is determined that the current MAC protocol is no longer suitable, the currently optimal MAC protocol is selected from the MAC protocol library. The pre-selection module quantitatively calculates the comprehensive score of the current MAC protocol based on the network performance indicators currently sensed and obtained by the node. If the comprehensive score is lower than a preset threshold, it is determined that the protocol is not suitable for the current network environment. The comprehensive score is obtained by weighted summation of the scores of each indicator currently obtained by the node.
[0027] If a node determines that the current MAC protocol is no longer applicable and the switching timer expires, the node becomes the starting node and requests to start the MAC protocol switching vote, and makes a consensus decision with the replica nodes in the network through the consensus decision module; the nodes in the network elect the master node through the consensus decision module, and take the other nodes in the network except the starting node as replica nodes, and elect a node from the replica nodes as the master node. The master node election method is: each node determines whether it is closest to the center of mass of the network. If it is closest, the node is selected as the master node. If the number of nodes closest to the center of mass is greater than 1, the node with the largest number of neighbor nodes is selected as the master node; the starting node sends the MAC protocol switching voting request to the master node, the master node broadcasts it, and each replica node calculates the comprehensive score of the current MAC protocol based on the currently perceived network status, and votes to decide whether to switch the MAC protocol. If the vote passes, all nodes synchronously start to use the new MAC protocol. If the vote fails, the node continues to use the current MAC protocol.
[0028] Furthermore, the present invention provides a highly dynamic mobile ad hoc network adaptive MAC protocol switching device, which is deployed on each communication node. The device includes a memory, a processor, and a computer program stored in the memory; when the computer program is executed by the processor, the adaptive MAC protocol switching method provided by the present invention is implemented.
[0029] Furthermore, the present invention also provides a readable storage medium having a computer program stored thereon, which implements the adaptive MAC protocol switching method provided by the present invention when the program is executed by a processor.
[0030] The advantages and positive effects of the adaptive MAC protocol switching method, apparatus, device, and storage medium of the present invention are:
[0031] (1) The present invention implements adaptive MAC protocol switching, optimizes network performance, and improves the robustness of the MAC layer. Through a protocol pre-selection mechanism and a consensus decision-making mechanism, the present invention can select the appropriate MAC protocol in real time based on network status and coordinate decisions between nodes, effectively reducing the complexity and overhead of MAC switching. This makes it particularly suitable for large-scale, highly dynamic mobile ad hoc networks, effectively avoiding network instability caused by frequent switching while ensuring consistency and reliability across the entire network when switching MAC protocols.
[0032] (2) The present invention can efficiently cope with highly dynamic network environments, significantly improving network resource utilization and network stability while ensuring low-latency communication. The present invention is applicable to highly dynamic scenarios such as drone formations, vehicle-mounted ad hoc networks, and emergency communication networks, providing reliable technical support for efficient communication in complex network environments.
[0033] (3) Although the existing solution 1 introduces deep reinforcement learning to make protocol switching decisions, its decision-making process relies on the intelligent agent evaluation of a single node and still has certain centralized characteristics. The existing solution 2 adopts centralized decision-making and relies on the cluster head node to make protocol switching decisions. There is a risk of single point failure, and the selection and maintenance of the cluster head node may increase network overhead. The present invention implements a distributed decision-making mechanism through the election of the master node and the protocol selection process based on Practical Byzantine Fault Tolerance (PBFT), avoiding the single point failure problem and enhancing the robustness and fault tolerance of the network. In addition, the distributed decision-making implemented by the present invention can better adapt to highly dynamic network environments and reduce decision delays.
[0034] (4) The protocol switching in existing solutions 1 and 2 is mainly based on traditional indicators such as network load, latency, and packet loss rate, and lacks real-time perception of dynamic changes in network topology. However, this invention introduces a network state perception mechanism that can adaptively select the optimal MAC protocol, better cope with highly dynamic network environments, and ensure the timeliness and accuracy of protocol switching.
[0035] (5) The protocol switching process of existing solutions 1 and 2 lacks a consensus mechanism, which may lead to inconsistent or frequent protocol switching, affecting network stability. The present invention introduces a consensus mechanism based on PBFT to ensure that all nodes reach consensus during the protocol switching process, avoiding frequent switching and network instability. By adopting the PBFT consensus mechanism, the present invention can also effectively deal with malicious nodes or faulty nodes in the network, enhancing the security and reliability of the network. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 It is a network protocol stack architecture diagram in the prior art;
[0037] Figure 2 This is a schematic diagram of the module composition provided in a node device according to an embodiment of the present invention;
[0038] Figure 3 2 is a schematic diagram of device communication interaction using the adaptive MAC switching method of the present invention in an embodiment of the present invention;
[0039] Figure 4 1 is a flow chart of the master node election process according to an embodiment of the present invention;
[0040] Figure 5 This is a diagram of the adaptive MAC protocol architecture based on Byzantine fault-tolerant decision-making of the present invention;
[0041] Figure 6 This is a schematic diagram of the process of decision-making consensus based on PBFT in the present invention. DETAILED DESCRIPTION
[0042] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments.
[0043] The present invention proposes an adaptive MAC protocol switching method, device, equipment and storage medium for highly dynamic mobile ad hoc networks. The physical entity involved in the embodiment of the present invention includes multiple communication nodes with the same data forwarding capability, establishing a cluster, and the communication of the nodes in the cluster does not require ground infrastructure and a centralized control center. The modules in each node device are composed as follows Figure 2 As shown, including:
[0044] (1) Upper-level application modules: These modules are located at the top level of the system and are responsible for processing high-level application logic and tasks.
[0045] (2) Topology perception module: This module is responsible for monitoring and understanding the network topology, that is, the connections and neighbor relationships between nodes; as well as perceiving the network status and obtaining network performance indicators.
[0046] (3) GNSS module: The Global Navigation Satellite System (GNSS) module provides precise positioning and time synchronization services, which are crucial for time synchronization and coordination in distributed systems.
[0047] (4) Pre-selection module: Filters suitable candidate MAC protocols from the protocol library based on the current network topology and node status. (5) Consensus decision module: Coordinates decisions between nodes through the PBFT algorithm to ensure consistency across the entire network when switching MAC protocols.
[0048] (6) Information interaction module: used for each node to exchange control information based on the established time frame, and to update the neighbor information table corresponding to each node according to the status of new nodes entering the network.
[0049] (7) Bottom-level communication module: This module handles the bottom-level communication protocols and data transmission to ensure reliable information delivery.
[0050] Among them, the topology perception module, consensus decision module and pre-selection module are all located in the access module, which are jointly responsible for managing the access and communication of nodes, ensuring that data can be effectively transmitted between nodes, and are also the main implementation modules of the adaptive MAC protocol switching device for highly dynamic mobile ad hoc networks in the embodiment of the present invention. For the specific implementation of each functional module of the adaptive MAC protocol switching device of the present invention, please refer to the description of the adaptive MAC protocol switching method of the present invention below. The adaptive MAC protocol switching device or method of the present invention can be implemented in the form of software functional units and sold or used as independent products. These software functional units can be stored in a computer-readable storage medium, and the user can implement the adaptive MAC protocol switching function by installing and executing the software.
[0051] The method for adaptive MAC protocol switching for highly dynamic mobile ad hoc networks of the present invention comprises the following steps:
[0052] Step 1) Network Initialization. All nodes perform initialization upon startup, including establishing their own neighbor node information table. This table stores information about neighbor nodes, including location, speed, and direction of movement. After initialization is complete, the node enters normal operation and prepares to exchange information with neighbor nodes.
[0053] Step 2) Neighbor node information exchange: Each node obtains the real-time motion information of neighbor nodes, such as location, speed, and direction of movement, by regularly broadcasting interaction packets.
[0054] Each node of the present invention can also further calculate other indicators based on the motion information of neighboring nodes for use in other improved MAC protocols. For example, a link duration indicator is calculated to evaluate the stability of the link between nodes. The longer the link duration, the more stable the link. A topology change index is calculated to reflect the degree of dynamic change in the network topology. The higher the topology change index, the more frequent the network topology changes.
[0055] Step 3) Elect the primary node. To ensure consistent switching of the distributed network, a primary node (PN) needs to be elected in the network. The election process is as follows: Each node receives the distance information broadcast by other nodes and stores it locally. The node compares its distance with other nodes to determine whether it is closest to the center of mass of the network. If a node finds that it is the node closest to the center of mass, it is selected as the primary node. If multiple nodes have the same distance from the center of mass, the node with the largest number of neighbor nodes is selected as the PN. Through this election process, a reliable node is selected in the network as the decision-making center, responsible for coordinating the consistent switching of the entire network protocol.
[0056] Step 4) Topology Perception and Preselection. Nodes adaptively acquire information about network topology changes through a periodic topology perception process. In this embodiment of the present invention, each node perceives topological changes in its network at regular intervals, including inter-node connectivity, link quality, and traffic load. Nodes are then preselected based on the current network status.
[0057] Each node executes a pre-selection mechanism to quantitatively calculate the comprehensive score of the current MAC protocol, and judges whether the current MAC protocol is still suitable for the current network environment based on the comprehensive score. The comprehensive score is calculated based on key network performance indicators collected by the node, including factors such as throughput, latency, packet loss rate, and channel utilization. If the score of the current protocol is lower than the preset threshold, it means that the protocol is no longer suitable for the current network environment. The node enters the protocol selection process based on the PBFT consensus, selects the current optimal MAC protocol from the MAC protocol library according to the network topology changes and network conditions, and then enters step 5). In the present invention, the node dynamically triggers the protocol selection process based on the PBFT consensus according to the detection of network performance, which can optimize network performance and adapt to dynamically changing network topology.
[0058] Step 5) Consensus decision. If a node in the network determines that the current MAC protocol is no longer applicable and the switching timer has expired, the node will become the starting node and start the voting procedure for MAC protocol switching. The specific steps are as follows: the starting node initiates a voting request for MAC protocol switching to other nodes. Other nodes vote to decide whether to switch the MAC protocol based on the current network status and pre-selection results. If the vote passes, all nodes update their own network status information and start using the new MAC protocol. If the vote fails, the node continues to use the original MAC protocol and re-measures the network status after the next detection cycle. Through the consensus decision-making mechanism, the network can achieve consistent switching of MAC protocols in a distributed environment, avoiding network instability caused by frequent switching. The present invention uses a protocol selection process based on PBFT consensus, so that the network can flexibly adjust the MAC protocol according to environmental changes without relying on centralized control nodes.
[0059] like Figure 3 This figure illustrates an example of a node using the adaptive MAC protocol switching method for a highly dynamic mobile ad hoc network. The figure also illustrates the interaction between these modules at different levels, as well as the information exchange between a node and its neighbors. This architecture supports dynamic resource allocation and efficient communication in distributed systems, particularly in mobile devices and dynamic network environments.
[0060] The network model constructed in the embodiment of the present invention is composed of N mobile nodes, which are denoted as Node = {n1, n2, ..., n N}. Each node is equipped with GNSS for clock synchronization and accurate location information. Each node has a unique identification number (ID) in the entire network and has wireless communication capabilities, with a unified communication radius of r. Communication between nodes uses omnidirectional antennas for half-duplex transmission, which means that nodes cannot simultaneously perform data packet sending and receiving operations at the same time. Assume that the nodes have sufficient energy during network operation, the communication radius remains unchanged, and the instantaneous speed, movement direction and position coordinates of the nodes can be obtained in real time, and the error is controlled within an acceptable range. Let f be the maximum number of nodes that can fail simultaneously in the network. Even if some nodes cannot participate in voting or fail, the remaining nodes can still reach a consensus through sufficient votes to ensure the synchronization and correctness of the protocol switching. The condition N≥3f+1 needs to be met, so f=(N-2) / 3 is set.
[0061] Considering the characteristics and actual situation of highly dynamic MANET, the present invention assumes that nodes can obtain their own motion information regularly through GNSS. i The motion information includes the instantaneous position and instantaneous velocity of the node. i The instantaneous position at time t is pi (t) = x i (t),y i (t),z i (t), the instantaneous speed at time t is Assume that at time t, node n i and node n j The distance between them is d ij (t). The transmission range of each node in the network is a circular area with itself as the center and a radius of r. If the distance between two nodes is d ij ≤r, then node n i and node n j Two nodes can communicate directly if they are within each other's communication range. ij >r, then node n i and node n j Direct communication is not possible and must be relayed through other nodes.
[0062] At the same time, each node can also obtain the movement information of its neighbor nodes through periodic single-hop transmission of beacon data packets. In order to characterize the dynamics and spatiotemporal correlation of node movement, it is assumed that each node moves according to the enhanced three-dimensional Gauss-Markov mobility model. Assume that the node movement process is in a limited three-dimensional space. In which x max ,y max ,z max are much larger than r. Therefore, once the nodes reach the boundary, they will move in opposite directions, that is:
[0063]
[0064] Where Δt is the time interval between two adjacent discrete time nodes. i (t) varies independently between each time interval and remains constant within the interval.
[0065] The method of the present invention adopts a topology perception mechanism with a fixed perception time interval, that is, each node perceives the topology changes of its network environment, that is, obtains the topology information such as the topological relationship, link quality, and traffic load of the connection between the nodes, and according to the current network conditions, each node selects a relatively suitable MAC protocol to adapt to the current network environment. The topology perception capability of the node enables the network to change flexibly based on the changes in its environment, and the network is not restricted by the central control node. The election of the master node is to ensure the consistent switching of the distributed network. The present invention defines the node requesting a vote as the start node (Start Node, SN), and the other nodes as replica nodes (Replica Nodes, RNs). Among the RNs, one node is selected as the master node PN, and the remaining nodes are backup nodes (Backup Nodes, BNs). An election process for the master node is as follows: Figure 4 The specific steps for electing a master node include:
[0066] Step 31: During the initialization phase of each election, each node obtains its own spatial location information through the global navigation satellite system and calculates the center of mass position of the mobile ad hoc network movement area. The center of mass position is the average of the positions of all nodes in the network and is used as a reference point. The center of mass position p c The calculation formula is:
[0067]
[0068] Where N is the total number of nodes in the network, (x i ,y i ,z i ) is the location coordinate information of node ni.
[0069] Step 32: Each node calculates the Euclidean distance to the center of mass of the mobile ad hoc network according to its current location information, and broadcasts the calculation results to other nodes in the network. The broadcast information includes: node ID, node location information, node speed information, distance value from the node to the center of mass, and neighbor node information. i Distance from the center of mass The calculation formula is:
[0070]
[0071] Among them, (x i ,y i ,z i ) is node n i The position coordinate information, (x c ,y c ,z c ) is the position coordinate information of the center of mass.
[0072] Step 33: Each node receives the distance information from the centroid broadcast by other nodes and stores it locally. The node then compares its own distance to the centroid with that of each other node to determine whether it is the closest node to the centroid. If a node finds that its distance to the centroid is the smallest, it is designated as the PN. If multiple nodes share the same minimum distance, the node with the largest number of neighboring nodes is selected as the PN.
[0073] Step 34: The node elected as the master node PN broadcasts a message containing its ID, distance, and a statement of its election as master node. This broadcast message informs other nodes of the PN's identity and ensures consistency across the entire network. Nodes that receive the PN's identity confirm its master status. Once all nodes have confirmed the master status, they execute the PN's instructions and proceed to the subsequent MAC protocol handover process.
[0074] When the master node exists, the backup nodes monitor its presence using a timer. If the master node fails, such as failing to respond to requests or broadcast messages, the backup node that received the timed-out message will notify all backup nodes in the cluster before the master node does, initiating a master reelection process.
[0075] Through the above process, the master node election process can ensure that a reliable node is selected in the network as the decision-making center, thereby coordinating the consistent switching of the entire network protocol.
[0076] The present invention proposes an adaptive MAC protocol based on Byzantine fault-tolerant decision-making, which optimizes network performance indicators and improves the robustness of the MAC layer through MAC protocol adaptive switching. Figure 5 As shown in the figure, first, each node can make a decision from the MAC protocol library based on the current network topology, node status and other network performance, and select the optimal MAC protocol for this node. Then, PBFT is used to coordinate the decision consistency between nodes when switching MAC protocols, ensuring that the MAC protocol of the entire network can remain consistent in the event of topology changes, node failures or malicious behavior.
[0077] In order to achieve smooth switching of MAC protocols, the present invention designs a MAC protocol library, which includes a variety of MAC protocols adapted to different network environments. The MAC protocol library of the embodiment of the present invention includes the TDMA protocol and the CSMA / CA protocol. It can also include a self-developed improved dynamic TDMA protocol or other MAC protocols. For example, the length and allocation of time slots are dynamically adjusted according to the node topology change and link duration to implement an improved TDMA protocol, thereby improving network throughput and reducing communication delays, avoiding channel contention, and improving network resource utilization.
[0078] The MAC protocol switching of the embodiment of the present invention is dynamically selected based on the network status, node status and communication requirements. The node status includes load, density, channel quality, etc. For example, if the network topology changes significantly or the node density increases significantly, it is possible to switch to the TDMA protocol to reduce conflicts; if the network environment is stable and the node load is low, the CSMA / CA protocol can be selected to optimize bandwidth utilization. The CSMA / CA protocol has lower overhead, shorter latency and higher channel utilization at low data rates, and can better adapt to dynamically changing network topologies. TDMA has significant advantages in spectrum efficiency, reliability and deterministic communications, and is particularly suitable for satellite, cellular networks, industrial control and medium and high-speed data transmission scenarios.
[0079] The MAC protocol pre-selection in the embodiment of the present invention is a mechanism in which a node autonomously determines whether the currently used MAC protocol is suitable for the current network environment based on the current local network status. The MAC protocol pre-selection process of the present invention is divided into the following four steps.
[0080] Step 41: To fully reflect the current network operation status, the node continuously monitors the network status and collects key network performance indicators, including network throughput, latency, packet loss rate, and channel utilization.
[0081] The embodiment of the present invention also calculates the topology change index based on some neighbor information and network status collected by the node. The topology change index t of the node i The calculation can be performed according to the method provided in the embodiment of the present invention, or by other methods in the prior art, which is not limited by the present invention. i The topology change index is calculated as follows:
[0082] Compute node n i The average distance change between the current time t and the neighboring nodes relative to the previous time is obtained as the distance change index
[0083] Count DVI i (t), calculated as: d i (t) and d i (t-1) represents the node n at the current moment and the previous moment respectively i The average distance to its neighboring nodes.
[0084] Compute node n i The direction change index MVI is obtained by calculating the rate of change of the relative motion direction of the neighbor node at the current time t relative to the previous time. i (t), specifically calculated as: Neigh i (t) represents the node n at time ti The number of neighbor nodes, θ ij (t) represents the node n at time t i With neighbor node n j The relative motion direction, θ ij (t-1) represents the node n at time t-1 i With neighbor node n j relative direction of movement.
[0085] Compute node n i The relative speed change index RVI is obtained by calculating the change in relative speed with neighboring nodes at the current time t relative to the previous time. i (t), specifically calculated as: relv ij (t), relv ij (t-1) represents node n i and its neighbor node n j The relative speed at time t and time t-1, parameter ∈ is 10 -6 , to avoid computational problems when the rate changes are minimal.
[0086] Compute node n i The change in the number of neighbor nodes at the current time t relative to the previous time is used to obtain the neighbor node number change index NVIi(t), which is specifically calculated as: Neighi(t-1) is the node n at the previous moment i The number of neighbors.
[0087] Compute node n i Topological change index t at time t i =ω1·DVI i t+ω2·MVI i t+ω3·RVI i t+ω4·NVI i t; among them, the value range of weights ω1, ω2, ω3 and ω4 is 0 to 1, and the sum of the four weights is 1.
[0088] Step 42: To quantitatively evaluate the applicability of the current MAC protocol, a multi-metric scoring system is used for the MAC protocol. The evaluation metrics include throughput, latency, packet loss rate, and channel utilization. The score for each metric is calculated as follows:
[0089] Throughput score T score , where T high 、T low These are the high throughput threshold and low throughput threshold set respectively;
[0090]
[0091] Delay score D score , where D high 、D low These are the high latency threshold and low latency threshold set respectively;
[0092]
[0093] Packet loss rate score P score , where P high 、P low They are high packet loss rate threshold and low packet loss rate threshold respectively;
[0094]
[0095] Channel utilization score C score , where C high 、C low These are the high utilization threshold and low utilization threshold set respectively;
[0096]
[0097] The comprehensive score S is calculated by weighted summation:
[0098] S=ω T ×T score +ω D ×D score +ω P ×P score +ω C ×C score
[0099] Among them, ω T 、ω D 、ω P 、ω C are the weights of throughput, delay, packet loss rate and channel utilization respectively,
[0100] And satisfy the weight ω T 、ω D 、ω P and ω C The sum of the weights is 1, and the weight distribution can be adjusted according to specific network requirements.
[0101] Step 43: The node determines whether the current MAC protocol is suitable for the current network environment based on the comprehensive score S. If the score of the current protocol is less than a preset threshold, it means that the current protocol is no longer suitable for the network environment. Otherwise, it means that the current protocol is suitable for the current network environment.
[0102] Step 44: If the node determines that the current protocol is no longer suitable for the current network environment, it selects the currently optimal MAC protocol from the MAC protocol library. The node then enters the PBFT consensus-based protocol selection process and triggers protocol switching.
[0103] In the embodiment of the present invention, corresponding applicable topology change indexes, node status ranges, etc. can be set for different protocols in the MAC protocol library. For example, according to the current topology change index t i and node load l i , select the current optimal MAC protocol m from the MAC protocol library M i ∈ M. It should be noted that the method of the present invention does not limit the calculation method of the topology change index, nor does it limit the method of selecting the MAC protocol. The user can select the node status as the basis for selecting the MAC protocol according to actual usage.
[0104] By using the above MAC protocol pre-selection, the node can determine the optimal MAC protocol according to the network status, thereby optimizing the network and adapting to changes in the network topology.
[0105] There may be some faulty nodes in the network due to their own factors. They cannot send or receive data packets from other nodes. Therefore, these faulty nodes can be detected through data packet interaction. In the method of the present invention, it is assumed that the faulty nodes cannot participate in the consensus decision-making process and the broadcast failure problem is not considered. That is, when the node n i If any neighbor node can receive the broadcast information, then by default all normal nodes within the communication range can receive the broadcast packet.
[0106] If the node determines that the current MAC protocol is no longer applicable and the switching timer has expired, the node will become the starting node and initiate the voting procedure for the MAC protocol switching. The switching timer is a pre-set timer to prevent frequent switching of the MAC protocol. The timer will be reset each time the MAC protocol is switched to avoid unnecessary protocol switching due to short-term fluctuations in the network status. In the present invention, the result of the node vote determines whether the MAC protocol is switched: if the vote is successful, the MAC protocol is switched; if it fails, the current MAC protocol continues to be used. In order to prevent the failure of PN from affecting the normal communication of the network, BNs monitor the status of PN through a data packet timeout mechanism. Once a BN detects that a PN has failed, the node will immediately broadcast the master node failure message to other nodes, and then the network will enter a new consensus decision-making process to re-elect the PN.
[0107] like Figure 6The following diagram illustrates the consensus decision-making process based on PBFT in an embodiment of the present invention. In the diagram, node n0 is the SN, nodes n1 through n4 are RNs, and node n1 is currently elected as the PN, while nodes n2 through n4 are elected as the BNs. Assuming node n4 fails, the following is the implementation flow of the consensus decision-making mechanism:
[0108] (1) Request Phase: Node n0 initiates a MAC protocol switch request and sends a voting request packet to node n1. The voting request packet mainly contains the MAC protocol switch request information and the pre-set switching time, ensuring that multiple drone nodes perform protocol switching at the same time, avoiding communication failures due to asynchronous switching.
[0109] (2) Proposal Phase (Pre-prepare Phase): After node n1 receives the voting request packet from node n0, node n1 confirms the request is valid and begins broadcasting the voting request packet. The master node n1 broadcasts the request to all replica nodes and prepares for voting.
[0110] (3) Prepare Phase: After receiving the voting request packet broadcast by node n1, replica node n2 processes the request and decides whether to agree to the protocol switch. If it agrees, it declares its agreement to the protocol switch in the voting preparation data packet and broadcasts it out, notifying other BNs that the protocol switch is ready, and all replica nodes will broadcast the voting preparation data packet to other replica nodes. For example, node n2 will broadcast the voting preparation data packet to nodes n1, n3 and n4. It is worth noting that since node n4 failed and could not be broadcast, this node did not participate in this vote. If it disagrees, it declares its disagreement to the protocol switch in the voting preparation data packet and broadcasts it out. Each replica node in the embodiment of the present invention calculates the comprehensive score of the current MAC protocol based on the network status currently perceived by the node itself to decide whether to agree to the protocol switch.
[0111] (4) Commit Phase: If a replica node receives 2f voting preparation packets agreeing to the protocol switch, it enters the commit phase and broadcasts a voting commit packet containing its voting results to other replica nodes. The voting commit packet mainly contains the node's voting results, which is used to ensure that all replica nodes agree to the switch. The voting result means that the node agrees to the protocol switch.
[0112] (5) Reply Phase: If a replica node receives at least 2f+1 voting submission packets, including packets that it may have sent, the replica node considers the vote to be passed and will send a voting reply packet to all other nodes to confirm that consensus has been reached.
[0113] Through a consensus decision-making mechanism, if the MAC protocol switch succeeds, all nodes update their network status information and begin using the new MAC protocol. They then continue to monitor the network status and wait for the next MAC protocol switch. If the MAC protocol switch fails, the nodes continue to use the original MAC protocol and remeasure the network status after the next detection cycle.
[0114] During the entire protocol decision-making process, PBFT can tolerate a maximum number of faulty nodes, f. For example, if there are five nodes in the network, then at most one node can fail. During this process, some nodes may be unable to make a vote due to failures, but the voting results of enough nodes can still be satisfied to ensure the consistency and correctness of the protocol switch.
[0115] In step 2) of the method of the present invention, information exchange is required between nodes. Neighboring nodes mainly exchange important information such as link quality, node neighbor table, and node location and speed. The specific packet format design is shown in Table 1:
[0116] Table 1 Neighbor node information exchange data packet format
[0117]
[0118] The meanings of the main fields in the data packet are as follows:
[0119] Type indicates the data packet type, and the packet interaction value is 0x0000.
[0120] TimeStamp indicates the timestamp of the data packet.
[0121] Source Address indicates the address of the source node.
[0122] Node Position indicates the three-dimensional position information of the source node, including Position_X, Position_Y, and Position_Z.
[0123] Node Velocity represents the three-dimensional motion speed information of the source node, including Velocity_X, Velocity_Y, and Velocity_Z.
[0124] Node Status indicates the node's online status. True indicates it is online, and false indicates it is offline.
[0125] Sequence Number indicates the sequence number of the data packet.
[0126] The master node election process in step 3 of the present method includes two types of data packets. The first is a distance broadcast packet (DBP), generated by each node. This packet contains the node ID, node location information, node velocity information, the Euclidean distance between the node and the center of mass of the ad hoc network's motion area, and neighbor node information. The node broadcasts this information to the network for distance comparison and decision-making during the master node election process. The specific format of the distance broadcast packet is shown in Table 2.
[0127] Table 2 Distance broadcast data packet format
[0128]
[0129] The meanings of the main fields of the data packet are as follows:
[0130] Type indicates the data packet type, and the distance broadcast packet is marked as 0x0001.
[0131] TimeStamp indicates the timestamp of the data packet.
[0132] Source Address indicates the address of the source node.
[0133] Node Position indicates the three-dimensional position coordinate information of the source node, including Position_X, Position_Y, and Position_Z.
[0134] Node Velocity represents the three-dimensional motion speed information of the source node, including Velocity_X, Velocity_Y, and Velocity_Z.
[0135] Center Position represents the coordinate information of the center of mass of all nodes in the network.
[0136] Distance represents the distance information between the source node and the centroid at the current moment.
[0137] Neighbor Num indicates the number of neighbor nodes of the source node.
[0138] The second type is the Primary Declaration Broadcast Packet (PDBP). This packet is generated by the node elected as the primary node and contains the node ID, distance from the center of mass, and a declaration of becoming the primary node. The primary node broadcasts this information to the entire network, announcing its status as the primary node so that other nodes can update their status and follow the primary node's schedule. The specific format of the Primary Declaration Broadcast Packet is shown in Table 3.
[0139] Table 3 Masternode declaration broadcast data packet format
[0140]
[0141] The meanings of the main fields of the data packet are as follows:
[0142] Type indicates the packet type, which is 0x0010.
[0143] TimeStamp indicates the timestamp of the master node's declaration data packet.
[0144] Source Address indicates the address of the master node.
[0145] Node Role indicates the identity information of the node, and the master node is identified as 1.
[0146] Node Position indicates the three-dimensional position coordinate information of the main node, including Position_X, Position_Y, and Position_Z.
[0147] Node Velocity represents the three-dimensional motion speed information of the main node, including Velocity_X, Velocity_Y, and Velocity_Z.
[0148] During the PBFT protocol decision-making process in step 6 of the present method, different nodes send and receive different types of data packets, depending on their roles and phases, to ensure a smooth consensus process. Each data packet has a specific purpose, ensuring synchronization and fault tolerance during protocol switching.
[0149] First, in the proposal phase, a node generates a MAC protocol proposal based on its local topology awareness and network status and broadcasts it to surrounding nodes. The Propose Request Packet (PRP) contains the proposing node's identity, MAC protocol selection, and timestamp. Second, in the prepare phase, if a replica node agrees with the proposal, it broadcasts a Propose Prepare Packet (PPP) to notify other BNs that it is ready to participate in the protocol switch. The Propose Prepare Packet (PPP) primarily contains information confirming the proposal, the node's address, identity, and timestamp. Subsequently, in the commit phase, if a replica node receives a certain number of Propose Prepare Packets, it broadcasts a Propose Commit Packet (PCP). The Propose Confirm Packet (PCP) primarily contains the requesting node, node address, identity, and timestamp. Finally, in the reply phase, if a replica node receives a certain number of Propose Commit Packets, it recognizes the vote as passed and sends a Propose Reply Packet, confirming consensus. The Propose Reply Packet (PRP) primarily contains the requesting node, node address, identity, and timestamp. The data packet format in the consensus decision phase is shown in Table 4.
[0150] Table 4 Data packet format for consensus decision phase
[0151]
[0152] The meanings of the main fields in the data packet are as follows:
[0153] Type: Data packet type. The voting request packet type is 0x0011, the voting preparation packet type is 0x0100, the voting submission packet type is 0x0101, and the voting reply packet type is 0x0110.
[0154] TimeStamp indicates the timestamp of the data packet sending.
[0155] ProposeProcotol indicates the MAC protocol type of the starting node requesting handover.
[0156] Propose Choice indicates whether to agree to the protocol switch. True indicates that the node agrees to the protocol switch and is ready to proceed to the next step of voting. False indicates that the node disagrees with the protocol switch.
[0157] Propose Node indicates the starting node for proposing MAC protocol switching.
[0158] Source Address indicates the address of the source node that sends the data packet.
[0159] Destination Address indicates the address of the destination node.
[0160] Topology Message indicates the topology information of the node.
[0161] Link Message indicates the link status of a node.
[0162] Node Position represents the three-dimensional position coordinate information of the node.
[0163] Node Velocity represents the three-dimensional motion speed information of the main node.
[0164] The highly dynamic mobile ad hoc network adaptive MAC switching device of the embodiment of the present invention can be implemented in the form of various computing devices, including but not limited to the following devices:
[0165] Desktop computers: Implement dynamic protocol switching algorithms through high-performance processors and large-capacity memory.
[0166] Notebook: A portable computing device suitable for dynamic MAC protocol switching in mobile scenarios.
[0167] PDA: A small computing device suitable for resource-constrained network environments.
[0168] Cloud Server: Achieve large-scale network awareness and protocol switching through the cloud computing platform, supporting high concurrency and high-performance computing requirements.
[0169] The adaptive MAC switching device implemented in the embodiment of the present invention is deployed on each communication node and includes the following core devices: Processor: used to execute the adaptive MAC protocol switching algorithm of the present invention, including topology awareness, protocol pre-selection, consensus decision-making and other tasks.
[0170] Memory: used to store the program code for implementing the adaptive MAC protocol switching method of the present invention, as well as data such as the network topology information table and the neighbor node information table required during the execution process.
[0171] Network interface: used to communicate with other nodes in the network, sending and receiving control information and data.
[0172] Other optional devices:
[0173] a) Power management module: Applicable to energy-constrained devices to optimize energy consumption.
[0174] b) Sensor module: used to obtain the real-time location, speed and other information of the node.
[0175] The present invention also provides a computer-readable storage medium for storing a computer program for implementing the adaptive MAC switching method of the present invention. The computer-readable storage medium includes but is not limited to the following forms:
[0176] Physical storage media:
[0177] USB flash drive: A portable storage device suitable for program distribution in small networks.
[0178] Mobile hard disk: A large-capacity storage device suitable for storing programs and data on large-scale networks.
[0179] Disk: Traditional storage medium, suitable for offline storage.
[0180] Optical discs: including CDs, DVDs, Blu-ray discs, etc., suitable for program distribution and long-term storage.
[0181] Computer memory: includes RAM and ROM, used for temporary storage and quick access to program code.
[0182] Virtual storage media:
[0183] Electrical carrier signal: transmits program code via electrical signal.
[0184] Telecommunications signals: Transmission of program code via wireless or wired communications networks.
[0185] Software distribution media: Distribution of program code via the Internet or a local area network.
[0186] Except for the technical features described in the specification, all other technical features are known to those skilled in the art. The present invention omits descriptions of well-known components and well-known technologies to avoid redundancy and unnecessary limitation of the present invention. The implementation methods described in the above embodiments do not represent all implementation methods consistent with the present application. Based on the technical solution of the present invention, various modifications or variations that can be made by those skilled in the art without creative effort are still within the scope of protection of the present invention.
Claims
1. A highly dynamic mobile ad hoc network adaptive MAC protocol switching method, characterized in that: include: Step 1: All nodes in the network perform initialization operations at startup and establish a neighbor node information table, which stores the information of neighbor nodes, including location, speed and movement direction; Step 2: Each node regularly broadcasts information interaction packets to obtain real-time information of neighboring nodes; Step 3: If a node initiates a MAC protocol switch voting request, the node is used as the starting node, and the other nodes in the network are used as replica nodes. One node is elected from the replica nodes as the master node, and the remaining replica nodes are used as backup nodes. MAC stands for Media Access Control; The master node election method is as follows: each node determines whether it is closest to the centroid of the network. If so, the node is selected as the master node. If the number of nodes closest to the centroid is greater than one, the node with the largest number of neighboring nodes is selected as the master node. Step 4: Each node periodically senses the current network status and executes a pre-selection mechanism to determine whether the current MAC protocol is suitable for the current network environment. If a node determines that the current MAC protocol is no longer suitable, it selects the currently optimal MAC protocol from the MAC protocol library, and then the node proceeds to step 5; The pre-selection mechanism is as follows: the node quantitatively calculates the comprehensive score of the current MAC protocol based on the network performance indicators currently sensed and obtained. If the comprehensive score is lower than a preset threshold, it is determined that the protocol is not suitable for the current network environment; The obtained network performance indicators include network throughput T, delay D, packet loss rate P and channel utilization C. The comprehensive score is obtained by weighted summation of the scores of each indicator currently obtained by the node; Step 5: If a node determines that the current MAC protocol is no longer applicable and the switch timer expires, the node becomes the starting node, initiates a MAC protocol switch voting request, and reaches a consensus decision with the replica nodes in the network; The consensus decision means that the nodes in the network calculate the comprehensive score of the current MAC protocol based on the currently perceived network status and vote to decide whether to switch the MAC protocol. If the vote is passed, all nodes will synchronously start to use the new MAC protocol. If the vote is not passed, the nodes will continue to use the current MAC protocol and proceed to step 4.
2. The method according to claim 1, characterized in that In the method described, the backup node periodically detects the existence of the master node. When the master node fails and the backup node receives a message timeout notification, it sends a message of the master node failure to all backup nodes in the network, starting the process of re-electing the master node.
3. The method according to claim 1, characterized in that In step 3, the master node election process includes: Step 31: Each node obtains its own spatial position through the global navigation satellite system and calculates the network centroid of the current mobile ad hoc network movement area. The centroid position p c is the average of all node positions in the network; Step 32: Each node calculates the Euclidean distance between its current location and the network centroid and broadcasts it to the network; Step 33: Each node receives the distances to the network centroid broadcast by other nodes and stores them locally. It compares its own distance to the network centroid with the distances to other nodes to determine whether it is the node closest to the network centroid. If a node finds that its distance to the network centroid is the smallest, it is determined to be the master node. If more than one node has the same minimum distance to the network centroid, the node with the largest number of neighboring nodes is selected as the master node. Step 34: The node elected as the master node sends a broadcast message, which includes the node ID, the distance to the network centroid and the declaration of being selected as the master node; after receiving the broadcast message, other nodes confirm the identity of the master node; when all nodes confirm the identity of the master node, all nodes execute the master node's instructions to enter the subsequent MAC protocol switching process.
4. The method according to claim 1, wherein In step 4, the node performs a pre-selection mechanism to determine whether the current MAC protocol is suitable for the current network environment in the following manner: Based on the network status detected in the current cycle, the node collects and obtains its own network performance indicators, including network throughput T, delay D, packet loss rate P, and channel utilization C; Then, the node calculates its throughput score T score , delay score D score , packet loss rate score P score And the channel utilization score C score as follows: Throughput score Where T high and T low These are the high throughput threshold and low throughput threshold set respectively; Latency Score Among them D high and D low These are the high latency threshold and low latency threshold set respectively; Packet loss rate score Among them, P high and P low These are the high packet loss rate threshold and low packet loss rate threshold set respectively; Channel Utilization Score Among them C high and C low These are the high utilization threshold and low utilization threshold set respectively; The node calculates the comprehensive score S = ω of the current MAC protocol T ×T score +ω D ×D score +ω P ×P score +ω C ×C score ; where the weight ω T 、ω D 、ω P and ω C The sum of is 1; If the comprehensive score currently calculated by the node is less than the preset threshold, it is determined that the current MAC protocol is no longer suitable for the current network environment; otherwise, it is determined that the current MAC protocol is suitable for the current network environment.
5. The method according to claim 1, wherein The switching timer is a pre-set timer for preventing the MAC protocol from switching frequently. Each time the MAC protocol is switched, the timer starts to count again.
6. The method according to claim 1, characterized in that In step 5, let node n0 be the starting node, execute the master node election in step 3, and elect node n1 as the master node. The consensus decision-making includes the following stages: (1) Request phase: Node n0 initiates a MAC protocol switching request and sends a voting request packet to node n1. The voting request packet contains the MAC protocol switching request information and the pre-set switching time. (2) Proposal phase: When node n1 receives the voting request packet from node n0, node n1 confirms that the request is valid and starts broadcasting the voting request packet; (3) Preparation phase: After receiving the voting request packet, each replica node calculates the comprehensive score of the current MAC protocol based on the currently perceived network status, decides whether to agree to the protocol switch, declares its agreement or disagreement to the protocol switch in the voting preparation packet, and broadcasts it; (4) Commitment phase: If a replica node receives 2f voting preparation packets agreeing to the protocol switch, the node enters the commit phase and broadcasts the voting submission packet to other replica nodes. The voting submission packet contains the node's voting results agreeing to the protocol switch; where f is the maximum number of faulty nodes that can be tolerated, set f = (N-2) / 3, and N is the number of communication nodes in the network; (5) Reply phase: If a replica node receives at least 2f+1 voting submission packets, the node considers the vote to be passed and sends a voting reply packet to all other nodes to confirm that a consensus has been reached.
7. The method according to claim 1, characterized in that In step 5, the fields in the data packets exchanged between nodes during the consensus decision-making phase include: data packet type, which is divided into four types: voting request packet, voting preparation packet, voting submission packet, and voting reply packet; the timestamp of the data packet transmission; the starting node; the MAC protocol type of the starting node requesting the switch; Whether to agree to the protocol switch; source node address; Destination node address; node topology information; node link status; node location coordinates; node movement speed.
8. A highly dynamic mobile ad hoc network adaptive MAC protocol switching device, deployed on all mobile communication nodes in the network, set between the upper application module and the bottom communication module, characterized in that: The device includes a topology perception module, a pre-selection module and a consensus decision module; The nodes periodically perceive the network topology through the topology perception module, including the connection relationship between nodes and the node's neighbor node information; perceive the network status and obtain network performance indicators including network throughput, delay, packet loss rate and channel utilization; Each node periodically senses the current network status and determines whether the current MAC protocol is suitable for the current network environment through the pre-selection module. If it is determined that the current MAC protocol is no longer suitable, the optimal MAC protocol is selected from the MAC protocol library. The pre-selection module quantitatively calculates the comprehensive score of the current MAC protocol based on the network performance indicators currently perceived by the node. If the comprehensive score is lower than a preset threshold, it is determined that the protocol is not suitable for the current network environment; The comprehensive score is obtained by weighted summation of the scores of each indicator currently obtained by the node; If a node determines that the current MAC protocol is no longer applicable and the switching timer expires, the node becomes the starting node and initiates a MAC protocol switching voting request. The consensus decision module is used to make a consensus decision with the replica nodes in the network. The nodes in the network elect a master node through the consensus decision module, and the nodes other than the starting node in the network are used as replica nodes. A node is elected from the replica nodes as the master node. The master node is elected in the following way: each node determines whether it is closest to the centroid of the network. If so, the node is selected as the master node. If the number of nodes closest to the centroid is greater than one, the node with the largest number of neighbor nodes is selected as the master node. The starting node sends the MAC protocol switching voting request to the master node, which broadcasts it. Each replica node calculates the comprehensive score of the current MAC protocol based on the currently perceived network status and votes to decide whether to switch the MAC protocol. If the vote passes, all nodes synchronously start using the new MAC protocol. If the vote fails, the nodes continue to use the current MAC protocol.
9. A highly dynamic mobile ad hoc network adaptive MAC protocol switching device, deployed on each communication node, the device comprising a memory, a processor, and a computer program stored in the memory; when the computer program is executed by the processor, the adaptive MAC protocol switching method according to any one of claims 1 to 7 is implemented.
10. A readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the adaptive MAC protocol switching method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
MAC protocol switching method based on deep reinforcement learning in self-organizing network
CN115767785A
Media access control (MAC) protocol switching method and system for tactical unmanned aerial vehicle network
CN117938979A
Cited By
Network switching method and device, electronic equipment, storage medium and program
CN120658569A
Communication protocol switching method and device, storage medium and electronic equipment
CN121309692A