- "Do I Know This Already?" Quiz
- Foundation Topics
- Exam Preparation Tasks
Wireless Frame Transmission
When people talk about wireless networks, they often say that they are just like wired 802.3 LANs. This is actually incorrect, aside from the fact that they use MAC addresses. Wireless LANs use the 802.11 frame structure, and you can encounter multiple types of frames. To get a better understanding, you can begin by learning the three types of wireless frames. Once you are familiar with the three types of wireless frames, you can further your knowledge by taking a deeper look at interframe spacing (IFS) and why it is necessary.
Wireless Frame Types
Wireless LANs come in three frame types:
- Management frames: Used for joining and leaving a wireless cell. Management frame types include association request, association response, and reassociation request, just to name a few. (See Table 7-2 for a complete list.)
- Control frames: Used to acknowledge when data frames are received.
- Data frames: Frames that contain data.
Table 7-2. Frame Types Table
Request to Send (RTS)
Clear to Send (CTS)
Contention Free End (CF-End)
Contention Free End + Acknowledgment (CF-End +ACK)
Announcement traffic indication message (ATIM)
Each frame type merits its own discussion to follow.
Now that you have an idea of what frames are used, it is helpful to see how these frames are sent. For this, you need to understand a few more terms that might be new to you. Because all the terms meld together to some degree, they are explained in context throughout the next section.
Sending a Frame
Recall that wireless networks are half-duplex networks. If more than one device were to send at the same time, a collision would result. If a collision occurs, the data from both senders would be unreadable and would need to be resent. This is a waste of time and resources. To overcome this issue, wireless networks use multiple steps to access the network. Wireless LANs use carrier sense multiple access collision avoidance (CSMA/CA), which is similar to the way 802.3 LANs work. The carrier sense part means that a station has to determine if anyone else is sending. This is done with clear channel assessment (CCA), and what it means is that you listen. You can, however, run into an issue where two devices cannot hear each other. This is called the hidden node problem. This issue is overcome using virtual carrier sense (VCS). The medium is not considered available until both the physical and virtual carrier report that it is clear.
Each station must also observe IFS. IFS is a period that a station has to wait before it can send. Not only does IFS ensure that the medium is clear, but it ensures that frames are not sent so close together that they are misinterpreted. The types of IFS periods are as follows:
- Short interframe space (SIFS): For higher priority and used for ACKs, among other things
- Point-coordination interframe space (PIFS): Used when an AP is going to control the network
- Distributed-coordination interframe space (DIFS): Used for data frames and is the normal spacing between frames
Each of these has a specific purpose as defined by the IEEE.
SIFS is used when you must send a frame quickly. For example, when a data frame is sent and must be acknowledged (ACK), the ACK should be sent before another station sends other data. Data frames use DIFS. The time value of DIFS is longer than SIFS, so the SIFS would preempt DIFS because it has a higher priority.
Figure 7-1 illustrates the transmission of a frame. In the figure, Station A wants to send a frame. As the process goes, both the physical and virtual carrier need to be free. This means the client has to listen. To listen, the client chooses a random number and begins a countdown process, called a backoff timer. The speed at which the countdown occurs is called a slottime and is different for 802.11a, b, and g.
Figure 7-1 Sending a Frame: Part 1
It works like this:
- Station A selects the random timer value of 29.
- Station A starts counting at 29, 28, 27, 26, and so on. While Station A is counting down, it is also listening for whether anyone else is sending a frame.
- When the timer is at 18, Station B sends a frame, having a duration value in the header of 45.
- The duration of 45 that is in the header of the frame sent by Station B is called a network allocation vector (NAV) and is a reservation of the medium that includes the amount of time to send its frame, wait for the SIFS, and then receive an ACK from the AP.
- Station A adds 45 to the 18 that is left and continues counting down, 63, 62, 61, and so on. The total time that Station A waits before sending is called the contention window.
- After the timer on Station A reaches 0, it can send its frame as illustrated in Figure 7-2. At this point, the medium should be clear.
Figure 7-2 Sending a Frame: Part 2
If Station A sends but fails, it resets the backoff timer to a new random number and counts down again. The backoff timer gets larger as the frames fail in transmission. For example, the initial timer can be any number between 0 and 31. After the first failure, it jumps to any number between 0 and 127. It doubles for the next failure, then again, then again.
This entire process is known as the distributed coordination function (DCF). This simply means that each station is responsible for coordinating the sending of its data. The alternative to DCF is point coordination function (PCF), which means the AP is responsible for coordination of data transmission.
If the frame is successful, an ACK must be sent. The ACK uses the SIFS timer value to make sure it is sent quickly. Some amount of silence between frames is natural. The SIFS is the shortest period of silence. The NAV reserves this time. A normal silence time is the DIFS. Again, the ACK uses SIFS because you want it to be sent immediately. The station that sends the ACK waits for the SIFS and then ACKs with the duration of 0. This is how the end of the transmission is indicated.
Wireless Frame Headers
Figure 7-3 shows a wireless frame. Each of the fields has been expanded so you can see it more clearly. It is beneficial to understand these fields and how they play a part in the sending and receiving of wireless frames.
Figure 7-3 Wireless Frame Capture 1
As you can see from the capture, a preamble is present, denoted with the Type/Subtype label, followed by a Frame Control field. The preamble can be anywhere from 76 to 156 bytes. The Frame Control field is 2 bytes. It tells what type of frame it is, represented with 2 bytes. In this case, it is a data frame.
The Flags field indicates that the frame is traveling from the DS, not toward the DS. This is represented with a single byte. In the figure, this is a frame that is coming back to the client.
Following the Flags field is a Duration field. The Duration field indicates how long the medium is reserved while this frame is being sent and includes time for an ACK to be sent in reply. The idea behind this process is to prevent collisions.
A wireless frame can have up to three MAC addresses following the Duration field. This is a total of 18 bytes. In the figure, you can see the following:
- Destination MAC address
- BSS ID, which is also a MAC address
- Source MAC address
The source address (SA) is the station that sent the frame. The transmitter address (TA) is the address of the station that is emitting the frame; in Figure 7-3, a TA is not shown. In some scenarios, a TA might vary from an SA. For example, if a wireless frame is relayed through a repeater, the TA would be the radio of the repeater, and the SA would be the sending device. The destination address (DA) is the final destination of the frame; in this case, it is the wireless client.
The Sequence Control field (2 bytes) indicates whether the frame is a fragment. Again, in Figure 7-3, the Sequence Control field is indicated with Fragment Number and shows that this is number 0, or the last fragment. This leads to an interesting topic—fragmentation. When and why would you fragment on a wireless network? The answer is that a wireless frame is, by default, 2346 bytes long. Considering that the frame is going to move to or from an Ethernet distribution that has a maximum transmission unit (MTU) of 1500 bytes and can see frames as big as 1518 bytes or slightly larger (depending on the trunking used), the frames on the wireless side are too big and need to be chopped up.
Optionally, you can see a fourth MAC address, a receiving address (RA), which is the address of the direct station that this frame is sent to; however, this is not seen in the figure. The frame could be relayed through a wireless bridge or repeater. This additional address adds six more bytes.
Finally, the frame body follows (not seen in the figure). It can be up to 2306 bytes and references only two MAC addresses, just like any other L2 frame. The frame body is encapsulated inside the last header shown in the figure.
In addition, you might see a 4-byte frame check sequence (FCS) following the L2 frame. This is common but not required.
For the most part, all frames are going to have the same type of header. The difference is in the body of the frame. The body is more specific and indicates what the frame is all about. Table 7-2 shows some frame types.
Management frames, as their name indicates, are used to manage the connection. In looking at a frame capture, the Type field indicates Management, and the subtype tells what kind of management frame it is. As Table 7-2 listed, there are 11 Management frame types. There are some more-often seen frames that you should be familiar with. These frame types are discussed in the following sections.
Beacons and Probes
Figure 7-4 shows a management frame with a subtype of 8. This indicates that it is a beacon frame, which is used to help clients find the network.
Figure 7-4 Management Frame Capture
Figure 7-5 shows a sample network where the AP is sending a beacon frame.
Figure 7-5 Sample Network Using Beacon Frames
When the client hears the beacon frame, it can learn a great deal of information about the cell. In Figure 7-6, you can see that the beacon frame includes a timestamp that gives a reference time for the cell, the beacon interval, and a field called Capability Information, which provides specifics for this cell. The Capability Information field includes information regarding power save mode, authentication, and preamble information.
Figure 7-6 Beacon Frame Details
A beacon frame also includes the SSIDs that the AP supports, the rates that are supported, and six fields called Parameter Set that indicate modulation methods and such.
Another field you will find is Traffic Indication Map (TIM), which indicates whether the AP is buffering traffic for clients in power-save mode.
When a client sees a beacon frame, it should be able to use that information to determine if it is able to connect to the wireless Cell. Chapter 16, “Wireless Clients,” covers the process of how a client searches channels and displays connection capability information. For now, just understand that the beacon frame allows a client to passively scan a network.
Sometimes, however, you do not want to passively scan a network. Perhaps you know exactly what cell you want to connect to. In this situation, you can actively scan a network to determine if the cell you are looking for is accessible. When a client actively scans a network, it uses probe request and probe response messages. Figure 7-7 shows a client actively scanning.
Figure 7-7 Active Scanning
As you can tell in the figure, the client is looking for a wireless cell with the SSID of “Carroll.” This client sends a probe request and the AP, upon receiving the probe request, issues a probe response. The probe response is similar to the beacon frame, including capability information, authentication information, and so on. The difference is that a beacon frame is sent frequently and a probe response is sent only in response to a probe request.
Connecting After a Probe or Beacon
After a client has located an AP and understands the capabilities, it tries to connect using an authentication frame. This frame has information about the algorithm used to authenticate, a number for the authentication transaction, and information on whether authentication has succeeded or failed.
One thing to note is that authentication can be Open, meaning that no authentication algorithm such as WEP is being used. The only reason an authentication message is used is to indicate that the client has the capability to connect. In Figure 7-8, the client is sending an authentication request, and the AP is sending an authentication response. Upon authentication, the client sends an association request, and the AP responds with an association response.
Figure 7-8 Authentications and Association
Leaving and Returning
When a client is connected to a wireless cell, either the client or the AP can leave the connection by sending a deauthentication message. The deauthentication message has information in the body as to why it is leaving. In addition, a client can send a disassociation message, which disassociates the client from the cell but keeps the client authenticated. The next time a client comes back to the wireless cell, it can simply send a reassociation message, and the AP would send a reassociation response—eliminating the need for authentication to reconnect to the cell.
One of the most common control frames is the ACK, which helps the connection by acknowledging receipt of frames. Other control frames include the request to send (RTS) and clear to send (CTS), which were discussed in Chapter 6, “Overview of the 802.11 WLAN Protocols.” The ACK, RTS, and CTS frames are used in DCF mode.
The control frames that are used in PCF mode are as follows:
- Contention Free End (CF+End)
- Contention Free End Ack (CF +end_ack_)
- CF Ack+CF Poll
These frames are also discussed in the paragraphs to follow.
When an AP takes control of a network and shifts from DCF mode (every station for itself) to PCF mode (the AP is responsible for everyone sending), the AP lets all stations know that they should stop sending by issuing a beacon frame with a duration of 32768. When this happens and everyone stops sending, there is no longer a contention for the medium, because the AP is managing it. This is called a contention free window (CFW). The AP then sends poll messages to each client asking if they have anything to send. This is called a CF-Poll, as illustrated in Figure 7-9.
Figure 7-9 CF-Poll in PCF Mode
Figure 7-10 illustrates how the AP might control communication. Here, the AP has data to deliver to the client (DATA). It allows the client to send data (CF-Poll) and acknowledges receipt of the client data (CF-ACK).
Figure 7-10 Data + CF-Poll + CF-ACK
Other variations exist, but from these examples you should have a decent understanding of PCF operation.
Power Save Mode and Frame Types
Another mode of operation mostly seen on laptops is called power save mode. Looking back at Table 7-2, you can see that a control frame is related to a power save (PS-Poll). In a power save, a client notifies an AP that it is falling asleep by using a null function frame. The client wakes up after a certain period of time, during which the AP buffers any traffic for it. When the client wakes up and sees a beacon frame with the TIM listing that it has frames buffered, the client sends a PS-Poll requesting the data.
One final item to discuss before putting it together is frame speed. The AP advertises mandatory speeds at which a client must be able to operate. You can use other speeds, but they are not mandatory. For example, 24 Mbps might be mandatory, but an AP might also be capable of 54 Mbps. A client must support 24 Mbps but is allowed to use the best rate possible, in this example 54 Mbps. When data is sent at one rate, the ACK is always sent at 1 data rate lower.
A Wireless Connection
Using Figures 7-11 through 7-18, you can step through a simple discovery and association process.
- The AP sends beacons every 2 seconds, as shown in Figure 7-11.
Figure 7-11 AP Beacons
- Client A is passively scanning and hears the beacon. This enables the client to determine whether it can connect. You can see this in Figure 7-12.
Figure 7-12 Passive Scanning
- A new client (Client B) arrives. Client B is already configured to look for the AP, so instead of passive scanning, it sends a probe request for the specific AP (see Figure 7-13).
Figure 7-13 Active Scanning Probe Request
- The AP sends a probe response, seen in Figure 7-14, which is similar to a beacon. This lets Client B determine if it can connect.
Figure 7-14 Probe Response
- From this point on, the process would be the same for Client A and Client B. In Figure 7-15, Client B sends an authentication request.
Figure 7-15 Association Request and Response
- Also seen in Figure 7-15, the AP returns an authentication response to the client.
- The client then sends an association request, as seen in Figure 7-16.
Figure 7-16 Association Request and Response
- Now the AP sends an association response, also seen in Figure 7-16.
- When the client wants to send, it uses an RTS, assuming this is a mixed b/g cell. The RTS includes the duration, as you can see in Figure 7-17.
Figure 7-17 RTS/CTS
- Also seen in Figure 7-17, the AP returns a CTS.
- The client sends the data (see Figure 7-17).
- The AP sends an ACK after each frame is received (Figure 7-17).
- In Figure 7-18, the client sends a disassociation message.
Figure 7-18 Reassociation
- The AP replies with a disassociation response (Figure 7-18).
- The client returns and sends a reassociation message (Figure 7-18).
- The AP responds with a reassociation response (Figure 7-18).
Again, this process has other variations, but this should give you a pretty good understanding of how to manage a connection.