=Paper= {{Paper |id=Vol-2254/10000311 |storemode=property |title=Building the simulation model of a PLC network in the NS-3 environment |pdfUrl=https://ceur-ws.org/Vol-2254/10000311.pdf |volume=Vol-2254 |authors=Dmitriy Zykov,Anatoly Karassenko,Damir Urazayev,Yuri Myakochin }} ==Building the simulation model of a PLC network in the NS-3 environment== https://ceur-ws.org/Vol-2254/10000311.pdf
    Building the simulation model of a PLC network in the
                      NS-3 environment

                               Dmitriy Zykov1 , Anatoly Karassenko1 ,
                                Damir Urazayev1 , Yuri Myakochin2
     1
       Tomsk State University of Control Systems and Radioelectronics, 40 Lenina Prospect,
                                Tomsk, 364050, Russian Federation
         2
           Integrated Circuit Design Center Milandr, 5 Georgievskiy Prospect, Zelenograd,
                                Moscow, 124498, Russian Federation
                                        office@scp.tusur.ru




                                                        Abstract
                       The method of simulation modelling is widely used to study data trans-
                       mission protocols. The purpose of the work is to develop a model of the
                       PLC-network topology of a multistoried building and to demonstrate
                       the process of its construction with subsequent analysis of the opera-
                       tion, which is carried out by identifying the dependence of transmission
                       speed on the distance between the network node and the server and of
                       data transmission time on the packet size. In the process of modelling
                       the topology of the PLC network we build the functional diagram of
                       the network model, where the mathematical model of the channel is
                       presented as transfer functions that are calculated for the entire net-
                       work and for each node separately in the network simulator. The model
                       showed the inverse dependence of the data transfer rate on the distance
                       and the number of nodes in the network, and the direct dependence of
                       the time of data transfer from the host to the server on the packet size
                       during the process of simulating data transfer from the network nodes
                       to the server. The results obtained empirically in the NS-3 environment
                       correspond to the theoretical concepts of the object.
                       Keywords: Simulation Modelling, NS-3 Network Simulator, Topology,
                       PLC Network.




1    Introduction
The high cost of equipment for testing new protocols, solving architecture optimization problems, and selecting
certain topologies to apply in new network solutions is one of the common problems in the research of telecom-
munication systems [1]. That is why network simulation has become widespread. It is more convenient compared
to the construction of real networks, as it has low cost, requires less time and allows the repetition of different
experiments with different parameters, without affecting the accuracy and visibility of the result.

Copyright c by the paper’s authors. Copying permitted for private and academic purposes.
In: Marco Schaerf, Massimo Mecella, Drozdova Viktoria Igorevna, Kalmykov Igor Anatolievich (eds.): Proceedings of REMS 2018
– Russian Federation & Europe Multidisciplinary Symposium on Computer Science and ICT, Stavropol – Dombay, Russia, 15–20
October 2018, published at http://ceur-ws.org
   There exist a large number of network simulation programs that allow you to create network models and
provide results in a variety of data formats. NS-2, NS-3, OPNET, OMNeT++, QualNet, AnyLogic, GTNetS,
and NetSim are some popular examples among them [2]. The main difference between them is the availability
of libraries, the level of support, scalability, execution speed, the complexity of use, etc. The most popular
among researchers is the network simulator NS-3. This simulator is a flexible and powerful tool for modelling
information and communication networks. This is due to the possibility of using the built-in C++ and Python
programming languages when creating models [3].
   The NS-3 simulator is used to study heterogeneous communication systems. But the systems with different
types of communication channels have one big problem, i.e. it is difficult to coordinate different data communi-
cation protocols.
   Simulation of heterogeneous systems with a PLC-channel has gained interest in scientific circles with the
development of PLC-technology. To study the PLC-channel and to build models of the network, there exist
the developed modules of PLC-channels. These modules are described in scientific papers of the authors [4, 5].
Herewith, there is no description of the process of building a model of a PLC-network. The network model built
in C++ builder with the use of OMNeT++ and its submodule INET is presented in the work [5]. The operation
principles and capabilities of the PLC module developed in C++ for NS-3 are described in the publication [4]. The
work [6] investigates the dependence of the transmission speed on the distance for the point-to-point connection
on the basis of the PLC module [4]. The research report [7] considers the dependence of the PLC channel carrier
capacity on the distance in the NS-3 network simulator, without taking into account the network topology. The
article [8] presents the algorithm for assessing the state of the PLC-channel between the endpoints of the network,
which is aimed at choosing the topology of the network in which data transmission will be implemented.
   The purpose of this work is to develop a model of the PLC-network topology of a multistoried building and
to demonstrate the process of its construction with subsequent analysis of the operation, which is carried out by
identifying the dependence of data transmission speed on the distance between the network node and the server
and of data transmission time on the packet size.

2     Features of a PLC network model in NS-3
NS-3 simulation environment does not contain a base module to work with PLC-based networks. In this regard,
we used a third-party PLC module which allows simulating a PLC network in the NS-3 environment [4].
  The PLC network model can be built using such parameters as:
    • types of physical connections used;
    • drawing up a network diagram;
    • defining the positions of network devices;
    • determining the spectral model values.
   Let us consider the main components of the PLC network [9] in an NS-3, which allow you to create network
models with the characteristics close to the conditions of the real world. These components include: node unit,
transmitting channel, and noise.
   Abstraction of a network device on a node is implemented in C++ by means of the NetDevice class. The
network device in the NS-3 simulator allows you to control connections to other objects using data channels and
can be defined and used by the user within the framework of the object-oriented programming paradigm.
   The model of a power line is considered as a black box described by the transfer function. The method of
modelling the transfer function of the PLC channel uses parameter matrices which describe the relationship
between the input and output voltage and the current of the dual-port network [9].
   The general model of background noise with a low spectral density of signal power (PSD) is used to match
the real environment of signal propagation along the power lines. PLS module libraries have two methods of
adding noise to the data channel:
    • adding white noise that does not exceed the signal amplitude;
    • adding pulse disturbance.
   In a model, noise can be realized in the form of noise background in the channel or as a noise source for
separate node units. To represent the cumulative effect of many noise sources, there is one function which is a
white background noise at a certain level [10, 11].
3     Description of the object for modelling
Power Line Communications is a technology aimed at using the cable infrastructure of power grids as a physical
medium for information transmission. As a result, the topology of the communication network depends largely
on the topology of the electrical network.
   The structure of power lines in a multi-storied residential building is a wired non-uniform network with
the topology of the ”common bus”. This creates interferences typical for a PLC-network such as multipath
propagation, exposure to white noise and impulse interference. They result in signal distortion and increase data
transfer time. The realistic model of a PLC-network is formed on the basis of analyzing the topology of the
all-house electric power grid, taking into account the characteristics of the transmission channel and the research
of interferences.
   The object for modelling is a nine-storied residential building. On each floor of the house, there are four
PLC-modems which are designed to generate data packets and are the nodes of the PLC-network. All units
are separately connected to one common electrical cable with mains voltage equal to 220 V. To connect nodes
to the common network, as well as to transfer data packets to the data acquisition and transmission device
(DATD) and subsequently to the network server, there are 3 types of cables. The first is an electric cable with
a cross-sectional area of 50 · 10−6 m2 designed to connect PLC modems to a common cable. The second is the
Ethernet cable that connects the DATD and the general network server. The third is an electric cable with a
cross-sectional area of the conductor of 150 · 10−6 m2 . This cable is a kind of ”common bus” to which the nodes
of the network are connected. DATD is a separate node that is able to both transmit and receive information
from all other nodes of the network.
   The shared network server is on the first floor of the house, together with DATD. During the process of
simulating the PLC-network we also considered data transfer from a selected node to the DATD. It is assumed
that the data package has already been generated and is ready to be sent. The packet size is assumed to be 256
bytes by default.

4     Building a simulation model of a PLC network
The mathematical model of the channel is presented as transfer functions, which are calculated for the entire
network and for each node separately [9, 12]. To create the model, we used standard C++ libraries and NS-3
environment modules. All output information containing data on the process of modelling has seven levels of
detail:

    • LOG ERROR – fail log (macro: NS LOG ERROR);

    • LOG WARN – alert log (macro: NS LOG WARN);

    • LOG DEBUG – debug message log (related by macro: NS LOG DEBUG);

    • LOG INFO – information message log (macro: NS LOG INFO);

    • LOG FUNCTION – registration message log with the description of each function (two associated macros:
      NS LOG FUNCTION, used for component functions, and NS LOG FUNCTION NOARGS, used for static
      functions);

    • LOG LOGIC – registration message log describing the logical structure within the function (macro:
      NS LOG LOGIC);

    • LOG ALL – the log includes all of the above (not a macro).

   Each level of detail can be requested individually or in the aggregate. Thus, logging can be started using
the NS LOG shell environment variable. Enabling the logging option requires calling the LOG LEVEL ALL
function, which specifies the parameters to be displayed when the program is executed. In this case, it is
LOG PREFIX TIME and LOG PREFIX NODE. The first parameter displays events occurring with the passage
of time in the simulator. The second one shows the processes taking place on a certain node, as well as its
main characteristics that were set during the simulation. The LOG LEVEL INFO parameter is used to display
information about the physical parameters of the environment specified in the simulation. This option displays
only informational messages defined in the NS-3 environment.
   Further on, we configured physical environment, spectrum model and transmission power. In particular, we
set the spectral model of electric network frequency and the time interval. The data on physical environment
and spectrum is specified according to the G3-PLC standard [13].
   In the simulation we used cables of PLC NAYY150SE and PLC NAYY50SE types. The physical parameters
of the cables are described in the PLC Cable class and provide more detailed visualization of network device
connections on the nodes. Based on the parameters of the distributed diagram, we calculated the characteristic
impedance and the constant of propagation gamma [12, 14].
   Then, we made the description of the network nodes in accordance with the required topology. The position
coordinates in space are set for each node using the SetPosition(x, y, z) function. After the nodes were given
names and positions, they needed to be connected by physical communication lines. Next, we created a container
for keeping the described nodes. After adjusting all objects of the model, it was necessary to create the data
channel. Initialization of nodes and assignment of the spectral density of signal propagation power were the last
step in creating the model. Further, it was important to set the size of the package and to specify the simulation
parameters. The simulation started after calling the Simulator::Run() function. The functional diagram of the
model of the network is shown in Figure 1.




                                  Figure 1: Functional diagram of the scenario
5     Simulation results
During the process of simulating data transfer from network nodes to the server, we determined a number of the
dependencies:

    • the dependence of the data transmission rate from the distance;

    • the dependence of the time in which data is transferred from the network node to the server from the packet
      size.

   The results of the simulation on the basis of which we can observe the dependence of the packet transfer rate
on the distance are represented in table 1. The time of data transmission from a network node to the server
in average equals 0.11724. Because of the fact that data transmission is run on 0 to 1 second, it is customary
to assume that the measuring unit of speed equals the speed value multiplied by 103 meters per second. The
maximum value of the data transmission rate equals 0.2004 · 103 , and it corresponds to the communication
node which is located 23.5 meters away from the server. The minimum speed value equals 0.0256 · 103 meters
per second. The difference between the minimum and maximum results is due to the dependence of the data
transfer rate on the amount of the network nodes.


                   Table 1: The results of simulating data transmission over the PLC channel

                           Name of the network node        t, 10−3 s    S, m   v, 103 ms
                           PLC modem 36                    117.251      23.5   0.2004
                           PLC modem 33                    117.250      19.5   0.1663
                           PLC modem 32                    117.249      21.5   0.1834
                           PLC modem 29                    117.247      17.5   0.1493
                           PLC modem 28                    117.245      15.5   0.1322
                           PLC modem 24                    117.243      17.5   0.1493
                           PLC modem 21                    117.242      13.5   0.1151
                           PLC modem 20                    117.241      15.5   0.1322
                           PLC modem 17                    117.239      11.5   0.0981
                           PLC modem 16                    117.238      13.5   0.1152
                           PLC modem 13                    117.237      9.5    0.0810
                           PLC modem 12                    117.235      11.5   0.0981
                           PLC modem 9                     117.234      7.5    0.0640
                           PLC modem 8                     117.233      9.5    0.0810
                           PLC modem 5                     117.231      5.5    0.0469
                           PLC modem 4                     117.230      7.5    70.0640
                           PLC modem 1                     117.229      3.5    0.0299
                           DATD                            117.224      3.5    0.0256


Figure 2 represents the dependence of the data-transmission time on the data packet size. The packets were
transmitted from 36th PLC modem.
   Consequently, transmission of the packet with the maximum chosen size equal to 1024 bytes takes 284.5 · 10−3
seconds. This time is the maximal result. It is due to the fact that the process of forming and preparing the
packet with the size of 1024 bytes for transmission is more time-consuming. Therefore, when packet size is more
than 1024 bytes, there will be a small time delay in data transmission over the PLC channel.

6     Conclusion
During the process of simulating data transfer from the network nodes to the server, the model showed the
inverse dependence of the data transfer rate on the distance and the number of nodes in the network, and the
direct dependence of the time of data transfer from the host to the server on the packet size. Therefore, when
the packet size is more than 1024 bytes, a small time delay will be observed in data transmission over the PLC
channel. These results correspond to the theoretical concepts of the object.
                 Figure 2: Diagram of data-transmission time depending on data packet size

Based on the results of the simulation it is necessary to note that the developed model of the PLC network
topology is close to the real network topology of a multistoried building and can be used to study data trans-
mission protocols. The modified and refined model will be used in the future in simulating a heterogeneous
communication system, which will save time and financial costs associated with creating the system.

7   Acknowledgements
This work was financially supported by the Ministry of Education and Science of the Russian Federation, agree-
ment no. 14.577.21.0230, unique project identifier: RFMEFI57716X0230.

References
   1. Pospelova, I., Chebotayev, P., Klimenko, A., Myakochin, Y., Polyakov, I., Shelupanov, A., Zykov, D.: Re-
search of G3-PLC net self-organization processes in the NS-3 modeling framework. AIP Conference Proceedings
1899(1), 060017 (2017).
   2. Bilalb, S. M., Othmana, M.: A Performance Comparison of Network Simulators for Wireless Networks.
arXiv preprint arXiv:1307.4129 (2013).
   3. NS3 Network Simulator: ns-3 Tutorial. Release ns-3.18.1, https://www.nsnam.org/docs/release/3.18/
tutorial/ns-3-tutorial.pdf, last accessed 2018/05/07.
   4. Aalamifar, F., Schlogl, A., Harris, D., Lampe, L.: Modelling power line communication using network
simulator-3. Global Communications Conference, 2969-2974 (2013).
   5. Kellerbauer, H., Hirsch, H.: Simulation of powerline communication with OMNeT++ and INET-
Framework. In: Power Line Communications and Its Applications, pp. 213-217. IEEE International Symposium,
Udine (2011).
   6. Csiba, P.: Model of the distribution network. Dissertation, Brno (2017).
   7. Khach, E., Jacobsen, K. E., Skov, M. N., Hojholt, N. B., Sorensen, R. B.: Investigation of QoS in PLC
and evaluation of a ns-3 based PLC simulator. (2014).
   8. Lampe, L., Ahmed, M. O.: Power grid topology inference using power line communications. In: Smart
Grid Communications, pp. 336-341. IEEE International Conference, Vancouver (2013).
   9. Lampe, L., Tonello, A., Swart, T.: Power Line Communications: principles, standards and applications
from multimedia to Smart Grid. 2nd ed. John Wiley & Sons, Chichester (2016).
   10. Nieman, K. F., Lin, J., Nassar, M., Waheed, K., Evans, B. L.: Cyclic spectral analysis of power line
noise in the 3200 kHz band. In: Power Line Communications and Its Applications, pp. 315-320. 17th IEEE
International Symposium, Johannesburg (2013).
   11. Misurec, J., Mrakava, P., Adamko, D.: Interference in power lines and data communication over narrow-
band PLC. Elektrorevue 2(3), 63-67 (2011).
   12. Dobush, I. M.: Investigation of Open, Open-Short, Open-Short-Thru de-embedding methods for on-wafer
measurements of S-parameters of MMIC Elements. Proceedings of Tomsk State University of Control Systems
and Radioelectronics 34(4), 138-145 (2014).
   13. ITU-T. G.9903 Narrowband orthogonal frequency division multiplexing power line communication
transceivers for G3-PLC networks. International Telecommunication Union, Geneva (2014).
   14. Pinomaa, A.: Power-line-communication-based data transmission concept for an LVDC electricity distri-
bution network Analysis and implementation. Acta Universitatis Lappeenrantaensis, Lappeenranta. (2013).