# EmuCD: An Emulator for Content Dissemination Protocols in Vehicular Networks
## 3 EmuCD Architecture  
Testing a new protocol for content dissemination in networks using a traditional simulator requires, at least, two steps: first, it is necessary to configure the network with all its details (communication technology, node characteristics, interfaces, etc. ); after that, it is necessary to deploy the new protocol, that is, the customization of the protocol inside of the simulator following all the rules defined by this software. In order to do these tasks, a deep knowledge of the simulator is required, starting with an initial stage of studies to absorb the entire process for the network configuration, and then the implementation process of the new protocol for the simulator, where a knowledge of its libraries is required. On the other hand, what is expected from a virtual environment where it is possible to develop and test networks and protocols is for it to be as realistic as possible, and offer conditions that allow transferring what was developed virtually to real physical networks, with a minimum effort to deploy and prepare for the real use. However, this is not offered by traditional simulators, as after the development period a customization period is still necessary for the protocols to be properly adapted to the conditions of the real physical network. A simple example is the configuration of the network and its nodes: each simulator has its own process for these definitions, usually stored in tables/files of the simulator, which do not correspond to the settings of the operating systems. Another aspect closely linked to the realism of the simulation is what is expected from the behaviour of the network nodes. This aspect is particularly important in mobile networks where a delay tolerance capability is desired. Taking into account a VANET where the characteristics of each city, the habits of the inhabitants and the weather conditions have a great influence on the mobility of the vehicles, it is very important to use real traces taken directly from the vehicular networks installed in the cities. Such traces provide a degree of realism that simulators like SUMO cannot achieve. With all these aspects in mind, we propose an emulator where each node of the network consists of a Docker container where we install a simple engine (daemon) that consumes a data trace with the node's mobility and connectivity. That is, at each step (timestamp), the node's daemon updates the configuration of the container's operating system (IPs, routing tables, etc.) according to the neighbours table indicated by the information coming from the data trace. In this way, we emulate all the networking aspects directly in the OS of the container and the new protocol can be developed and tested as if it were running in real conditions such as a notebook, a vehicle communication box, a Raspberry Pi, etc. We adopt a service choreography strategy, where nodes are fully independent and our emulated network has the same conditions of the real network. Besides, our emulator enables the testing of the new protocols with many types of communication technologies without any modifications, as the protocol is not aggregated inside the emulator or bound to it. In our emulator, each container acts as a real Ubuntu node with a configurable number of network interfaces, and follows the mobility provided by a dataset from a VANET. Because the nodes are not really moving, and to support everything being run locally in a single machine, the mobility aspect of the emulation is created by manipulating the routing table in the OS of each container. Each node knows who its neighbours are at every instant, and the routing table is updated so that the node can only reach its neighbours, as it would if it were in a real VANET. It should be noted that, due to the aimed abstraction between the emulator and the software/protocol being tested, the emulator only supports standalone software, whether it is a Python script or a standalone binary.