1. Challenges faced by Mac
RF Link Quality802.11 adopt a positive confirmation mechanism. All transmitted frames must be responded to, as long as any one link fails, the frame is considered a loss. -------Atomic operation
problems with hidden nodesWireless transceivers typically have a half-duplex operation, which means they cannot send and receive data at the same time. Use RTS and CTS signals to clear the transfer area. RTS frames have two purposes: to reserve the right to use the wireless link, requiring other workstations that receive the frame to remain silent. It is often used only in high-volume environments and where transmission competition is more significant.
2.MAC access mode and timing
Carrier interception (Carrier sensing) is used to determine whether the media is in a usable state. 802.11 has 2 kinds of carrier interception function: Physical carrier interception and virtual carrier interception. As long as one of them is busy, the Mac informs this state of the higher-level protocol. Virtual carrier interception: provided by the network allocation vector (NET Allocation vector short NAV). 802.11 frames typically contain a duration field, which is used to schedule a period of time for a medium. Other workstations will count Nav values to 0. As long as the NAV is not zero, it means the media is in a busy state. SIFS: Short frame spacing for high-priority transmissions, such as rts/cts and affirmative-confirmation frames. PIFS:PCF inter-frame interval, pifs is primarily used by PCF in a non-competitive operation and is sometimes mistakenly referred to as the priority inter-frame interval. DIFS:DCF between frames, DIFS is the shortest medium idle time in a competitive service. EIFS: Extend the inter-frame interval to use EIFS only if there is an error in the frame transfer.
3. Segmentation and reorganization of framesSegmented subcontracting helps to improve reliability when interference is present. With the segmentation of frames, wireless LAN workstations allow interference to affect only smaller fragments, rather than larger frames. Reducing the amount of data that may be disturbed, frame segmentation can improve the overall effective throughput. When the packet size of the upper layer exceeds the segmentation threshold set by the network manager, the frame is segmented. Each frame fragment has the same frame symbol and an incremented frame fragment number to facilitate reorganization. Frame control information is used to indicate whether there are other frame fragments to be received.
4. Frame FormatThe transfer order of the field is left to right and the most significant bit will appear last.
Frame control Field2 bytes in length. Protocol field: A two-bit composition to display the Mac version used by the frame. There is currently only one, which is 0. Type and Subtype fields: used to specify the frame type.
Type |
Subtype |
Frame type |
00 (Manage frames) |
0000 |
Association request |
|
0001 |
Association response |
|
0010 |
Reassociation Request |
|
0011 |
Reassociation response |
|
0100 |
Probe Request |
|
0101 |
Probe response |
|
1000 |
Beacon |
|
1001 |
ATIM (Notification transmission indication message) |
|
1010 |
Disassociation |
|
1011 |
Authentication |
|
1100 |
Deauthentication |
01 (Control frame) |
1010 |
Power Save (PS)-poll |
|
1011 |
Rts |
|
1100 |
Cts |
|
1101 |
Ack |
|
1110 |
Cf-end |
|
1111 |
Cf-end + cf-ack |
10 (Data frame) |
0000 |
Data |
|
0001 |
Data + cf-ack |
|
0010 |
Data + Cf-poll |
|
0011 |
Data + Cf-ack + cf-poll |
|
0100 |
Null data |
|
0101 |
Cf-ack |
|
0110 |
Cf-poll |
|
0111 |
Data + Cf-ack + cf-poll |
|
1000 |
Qos Data |
|
1001 |
Qos Data + cf-ack |
|
1010 |
Qos Data + cf-poll |
|
1011 |
Qos Data + cf-ack + cf-poll |
|
1100 |
Qos Null |
|
1101 |
Qos Cf-ack |
|
1110 |
Qos Cf-poll |
|
1111 |
Qos Cf-ack + cf-poll |
To DS with from DS bit:
|
To Ds=0 |
To Ds=1 |
From Ds=0 |
All management frames and control frames. Data frames in the IBSS |
Data frames transmitted by wireless workstations in an infrastructure-based network |
From Ds=1 |
Data frames received by wireless workstations in an infrastructure-based network |
Data frames on a wireless bridge |
duration/id FieldThe Duration/id field immediately follows the Frame control field. This field has a number of functions, and there are three possible forms: the first: The number of microseconds that represent the expected medium for the current delivery. The second type: A value of 32768 is interpreted as NAV. It allows any workstation that has been confiscated to beacon frames to announce a non-competitive cycle. The third type: The workstation in hibernation must wake up regularly. To ensure that no frames are omitted, the workstation waking from hibernation must send out a ps-poll frame to obtain any previously cached frames from the access point.
Address fieldAddress 1 on behalf of the receiving end, address 2 on behalf of the sender, Address 3 field by the receiving end to filter addresses.in an infrastructure network, the third address field is used by the receiving end to determine whether the frame belongs to its associated network. Unicast (unicast): The first bit is 0, the address represents a single workstation multicast (multicast): The first bit is 1, the address represents a set of entity station broadcasts (broadcast): All bits 1, are transmitted to all workstations connected to the wireless medium destination address-- The final source address of the receiver-representing the source of the transmission, each frame can only come from a single workstation, so the individual/group bit must be a 0 receive-side address-representing the workstation responsible for processing the frame. If it is a wireless workstation, the receive-side address is the destination address. If the destination of the frame is the Ethernet node connected to the access point, the receiving end is the wireless interface of the access point, and the destination address may be a router connected to the Ethernet. Send-side address-represents a wireless interface that transmits frames to a wireless medium. Send-side addresses are typically used only for wireless bridging. Basic Service Set Identifier (BSSID)-the MAC address used by the access point wireless interface. Most data frames use 3 fields: source, destination, and Bssid.
3.3.11 Sequential control bitsComposed of 4 bit fragment number (fragment numbered) bit and 12 bit sequence number (sequential numbered) bit
3.3.12
Frame Body(Frame Boby)
Also known as data bits, which are responsible for transmitting upper-layer data (payload) between workstations. In the original specification, 802.11 frames can transmit up to 2,304 bit sets of upper data. The 802.2 LLC header has 8 bit groups and can transmit up to 2,296 bit sets of network protocol data. Prevention of fragmentation must be addressed at the protocol level. In an IP network, path MTU Discovery (path Maximum transmission unit query; RFC1191) will avoid frame passing that is larger than 1500 bit groups.802.11 different from other link layer technologies:1. There is no sign of any upper layer agreement in 802.11 frames to differentiate.
2. 802.11 usually does not fill the frame to a minimum length.
3.3.13
frame test sequence (
FCS
)
As with Ethernet, 802.11 frames are also terminated with a frame check sequence (frame checked sequence, or FCS). FCS is often considered a cyclic redundancy code (cyclic redundancy check, referred to as CRC) because the underlying mathematical operations are the same. FCS allows the workstation to check the integrity of the received frames. The FCS calculation range covers all bits in the MAC header and the frame body.
3.4
802.11
encapsulation of the upper layer protocol
3.5
Competitive Data Services
Atomic Exchange Program-the process of exchanging data must be considered as a single whole. For example, a single point of propagating data must be answered to ensure that the data is delivered correctly. Although the entire data exchange process consists of two frames, the data exchange itself is only the first process. As long as one side fails, the whole process must be restarted. 802.11 defines two distinct sets of basic exchange programs. One is DCF, for competitive services, see this chapter. The second type of Exchange is PCF, which is used for competition-free services (Contention-free service).DCF said that the use of the frame Exchange Mode in 802.11 MAC in a decisive position.
3.5.1
broadcast with multicast data or manage frames
- Broadcast data frames are populated with broadcast addresses in the ADDRESS1 bit
- Multicast data frames are populated with multicast addresses in the ADDRESS1 bit
- Broadcast management frames are populated with broadcast addresses (beacons, Probe Request, and IBSS Atim frames) in the ADDRESS1 bit
3.5.2
single-point propagation frameSingle-point propagation frames must be answered to ensure reliability
3.5.2.1
single frame (last fragment) and its positive response
Transmission reliability between the two workstations is based on a simple positive response. The single-point propagation data frame must be answered positively, otherwise the frame will be considered lost.
This frame uses NAV as its own, response, and SIFS intended media usage. The long NAV is set to lock the virtual carrier for the entire switching process to ensure that the receiver can transmit the response. Because this interchange is terminated with an ACK, there is no need to lock the virtual carrier, so NAV in this ACK is set to 0.
3.5.2.2
Frame Segment
Including IP, some of the higher-level network protocols will more or less use frame segmentation. The disadvantage of fragmentation at the network layer is that the receiving end must be reorganized, and if the frame is lost during transmission, the entire packet must be re-transmitted. Using the staging mechanism at the link layer can increase the speed, that is, transfer data between the transport point (hop) with a smaller MTU. In addition, 802.11 can use frame segmentation to avoid interference. Wireless on-demand interference usually occurs in the form of instantaneous, high-energy spikes and is often synchronized with the AC power cord. Segment frames to protect most frames from damage. The basic fragmentation mechanism is shown in 3-16. Frame segmentation is controlled by the MAC's fragmentation threshold (cutting threshold) parameter. Most network card drivers allow the user to set this parameter. Any frames that exceed the segment threshold are segmented, and the segmentation method varies depending on the actual situation. Higher segment thresholds mean that frames are less likely to be transported, but the cost of frame loss and damage is higher because there will be more data to discard and retransmit. Lowering the segment threshold means that the transmission burden is heavier, but it can provide better stability in the face of a more hostile environment.
3.5.2.3 rts/cts
The practice of rts/cts switching is no different from the beginning of frame segmentation, except that RTS frames do not carry any data. The NAV in Rts/cts allows the CTS to do its work, while the CTS can be used to preserve the use of data frames.
As with frame segmentation, rts/cts is controlled by thresholds in the initiator program. Frames exceeding this threshold are emptied by rts/cts, while smaller frames are transmitted directly.
3.5.3.1
Answer nowThe base station can respond immediately to the ps-poll (power-down mode-polling) frame. After a period of SIFS (short frame interval), the base station can transmit frames. The DURATION/ID bit of the Ps-poll frame contains the association ID (connection identifier), so the base station can determine which frames are staged for the workstation. If the staged frame is too large, it must be segmented.
3.5.3.2
Delay Response
In addition to an immediate response, the base station can reply to a simple answer first. This practice is called delayed response (deferred response), because the base station responds to the requirement to access the staging frame, but does not and immediately take the actual send action. One of the advantages of using delay response is that the base station software is easier to implement, because the response information can be transmitted through the chipset immediately, as for the data can be staged first, and then transmitted according to normal process.
3.5.4
Multiple rate Support (
multirate Support
)
Network technologies that can work at different speeds must have a mechanism to coordinate a data rate that is acceptable to each other. Workstations must be able to adapt to a changing environment and change the transfer rate if necessary.
- Each workstation maintains a rate list, which records all the rates supported by the workstation and the connected BSS. (The so-called BSS is usually the equivalent of a base station, but newer products allow users to customize the rate according to the virtual base station.) ) The transfer rate above the rate combination is not allowed to transmit frames.
- Each BSS must be responsible for maintaining a set of basic rates, which are the rate lists that must be supported by the workstations that intend to join this BSS. Any frames sent to a group receive address must be transmitted at a basic rate to ensure that all workstations are correctly interpreted.
- The control frames used for the start frame exchange, such as RTS and CTS, must be transmitted at one rate in the base rate combination. This rule ensures that workstations that must respond to RTS frames in the CTS can work at the same rate.
- Frames sent to a particular workstation will be recorded at address 1 for a single point of communication. A single-point propagation frame (Unicast frame) can be delivered at any rate supported by the destination. As for the choice of data rate, the 802.11 standard is not regulated.
- An acknowledgment frame such as an ACK or CTS must be transmitted at a rate that is included in the base rate combination, but not higher than the starting frame used for this transmission. The answer frame must use the same modulation (DSSS, CCK, or OFDM) as the starting frame.
3.7.4.1 selection speed and spin down
Rate selection mainly determines when a network card should speed up to improve the link quality. How rate selection is achieved is left to the chip manufacturer to decide.
Change the rate, either by signal quality (SNR), or by indirectly observing how many frames need to be re-transmitted. When the signal quality becomes worse, the chip will adjust to spin down.
Indirect measurement is the monitoring of the instantaneous or average loss of how many frames, and then to be moderately compensated.
3.6Processing and bridging of frames
The core of a wireless base station is actually a bridge that is responsible for converting frames between wireless and wired media.
3.6.1 Wireless Media to limited media1. When the access point receives a frame, the basic integrity of the frame is detected first. 2-1. The frame transmitted to the access point will use the MAC address of the access point as an address 1 field for the 802.11 mac header. The 2-2.802.11 MAC then monitors and moves the duplicated frames. 3. Once the base station determines that the frame needs to be further processed, it must be decrypted because the frame is protected by the link-layer security algorithm. 4. After successful decryption, the base station checks whether the frame is a frame fragment and needs further reorganization. Integrity Protection (Integrity protection) is for full frames after reassembly, not individual frame fragments.
5. If the BSSID test of step 2-1, the decision base station must bridge the frame, the more complex 802.11 mac header will be converted to a simpler Ethernet MAC header. 5-1. The destination address that is recorded in location 3 of the 802.11 MAC header will be copied to the destination address of the Ethernet.
5-2. The source address that is recorded in the addresses 2 bits of the 802.11 MAC header is copied to the source address of the Ethernet.
5-3. From the SNAP header in the 802.11 Data bit, copy the (type) type code to the type bit in the Ethernet frame. If the Ethernet frame also uses snap, the entire snap header is copied.
5-4. Sequential information is mainly used for the reorganization of frame fragments, but is discarded when the frame is sent to the bridge. 5-5. If there is a standard quality of service handler, the wireless and wired Qos corresponds. But so far, the form used to represent the quality of service is usually the use of a 802.1p priority level bit in a wired frame, or some other form of control. 6. Recalculate the frame check code. Ethernet and 802.11 use the same algorithm to calculate FCS, but 802.11 frames more bits, while the FCS is protected. 7. The resulting new frames are delivered via the Ethernet interface.
3.6.2 Wired Media to Wireless media (Wired Medium to Wireless Medium)1. After verifying the Ethernet FCS, the base station first checks whether the received frame needs to be further processed, that is, whether the destination address of the frame is the one currently connected to the base station.
2. Attach the SNAP header to the data of the Ethernet frame. The upper packet is encapsulated with the SNAP header, and its type bit is copied from the types code in the Ethernet frame. If the Ethernet frame also uses snap, the entire snap header is copied.
3. Schedule the transfer of frames. 802.11 contains a complex power-saving process, before the frame is placed in the routing sequence, the base station may temporarily hold the frame in the buffer. The power saving process will be on the 8th Zhangxiangshu. 4. Once the frame is placed in the sequence to be passed, it is given a sequential number. If necessary, the resulting data can be protected with integrity test values. If a frame needs to be segmented, it is segmented according to a predetermined segment threshold. When you segment a frame, the fragment number is specified in the Sequence Control bit. 5. If the frame needs to be protected, the body of the frame (or each frame fragment) is encrypted.
6. The 802.11 mac header is generated based on the Ethernet MAC header.
6-1. Copy the destination of the Ethernet to address 1 bits of the 802.11 MAC header.
6-2. Place the BSSID in Address 2 of the MAC header as the sender of the frame on the wireless media.
6-3. Copy the source address of the frame to the address 3-bit of the MAC header.
6-4. Fill in the 802.11 MAC header with the other bits. That is, fill in the expected delivery time into the Duration bit, and fill in the appropriate flag into the Frame Control bit.
7. Recalculate the frame check code. Ethernet and 802.11 use the same algorithm to calculate FCS, but 802.11 frames more bits, while the FCS is protected.
8. The resulting new frame delivery 802.11 interface is delivered.
802.11 MAC Basics