A kind of method that realizes immediate block reply mechanism of wireless local area network
Technical field
The present invention relates to a kind of acknowledgement frame building method in wireless communication field, relate in particular to a kind of method according to the bitmap in the immediate block acknowledgement frame of rearrangement buffer queue state structure IEEE 802.11n WLAN.
Background technology
Block reply mechanism is the mechanism that a kind of IEEE 802.11n WLAN is merged into a plurality of acknowledgement frames in order to improve link efficiency an acknowledgement frame.It is that a kind of selection retransmits automatic re-send request may (Automatic Repeat reQuest, ARQ) mechanism in essence that piece is replied.After the recipient found that some packet is made mistakes, though the correct data bag that its continued is sent here can not be submitted to recipient's high level immediately, the recipient still can receive to be kept at and receive in the buffering area, required the opposite end transmit leg error data bag that retransfers simultaneously.In case after receiving the packet that transmits again, can submit high level in the lump in the correct order with the remainder data bag that originally has been stored in the buffering area.Use to select retransmit ARQ mechanism and can avoid repeating to transmit those and already correctly arrive the packet of receiving terminal, but the cost of paying is the reception spatial cache that has suitable capacity in the receiving terminal setting, and complex processing flow process more.
The block reply mechanism of IEEE 802.11n is divided into two kinds: immediate block is replied with delay block and is replied.Immediate block is replied and is applicable to high bandwidth, low deferred traffic, and delay block is replied the application that is applicable to that tolerable suitably postpones.The present invention only relates to immediate block reply mechanism wherein.
Because recipient's website possibly set up immediate block with a plurality of opposite ends transmit leg website simultaneously and reply agreement; Each opposite end transmit leg sends the order of packet maybe be different with the sequencing of sequence of data packet number; And all there is the possibility of retransmission data packet may in each opposite end transmit leg; Therefore, the recipient must will resequence and recombinate from the out of order and retransmission data packet may of different opposite ends transmit leg, and submit to upper-layer protocol with correct order.To achieve these goals, the invention provides a kind of method that realizes immediate block reply mechanism of wireless local area network.
A kind of method that realizes immediate block reply mechanism of wireless local area network provided by the invention can be applicable to access point (Access Point, AP) equipment.AP equipment need be replied bitmap etc. like encryption key, piece for each station maintenance relevant information.When whole Basic Service Set (Basic Service Set, BSS) in related website when more, AP equipment all will carry out matching addresses, to obtain relevant information before sending and receiving each packet.For the realization of matching addresses, can be divided into dual mode:
1. use MAC Address to realize accurately coupling.The advantage of this mode is that the result who matches is accurate and less demanding to internal memory.Shortcoming is that relative logical gate area is bigger, and the access station of supporting is counted and the logical gate area is linear growth.
2. use hash algorithm to generate matching result.The advantage of this implementation is, matching speed is fast, the logical circuit area is little, and the increase of counting along with access station, and the logical gate area increases not obvious.Shortcoming is that matching result may produce collision, and memory consumption is bigger.
Take all factors into consideration above factor, under efficiency of algorithm and all acceptable prerequisite of memory cost, the present invention adopts hash algorithm to realize the matching addresses function.
Hash table is the array of a fixed size, each list item of Hash table, and promptly each element of array is a structure.In a kind of method that realizes immediate block reply mechanism of wireless local area network provided by the invention, this structure member comprises pointer, Hash number of times of a strong value Key, a sensing site information structure at least.In a kind of method that realizes immediate block reply mechanism of wireless local area network provided by the invention; The building method of Hash table adopts leaving remainder method; With high 3 bytes of MAC Address with low 3 byte additions be Key; Long to remove back gained remainder be Hash address H (Key) by the Hash table table to get Key, is shown below:
High 3 bytes in Key=MAC address+MAC Address hangs down 3 bytes (1)
H (Key)=(Key) % (the Hash table table is long) (2)
Because the own characteristic of hash algorithm maybe be identical by the Hash address that obtains behind the different K ey process Hash table building method, promptly possibly clash, and like this, must comprise the method that manages conflict in the realization of hash algorithm.The target that conflict solves is when the Hash address of list item is occupied, in Hash table, finds another sky Hash address.Performance simulation through to each algorithm compares, and adopts pseudorandom method for solving hash collision again among the present invention, is shown below:
H (Key)=(H (Key)+Key%10+1) % (the Hash table table is long) (3)
If the Hash address by (2) formula calculates is occupied, contention resolution calculates next Hash address according to (3) formula.If this address is also occupied, then calculate next Hash address again according to (3) formula, the rest may be inferred, up to obtaining an empty Hash address.
Summary of the invention
The present invention provides a kind of method that realizes immediate block reply mechanism of wireless local area network; In the hope of reaching under different frame transmission sequence (like out of order, re-transmission); Bitmap in the correct structure immediate block acknowledgement frame is correctly replied blocks of data, and is submitted the purpose of packet to upper-layer protocol with correct order.
For realizing this goal, the invention discloses a kind of method that realizes immediate block reply mechanism of wireless local area network, the present invention includes a matching addresses table; An immediate block is replied descriptor; A caller information table, an immediate block response status table, a matching addresses hardware circuit.Wherein:
Said matching addresses table comprises n bar caller information list item; Every the caller information list item points to a caller information table; Be used to write down with local and set up the relevant information that immediate block is replied the opposite end transmit leg website of agreement, and immediate block is replied the relevant information of agreement therewith.
Immediate block is replied descriptor and comprised: the hash keys value field is used to write down the key assignments that is calculated according to opposite end transmit leg website MAC Address by drive software; Hash offset address field is used to write down the address of Hash again that is calculated by drive software again, has preserved the next deposit position of caller information list item when hash result clashes again in the Hash address; The bitmap pointer field is used for writing down by drive software in the preservation address of receiving the immediate block acknowledgement frame bitmap that the Frame process forms.
Said caller information table comprises: whether support the block reply mechanism list item for one; Be used to indicate whether the opposite end transmit leg supports block reply mechanism; When receiving the association request frame that opposite end transmit leg website sends; Drive software can be replied (Delayed Block Ack) thresholding or immediate block is replied (Immediate Block Ack) thresholding and upgraded this list item according to the delay block of the ability information in this frame (Capability Information) unit; When above-mentioned two thresholdings all were 0, this list item was set to 0, and promptly transmit leg website in opposite end is not supported block reply mechanism; When one of above-mentioned two thresholdings were 1, this list item was set to 1, and promptly transmit leg website in opposite end is supported block reply mechanism; Article eight, receive sequence number counter list item,, each list item correspondence belongs to a priority of this transmit leg website; And be respectively applied for the local sequence of data packet that receives of record number; Each transmit leg can be supported eight priority at most, so need to safeguard eight receive sequence number counter list items in each caller information table, the local sequence of data packet that belongs to this priority that receives of record number; When receiving the blocks of data frame; Drive software can judge whether to duplicate frame according to the sequence number of blocks of data frame and the comparative result of this record, if not repeating frame, then receive sequence number counter list item is updated to the sequence number of Frame; Otherwise this list item remains unchanged; Article eight, immediate block response status list item; The corresponding priority of each list item, and point to an immediate block response status table respectively, be used to write down the accepting state of each blocks of data bag; Each transmit leg can be supported eight priority at most; Therefore need in each caller information table to safeguard eight immediate block response status list items, every list item correspondence belongs to a priority of this transmit leg website, is used to write down the accepting state of the blocks of data bag that belongs to this priority that this locality receives.
Said immediate block response status table comprises: upwards submit the sequence of data packet list item at last to for one; Be used to write down the sequence number of the packet that local mac submits to upper-layer protocol for the last time; When receiving the piece acknowledges requests frame (Block Ack Request) that opposite end transmit leg website sends; Drive software is submitted the complete MSDU that is accomplished by the drive software reorganization according to 802.11n agreement regulation to upper-layer protocol, and drive software is the sequence number to upper strata complete data packet that submit to, last with this entry updating; , a transmit leg strategy list item; Be used to write down with this locality and set up the piece acknowledgment strategy that piece is replied the opposite end transmit leg website of agreement; When receiving the association request frame that opposite end transmit leg website sends, drive software is replied thresholding or immediate block according to the delay block of the ability information unit in this frame and is replied thresholding and upgrade this list item, when above-mentioned delay block reply thresholding be 1 and immediate block reply thresholding when being 0; This list item is set to 0, and expression opposite end transmit leg website is supported the delay block acknowledgement mechanism; When above-mentioned delay block reply thresholding be 0 and immediate block reply thresholding when being 1, this list item is set to 1, expression opposite end transmit leg website is supported immediate block reply mechanism; When above-mentioned two thresholdings all were 0, this list item was set to 2, and expression opposite end transmit leg website is not supported block reply mechanism; When above-mentioned two thresholdings all were 1, this list item was set to 3, and expression opposite end transmit leg website is supported block reply mechanism; , a transmit leg data block length list item; Be used to write down with local and set up immediate block reply the data packet number that the opposite end transmit leg website of agreement sends in single; When receive that opposite end transmit leg website sends set up piece acknowledges requests (ADDBA Request) frame the time, drive software can upgrade this list item according to buffer size (Buffer Size) thresholding that the piece in this frame replied parameter set (Block Ack Parameter Set) unit; , a transmit leg homing sequence list item; Be used to write down with local and set up immediate block is replied first packet that the opposite end transmit leg website of agreement sends in single sequence number; When receive that opposite end transmit leg website sends set up piece acknowledges requests (ADDBA Request) frame or piece acknowledges requests frame the time, drive software is replied homing sequence number control (Block Ack Starting Sequence Control) thresholding according to the piece in the frame and is upgraded this list item; Article one, the bitmap list item points to a bitmap structure, and bitmap structure is by IEEE 802.11n definition, is used to write down with the local immediate block of setting up whether reply all packets that the opposite end transmit leg website of agreement sends by correct reception in single; Article one, the bitmap list item points to a bitmap structure, and bitmap structure is by IEEE 802.11n definition, is used to write down with the local immediate block of setting up whether reply all packets that the opposite end transmit leg website of agreement sends by correct reception in single; Article one, rearrangement buffer queue list item points to a buffer queue structure, is used for the packet that buffer memory receives.
Said matching addresses hardware circuit is arranged in hardware component, and the Hash table size according to drive software is provided with calculates the opposite end immediate block and replys the preservation address of bitmap in host memory.When the matching addresses hardware circuit is received the control module startup, MAC Address is carried out Hash operation, produces operation result, and produce computing completion indication simultaneously according to the described hash algorithm of (1) formula:
H(Key)=GetHash(Key)%HashSize (4)
Wherein, HashSize is the size of Hash table, by the drive software setting; H (Key) is the result of hash algorithm; GetHash (Key) is high 3 byte values and low 3 byte values summation gained key assignments (Key) of opposite end MAC Address, shown in formula (2):
GetHash(key)=MACAddr[47:24]+MACAddr[23:0] (5)
Matching addresses hardware circuit external interface signal comprises:
Machash_start: the enabling signal of Hash operation;
The mac_addr:MAC address;
Hash_size: the Hash table size, the hash result of gained will be in this scope;
Hash_done: Hash operation is accomplished signal;
Hash_result: the result of Hash;
Characteristic of the present invention in turn includes the following steps:
(1) drive software is received behind the QoS packet of physical layer arrival, from the QoS Control territory of packet, obtains Tid and Ack Policy thresholding, when Ack Policy is Block Ack, changes step (2) block data frame and receives flow process; Otherwise handle as the general responses Frame, wherein QoS is a service quality, and QoS Control is service quality control, and Tid is a flow identifier, and Ack Policy is an acknowledgment strategy, and Bloc kAck is that piece is replied;
(2) drive software is obtained the caller information list item corresponding with receiving the packet sender address according to the sender address thresholding that receives packet from the matching addresses table; And from the caller information table that this list item points to, obtain whether support block reply mechanism list item value; If this list item value is 1; Show transmit leg website support block reply mechanism, then change step (3); Otherwise destroy the packet of current reception, and change step 1;
(3) drive software is according to the Tid thresholding that receives packet; Obtain the immediate block response status list item corresponding with it; If this list item value is empty, then immediate block reply mechanism is set up as yet between explanation this locality and the opposite end transmit leg website, and the blocks of data bag that receives can't be handled in this locality; Therefore this packet is destroyed and responded the Ack acknowledgement frame, change step 1; If this list item value is not empty, explain that immediate block reply mechanism is set up between local and the opposite end transmit leg website, change step (4);
(4) drive software is obtained transmit leg homing sequence list item and bitmap list item from this immediate block response status table, and bitmap list item bitmap structure pointed, if receive sequence of data packet number more than or equal to transmit leg homing sequence list item value, then changes step (5); Otherwise, this packet is destroyed, change step 1;
(5) check whether the corresponding bit that receives packet is 1 in the bitmap, if corresponding bit is 1, explain that then this packet correctly receives, the packet of current reception is a repeating frame, directly destroys, and responds the Ack acknowledgement frame, changes step 1; Otherwise, then change step (6);
(6) drive software is obtained transmit leg data block length list item from this immediate block response status table; Compare rearrangement buffer queue current length and transmit leg data block length list item value that drive software is safeguarded; If the rearrangement length of buffer queue equals transmit leg data block length list item value; Explain that the rearrangement buffer queue is full, then change step (7); Otherwise, change step (8);
(7) the buffer queue head of the queue packet of will resequencing discharges, and immediate block is replied in the bitmap with head of the queue packet correspondence position is 0;
(8) record that will be corresponding with current data packet inserts the rearrangement buffer queue;
(9) will the immediate block corresponding with current data packet replying the bitmap relevant position is 1;
(10) the hardware receiving circuit receives the next frame that arrives from physical layer, if the judgment frame type is the QoS Frame, then changes step (1); If the judgment frame type is a piece acknowledges requests frame, then change step (11);
(11) the hardware receiving circuit is got the source address and the Tid of piece acknowledges requests frame, and the matching addresses hardware circuit obtains key value Key according to this destination address by computes, and changes step (12);
High 3 bytes of Key=source address+source address is hanged down 3 bytes (6)
(12) the matching addresses hardware circuit calculates gained Key value according to step (11), is obtained replying the preservation address of descriptor in host memory with piece acknowledges requests frame source address and the corresponding immediate block of Tid by computes, and changes step (13);
Immediate block is replied the % of bitmap descriptor=plot+(Key) (the Hash table table is long) (7)
(13) whether comparison step (11) calculating gained Key value equates with the Key value that immediate block is replied in the descriptor, if equate, then changes step (15); Otherwise, clash, change step (14);
(14) obtain immediate block by step (12) and reply the offset address of Hash again in the descriptor, and by this again the Hash offset address obtain next immediate block and reply descriptor, change step (13);
(15) obtain replying the preservation address of bitmap in host memory by computes with piece acknowledges requests frame source address and the corresponding immediate block of Tid:
Immediate block is replied the % of bitmap address=plot+(Key) (the Hash table table is long)+8+ (Tid * 128) (8);
(16) reply the bitmap address according to immediate block and obtain the bitmap content, and the building block acknowledgement frame, fill immediate block acknowledgement frame corresponding field with the bitmap content, the hardware transtation mission circuit sends block ack frame.
Description of drawings
Fig. 1 is a kind of method structure chart of realizing immediate block reply mechanism of wireless local area network.
Fig. 2 is two kinds of hash-collision resolution policies: linear Hash again and the pseudorandom performance of Hash again compare.Wherein, ordinate is to clash and the average time of Hash again, and abscissa is a load factor, and it is defined as the length of list item number/Hash table of having inserted in the a=Hash table.It is thus clear that the more for a short time possibility that clashes of a is more little; Otherwise then possibility is big more.Prove by simulation result shown in Figure 2, under the identical condition of load factor, pseudorandom again the number of times that clashes of hash method less than linearity hash method again.
Fig. 3 replys the institutional framework of descriptor in internal memory for immediate block.
Fig. 4 is the institutional framework of rearrangement buffer queue.
Fig. 5 is a matching addresses hardware circuit external interface.
Embodiment
Below in conjunction with accompanying drawing, specify the present invention.
The present invention provides a kind of method that realizes immediate block reply mechanism of wireless local area network, in the hope of reaching under different frame transmission sequence (like out of order, re-transmission), correctly constructs the bitmap in the immediate block acknowledgement frame, correctly replys the purpose of blocks of data.The present invention includes a matching addresses table, an immediate block is replied descriptor, a caller information table, an immediate block response status table, a matching addresses hardware circuit.Wherein:
The matching addresses table comprises n bar caller information list item; Every the caller information list item points to a caller information table; Be used to write down with local and set up the relevant information that immediate block is replied the opposite end transmit leg website of agreement, and immediate block is replied the relevant information of agreement therewith.
Said caller information table comprises: whether support the block reply mechanism list item for one, be used to indicate whether the opposite end transmit leg supports block reply mechanism; Article eight, receive sequence number counter list item, the corresponding priority of each list item, and be respectively applied for the local sequence of data packet that receives of record number; Article eight, immediate block response status list item, the corresponding priority of each list item, and point to an immediate block response status table respectively, be used to write down the accepting state of each blocks of data bag.
Immediate block response status table comprises: upwards submit the sequence of data packet list item at last to for one, be used to write down the sequence number of the packet that local mac submits to upper-layer protocol for the last time; Article one, transmit leg strategy list item is used to write down with this locality and sets up the piece acknowledgment strategy that piece is replied the opposite end transmit leg website of agreement; , a transmit leg data block length list item is used to write down with local and sets up immediate block reply the data packet number that the opposite end transmit leg website of agreement sends in single; , a transmit leg homing sequence list item is used to write down with local and sets up immediate block is replied first packet that the opposite end transmit leg website of agreement sends in single sequence number; Article one, the bitmap list item points to a bitmap structure, and bitmap structure is by IEEE 802.11n definition, is used to write down with the local immediate block of setting up whether reply all packets that the opposite end transmit leg website of agreement sends by correct reception in single; Article one, rearrangement buffer queue list item points to a buffer queue structure, is used for the packet that buffer memory receives.The rearrangement buffer queue is used for the packet that buffer memory receives.
Immediate block is replied descriptor and comprised: the hash keys value field is used to write down the key assignments that is calculated according to transmit leg website MAC Address by drive software; Hash offset address field is used to write down the address of Hash again that is calculated by drive software again, has preserved the next deposit position of caller information list item when hash result clashes again in the Hash address; Immediate block acknowledgement frame bitmap address field is used for writing down by drive software and is receiving Frame process preservation address that form, immediate block acknowledgement frame bitmap.The matching addresses hardware circuit is arranged in hardware component, and the Hash table size according to drive software is provided with calculates the opposite end immediate block and replys the preservation address of bitmap in host memory.
Concrete steps are following:
(1) drive software is received behind the QoS packet of physical layer arrival, from the QoS Control territory of packet, obtains Tid and Ack Policy thresholding, when Ack Policy is Block Ack, changes step (2) block data frame and receives flow process; Otherwise handle as the general responses Frame, wherein QoS is a service quality, and QoS Control is service quality control, and Tid is a flow identifier, and Ack Policy is an acknowledgment strategy, and Block Ack is that piece is replied;
(2) drive software is obtained the caller information list item corresponding with receiving the packet sender address according to the sender address thresholding that receives packet from the matching addresses table; And from the caller information table that this list item points to, obtain whether support block reply mechanism list item value; If this list item value is 1; Show transmit leg website support block reply mechanism, then change step (3); Otherwise destroy the packet of current reception, and change step 1;
(3) drive software is according to the Tid thresholding that receives packet; Obtain the immediate block response status list item corresponding with it; If this list item value is empty, then immediate block reply mechanism is set up as yet between explanation this locality and the opposite end transmit leg website, and the blocks of data bag that receives can't be handled in this locality; Therefore this packet is destroyed and responded the Ack acknowledgement frame, change step 1; If this list item value is not empty, explain that immediate block reply mechanism is set up between local and the opposite end transmit leg website, change step (4);
(4) drive software is obtained transmit leg homing sequence list item and bitmap list item from this immediate block response status table, and bitmap list item bitmap structure pointed, if receive sequence of data packet number more than or equal to transmit leg homing sequence list item value, then changes step (5); Otherwise, this packet is destroyed, change step 1;
(5) check whether the corresponding bit that receives packet is 1 in the bitmap, if corresponding bit is 1, explain that then this packet correctly receives, the packet of current reception is a repeating frame, directly destroys, and responds the Ack acknowledgement frame, changes step 1; Otherwise, then change step (6);
(6) drive software is obtained transmit leg data block length list item from this immediate block response status table; Compare rearrangement buffer queue current length and transmit leg data block length list item value that drive software is safeguarded; If the rearrangement length of buffer queue equals transmit leg data block length list item value; Explain that the rearrangement buffer queue is full, then change step (7); Otherwise, change step (8);
(7) the buffer queue head of the queue packet of will resequencing discharges, and immediate block is replied in the bitmap with head of the queue packet correspondence position is 0;
(8) record that will be corresponding with current data packet inserts the rearrangement buffer queue, and the institutional framework of rearrangement buffer queue is as shown in Figure 4;
(9) will the immediate block corresponding with current data packet replying the bitmap relevant position is 1;
(10) the hardware receiving circuit receives the next frame that arrives from physical layer, if the judgment frame type is the QoS Frame, then changes step (1); If the judgment frame type is a piece acknowledges requests frame, then change step (11);
(11) the hardware receiving circuit is got the source address and the Tid of piece acknowledges requests frame, enabling address coupling hardware circuit, and circuit input/output interface block diagram is as shown in Figure 5.When input timing is that the effective source address mac_addr [47:0] simultaneously of enabling signal machash_start is effective and Hash table length hash_size is effective; The matching addresses hardware circuit is according to this destination address; Obtain key value Key by computes, and change step (12);
High 3 bytes of Key=source address+source address is hanged down 3 bytes (9)
(12) the matching addresses hardware circuit calculates gained Key value according to step (11); Obtain replying the preservation address of descriptor in host memory by computes with piece acknowledges requests frame source address and the corresponding immediate block of Tid; It is as shown in Figure 3 that piece is replied the institutional framework of descriptor in internal memory; When output timing is that computing is accomplished indication hash_done effectively operation result hash_result is effective simultaneously, and change step (13);
Immediate block is replied the % of bitmap descriptor=plot+(Key) (the Hash table table is long) (10)
(13) whether comparison step (11) calculating gained Key value equates with the Key value that immediate block is replied in the descriptor, if equate, then changes step (15); Otherwise, clash, change step (14);
(14) obtain immediate block by step (12) and reply the offset address of Hash again in the descriptor, and by this again the Hash offset address obtain next immediate block and reply descriptor, change step (13);
(15) obtain replying the preservation address of bitmap in host memory by computes with piece acknowledges requests frame source address and the corresponding immediate block of Tid:
Immediate block is replied the % of bitmap address=plot+(Key) (the Hash table table is long)+8+ (Tid * 128) (11);
(16) reply the bitmap address according to immediate block and obtain the bitmap content, and the building block acknowledgement frame, fill immediate block acknowledgement frame corresponding field with the bitmap content, the hardware transtation mission circuit sends block ack frame.
The present invention has the following advantages:
(1) correctly realizes immediate block reply mechanism.
(2) correctly construct bitmap in the immediate block acknowledgement frame.
(3) matching addresses process speed is fast, the logical circuit area is little, and the increase of counting along with access station, and the logical gate area increases not obvious.
More than disclosedly be merely specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, any those skilled in the art can think variation all should drop in protection scope of the present invention.