# Experimental Study of 6 LoPLC for Home Energy Management Systems
## 4 Simulation Setup
### Model Description  
This section describes the HEMS models employed in this paper as illustrated in Figure 4. The figure shows a connected home in which the HEMS controller monitors and controls the local loads over the power lines. According to IETF RFC 2460 (pp. 23-24), the IPv6 specification requires that every link provides an Maximum Transmission Unit (MTU) of 1280 bytes or more. However,  
Figure 3: Constrained Application Protocol (CoAP) interface showing the monitoring (sensor) and control (lamp) windows. Figure 2: Protocol stack showing 6 LoPLC. in the event that a link cannot convey a full IPv6 packet in a single piece, fragmentation and reassembly mechanisms must be provided at a layer below IPv6. A simulation approach similar to [34] is employed, but with some modifications. Rather than MATLAB and OMNeT++ utilised in [34], we combine MATLAB (R2014a) with NS-3 (Version 21). NS-3 is a discrete-event network simulator packaged as C++ libraries for public use. As the mainstream NS-3 is devoid of the PLC module, we adopt the PLC module provided in [11] as described in Section 1. This power line channel model is based on TLT. Although the provided PLC module supports BPLC and NPLC, the BPLC spectrum is employed in this study. The power line is a time-, frequency- and location-variant channel [35]. Accordingly, impedance can be fixed, time dependent and/or frequency dependent. For simplicity, we employ fixed line impedance for the duration of monitoring and control events. IP is generally attractive in service-oriented networks such as HEMS because: (i) it aids the integration of existing appliances; (ii) it renders the overlaying network non-disruptive during architecture change; (iii) it is agnostic of the low layers' protocols; this helps to seamlessly integrate a variety of link layer technologies, and finally, it eliminates the use of the application gateway to translate across protocols, which promotes convergence and reduces the cost of installation. With IPv6 and User Datagram Protocol (UDP) as the network and transport layer protocols, respectively, the communication between the gateway and nodes is based on the client/server architecture, such that the CoAP client is installed on the HEMS controller and the server on the node (sensor or lamp). For example, to obtain the temperature, the HEMS controller sends a CoAP request to the CoAP server embedded in the sensor. The CoAP server then encodes the measured temperature into a CoAP message and returns it as the response to the controller. The test bed employed in this work was set up in a controlled environment such that the temperature polling and control signalling are triggered manually. These are necessary to allow deep visibility into system behaviour. In reality, temperature sensing would be automated based on a predefined schedule, while control would be on-demand. Although multicasting will be more beneficial in some HEMS applications (such as temperature sensing) such that a CoAP server monitors its attached sensor and sends out observations to all connected CoAP clients over IPv6 multicast,  
Figure 4: Home Energy Management System (HEMS) model showing various types of in-home loads. as group communication for CoAP (RFC 7390) is still experimental and has not attained RFC status, all communications in the simulation and test bed are based on unicast. With NS-3, upper layer protocols (IP, transport, application) can run on top of the PHY/MAC provided in the PLC module to investigate complete PLC networks. However, since the devices under evaluation are intended for low-rate application, an adaptation layer is included in the system model. As with the Hanadu kits, the adaptation layer is agnostic of the underlying PHY and MAC layers. It is designed to support any standard lower layer protocols. The 6 LoWPAN was developed for constrained wireless networks to support an MTU size of 127 bytes at the MAC layer; hence, a complete IPv6 packet of 1280 bytes cannot fit into a single LoWPAN frame.