This documentation will give you a insight how European VANETs based on the ETSI ITS-G5 and IEEE 802.11p can be simulated by using the discrete event simulator OMNeT++.
Artery (https://github.com/riebl/artery) is a simulation framework for OMNeT++. It is designed to simulate the ETSI ITS-G5 protocol stack which is used in European VANETs. Currently, it is using OMNeT++ in version 5.0. It is completely open source and under active development.
Artery is basically composed of four parts. First, there is the network simulation which handles the sending and receiving of packets. This is based on OMNeT++ networks, where Veins or INET provide reasonable realistic models of the radio medium. Also, Veins and INET both provide an implementation of the IEEE 802.11 physical and link layers. You are free to choose which framework you want to use by changing the networks configuration file.
The routing between the network participants is done by Vanetza. Vanetza includes topological ITS-G5 routing algorithms like the Single Hop Broadcast (SHB) as well as geographic routing like GeoBroadcasts (GBC). Each ITS-G5 station in the network is represented by a Vanetza
Router. Currently, only vehicles are used as ITS-G5 stations but Road Side Units (RSU) are on the roadmap already. Based on the chosen routing algorithm, the router determines the next hop in the network and sends the packet down to the physical layer, which is provided by either Veins or INET.
Applications are the reason why packets are created at first hand. The application layer is provided by Artery. The Day One applications mentioned by ETSI are already implemented and generate Cooperative Awareness (CA) and Decentralized Environmental Notification (DEN) Messages according to the standard's definition. For triggering DEN messages, the definition of proper trigger scenarios is needed. For this purpose the
Storyboard can be used. It allows to define scenario conditions as well as effects to provoke various traffic scenarios like accidents, weather conditions or traffic jams. According to the traffic situation, the application triggers the appropriate DEN message.
Last but not least, there is the traffic simulation provided by SUMO. SUMO and Artery are connected using the TraCI interface. TraCI allows for reading information about the current state of each vehicle inside the simulation as well as changing vehicle parameters. Changing vehicle parameters is mainly used by the
Storyboard to achieve above mentioned traffic situations. The maps used by
SUMO can be derived from real maps with realistic traffic flows (like https://github.com/lcodeca/LuSTScenario/wiki or Open Street Map) or synthetic scenarios.
It is quite easy to install Artery on Linux based systems. You need to have a C++ Compiler with C++11 support as well as Boost and Vanetza libraries for building Artery. Also, you need one of Veins and INET. Of course, OMNeT++ and SUMO are also required.
./configureand after this type
path/to/OMNeT/builddirectory into your
omnetpp. It is expected that the OMNeT++ development environment starts.
libproj-dev(on Debian or Ubuntu) installed.
./configure. After the configuring was done, take a look at the
Optional features summary, which was printed at the end. It has to include the entry
Enabled:list. This feature needs the above mentioned
libproj-devand enables SUMO to provide geographic coordinates for each vehicle. Without this feature, the simulation will stop at run-time because of invalid coordinates.
maketo build SUMO in the
To install Artery, you need to have Vanetza, Veins and Inet. For the ease of installing, the Artery repository contains all these frameworks as sub-repository links. This ensures, that only compatible versions of *INET, Veins, and Vanetza are used with Artery.
make vanetza. Vanetza will now be built in
make inet. Inet will now be built.
make veins. Veins will now be built in
Further information about building the above mentioned tools can be found at the following sources. This may be useful in case of an error.
Congrats, now you have all prerequisites to move forward and try to launch the first Artery example. How this is done is explained in the next section!
As Artery is quite complex, it is recommended to start by understanding OMNeT++. A good point to start is the TicToc tutorial. It can be found at https://omnetpp.org/doc/omnetpp/tictoc-tutorial/. This tutorial provides an overview on the basic functionality of OMNeT++. This includes, among others, the NED language and the definition of Networks.
If you already came in touch with OMNeT++ you can try to start the example shipped with Artery. To do so, follow these steps:
builddirectory (which was created while building)
make run_example. This command checks for code changes (like
makeusually does) and then launches OMNeT++ using the
SUMOto open its GUI while simulating, add this line to your
*.traci.launcher.sumo = "sumo-gui"
If you want to investigate the code while your simulation is running, you have to build Artery in debug mode. To do so it's recommended to use
builddirectory of Artery
CMAKE_BUILD_TYPE(usually this entry is at the top first position) press [enter] and type:
Debug. Than again, press [enter].
To start with creating your own service, take a look at the base class of each service, which is called
ItsG5Service. Also you can look at the
CamService and the
DenmService as they are already implemented services. All application related files and classes can be found in the
The initialization of a service is done by the
ItsG5Middleware. Before adding your service, provide a proper C++ class and a .ned file belonging to your class. Your service class must be derived from
ItsG5Service. Than, put your service in
examples/yourExample/services.xml. As a starting point, you can copy
CamService entry (
examples/artery/services.xml) and change the port number.
ItsG5Middleware also invokes the services each simulation step by calling
ItsG5Service::trigger(). This means, if you want to do something periodically with your service, override this method and put your code in there.