CN107070695B - Bus type network load self-adaptive communication method - Google Patents
Bus type network load self-adaptive communication method Download PDFInfo
- Publication number
- CN107070695B CN107070695B CN201710037511.4A CN201710037511A CN107070695B CN 107070695 B CN107070695 B CN 107070695B CN 201710037511 A CN201710037511 A CN 201710037511A CN 107070695 B CN107070695 B CN 107070695B
- Authority
- CN
- China
- Prior art keywords
- token
- mode
- node
- network
- load
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 56
- 238000004891 communication Methods 0.000 title claims abstract description 30
- 101100172132 Mus musculus Eif3a gene Proteins 0.000 claims abstract description 62
- 238000001514 detection method Methods 0.000 claims description 11
- 230000003044 adaptive effect Effects 0.000 claims description 10
- 230000009191 jumping Effects 0.000 claims description 6
- 238000004806 packaging method and process Methods 0.000 claims description 4
- 238000005516 engineering process Methods 0.000 abstract 1
- 230000005540 biological transmission Effects 0.000 description 12
- 230000001186 cumulative effect Effects 0.000 description 6
- 230000007547 defect Effects 0.000 description 5
- 230000032683 aging Effects 0.000 description 4
- 230000002860 competitive effect Effects 0.000 description 4
- 230000000903 blocking effect Effects 0.000 description 3
- 230000003247 decreasing effect Effects 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 239000002243 precursor Substances 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 238000013459 approach Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L12/40006—Architecture of a communication node
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0896—Bandwidth or capacity management, i.e. automatically increasing or decreasing capacities
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/12—Discovery or management of network topologies
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/12—Avoiding congestion; Recovering from congestion
- H04L47/125—Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W74/00—Wireless channel access
- H04W74/08—Non-scheduled access, e.g. ALOHA
- H04W74/0808—Non-scheduled access, e.g. ALOHA using carrier sensing, e.g. carrier sense multiple access [CSMA]
- H04W74/0825—Non-scheduled access, e.g. ALOHA using carrier sensing, e.g. carrier sense multiple access [CSMA] with collision detection
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Environmental & Geological Engineering (AREA)
- Small-Scale Networks (AREA)
Abstract
The invention provides a bus type network load self-adaptive communication method, which realizes load self-adaptive scheduling. The method realizes mode switching and bus polling through a mode identification bit A and a token identification bit B in an MAC frame generated by a network node, and a corresponding counter and a relevant register. The method can enable the network terminal to be in a CSMA/CD mode under high network load and in a 'virtual token' mode under low load, so that the network can keep high throughput under high network load and keep high utilization rate under low network load. The mode information and the token information in the method are hidden in the identification bit, and a special information frame does not need to be transmitted in the bus. The system adopting the method can not generate deadlock after the key MAC frame is lost, and simultaneously solves the problems of high conflict rate of the current single bus type scheduling algorithm under high load and low utilization rate under low load. The data scheduling method under the 'virtual token' mode solves the problem of network errors caused by loss of token frames in the existing token ring technology.
Description
Technical Field
The invention relates to the field of data communication, in particular to a bus type network load self-adaptive communication method.
Background
The bus is one of the earliest network topologies employed in data communications. In the bus structure, a plurality of network nodes are connected with the same bus, data transmission is carried out in a time division multiplexing mode, data sent to the bus can be received by all the network nodes on the bus, and the network nodes judge whether to receive the data or not according to destination addresses in MAC frames after receiving the data. The bus structure is widely applied to communication of chip-level and printed circuit board-level systems, is also commonly applied to industrial field bus and local area network structures, and has the characteristics of simple structure and good stability.
The data scheduling of the bus structure usually adopts CDMA/CD, token bus and other modes. The CSMA/CD mode adopts carrier sense and collision detection modes, realizes multiple access of a bus structure, and has the characteristics of low time delay and high throughput rate under low load, but the network performance is sharply reduced under high load. The token bus mode adopts special MAC frames called tokens to be sequentially transmitted on a bus, and a network node obtaining the tokens can send data only, so that the token bus mode has the characteristic of maximum time delay convergence of a network, has better network performances such as time delay, throughput rate and the like under high load, but has lower network utilization rate under the condition of low load because the token transmission needs to occupy bandwidth.
The invention combines two common bus data scheduling modes aiming at the respective defects of two common bus data communication methods, and simultaneously solves the problems that the CSMA/CD bus has poor network performance under high load and the token bus has low network utilization rate under low load. The network load adaptive communication method designed in the invention can adaptively adopt different data scheduling methods under different load conditions, realizes data transmission with lower time delay and higher throughput rate, has good stability, and can provide technical reference for data scheduling adopting bus type network node equipment.
Disclosure of Invention
In order to solve the defects in the prior art, the invention aims to provide a bus type network load self-adaptive communication method, which comprises two communication modes of a CSMA/CD mode and a virtual token mode, and is characterized in that: the communication method comprises the following specific steps:
the first step, initialization: setting a mode flag bit A and a token flag bit B and initial values of the mode flag bit A and the token flag bit B in an MAC frame header, controlling the bus type network to work according to a CSMA/CD mode, and jumping to the second step;
secondly, judging the load condition of the bus type network: when each node in the bus type network communicates according to a CSMA/CD mode, each node respectively counts the times of conflict when the node sends an MAC frame, and if the times of conflict reach t times, the third step is skipped; otherwise, keeping the bus type network to continue working according to the method in the second step;
step three, entering a virtual token mode: controlling the mode flag bit A to jump to a state opposite to an initial value, controlling each node in the bus type network to communicate according to a virtual token mode, and resetting a first load counter a and a second load counter b of the node when each node obtains a virtual token, wherein data in the load counters jump according to the network load condition, and if the data in the load counters meet a low load condition, jumping to the first step; otherwise, keeping the bus type network to continue working according to the method in the third step.
The initial values of the mode flag bit A and the token flag bit B are both 0. The control mode flag bit A jumping to the state opposite to the initial value means that the control mode flag bit A jumps to 1. The mode flag bit in CSMA/CD mode is 0, and the mode flag bit in virtual token mode is 1
In the CSMA/CD mode, the bus type network has the working mode that: setting a mode identification bit A and a token identification bit B in an MAC frame sent by a network node to be 0, carrying out carrier sense on a bus by the network node, waiting for the end of data transmission on the bus and waiting for IFG (Interframe gap) between minimum frames if data is transmitted on the busmSending data to the idle bus after time, if no data is transmitted on the bus, waiting for the minimum inter-frame gap IFGmSending data to be transmitted to an idle bus after time; when a certain network node sends data, whether the data conflict occurs in the sent data is detected, if the data conflict occurs, the blocking information is sent, the data sending is stopped after a conflict signal is strengthened, and then the back-off time T is determined according to a truncated binary exponential back-off algorithmdWaiting time TdAnd then, carrying out carrier sense operation on the bus again.
In the third step, in the virtual token mode, the working mode of the bus type network is as follows: if data to be sent exists in the cache, a token identification bit B in an MAC frame formed by packaging the data to be sent is identified as a data to be sent state and the data is sent by the network node which obtains the token; if no data is to be sent, 1 MAC frame marked by the token identification bit B as a no-data-to-be-sent state is sent, and the network node which does not obtain the token does not send data; each network node simultaneously carries out carrier sense and conflict detection, and executes a truncated binary exponential backoff algorithm when judging that data conflict occurs;
there are two ways for the node to obtain the token: when a node enters a virtual token mode from a CSMA/CD mode, the node obtains a token; when a node receives an MAC frame which is sent by a predecessor node and has a mode identification bit A with an initial value and an opposite state and a token identification bit B with a non-data-to-be-sent state, the node acquires a token.
Specifically, in the virtual token mode, the bus type network operates as follows: the mode identification bits A in the MAC frame sent by the network node are all set to be 1, the network node which obtains the token, if data are to be sent in the cache, the token identification bits B in the MAC frame formed by packaging the data to be sent are set to be 1, and the data are sent, if no data are to be sent, the MAC frame with 1 token identification bit B set to be 0 is sent, and the network node which does not obtain the token does not send the data; the network node executes carrier sense and conflict detection actions, and if data conflict occurs, a truncated binary exponential backoff algorithm is executed; timing time T of tokentokenFor R bit time, the value of the first load counter a of the node is reset to the token timing time T each time the network node obtains the tokentokenThe value of the second load counter b is increased by 1 (in the first step, the values of the first load counter a and the second load counter b are initialized to 0), and the value of the first load counter a is continuously decreased to 0 and stops when the network node is in the "virtual token" mode.
Further, to save the length of the MAC frame, in the first step, the specific steps of setting the mode flag a and the token flag B in the MAC frame header are as follows:
if more than 2 reserved bits exist in the MAC frame header, setting the 2 reserved bits as a mode flag bit A and a token flag bit B respectively; if 1 reserved bit exists in the MAC frame header, setting the reserved bit as one of a mode flag bit A or a token flag bit B, and correspondingly adding a one-bit token flag bit B or a mode flag bit A to the MAC frame header; otherwise, adding a mode flag bit A and a token flag bit B in the MAC frame header.
Further, the present invention provides two parallel methods for determining whether the bus type network needs to communicate through the CSMA/CD mode.
One of them is: in the third step, each node resets the first load counter a of the node as the token timing time T each time obtaining the virtual tokentoken(ii) a The data in the first load counter a jumps according to the network load condition in such a way that the data in the first load counter a is clocked by the node clock and timed by the token for a time TtokenStarting to decrement by 1 every clock cycle; the low load condition is that the first load counter a is not decremented to 0. Namely, each node resets the value of the first load counter a of the node as the token timing time T each time obtaining the virtual tokentokenAnd the first load counter a is controlled by the clock of the node to time T from the token timing after each resettokenAnd starting to decrement by 1 every time one clock cycle is passed, judging that a low load condition is met when the first load counter a is decremented to 0, and jumping to the first step. Token timing time T as described hereintokenIs an R bit time. The value of R is related to the number of network terminals in the bus network and the size of the data transmission buffer in the network terminal, and generally, the value range of R is 1/10 to 1/2 of the product of the number of network terminals in the bus network and the size of the data transmission buffer in the network terminal.
The other is as follows: in the third step, each node resets the second load counter b of the node to add 1 to the current value of the second load counter b when obtaining the virtual token each time; the data in the second load counter b jumps according to the network load condition in such a way that the data in the second load counter b counts according to the number of times of virtual tokens obtained by the node; the low load condition is that the second load counter b is incremented to a critical value m, and generally, according to the network burst traffic, the value range of m is 1 to 10. That is, each node adds 1 to the value in the second load counter b of the node (that is, records the number of times that the node obtains the virtual token) each time the node obtains the virtual token, and when the second load counter b is incremented to m, it is determined that the low load condition is satisfied, and the process jumps to the first step.
Further, the two methods may be combined to comprehensively determine whether the bus type network needs to communicate through the CSMA/CD mode. The specific judgment method comprises the following steps:
in the third step, each node resets the first load counter a of the node as the token timing time T each time obtaining the virtual tokentokenSimultaneously resetting a second load counter b of the node to be the current value of the load counter plus 1; the data in the first load counter a jumps according to the network load condition in such a way that the data in the first load counter a is clocked by the node clock and timed by the token for a time TtokenStarting to decrement by 1 in each clock period, wherein the data in the second load counter b jumps according to the network load condition in such a way that the data in the second load counter b counts according to the number of times of virtual tokens acquired by the node; the low load condition is that the first load counter a is not decremented to 0 or the second load counter b is incremented to a critical value m.
Further, in order to prevent the deadlock of the bus type network, in the third step, if the data in the load counter does not satisfy the low load condition, the following steps are performed while the bus type network continues to operate according to the method in the third step:
each node firstly judges whether the node is in deadlock judgment threshold TbReceiving effective MAC frame head in time, if not in deadlock judging threshold TbIf no effective MAC frame header is received within the time and no data conflict is detected, judging that the bus type network is deadlocked, and skipping to the first step; otherwise, judging that the bus type network is not deadlocked, and keeping the bus type network to continue working according to the method in the third step.
Further, in order to ensure that the working mode of each node in the bus type network is uniform, in the first step of the present invention, the method for controlling the bus type network to work according to the CSMA/CD mode is as follows: when one node in the bus type network sets the mode flag bit A of the MAC frame header as an initial value, all the nodes receiving the MAC frame header switch the working mode of the nodes into a CSMA/CD mode.
Also, in the third step, the method of controlling each node in the bus type network to communicate in the virtual token mode is as follows: when one node in the bus type network sets the mode flag bit A of the MAC frame header to be opposite to the initial value, all the nodes receiving the MAC frame header switch the working mode of the nodes into a virtual token mode.
In order to solve the defects of the prior art, the invention also provides a bus type network using the communication method, wherein the bus type network comprises more than two nodes, and the nodes are interconnected through a bus, and the bus type network is characterized in that each node is internally provided with a conflict number counter, a load counter and a deadlock judgment device;
the collision number counter is used for counting the number of the collisions when the collision occurs when the MAC frame header sent by the node;
the load counter jumps according to the network load condition and is used for judging whether the bus type network needs to communicate in a CSMA/CD mode; the load counters include a first load counter a and a second load counter b.
The deadlock decision apparatus comprises a timer, a conflict detection module and a judgment module, wherein the timer is set to a deadlock decision threshold Tb at a timing time, the output end of the timer and the output end of the conflict detection module are connected to the input end of the judgment module, and the judgment module judges that deadlock occurs when an effective MAC frame header is not received within the time of the deadlock decision threshold Tb and data conflict is not detected.
Advantageous effects
1. The idea of the bus type network data scheduling algorithm is based on time division multiplexing, and can be specifically divided into a contention bus mode and a polling bus mode, wherein the representative algorithms are respectively CSMA/CD and a token ring (token bus), but the contention bus mode has a rapid increase of network contention probability under high load, which can cause a rapid decrease of network throughput, and the polling bus mode still needs to poll network nodes on the bus through special information frames under low load, which causes a decrease of network utilization rate. The invention adopts a network load self-adaptive communication method, particularly sets a mode flag bit A and a load counter to enable a network node to work in a competitive bus mode (CSMA/CD mode) under low load and work in a polling bus mode (virtual token mode) under high load, and simultaneously avoids the defects of two scheduling algorithms of the competitive bus mode and the polling bus mode, so that the bus type network can keep high efficiency under low load and can maintain higher throughput under high load.
2. In the network load self-adaptive communication method, based on a designed algorithm, a mode identification bit A and a token identification bit B in an MAC frame generated by a network node and corresponding counters and registers (a load counter and token timing time T) are also utilizedtokenEtc.), the functions of mode switching and bus polling are realized, the mode information and the token information are hidden in the identification bits, and a special information frame does not need to be transmitted in the bus. Moreover, the method sets a deadlock judgment threshold TbAfter a key MAC frame (an MAC frame with a flag bit B of 0 when the virtual token is transmitted) in a 'virtual token' mode is lost, the network terminal automatically switches to a CSMA/CD mode when the bus has no MAC frame transmission through the judgment and detection of Tb bit time, and the system is ensured not to be deadlocked; compared with the existing token bus algorithm which needs a special token frame, the design avoids the problem of network deadlock caused by the loss of the token frame and enhances the reliability in the data scheduling process.
3. In the network load self-adaptive communication method, each network terminal can estimate the current network load condition without prior information of the current total load of the whole network, and further switches between a CSMA/CD mode and a virtual token mode: for a network terminal in a CSMA/CD mode, when the accumulated collision times of a certain MAC frame to be sent is not less than t times, namely the network is in a heavy load condition, the network terminal needs to switch into a virtual token mode to maintain the high throughput of the network, and at the moment, the network terminal switches into the virtual token mode; for a network terminal in a 'virtual token' mode, when the network terminal obtains a token, the value of a first load counter a is already decreased to 0, namely the network is still in a heavy load condition, the 'virtual token' mode needs to be kept to continuously maintain high throughput, at the moment, the network terminal keeps the 'virtual token' mode, when the network terminal obtains the token, the value of the first load counter a is not decreased to 0, namely the network is already in a light load condition, the network terminal needs to be switched to enter a CSMA/CD mode to improve the utilization efficiency of the network, and at the moment, the network terminal is switched to enter the CSMA/CD mode. For a bus-type network with a known network load having a burst characteristic, it can be considered that the second load counter b is incremented to the threshold value m, and the burst network load is processed, so that the token counter b can be used to switch from the "virtual token" mode to the CSMA/CD mode.
4. Meanwhile, the initial working state of the bus type network is set to be the CSMA/CD mode by default, and the dynamic addition of the network terminal is facilitated due to the fact that the token transmission sequence does not need to be considered in the mode. This approach also reduces the complexity of adding network nodes to a bus-type network. In the method, the network can select to add nodes in a CSMA/CD mode and then switch to a virtual token mode when needed. The algorithm is simpler and is easier to realize.
5. The invention has wide application range, all data communication networks with bus type structures can adopt the algorithm designed in the invention, especially the bus type network with network flow burst characteristic, the data center network which develops rapidly in the recent period has the flow characteristic, the algorithm has less requirement on hardware resources, the algorithm can be realized only by adding A, B two identification bits in the MAC frame and realizing corresponding digital logic, and no additional network equipment is needed.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Drawings
The accompanying drawings are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings:
fig. 1 is a network structure diagram to which the network load adaptive communication method of the present invention is applied;
FIG. 2 is a flow chart of a CSMA/CD mode scheduling method according to the present invention;
FIG. 3 is a flowchart of a "virtual token" mode scheduling method of the present invention;
FIG. 4 is a flowchart of a CSMA/CD mode and a "virtual token" mode switching method according to the present invention;
FIG. 5 is a second flowchart of the CSMA/CD mode and "virtual token" mode switching method of the present invention;
FIG. 6 is an example of an application scheme of a bus type network load adaptive communication method;
fig. 7 is a flowchart of a method for combining two modes.
Detailed Description
The preferred embodiments of the present invention will be described in conjunction with the accompanying drawings, and it will be understood that they are described herein for the purpose of illustration and explanation and not limitation.
Fig. 1 is a network structure diagram to which the network load adaptive communication method of the present invention is applied.
FIG. 2 is a flow chart of CSMA/CD mode scheduling algorithm of the present invention, and the following description of the scheduling algorithm in CSMA/CD mode is provided in conjunction with FIG. 2.
When the network node is in the CSMA/CD mode, the mode identification bit A and the token identification bit B in the MAC frame sent by the network node are both set to be 0, the network node carries out carrier sense on the bus, if data are transmitted on the bus, the network node waits for the end of the data transmission on the bus and waits for the IFG (Interframe gap) between minimum framesmSending data to the idle bus after time, if no data is transmitted on the bus, waiting for the minimum inter-frame gap IFGmSending data to be transmitted to an idle bus after time; when a certain network node sends data, it detects whether the data conflict occurs in the sending data, if so, it sends blocking information,stopping transmitting data after intensifying conflict signals, and then determining the back-off time T according to the truncated binary exponential back-off algorithmdWaiting time TdAnd then, carrying out carrier sense operation on the bus again.
Back-off time T in truncated binary exponential back-off algorithmdThe calculation method comprises the following steps: n is taken to be equal to 0 to 2k-1K is a positive integer, when k is not more than 10, k is the cumulative number of times of collision when a certain network node sends a certain MAC frame, and when the cumulative number of times of collision is more than 10, k is equal to 10; back-off time TdIs equal to B0Bit time multiplied by n, B0The value is generally the shortest MAC frame length.
Fig. 3 is a flowchart of the scheduling algorithm in the "virtual token" mode in the present invention, and the following describes the scheduling algorithm in the "virtual token" mode with reference to fig. 3.
When the network node is in the virtual token mode, the mode identification positions A in the MAC frame sent by the network node are all set to be 1, the network node of the token is obtained, if data to be sent exist in the cache, the token identification position B in the MAC frame formed by packaging the data to be sent is set to be 1, the data is sent, if no data to be sent exists, the MAC frame of 1 token identification position B set to be 0 is sent, and the network node which does not obtain the token does not send the data; the network node executes carrier sense and conflict detection actions, and if data conflict occurs, a truncation binary exponential backoff algorithm is executed to set k constant equal to 1; timing time T of tokentokenFor R bit time (the value of R is related to the number of network terminals in the bus network and the size of the data transmission buffer in the network terminal, generally, the value range of R is 1/10 to 1/2 of the product of the number of network terminals in the bus network and the size of the data transmission buffer in the network terminal), each time a token is obtained by a network node, the first load counter a of the node is reset to the token timing time TtokenThe value of the second load counter b is incremented by 1. The first load counter a and the second load counter b are initialized to 0 in the first step, and the first load counter a is continuously decremented to 0 and stops when the network node is in a 'virtual token' mode.
There are two ways for the network node to obtain the token: when the network node enters a virtual token mode from a CSMA/CD mode, the network node obtains a token; when a network node receives the MAC frame with the mode identification position a set to 1 and the token identification position B set to 0 sent by its predecessor network node, the network node obtains a token.
The determination mode of the precursor network node of a certain network node is as follows: after the network node receives the MAC frames of other network nodes in the CSMA/CD mode and the virtual token mode, the source address of the MAC frame is recorded into an address table and the aging time T is setage,TageDeleting the address after the time, and if the address exists in the address table, resetting the aging time to be Tage(ii) a And if all the difference values are negative numbers, the network node corresponding to the maximum MAC address in the address table is the precursor network node of the node.
Fig. 4 and 5 are flowcharts of CSMA/CD mode and "virtual token" mode switching algorithms according to the present invention, and the flowcharts of CSMA/CD mode and "virtual token" mode switching algorithms are described with reference to fig. 4 and 5.
In the MAC frame sent by the network node, the mode identification position A of 0 indicates that the network node is in CSMA/CD mode, and the mode identification position A of 1 indicates that the node is in 'virtual token' mode. The initialization value of the mode identification bit A of the network node is 0; when the number of times of collision occurring when a certain network node in the CSMA/CD mode transmits a certain MAC frame is not less than t times, the MAC frame mode identification position A1 transmitted by the network node enters a 'virtual token' mode, and after the MAC frame is successfully transmitted, all network nodes receiving the MAC frame of the mode identification position A1 identify the position A1 and identify the position B0 and enter the 'virtual token' mode. There are two ways to switch a network in "virtual token" mode to CSMA/CD mode: firstly, when the count of the second load counter B of the network node obtaining the token reaches a critical value m, wherein m is a positive integer, the MAC frame mode identification position A sent by the network node is set to be 0, the token identification position B is set to be 0, the network node enters a CSMA/CD mode, and all networks receiving the MAC frame of the mode identification position A set to be 0The node sets the mode identification position A to 0 and enters a CSMA/CD mode; secondly, when the value of the first load counter a of the network node obtaining the token is equal to 0, the network node enters a CSMA/CD mode by sending a MAC frame mode identification position A of 0 and a token identification position B of 0, and all network nodes receiving the MAC frame of the mode identification position A of 0 enter the CSMA/CD mode by setting the mode identification position A of 0. Network node in 'virtual token' mode determines threshold T in deadlockbAnd if no effective MAC frame is received within the bit time and no data collision is detected, the MAC frame mode identification position A sent by the network node is set to be 0 and the token identification position B is set to be 0, and the network node enters a CSMA/CD mode.
Case description:
fig. 6 is an example of an application scheme of a bus-type network load adaptive communication method, in which 16 desktop computers are connected to form a bus-type lan through a hub, and each desktop computer can generate and recognize MAC frames having a mode flag a and a token flag B, so that the desktop computers switch between a CSMA/CD mode and a "virtual token" mode to implement a network load scheduling function; the MAC frame with the mode identification bit a and the token identification bit B may be generated in the following two ways, or in combination: adding a mode identification bit A and a token identification bit B in the MAC frame header, wherein the mode can increase the length of the MAC frame; and respectively defining the 2-bit reserved bits in the MAC frame header as a mode identification bit A and a token identification bit B by using the reserved bits (if any) in the MAC frame header, wherein the length of the MAC frame is not increased by the mode.
The scheduling algorithm in the CSMA/CD mode is as shown in fig. 2, a mode identification bit a and a token identification bit B in an MAC frame sent by a desktop computer are both set to 0, the desktop computer performs carrier sensing on a bus, waits for the end of data transmission on the bus if data is being transmitted on the bus, sends data to an idle bus after waiting for a minimum inter-frame interval of 96 bits, and sends data to be transmitted to the idle bus after waiting for a minimum inter-frame interval of 96 bits if no data is being transmitted on the bus; when a desktop computer sends data, whether the data conflict occurs in the sent data is detected, if the data conflict occurs, blocking information is sent, the data sending is stopped after a conflict signal is strengthened, and then the data is retreated according to a truncated binary indexAvoidance algorithm determines a back-off time TdWaiting time TdAnd then, carrying out carrier sense operation on the bus again.
Back-off time T in truncated binary exponential back-off algorithmdThe calculation method comprises the following steps: n is taken to be equal to 0 to 2k-1K is a positive integer, when k is not more than 10, k is the cumulative number of times of collision when a certain desktop computer sends a certain MAC frame, and when the cumulative number of times of collision is more than 10, k is equal to 10; back-off time TdEqual to 512 bits time multiplied by n.
The scheduling algorithm in the 'virtual token' mode is shown in fig. 3, mode identification positions a in MAC frames sent by a desktop computer are all set to 1, the desktop computer obtaining tokens sends data, if data is to be sent in a cache, a token identification position B in the MAC frame formed by encapsulating the data to be sent is set to 1, and sends data, if no data is to be sent, the MAC frames with 1 token identification position B set to 0 are sent, and the desktop computer not obtaining tokens does not send data; the desktop computer executes carrier sensing and conflict detection actions, and if data conflict occurs, a truncation binary exponential backoff algorithm is executed to set k constant equal to 1; when the desktop computer obtains the token, the second load counter b of the node is added with 1, and the value of the first load counter a is reset to 1010The bit time, the values of the first load counter a and the second load counter b are initialized to 0, and the first load counter a is continuously decremented to 0 and stops when the desktop computer is in a virtual token mode.
There are two ways for the desktop to obtain the token: when the cumulative number of times of collision when the desktop computer sends a certain MAC frame is not less than 3 times; when a desktop computer receives the MAC frame which is sent by a predecessor desktop computer and has the mode identification position A with 1 and the token identification position B with 0, the desktop computer obtains a token.
The determination method of the front-driving desktop computer of a certain desktop computer is as follows: after the desktop computer receives the MAC frame of other desktop computers in the CSMA/CD mode and the virtual token mode, the source address of the MAC frame is recorded into an address table and the aging time T is setageEqual to 10 minutes, TageDeleting the address after the time, and if the address exists in the address table, resetting the aging time to be TageIs 10 minutesA clock; and (3) making the difference between the MAC address of the local computer and all the MAC addresses in the address table, wherein the obtained difference is positive and the desktop computer corresponding to the MAC address in the address table with the minimum difference is the predecessor desktop computer of the node, and if all the differences are negative numbers, the desktop computer corresponding to the maximum MAC address in the address table is the predecessor desktop computer of the node.
The CSMA/CD mode and the "virtual token" mode switching algorithm are shown in FIGS. 4 to 7, and the initialization value of the mode flag A of the desktop computer is 0. When the cumulative number of times of collision when a certain desktop computer in a CSMA/CD mode sends a certain MAC frame is not less than t times, the mode identification position A of the MAC frame sent by the desktop computer is 1, and the desktop computer enters a virtual token mode, after the MAC frame is successfully sent, all the desktop computers receiving the MAC frame of the mode identification position A at 1 identify the mode identification position A at 1, identify the token identification position B at 0, and enter the virtual token mode. There are two ways to switch each network terminal in "virtual token" mode to CSMA/CD mode: firstly, when a second load counter B of the desktop computer obtaining the token is equal to m, wherein m is a positive integer, the MAC frame mode identification position A sent by the desktop computer is 0, the token identification position B is 0, the desktop computer enters a CSMA/CD mode, and all the desktop computers receiving the MAC frame of the mode identification position A, the MAC frame mode identification position B and the CSMA/CD mode enter the CSMA/CD mode; secondly, when the value of a first load counter a of the desktop computer obtaining the token is equal to 0, the desktop computer enters a CSMA/CD mode by sending an MAC frame mode identification position A of 0 and a token identification position B of 0, and all desktop computers receiving the MAC frame of the mode identification position A of 0 enter a CSMA/CD mode by identifying the mode identification position A of 0; deadlock decision threshold T of desktop computer in 'virtual token' modebAnd if no valid MAC frame is received within the bit time and no data collision is detected, the desktop computer enters a CSMA/CD mode after the MAC frame mode identification position A and the token identification position B which are sent by the desktop computer are respectively set to be 0 and 0.
Through the network load self-adaptive communication method, each network node connected through the bus works in a competitive bus mode (CSMA/CD mode) under low load and works in a polling bus mode (virtual token mode) under high load, the defects of two scheduling algorithms of the competitive bus mode and the polling bus mode are overcome, and the bus type network can keep high efficiency under low load and can maintain high throughput under high load.
Those of ordinary skill in the art will understand that: although the present invention has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that changes may be made in the embodiments and/or equivalents thereof without departing from the spirit and scope of the invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (7)
1. A bus type network load self-adaptive communication method comprises two communication modes of a CSMA/CD mode and a virtual token mode, and is characterized in that: the communication method comprises the following specific steps:
the first step, initialization: setting a mode flag bit A and a token flag bit B and initial values of the mode flag bit A and the token flag bit B in an MAC frame header, controlling the bus type network to work according to a CSMA/CD mode, and jumping to the second step;
secondly, judging the load condition of the bus type network: when each node in the bus type network communicates according to a CSMA/CD mode, each node respectively counts the times of conflict when the node sends an MAC frame, and if the times of conflict reach t times, the third step is skipped; otherwise, keeping the bus type network to continue working according to the method in the second step;
step three, entering a virtual token mode: controlling the mode flag bit A to jump to a state opposite to an initial value, controlling each node in the bus type network to communicate according to a virtual token mode, and resetting a first load counter a and a second load counter b of the node when each node obtains a virtual token, wherein data in the load counters jump according to the network load condition, and if the data in the load counters meet a low load condition, jumping to the first step; otherwise, keeping the bus type network to continue working according to the method in the third step;
in the third step, the first load counter a of each node is reset as the token timing time T each time each node obtains the virtual tokentokenSimultaneously resetting a second load counter b of the node to be the current value of the load counter plus 1; the data in the first load counter a jumps according to the network load condition in such a way that the data in the first load counter a is clocked by the node clock and timed by the token for a time TtokenStarting to decrement by 1 in each clock period, wherein the data in the second load counter b jumps according to the network load condition in such a way that the data in the second load counter b counts according to the number of times of virtual tokens acquired by the node; the low load condition is that the first load counter a is not decremented to 0 or the second load counter b is incremented to a critical value m.
2. The method as claimed in claim 1, wherein in the first step, the specific steps of setting the mode flag a and the token flag B in the MAC frame header are as follows:
if more than 2 reserved bits exist in the MAC frame header, setting the 2 reserved bits as a mode flag bit A and a token flag bit B respectively; if 1 reserved bit exists in the MAC frame header, setting the reserved bit as one of a mode flag bit A or a token flag bit B, and correspondingly adding a one-bit token flag bit B or a mode flag bit A to the MAC frame header; otherwise, adding a mode flag bit A and a token flag bit B in the MAC frame header.
3. A bus type network load adaptive communication method according to claim 1 or 2, wherein in the third step, in the virtual token mode, the bus type network operates in a manner of: if data to be sent exists in the cache, a token identification bit B in an MAC frame formed by packaging the data to be sent is identified as a data to be sent state and the data is sent by the network node which obtains the token; if no data is to be sent, 1 MAC frame marked by the token identification bit B as a no-data-to-be-sent state is sent, and the network node which does not obtain the token does not send data; each network node simultaneously carries out carrier sense and conflict detection, and executes a truncated binary exponential backoff algorithm when judging that data conflict occurs;
there are two ways for the node to obtain the token: when a node enters a virtual token mode from a CSMA/CD mode, the node obtains a token; when a node receives an MAC frame which is sent by a predecessor node and has a mode identification bit A with an initial value and an opposite state and a token identification bit B with a non-data-to-be-sent state, the node acquires a token.
4. The bus-type network load adaptive communication method of claim 1, wherein the token timing time T istokenIs an R bit time.
5. A method for load adaptive communication according to any one of claims 1 to 4, wherein in said third step, if the data in the load counter does not satisfy the low load condition, the following steps are performed while keeping the bus network operating according to the method of the third step:
each node firstly judges whether the node is in deadlock judgment threshold TbReceiving effective MAC frame in time, if not, judging threshold T in deadlockbIf no effective MAC frame is received within the time and no data conflict is detected, judging that the bus type network is deadlocked, and skipping to the first step; and if the bus type network is judged not to be deadlocked, keeping the bus type network to continue working according to the method in the third step.
6. The method for load adaptive communication of a bus type network according to claim 1, wherein in the first step, the method for controlling the bus type network to operate in CSMA/CD mode is as follows: when one node in the bus type network sets the mode flag bit A of the MAC frame header as an initial value, all the nodes receiving the MAC frame header switch the working mode of the nodes into a CSMA/CD mode;
in the third step, the method for controlling each node in the bus type network to communicate according to the virtual token mode is as follows: when one node in the bus type network sets the mode flag bit A of the MAC frame header to be opposite to the initial value, all the nodes receiving the MAC frame header switch the working mode of the nodes into a virtual token mode.
7. A bus type network using the load adaptive communication method of the bus type network according to claim 1, comprising more than two nodes, wherein the nodes are interconnected through a bus, and each node is provided with a collision number counter, a load counter and a deadlock determination device;
the collision number counter is used for counting the number of the collisions when the collision occurs when the MAC frame header sent by the node;
the load counter jumps according to the network load condition and is used for judging whether the bus type network needs to communicate in a CSMA/CD mode;
the deadlock judging device comprises a timing time setting unit for setting a timing time as a deadlock judging threshold TbThe system comprises a timer, a conflict detection module and a judgment module, wherein the output ends of the timer and the conflict detection module are connected to the input end of the judgment module, and the judgment module judges a threshold T at deadlockbAnd judging that deadlock occurs when a valid MAC frame header is not received within the time and data collision is not detected.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710037511.4A CN107070695B (en) | 2017-01-18 | 2017-01-18 | Bus type network load self-adaptive communication method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710037511.4A CN107070695B (en) | 2017-01-18 | 2017-01-18 | Bus type network load self-adaptive communication method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107070695A CN107070695A (en) | 2017-08-18 |
CN107070695B true CN107070695B (en) | 2020-03-31 |
Family
ID=59598319
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710037511.4A Active CN107070695B (en) | 2017-01-18 | 2017-01-18 | Bus type network load self-adaptive communication method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107070695B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108170132B (en) * | 2018-01-09 | 2022-04-01 | 电子科技大学成都学院 | Modular EPS bus processing method based on serial bus |
CN110412983B (en) * | 2019-08-01 | 2022-11-01 | 北京百度网讯科技有限公司 | Vehicle collision avoidance detection method and device and vehicle |
CN113691961B (en) * | 2021-10-27 | 2022-01-07 | 广州慧睿思通科技股份有限公司 | Mode switching method, terminal, system and storage medium of communication terminal |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101783758A (en) * | 2009-08-28 | 2010-07-21 | 中国科学院声学研究所 | Family coaxial network MAC layer data transmission method based on service differentiation |
EP2389040A1 (en) * | 2010-05-21 | 2011-11-23 | Alcatel Lucent | A method for monitoring and control of load in a communication network, and a base station therefor |
CN103823780A (en) * | 2014-03-03 | 2014-05-28 | 东南大学 | Real-time field bus controlling and dispatching method |
-
2017
- 2017-01-18 CN CN201710037511.4A patent/CN107070695B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101783758A (en) * | 2009-08-28 | 2010-07-21 | 中国科学院声学研究所 | Family coaxial network MAC layer data transmission method based on service differentiation |
EP2389040A1 (en) * | 2010-05-21 | 2011-11-23 | Alcatel Lucent | A method for monitoring and control of load in a communication network, and a base station therefor |
CN103823780A (en) * | 2014-03-03 | 2014-05-28 | 东南大学 | Real-time field bus controlling and dispatching method |
Non-Patent Citations (1)
Title |
---|
一种应用于控制网络的新的媒体访问控制协议——Token-CSMA/CD混合协议;刘怀,胡继峰;《测控技术》;20110630;第20卷(第6期);正文第1节 * |
Also Published As
Publication number | Publication date |
---|---|
CN107070695A (en) | 2017-08-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9998389B2 (en) | Method and apparatus for blocking transmission of frames from a network device | |
US7515608B2 (en) | Methods and media access controller for mesh networks with adaptive quality-of-service management | |
US6192422B1 (en) | Repeater with flow control device transmitting congestion indication data from output port buffer to associated network node upon port input buffer crossing threshold level | |
KR100320395B1 (en) | Flow control method for networks | |
JP7512456B2 (en) | Packet scheduling method, scheduler, network device, and network system | |
US5859837A (en) | Flow control method and apparatus for ethernet packet switched hub | |
US5631905A (en) | Communications network control method | |
EP2896170A1 (en) | Method and apparatus for transmitting packets in accordance with ieee 802.1 qbv | |
CN107070695B (en) | Bus type network load self-adaptive communication method | |
US20090213731A1 (en) | Use of neuropeptide y (npy) and agonists and antagonists thereof for tissue regeneration | |
US7130927B2 (en) | Method of bandwidth management between the stations of a local area network | |
CN113746751A (en) | Communication method and device | |
KR20230054792A (en) | EMI reduction in PLCA-based networks through temporal spreading of beacons | |
KR101023441B1 (en) | method for a multi-hop network using spatial reuse | |
US11916768B2 (en) | Information sharing method and apparatus in redundancy network, and computer storage medium | |
CN103580976A (en) | Method and device for avoiding carrier sensing conflicts | |
WO2022001867A1 (en) | Power line communication (plc) method and apparatus | |
Amodei et al. | Increasing the throughput of the HomePNA MAC protocol | |
US20080013565A1 (en) | Reverse Polling Algorithm For Shared Resources To Reduce Collisions In A Network | |
Arun et al. | QoS provisioning with adaptive backoff algorithm for IEEE 802.11 ac under multipacket reception | |
JP3993115B2 (en) | Wireless packet transmission method | |
US12010028B1 (en) | Method and apparatus for proactively forming flowlets for a flow in communication network | |
US10165598B2 (en) | Wireless medium clearing | |
DRIDI et al. | Coupling latency time to the throughput performance analysis on wireless CAN networks | |
US9450708B2 (en) | System and method for avoiding hidden node collisions in a communication network |
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 |