Validation of IEEE 802.11 DCF
收藏资源简介:
802.11 Distributed Coordination Function (DCF) is a protocol which uses carrier sensing along with a four way handshake to maximize the throughput while preventing packet collisions. A packet collision is defined as any case where a node is receiving more than one packet at a time, resultingin neither packet being correctly received. The 802.11 protocol is the most well known and widely used wireless networking protocol in real applications. Essentially, 802.11 is a carrier sensing multiple access with collision avoidance(CSMA/CA) medium access control (MAC) protocol using a direct sequence spread spectrum (DSSS) physical interface.<br>In 802.11, priority access to the wireless medium is controlled by the use of inter-frame space(IFS) time between the transmission of frames. Totally three IFS intervals have been specified by 802.11 standard: short IFS(SIFS), point coordination function IFS(PIFS), and DCF-IFS(DIFS). The SIFS is the smallest and the DIFS is the largest. The station may proceed with its transmission if themedium is sensed to be idle for an interval larger than the Distributed Inter Frame Space(DIFS). If the medium is busy, the station defers until after a DIFS is detected and then generate a random back-off period before transmitting. The back-off timer counter is decreased as long as the channel is sensedidle, frozen when the channel is sensed busy, and resumed when the channel is sensed idle again for more than a DIFS. A station can initiate a transmission when the back-off timer reaches zero. The back-off time is uniformly chosen in the range (0, w>1). Also (w>1) is known as Contention Window(CW), which is an integer with the range determined by the PHY characteristics CWmin and CWmax. After each unsuccessful transmission, w is doubled, up to value 2^m * W where W equals to (CWmin+1) and 2^m * W equals to (CWmax+1) .<br>Upon received a packet correctly, the destination station waits for a SIFS interval immediately following the reception of the data frame and transmits a MAC ACK back to the source station, indicating that the data frame has been received correctly. In case the source station does not receive an ACK, the data frame is assumed to be lost and the source station schedules retransmission with the CW doubled. When the data frame is transmitted, all the other stations hearing the data frame adjust their Network Allocation Vector(NAV), which is used for virtual CS at the MAC layer, based on the duration field value in the data frame, which includes the SIFS and the ACK following the data frame.<br>The basic functionality of 802.11 is as follows. Assume that a node has data that it needs to transmit. First it will wait a random backoff time. This is a random number of time slots which is within a contention window. If at any time the node senses that another node is using the channel, it will pause its timer until the other node has finished transmitting. When the backoff time has expired, the node will sense the channel to determine if there is another node transmitting. If the channel is clear, it will then wait for a short time and sense the channel again. If the channel is still free, it will transmit a request to send (RTS) to the destination. The destination will respond with a clear to send (CTS) if it is available to receive data (i.e. if it is not receiving data from another node) 802.11 Distributed Coordination Function (DCF) maximizes throughput while preventing packet collisions. When the source node receives the CTS, it will transmit its data. Along with both the RTS and CTS, a network allocation vector (NAV) is transmitted. After correct reception of the data, the destination will transmit an acknowledgment (ACK) back to the sender. At this point, if the sender has more data to transmit, it will again begin its backoff and repeat the process. This process is demonstrated in figure above.<br>In 802.11, carrier sensing is the primary method used to avoid collision. Carrier sensing is accomplished by simply measure the amount of energy received on the channel. If that energy is above a threshold, the sensing node determines that another node is currently transmitting and that it must remain silent.Along with carrier sensing, interframe spacing is primarily used to ensure that the channel is truly free. When a node is sensing the channel, it must be free for the length of the DCF interframe spacing (DIFS) period. The short interframe spacing (SIFS) is used as the wait time between the RTS, CTS, DATA and ACK frames. Since the SIFS is always shorter than the DIFS, this ensures that another node does not incorrectly determine that the channel is idle during the handshake and that priority is given to the transmission in progress.<br>Default value of RTS threshold is 2347 bytes and the allowed range is 0-2347 bytes, only minor change is recommended. If a network packet is smaller than the preset RTS threshold size, the RTS/CTS mechanism will not be activated. The wireless router sends Request to Send (RTS) frames to a particular receiving computer and negotiates the sending of a data frame. After receiving an RTS, the computer responds with a Clear to Send (CTS) frame to acknowledge the right to begin transmission. This feature will prevent packet collisions on wireless network but it slows down network throughput too if used incorrectly. If you have many wireless users located far apart and also far from wireless router/access point, you can then test to decrease this threshold to 2304 bytes and check the result. The optimal tuning of the RTS threshold allows the network to choose an access mode, that will guarantee the best throughput performance.
802.11分布式协调功能(Distributed Coordination Function,DCF)是一种采用载波侦听与四次握手机制的协议,旨在在最大化吞吐量的同时避免数据包碰撞。数据包碰撞指的是任意节点同时接收多个数据包,导致两个数据包均无法被正确接收的场景。802.11协议是实际应用中最知名且应用最广泛的无线网络协议。本质上,802.11是一种采用直接序列扩频(Direct Sequence Spread Spectrum,DSSS)物理接口的带冲突避免的载波侦听多路访问(Carrier Sense Multiple Access with Collision Avoidance,CSMA/CA)介质访问控制(Medium Access Control,MAC)协议。 在802.11协议中,无线介质的优先访问权由帧传输之间的帧间间隔(Inter-frame Space,IFS)时长控制。802.11标准共定义了三种IFS区间:短帧间间隔(Short IFS,SIFS)、点协调功能帧间间隔(Point Coordination Function IFS,PIFS)以及DCF帧间间隔(DCF-IFS,DIFS)。其中SIFS是最短的IFS,DIFS是最长的。若介质被检测到空闲时长超过分布式帧间间隔(Distributed Inter Frame Space,DIFS),站点即可开始传输。若介质处于忙状态,则站点需延后传输,直至检测到DIFS时长的空闲期,随后生成一段随机退避时长后再发起传输。退避计时器仅在信道被检测为空闲时递减,信道忙时暂停计时,当信道再次空闲且时长超过DIFS时恢复计时。当退避计时器归零后,站点即可发起传输。退避时长在(0, w>1)区间内均匀选取,其中(w>1)被称为竞争窗口(Contention Window,CW),其整数范围由物理层参数CWmin与CWmax决定。每次传输失败后,w值翻倍,上限为2^m * W,其中W等于(CWmin+1),且2^m * W等于(CWmax+1)。 当目的站点正确接收数据包后,会在数据帧接收完成后立即等待一个SIFS时长,随后向源站点回传MAC层确认帧(ACK),以告知源站点数据帧已被正确接收。若源站点未收到ACK,则默认数据帧丢失,源站点将以翻倍后的CW调度重传。在数据帧传输过程中,所有监听到该数据帧的其他站点都会根据数据帧中的时长字段值更新其网络分配向量(Network Allocation Vector,NAV)——该向量用于MAC层的虚拟载波侦听,时长字段包含SIFS与紧随数据帧后的ACK所需的时长。 802.11的基本工作流程如下。假设某节点有待传输的数据,首先它会等待一段随机退避时长,该退避时长是处于竞争窗口内的随机时隙数量。若节点在任意时刻检测到其他节点正在使用信道,则会暂停其计时器,直至其他节点完成传输。当退避时长耗尽后,节点会先侦听信道以确认是否有其他节点正在传输。若信道空闲,节点会先等待一段短时长,再次侦听信道。若信道仍处于空闲状态,则会向目的站点发送请求发送(Request to Send,RTS)帧。若目的站点可用以接收数据(即未在接收其他节点的数据),则会回应一个清除发送(Clear to Send,CTS)帧。802.11 DCF可在避免数据包碰撞的同时最大化吞吐量。当源节点收到CTS后,即可开始传输数据。RTS与CTS帧均会附带网络分配向量(NAV)信息。在正确接收数据后,目的站点会向发送方回传确认帧(ACK)。此时若发送方仍有待传输的数据,则会再次启动退避流程并重复上述过程,该过程如上图所示。 在802.11中,载波侦听是避免碰撞的主要手段。载波侦听通过简单测量信道上接收的能量大小实现,若该能量高于阈值,则侦听节点会判定当前有其他节点正在传输,自身必须保持静默。除载波侦听外,帧间间隔主要用于确保信道确实处于空闲状态。当节点侦听信道时,信道必须保持DIFS时长的空闲状态。短帧间间隔(SIFS)被用作RTS、CTS、数据帧与ACK帧之间的等待时长。由于SIFS始终短于DIFS,这可确保在握手过程中不会有其他节点误判信道为空闲,同时为正在进行的传输赋予优先级。 RTS阈值的默认值为2347字节,允许范围为0-2347字节,仅建议进行小幅调整。若网络数据包小于预设的RTS阈值,则不会激活RTS/CTS机制。无线路由器会向特定接收计算机发送RTS帧,并协商数据帧的传输。接收方收到RTS后,会回传CTS帧以确认其拥有发起传输的权限。该功能可避免无线网络中的数据包碰撞,但如果使用不当,也会降低网络吞吐量。若存在大量距离无线路由器/接入点较远的无线用户,可尝试将该阈值调低至2304字节并测试效果。对RTS阈值进行最优调优,可使网络选择最优接入模式,从而保障最佳的吞吐量性能。



