# Software Defined Networking Architecture for Energy Transaction in Smart Microgrid Systems
## 5 Simulations and Results
### IPsec Encryption Simulation  
There is a security vulnerability in the SDN architecture due to the universal network visibility over public networks such as the Internet. In addition, IPsec encryption hides all the information in an encrypted packet, making it extremely difficult to use. An IPsec tunnel between the simulation router and the Mininet network emulator is used for the security simulation. The VPN tunnel is established from the network emulator VM as the VPN client, and the simulator router as the VPN. A keyed hash algorithm called HMAC SHA1 is used to configure the IPsec tunnel in the simulation. Packet captures are performed using the Wireshark packet analysis tool at both the network and SDN controller emulators. The objective of the simulation is to show the comparison of the nonencrypted information flow at the controller emulator to the encrypted information flow at the network emulator. A nonencrypted packet shows the original IP packet header and data, which includes the source and destination IP address of the controller and SDN node, SDN protocol, SDN source and destination port, and the raw data. Figure 17 shows an encrypted packet that shows the IP packet header and data. However, the encrypted IP packet's header is the VPN tunnel information. The data in the packet is the original IP packet that is encapsulated and encrypted. Therefore, the original IP packet is not visible to the network nodes between the IPsec tunnel endpoints. The IPsec encryption improves the security of the SDN architecture over a public wide area network (WAN). Each SDN node needs to establish an IPsec tunnel to each other to ensure the security of the SDN architecture. Figure 16: Redundant path simulation failover debug messages. Figure 17: Simulated encrypted IP packet. Application of Developed SDN Architecture to South African Public Electricity Provider as a Case Study  
Telkom is a South African wired and wireless telecommunications provider with nationwide network coverage [38]. In a typical SDN architecture for this applied design scenario, the SDN controller will be hosted in Johannesburg with the Smart Microgrid SDN Node in Cape Town and Prosumer SDN Node in Piketberg. Figure 18 shows the network coverage of Telkom with network exchange points which is represented by the dark points on the map. It also shows the geographical map of the node locations and the data path between the SDN controller and the SDN nodes. All the nodes are connected to the fixed line network of Telkom using a layer 2 connection on a dedicated virtual local access network (VLAN). The data paths between the SDN controller and the SDN nodes establish over multiple network nodes. The prosumer and smart microgrid are connected to the Eskom electrical grid, supplementing the energy supply to the national power grid. Both are participants in the transactive energy process. The unencrypted data path between the SDN controller and the SDN node at the smart microgrid establishes over 11 network nodes. The unencrypted data path between the SDN controller and the SDN node at the prosumer establishes over 16 network nodes. Traffic in a typical SDN architecture flow through the SDN controller, meaning the total number of network nodes between the prosumer SDN and the smart microgrid equates to 27. The data path availability is calculated using Equation (5), and the availability of 99.99% is better than a physical network element in a traditional business network [36],  
* \(A_{T}=\mathrm{e}^{-27(1-0.9999)}\)  
The data path availability equates to 99.73%. Unfortunately, this also means the data path will experience outages of 120 min per month. By implementing the optimized SDN architecture for TESMS, the following changes are performed to the architecture,  
Figure 18: Data path between the SDN nodes of a smart microgrid and consumer. The SDN controller is decentralized, and the SDN controller for the region is placed at the hosting facility in Cape Town, Stellenbosch. As a result, the number of network nodes is reduced.