## 4 Simulator Implementation for WirelessHART Simulations
### Physical Layer Technologies  
Typical wireless real-time mesh networks, such as WirelessHART and ISA100.11a by the International Society of Automation (ISA), adopt the physical layer of the IEEE 802.15.4-2006 standard [17] almost unchanged, complementing it with a proprietary Medium Access Control (MAC) scheme that is better suited for time-critical applications than the dominantly contention-based 802.15.4-2006 MAC. In addition to the legacy IEEE 802.15.4-2006 physical layer (PHY), we also briefly describe one recent addition to this family of standards, one element of the IEEE 802.15.4 g-2012 standard [6]. These two PHYs together represent typical PHY designs that our simulator should be able to model adequately: the former is a single-carrier, spread spectrum scheme, whereas the latter is a multi-carrier one, using error correcting codes. We consider these two PHYs in the case studies.  
The standard IEEE 802.15.4 PHY for the 2.4 GHz band uses the offset quadrature phase shift keying (OQPSK)-based spread spectrum modulation technique. The transmit signal flow is illustrated in Figure 4. Blocks of four input bits are mapped to 32-chip sequences, which are, in turn, mapped to an offset-QPSK constellation. The subsequent pulse shaping uses half-sine pulses, so the resulting scheme can also be thought of as a constant envelope minimum shift keying (MSK) modulation. Typical receivers demodulate the signal either as MSK or by employing a coherent OQPSK demodulator.  
The IEEE 802.15.4 g-based PHY: The 802.15.4 family of standards is being continuously amended with new PHYs for various specific purposes. Among these amendments, 802.15.4 g-2012 proposes three new PHYs primarily for wireless smart utility network purposes [6]. One of these new PHYs relies on multi-carrier transmission, orthogonal frequency division multiplex (OFDM). The techniques employed in this PHY make it a promising candidate for industrial environments, offering a significantly better spectrum efficiency than the original 802.15.4 PHY at comparable throughputs.  
OFDM finds widespread usage in state-of-the-art wireless systems. Its well-known advantages include resiliency against frequency selective fading effects in the channel, low-complexity frequency domain equalization, good spectrum efficiency and fair tolerance against jamming/interference. Even more important for CPS applications where a minimum performance should be attained even under adverse channel conditions, it can be shown that the variance of the instantaneous link capacity decreases in a multipath fading channel as the number of subcarriers is  
Figure 4: The IEEE 802.15.4 2.4-GHz PHY signal flow.  
increased [18]. This means that a well-designed OFDM-based system can ensure that an average channel capacity will be attained with high probability.  
The 802.15.4 g OFDM PHY mitigates typical channel impairments by the appropriate choice of modulation and channel coding schemes. OFDM with a cyclic prefix allows for low-complexity channel equalization, whereas convolutional coding contributes to the robustness of the PHY scheme. The PHY contains four \"options\" (parameter sets) that differ in the number of subcarriers and, hence, in the occupied bandwidth. These four options result in channel spacings from 200 kHz up to 1.2 MHz.  
In the following, we focus on 802.15.4 g Option 2. This option uses 48 data subcarriers. The nominal channel bandwidth is 800 kHz, which is by a factor of six less than in the original 802.15.4, making this PHY significantly more efficient in terms of spectrum utilization. Additionally, IEEE 802.15.4 g allows adaptive modulation and coding with up to six different modulation/coding schemes. With Option 2, QPSK modulation with a rate 1/2 code, called Modulation and Coding Scheme 3 (MCS3), yields to a data rate of 400 kbit/s. An additional degree of diversity can be introduced by frequency repetition coding.