<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Building the simulation model of a PLC network in the NS-3 environment</article-title>
      </title-group>
      <contrib-group>
        <aff id="aff0">
          <label>0</label>
          <institution>Dmitriy Zykov</institution>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Integrated Circuit Design Center Milandr</institution>
          ,
          <addr-line>5 Georgievskiy Prospect, Zelenograd, Moscow, 124498, Russian Federation o</addr-line>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Tomsk State University of Control Systems and Radioelectronics</institution>
          ,
          <addr-line>40 Lenina Prospect, Tomsk, 364050, Russian Federation</addr-line>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2018</year>
      </pub-date>
      <abstract>
        <p>The method of simulation modelling is widely used to study data transmission 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 operation, 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 network 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.</p>
      </abstract>
      <kwd-group>
        <kwd>Simulation Modelling</kwd>
        <kwd>NS-3 Network Simulator</kwd>
        <kwd>Topology</kwd>
        <kwd>PLC Network</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        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
telecommunication systems [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. 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 di erent
experiments with di erent parameters, without a ecting the accuracy and visibility of the result.
      </p>
      <p>
        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 [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. The main di erence 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 exible 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 [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
      </p>
      <p>The NS-3 simulator is used to study heterogeneous communication systems. But the systems with di erent
types of communication channels have one big problem, i.e. it is di cult to coordinate di erent data
communication protocols.</p>
      <p>
        Simulation of heterogeneous systems with a PLC-channel has gained interest in scienti c 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 scienti c papers of the authors [
        <xref ref-type="bibr" rid="ref4 ref5">4, 5</xref>
        ].
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 [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. The operation
principles and capabilities of the PLC module developed in C++ for NS-3 are described in the publication [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. The
work [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] investigates the dependence of the transmission speed on the distance for the point-to-point connection
on the basis of the PLC module [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. The research report [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] 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 [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] 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.
      </p>
      <p>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</p>
    </sec>
    <sec id="sec-2">
      <title>Features of a PLC network model in NS-3</title>
      <p>
        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 [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
      </p>
      <p>The PLC network model can be built using such parameters as:
types of physical connections used;
drawing up a network diagram;
de ning the positions of network devices;
determining the spectral model values.</p>
      <p>
        Let us consider the main components of the PLC network [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] 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.
      </p>
      <p>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 de ned and used by the user within the framework of the object-oriented programming paradigm.</p>
      <p>
        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 [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ].
      </p>
      <p>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.</p>
      <p>
        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 e ect of many noise sources, there is one function which is a
white background noise at a certain level [
        <xref ref-type="bibr" rid="ref10 ref11">10, 11</xref>
        ].
      </p>
    </sec>
    <sec id="sec-3">
      <title>Description of the object for modelling</title>
      <p>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.</p>
      <p>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.</p>
      <p>The object for modelling is a nine-storied residential building. On each oor 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 rst 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.</p>
      <p>The shared network server is on the rst oor 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</p>
    </sec>
    <sec id="sec-4">
      <title>Building a simulation model of a PLC network</title>
      <p>
        The mathematical model of the channel is presented as transfer functions, which are calculated for the entire
network and for each node separately [
        <xref ref-type="bibr" rid="ref9">9, 12</xref>
        ]. 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:
      </p>
      <sec id="sec-4-1">
        <title>LOG ERROR { fail log (macro: NS LOG ERROR);</title>
      </sec>
      <sec id="sec-4-2">
        <title>LOG WARN { alert log (macro: NS LOG WARN);</title>
      </sec>
      <sec id="sec-4-3">
        <title>LOG DEBUG { debug message log (related by macro: NS LOG DEBUG);</title>
      </sec>
      <sec id="sec-4-4">
        <title>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);</title>
        <p>LOG LOGIC { registration message log describing the logical structure within the function (macro:
NS LOG LOGIC);</p>
      </sec>
      <sec id="sec-4-5">
        <title>LOG ALL { the log includes all of the above (not a macro).</title>
        <p>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 speci es the parameters to be displayed when the program is executed. In this case, it is
LOG PREFIX TIME and LOG PREFIX NODE. The rst 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 speci ed in the simulation. This option displays
only informational messages de ned in the NS-3 environment.</p>
        <p>Further on, we con gured 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 speci ed according to the G3-PLC standard [13].</p>
        <p>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].</p>
        <p>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.</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Simulation results</title>
      <p>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.</p>
      <p>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 di erence between the minimum and maximum results is due to the dependence of the data
transfer rate on the amount of the network nodes.</p>
    </sec>
    <sec id="sec-6">
      <title>Conclusion</title>
      <p>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.
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
transmission protocols. The modi ed and re ned model will be used in the future in simulating a heterogeneous
communication system, which will save time and nancial costs associated with creating the system.
7</p>
    </sec>
    <sec id="sec-7">
      <title>Acknowledgements</title>
      <p>This work was nancially supported by the Ministry of Education and Science of the Russian Federation,
agreement no. 14.577.21.0230, unique project identi er: RFMEFI57716X0230.</p>
      <p>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).</p>
      <p>13. ITU-T. G.9903 Narrowband orthogonal frequency division multiplexing power line communication
transceivers for G3-PLC networks. International Telecommunication Union, Geneva (2014).</p>
      <p>14. Pinomaa, A.: Power-line-communication-based data transmission concept for an LVDC electricity
distribution network Analysis and implementation. Acta Universitatis Lappeenrantaensis, Lappeenranta. (2013).</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Pospelova</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Chebotayev</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Klimenko</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Myakochin</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Polyakov</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shelupanov</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zykov</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>Research of G3-PLC net self-organization processes in the NS-3 modeling framework</article-title>
          .
          <source>AIP Conference Proceedings 1899(1)</source>
          ,
          <volume>060017</volume>
          (
          <year>2017</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Bilalb</surname>
            ,
            <given-names>S. M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Othmana</surname>
            ,
            <given-names>M.:</given-names>
          </string-name>
          <article-title>A Performance Comparison of Network Simulators for Wireless Networks</article-title>
          .
          <source>arXiv preprint arXiv:1307.4129</source>
          (
          <year>2013</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3. NS3 Network Simulator:
          <fpage>ns</fpage>
          -3
          <source>Tutorial. Release ns-3</source>
          .
          <fpage>18</fpage>
          .1, https://www.nsnam.org/docs/release/3.18/ tutorial/ns-3
          <article-title>-tutorial</article-title>
          .pdf,
          <source>last accessed</source>
          <year>2018</year>
          /05/07.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Aalamifar</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schlogl</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Harris</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lampe</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          :
          <article-title>Modelling power line communication using network simulator-3</article-title>
          . Global Communications Conference,
          <volume>2969</volume>
          -
          <fpage>2974</fpage>
          (
          <year>2013</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Kellerbauer</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hirsch</surname>
          </string-name>
          , H.:
          <article-title>Simulation of powerline communication with OMNeT++ and INETFramework</article-title>
          .
          <source>In: Power Line Communications and Its Applications</source>
          , pp.
          <fpage>213</fpage>
          -
          <lpage>217</lpage>
          . IEEE International Symposium, Udine (
          <year>2011</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Csiba</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          :
          <article-title>Model of the distribution network</article-title>
          .
          <source>Dissertation</source>
          , Brno (
          <year>2017</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Khach</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Jacobsen</surname>
            ,
            <given-names>K. E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Skov</surname>
            ,
            <given-names>M. N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hojholt</surname>
            ,
            <given-names>N. B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sorensen</surname>
          </string-name>
          , R. B.:
          <article-title>Investigation of QoS in PLC and evaluation of a ns-3 based PLC simulator</article-title>
          . (
          <year>2014</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Lampe</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ahmed</surname>
            ,
            <given-names>M. O.</given-names>
          </string-name>
          :
          <article-title>Power grid topology inference using power line communications</article-title>
          .
          <source>In: Smart Grid Communications</source>
          , pp.
          <fpage>336</fpage>
          -
          <lpage>341</lpage>
          . IEEE International Conference, Vancouver (
          <year>2013</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Lampe</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tonello</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Swart</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>Power Line Communications: principles, standards and applications from multimedia to Smart Grid</article-title>
          . 2nd ed. John Wiley &amp; Sons, Chichester (
          <year>2016</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Nieman</surname>
            ,
            <given-names>K. F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lin</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nassar</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Waheed</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Evans</surname>
            ,
            <given-names>B. L.</given-names>
          </string-name>
          :
          <article-title>Cyclic spectral analysis of power line noise in the 3200 kHz band</article-title>
          .
          <source>In: Power Line Communications and Its Applications</source>
          , pp.
          <fpage>315</fpage>
          -
          <lpage>320</lpage>
          . 17th IEEE International Symposium, Johannesburg (
          <year>2013</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Misurec</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mrakava</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Adamko</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>Interference in power lines and data communication over narrowband PLC</article-title>
          .
          <source>Elektrorevue</source>
          <volume>2</volume>
          (
          <issue>3</issue>
          ),
          <fpage>63</fpage>
          -
          <lpage>67</lpage>
          (
          <year>2011</year>
          ).
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>