# CoSimulating Communication Networks and Electrical System for Performance Evaluation in Smart Grid
## 3 OOCoSim Design and Implementation
### OPNET and OpenDSS  
We first briefly introduce OPNET and OpenDSS. Basically, the cosimulation in the smart grid strongly depends on legacy simulation tools since extending an individual simulator to emulate the opposite part of the simulation model can cause unrealistic simplifications and assumptions as we mentioned in Section 1. Therefore, it is importantly considered in OOCoSim design how the interfaces of compromising simulators should be provided to the application model. In this context, we will focus on the functionality, which provides the way of accessing to each simulator for external programs and the reason of why we chose OPNET and OpenDSS as network and power simulators. OPNET is a widely used GUI based network simulator which allows event-driven packet-level simulation. The most novel characteristic of OPNET is the hierarchical structure of a network element--node model and a process model. A node model represents a network device, and each node model consists of process models which is a model of a network protocol. Due to its hierarchical structure, we can easily implement new functionalities and modify existing protocols in OPNET. In addition, OPNET simulation can cooperate with any external program through message and data exchanges by External System External System Module (ESM) and External Interface (EI). By inserting a new state which employs EIs to exchange messages, OPNET can easily communicate with the external program. OpenDSS is a comprehensive electrical system simulation tool for utility distribution systems which supports many new types of simulations that are designed to meet future needs. The most notable uniqueness of OpenDSS is that it provides sequential-time simulation. OpenDSS provides the functionality by the Quasi-static solution mode and Monitor and Energy Meter objects can generate time-series results from the simulation. Another notable uniqueness of OpenDSS is script based simulation. Engineers can design various simulation scenario through the script. The script consists of DSS commands (such as Compile and Solve) and DSS elements (such as Circuit, Transformer, Linecode and Load) [22]. Finally, various analyses can be performed by creating scripts and invoking the scripts from another program through COM interface [23], which enables the external program running a DSS script and generating the analysis results. Choosing OPNET and OpenDSS for smart grid cosimulation does not have much advantages in perspective of integration, since other network simulators, such as NS-2, NS-3, and OMNET++,and power system simulator like PSLF also have the functionality of external interface. However, each simulator has different merits for the smart grid cosimulation. By using OPNET, smart grid applications which consider diverse underlying network technologies can be precisely modeled and simulated, since it provides much more number of protocol models and system architectures than other simulators. Especially, OPNET has high performance with its realistic physical layer model, such as mobility, noise, and interference model [24]. In smart grid environment, wireless channel conditions are more severe than those of typical wireless environment [12; 13] due to the electromagnetic interference generated by electrical equipments, densely deployed obstacles, etc. The physical layer of OPNET is elaborately modeled with 14 pipeline stages, and each stage can be easily modified and implemented for the desired configuration. Therefore, OPNET can reflect the influence of physical layer characteristics of smart grid environment better than other typical network simulators, so much more realistic simulations can be achieved. Although other simulators such as NS-2 and NS-3 also have well-defined transport layer and application protocol models, they have limited and simplified models of physical layer characteristics [25]. Therefore, OOCoSim employs OPNET as a network-side simulator. As for OpenDSS, it provides distribution domain specific functionalities which OOCoSim focuses on.