  In this paper, we analyze the coexistence of a primary and a secondary
(cognitive) network when both networks use the IEEE 802.11 based distributed
coordination function for medium access control. Specifically, we consider the
problem of channel capture by a secondary network that uses spectrum sensing to
determine the availability of the channel, and its impact on the primary
throughput. We integrate the notion of transmission slots in Bianchi's Markov
model with the physical time slots, to derive the transmission probability of
the secondary network as a function of its scan duration. This is used to
obtain analytical expressions for the throughput achievable by the primary and
secondary networks. Our analysis considers both saturated and unsaturated
networks. By performing a numerical search, the secondary network parameters
are selected to maximize its throughput for a given level of protection of the
primary network throughput. The theoretical expressions are validated using
extensive simulations carried out in the Network Simulator 2. Our results
provide critical insights into the performance and robustness of different
schemes for medium access by the secondary network. In particular, we find that
the channel captures by the secondary network does not significantly impact the
primary throughput, and that simply increasing the secondary contention window
size is only marginally inferior to silent-period based methods in terms of its
throughput performance.
