OLD | NEW |
(Empty) | |
| 1 PageBreak |
| 2 |
| 3 Low-Rate Wireless Personal Area Network (LR-WPAN) |
| 4 ------------------------------------------------- |
| 5 |
| 6 This chapter describes the implementation of ns-3 models for the |
| 7 low-rate, wireless personal area network (LR-WPAN) as specified by |
| 8 IEEE standard 802.15.4 (2006). |
| 9 |
| 10 Model Description |
| 11 ***************** |
| 12 |
| 13 The source code for the lr-wpan module lives in the directory ``src/lr-wpan``. |
| 14 |
| 15 Design |
| 16 ====== |
| 17 |
| 18 The model design closely follows the standard from an architectural standpoint. |
| 19 |
| 20 .. _fig-lr-wpan-arch: |
| 21 |
| 22 .. figure:: figures/lr-wpan-arch.* |
| 23 |
| 24 Architecture and scope of lr-wpan models |
| 25 |
| 26 The grey areas in the figure (adapted from Fig 3. of IEEE Std. 802.15.4-2006) |
| 27 show the scope of the model. |
| 28 |
| 29 The Spectrum NetDevice from Nicola Baldo is the basis for the implementation. |
| 30 |
| 31 The implementation also plans to borrow from the ns-2 models developed by· |
| 32 Zheng and Lee in the future. |
| 33 |
| 34 APIs |
| 35 #### |
| 36 |
| 37 The APIs closely follow the standard, adapted for ns-3 naming conventions |
| 38 and idioms. The APIs are organized around the concept of service primitives |
| 39 as shown in the following figure adapted from Figure 14 of· |
| 40 IEEE Std. 802.15.4-2006. |
| 41 |
| 42 .. _fig-lr-wpan-primitives: |
| 43 |
| 44 .. figure:: figures/lr-wpan-primitives.* |
| 45 |
| 46 Service primitives |
| 47 |
| 48 The APIs are organized around four conceptual services and service access |
| 49 points (SAP): |
| 50 |
| 51 * MAC data service (MCPS) |
| 52 * MAC management service (MLME) |
| 53 * PHY data service (PD) |
| 54 * PHY management service (PLME) |
| 55 |
| 56 In general, primitives are standardized as follows (e.g. Sec 7.1.1.1.1 |
| 57 of IEEE 802.15.4-2006)::: |
| 58 |
| 59 MCPS-DATA.request ( |
| 60 SrcAddrMode, |
| 61 DstAddrMode, |
| 62 DstPANId, |
| 63 DstAddr, |
| 64 msduLength, |
| 65 msdu, |
| 66 msduHandle, |
| 67 TxOptions, |
| 68 SecurityLevel, |
| 69 KeyIdMode, |
| 70 KeySource, |
| 71 KeyIndex |
| 72 ) |
| 73 |
| 74 This maps to ns-3 classes and methods such as::: |
| 75 |
| 76 struct McpsDataRequestParameters |
| 77 { |
| 78 uint8_t m_srcAddrMode; |
| 79 uint8_t m_dstAddrMode; |
| 80 ... |
| 81 }; |
| 82 |
| 83 void |
| 84 LrWpanMac::McpsDataRequest (McpsDataRequestParameters params) |
| 85 { |
| 86 ... |
| 87 } |
| 88 |
| 89 MAC |
| 90 ### |
| 91 |
| 92 The MAC at present implements the unslotted CSMA/CA variant, without beaconing. |
| 93 |
| 94 The implemented MAC is similar to Contiki's NullMAC, i.e., a MAC without sleep |
| 95 features. The radio is assiumed to be always active (receiving or transmitting). |
| 96 Moreover, frame reception is disabled while performing the CCA. |
| 97 |
| 98 The main API supported is the data transfer API· |
| 99 (McpsDataRequest/Indication/Confirm). CSMA/CA according to Stc 802.15.4-2006, |
| 100 section 7.5.1.4 is supported. Frame reception and rejection |
| 101 according to Std 802.15.4-2006, section 7.5.6.2 is supported. Various |
| 102 trace sources are supported, and trace sources can be hooked to sinks. |
| 103 |
| 104 PHY |
| 105 ### |
| 106 |
| 107 The physical layer components consist of a Phy model, an error rate model,· |
| 108 and a loss model. The error rate model presently models the error rate· |
| 109 for IEEE 802.15.4 2.4 GHz AWGN channel for OQPSK; the model description can· |
| 110 be found in IEEE Std 802.15.4-2006, section E.4.1.7. The Phy model is· |
| 111 based on SpectrumPhy and it follows specification described in section 6· |
| 112 of IEEE Std 802.15.4-2006. It models PHY service specifications, PPDU· |
| 113 formats, PHY constants and PIB attributes. It currently only supports· |
| 114 the transmit power spectral density mask specified in 2.4 GHz per section· |
| 115 6.5.3.1. The noise power density assumes uniformly distributed thermal· |
| 116 noise across the frequency bands. The loss model can fully utilize all· |
| 117 existing simple (non-spectrum phy) loss models. The Phy model uses· |
| 118 the existing single spectrum channel model. |
| 119 |
| 120 NetDevice |
| 121 ######### |
| 122 |
| 123 Although it is expected that other technology profiles (such as· |
| 124 6LoWPAN and ZigBee) will write their own NetDevice classes, a basic |
| 125 LrWpanNetDevice is provided, which encapsulates the common operations |
| 126 of creating a generic LrWpan device and hooking things together. |
| 127 |
| 128 Scope and Limitations |
| 129 ===================== |
| 130 |
| 131 Future versions of this document will contain a PICS proforma similar to |
| 132 Appendix D of IEEE 802.15.4-2006. The current emphasis is on the· |
| 133 unslotted mode of 802.15.4 operation for use in Zigbee, and the scope |
| 134 is limited to enabling a single mode (CSMA/CA) with basic data transfer |
| 135 capabilities. |
| 136 |
| 137 References |
| 138 ========== |
| 139 |
| 140 * Wireless Medium Access Control (MAC) and Physical Layer (PHY) Specifications f
or Low-Rate Wireless Personal Area Networks (WPANs), IEEE Computer Society, IEEE
Std 802.15.4-2006, 8 September 2006. |
| 141 * J. Zheng and Myung J. Lee, "A comprehensive performance study of IEEE 802.15.4
," Sensor Network Operations, IEEE Press, Wiley Interscience, Chapter 4, pp. 218
-237, 2006. |
| 142 |
| 143 Usage |
| 144 ***** |
| 145 |
| 146 Enabling lr-wpan |
| 147 ================ |
| 148 |
| 149 Add ``lr-wpan`` to the list of modules built with ns-3. |
| 150 |
| 151 Helper |
| 152 ====== |
| 153 |
| 154 The helper is patterned after other device helpers. In particular, |
| 155 tracing (ascii and pcap) is enabled similarly, and enabling of all |
| 156 lr-wpan log components is performed similarly. Use of the helper |
| 157 is exemplified in ``examples/lr-wpan-data.cc``. For ascii tracing, |
| 158 the transmit and receive traces are hooked at the Mac layer. |
| 159 |
| 160 The default propagation loss model added to the channel, when this helper |
| 161 is used, is the LogDistancePropagationLossModel. |
| 162 |
| 163 Examples |
| 164 ======== |
| 165 |
| 166 The following examples have been written, which can be found in ``src/lr-wpan/ex
amples/``: |
| 167 |
| 168 * ``lr-wpan-data.cc``: A simple example showing end-to-end data transfer. |
| 169 * ``lr-wpan-error-model-plot.cc``: An example to test the phy. |
| 170 * ``lr-wpan-error-distance-plot.cc``: An example to plot variations of the pack
et success ratio as a function of distance. |
| 171 * ``lr-wpan-packet-print.cc``: An example to print out the MAC header fields. |
| 172 * ``lr-wpan-phy-test.cc``: An example to test the phy. |
| 173 |
| 174 In particular, the module enables a very simplified end-to-end data |
| 175 transfer scenario, implemented in ``lr-wpan-data.cc``. The figure |
| 176 shows a sequence of events that are triggered when the MAC receives |
| 177 a DataRequest from the higher layer. It invokes a Clear Channel |
| 178 Assessment (CCA) from the PHY, and if successful, sends the frame |
| 179 down to the PHY where it is transmitted over the channel and results |
| 180 in a DataIndication on the peer node. |
| 181 ·· |
| 182 .. _fig-lr-wpan-data: |
| 183 |
| 184 .. figure:: figures/lr-wpan-data-example.* |
| 185 |
| 186 Data example for simple LR-WPAN data transfer end-to-end |
| 187 |
| 188 The example ``lr-wpan-error-distance-plot.cc`` plots the packet success |
| 189 ratio (PSR) as a function of distance, using the default LogDistance |
| 190 propagation loss model and the 802.15.4 error model. The channel (default 11), |
| 191 packet size (default 20 bytes) and transmit power (default 0 dBm) can be |
| 192 varied by command line arguments. The program outputs a file named |
| 193 ``802.15.4-psr-distance.plt``. Loading this file into gnuplot yields |
| 194 a file ``802.15.4-psr-distance.eps``, which can be converted to pdf or |
| 195 other formats. The default output is shown below.· |
| 196 |
| 197 .. _fig-802-15-4-psr-distance: |
| 198 |
| 199 .. figure:: figures/802-15-4-psr-distance.* |
| 200 |
| 201 Default output of the program ``lr-wpan-error-distance-plot.cc`` |
| 202 |
| 203 Tests |
| 204 ===== |
| 205 |
| 206 The following tests have been written, which can be found in ``src/lr-wpan/tests
/``: |
| 207 |
| 208 * ``lr-wpan-error-model-test.cc``: Check that the error model gives predictable
values. |
| 209 * ``lr-wpan-packet-test.cc``: Test the 802.15.4 MAC header/trailer classes |
| 210 * ``lr-wpan-pd-plme-sap-test.cc``: Test the PLME and PD SAP per IEEE 802.15.4 |
| 211 * ``lr-wpan-spectrum-value-helper-test.cc``: Test that the conversion between p
ower (expressed as a scalar quantity) and spectral power, and back again, falls
within a 25% tolerance across the range of possible channels and input powers. |
| 212 |
| 213 Validation |
| 214 ********** |
| 215 |
| 216 The model has not been validated against real hardware. The error model |
| 217 has been validated against the data in IEEE Std 802.15.4-2006,· |
| 218 section E.4.1.7 (Figure E.2). The MAC behavior (CSMA backoff) has been· |
| 219 validated by hand against expected behavior. The below plot is an example· |
| 220 of the error model validation and can be reproduced by running |
| 221 ``lr-wpan-error-model-plot.cc``: |
| 222 |
| 223 .. _fig-802-15-4-ber: |
| 224 |
| 225 .. figure:: figures/802-15-4-ber.* |
| 226 |
| 227 Default output of the program ``lr-wpan-error-model-plot.cc``· |
| 228 |
| 229 |
OLD | NEW |