Tuesday, October 6, 2009

Interframe Spacing

Interframe spacing doesn’t sound like something an administrator would need to know; however, if you don’t understand the types of interframe spacing, you cannot effectively grasp RTS/CTS, which helps you solve problems, or DCF and PCF, which are manually configured in the access point. Both of these functions are integral in the ongoing communications process of a wireless LAN. First, we will define each type of interframe space (IFS), and then we will explain how each type works on the wireless LAN.

As we learned when we discussed beacons, all stations on a wireless LAN are timesynchronized. All the stations on a wireless LAN are effectively ‘ticking’ time in sync with one another. Interframe spacing is the term we use to refer to standardized time spaces that are used on all 802.11 wireless LANs.


Three Types of Spacing

There are three main spacing intervals (interframe spaces): SIFS, DIFS, and PIFS. Each type of interframe space is used by a wireless LAN either to send certain types of messages across the network or to manage the intervals during which the stations contend for the transmission medium. Figure 8.3 illustrates the actual times that each interframe space takes for each type of 802.11 technology.


Interframe spaces are measured in microseconds and are used to defer a station's access to the medium and to provide various levels of priority. On a wireless network, everything is synchronized and all stations and access points use standard amounts of time (spaces) to perform various tasks. Each node knows these spaces and uses them appropriately. A set of standard spaces is specified for DSSS, FHSS, and Infrared as you can see from Figure 8.3. By using these spaces, each node knows when and if it is supposed to perform a certain action on the network.

Short Interframe Space (SIFS)

SIFS is the shortest fixed interframe space. SIFS are time spaces before and after which the following types of messages are sent. The list below is not an exhaustive list.
  • RTS - Request-to-Send frame, used for reserving the medium by stations
  • CTS - Clear-to-Send frame, used as a response by access points to the RTS frame generated by a station in order to ensure all stations have stopped transmitting
  • ACK - Acknowledgement frame used for notifying sending stations that data arrived in readable format at the receiving station
SIFS provide the highest level of priority on a wireless LAN. The reason for SIFS having the highest priority is that stations constantly listen to the medium (carrier sense) awaiting a clear medium. Once the medium is clear, each station must wait a given amount of time (spacing) before proceeding with a transmission. The length of time a station must wait is determined by the function the station needs to perform. Each function on a wireless network falls into a spacing category. Tasks that are high priority fall into the SIFS category. If a station only has to wait a short period of time after the medium is clear to begin its transmissions, it would have priority over stations having to wait longer periods of time. SIFS is used for functions requiring a very short period of time, yet needing high priority in order to accomplish the goal.


Point Coordination Function Interframe Space (PIFS)

A PIFS interframe space is neither the shortest nor longest fixed interframe space, so it gets more priority than DIFS and less than SIFS. Access points use a PIFS interframe space only when the network is in point coordination function mode, which is manually configured by the administrator. PIFS are shorter in duration than DIFS (see Figure 8.3), so the access point will always win control of the medium before other contending stations in distributed coordination function (DCF) mode. PCF only works with DCF, not as a stand-alone operational mode so that, once the access point is finished polling, other stations can continue to contend for the transmission medium using DCF mode.


Distributed Coordination Function Interframe Space (DIFS)

DIFS is the longest fixed interframe space and is used by default on all 802.11-compliant stations that are using the distributed coordination function. Each station on the network using DCF mode is required to wait until DIFS has expired before any station can contend for the network. All stations operating according to DCF use DIFS for transmitting data frames and management frames. This spacing makes the transmission of these frames lower priority than PCF-based transmissions. Instead of all stations assuming the medium is clear and arbitrarily beginning transmissions simultaneously after DIFS (which would cause collisions), each station uses a random back off algorithm to determine how long to wait before sending its data.

The period of time directly following DIFS is referred to as the contention period (CP). All stations in DCF mode use the random back off algorithm during the contention period. During the random back off process, a station chooses a random number and multiplies it by the slot time to get the length of time to wait. The stations count down these slot times one by one, performing a clear channel assessment (CCA) after each slot time to see if the medium is busy. Whichever station's random back off time expires first, that station does a CCA, and provided the medium is clear, it then begins transmission.

Once the first station has begun transmissions all other stations sense that the medium is busy, and remember the remaining amount of their random back off time from the previous CP. This remaining amount of time is used in lieu of picking another random number during the next CP. This process assures fair access to the medium among all stations.

Once the random back off period is over, the transmitting station sends its data and receives back the ACK from the receiving station. This entire process then repeats. It stands to reason that most stations will chose different random numbers, eliminating most collisions. However, it is important to remember that collisions do happen on wireless LANs, but they cannot directly be detected. Collisions are assumed by the fact that the ACK is not received back from the destination station.

The Communications Process

When you consider the PIFS process described above, it may seem as though the access point would always have control over the medium, since the access point does not have to wait for DIFS, but the stations do. This would be true, except for the existence of what is called a superframe. A superframe is a period of time, and it consists of three parts:

1. Beacon
2. Contention Free Period (CFP)
3. Contention Period (CP)

A diagram of the superframe is shown in Figure 8.4. The purpose of the superframe is to allow peaceful, fair co-existence between PCF and DCF mode clients on the network, allowing QoS for some, but not for others.

Again, remember that PIFS, and hence the superframe, only occurs when

1. The network is in point coordination function mode
2. The access point has been configured to do polling
3. The wireless clients have been configured to announce to the access point that they are pollable


Therefore, if we start from a hypothetical beginning point on a network that has the access point configured for PCF mode, and the some of the clients are configured for polling, the process is as follows.

1. The access point broadcasts a beacon.

2. During the contention free period, the access point polls stations to see if any station needs to send data.

3. If a station needs to send data, it sends one frame to the access point in response to the access point’s poll

4. If a station does not need to send data, it returns a null frame to the access point in response to the access point’s poll

5. Polling continues throughout the contention free period

6. Once the contention free period ends and the contention period begins, the access point can no longer poll stations. During the contention period, stations using DCF mode contend for the medium and the access point uses DCF mode.

7. The superframe ends with the end of the CP, and a new one begins with the following CFP.

Think of the CFP as using a "controlled access policy" and the CP as using a "random access policy." During the CFP, the access point is in complete control of all functions on the wireless network, whereas during the CP, stations arbitrate and randomly gain control over the medium. The access point, in PCF mode, does not have to wait for the DIFS to expire, but rather uses the PIFS, which is shorter than the DIFS, in order to capture the medium before any client using DCF mode does. Since the access point captures the medium and begins polling transmissions during the CFP, the DCF clients sense the medium as being busy and wait to transmit. After the CFP the CP begins, during which all stations using DCF mode may contend for the medium and the access point switches to DCF mode.

Figure 8.5 illustrates a short timeline for a wireless LAN using DCF and PCF modes.


The process is somewhat simpler when a wireless LAN is only in DCF mode, because there is no polling and, hence, no superframe. This process is as follows:

1. Stations wait for DIFS to expire

2. During the CP, which immediately follows DIFS, stations calculate their random back off time based on a random number multiplied by a slot time

3. Stations tick down their random time with each passing slot time, checking the medium (CCA) at the end of each slot time. The station with the shortest time gains control of the medium first.

4. A station sends its data.

5. The receiving station receives the data and waits a SIFS before returning an ACK back to the station that transmitted the data.

6. The transmitting station receives the ACK and the process starts over from the beginning with a new DIFS.

No comments: