| 2 | |
| 3 | The CSMAMAC is serves as the user-level MAC layer in [wiki:OFDMReferenceDesign reference design]. The basic algorithm is simple: |
| 4 | |
| 5 | * Do I have a packet to send? |
| 6 | * If the medium is idle, send it, enter a timeout, and wait for an acknowledgment from the destination |
| 7 | * If the medium is busy, enter a backoff period and wait for the medium to become idle |
| 8 | * Did I receive a data packet? |
| 9 | * If the packet pass checksum and is addressed to me, send an acknowledgment |
| 10 | * Did no know acknowledgment happen during a timeout period? |
| 11 | * If the maximum number of retransmits has not occurred, enter a backoff and try retransmitting |
| 12 | * If the maximum number of retransmits has occurred, drop the packet |
| 13 | * Did I wait through a backoff period? |
| 14 | * If the medium is busy, retransmit, increment the total number of resends, enter a timeout, and wait for an acknowledgment from the destination |
| 15 | * If the medium is busy, enter a backoff period and wait for the medium to become idle |
| 16 | |
| 17 | This simple algorithm encompasses much of the behavior in commercial 802.11 MAC/PHY chipsets. This algorithm lends itself nicely to a state diagram, which in turn, translates into C-code that can be executed in the PowerPC of the FPGA on WARP. |
| 18 | |
| 19 | |
| 20 | |