# Computer Network Simulation with ns-3:
## 1 Introduction  
Computer networks are currently a cornerstone not only in traditional computing or business environment, but also in many different application fields, such as cloud facilities, Industry 4.0, Wireless Sensor Networks (WSN), CyberPhysical Systems (CPS), 5G communication systems, critical infrastructures protection, automotive, railways, military applications such as ground support, Command, Control, Communications and Intelligence (C3I), modern military air force systems, and many other possible examples. Computer networking took the place of other traditional technologies with the aim of providing richer services, adaptation to different conditions, reconfigurability, system-wide and node-wide intelligence, flexibility, interoperability, thanks to the fact that network architectures are layered, scalable, evolvable and adaptable, and to the intrinsic advantages of digitaldata orientation. The modularity of network technologies allows the independent development of standards that focus on individual problems and allow reuse of solutions and concurrent design of different layers for the same architecture or for different architectures to be made compatible or interoperable. Modern networking technologies include hardware and software components. The availability of more reliable and faster computing hardware is changing the balance between hardware and software and the structure of network devices as well: currently, both embedded, mainly hardware-based nodes may coexist with mainly software-based nodes, in which analogous functions are provided with different tools, and Software Defined Networks (SDN) are spreading aside conventional hardware-based infrastructures, basically reducing the logical portion of a network that is necessarily implemented in hardware to the essential components that ensure the connection. This evolution, mainly pushed by the needs of cloud infrastructures and large computing infrastructures in general, such as warehouse scale computers, to allow easier deployment, control and management of complex networks, in turn enables a change of paradigm from distributed network control and logic to a centralized approach, including the ability of a nearly complete reconfiguration of all network nodes in a large installation by a single control and management node. In some scenarios, moreover, the higher levels of the network stacks might be completely implemented in the cloud, such as in the case of 5G technologies that blur the communication and computing portions of the system, or, less extremely, 4G technologies that delegate some functions from the cell antenna to the terminals. When analyzing or integrating a computer network, this heterogeneity in hardware and software and the wide transparency in the interoperability of components results in a potentially lower knowledge of non-controllable nodes. The higher the number of vendors, the number of interacting technologies, the dimension and extension of the network, the amount of numbers, the heterogeneity in the services and layers, the security requirements, the survivability requirements, the more difficult is to model and understand faithfully the dynamics of the network. A low fidelity impacts significantly the results of assessments when the complexity of the network is not trivial, so the availability of modular simulation-based tools to support the process is a real need to avoid dramatic underestimation of network problems or erroneous assumptions on network behavior that may have serious consequences: for example, in evaluating the extension of the attack surface in a IoT system, the reliability of an Industry 4.0 installation or the performance of multimedia delivery systems. The use of modular simulation allows building a coherent model of a network with different levels of detail. The level of detail may, in principle, vary between high-level, behavioral modeling and emulation.