Vehicular Network Simulation Environment Via Discrete Event System Modeling
Vehicular Network Simulation Environment Via Discrete Event System Modeling
ABSTRACT A vehicular ad-hoc network (VANET) enables vehicles to communicate with each other
directly or via roadside infrastructure in order to improve road safety and efficiency. Within a VANET,
communications can potentially alter vehicular mobility and conversely, that the mobility could potentially
influence vehicular communications. Therefore, a VANET simulator environment is needed that can accu-
rately model interactions between vehicular mobility and network protocols. In this paper, we present a novel
vehicular network simulation environment designed using the MATLAB discrete event system (DES) in the
SimEvents toolbox. The proposed simulation environment is a bit-accurate, discrete event simulator that
integrates vehicular mobility operations with wireless network communication. This paper provides details
on the design of the proposed simulator. Its computational costs are evaluated in terms of events quantities and
execution time. The physical (PHY) layer of the proposed simulator shows a more realistic packet success
rate (PSR) using bit-level processing techniques when compared with the packet-based NS-3 simulator. The
performance of the priority-based media access control (MAC) layer proves the data with different priorities
that can coexist in the same channel.
INDEX TERMS Vehicular network simulation, vehicular mobility models, discrete-event system.
2169-3536 2019 IEEE. Translations and content mining are permitted for academic research only.
87246 Personal use is also permitted, but republication/redistribution requires IEEE permission. VOLUME 7, 2019
See http://www.ieee.org/publications_standards/publications/rights/index.html for more information.
L. Wang et al.: Vehicular Network Simulation Environment via DES Modeling
FIGURE 2. Systems overview and Discrete Event Systems. Discrete Event System is classified as a discrete-state event-trigger
system. A hybrid system including both time-driven and event-driven DES is suitable for network PHY layer simulation.
in Eq. (1): The state space of a system is a set of all possible values
a state may take. Based on the type of states in a model,
Ė = f (Ex (t), uE(t), t),
x(t) (1) a system can be classified into either a continuous-state sys-
Then the output Ey(t) is determined by state equations, tem or a discrete-state system, as shown in Figure 2 [21].
input, and time shown by: In a continuous-state system, the time variable, t, enables
the system to transit from one state to another state con-
Ey(t) = gE(Ex (t), uE(t), t), (2) tinuously. A system with such property is referred to as
time-driven system. A continuous-state system is considered At time tk = tk−1 + vk , the timer reaches 0, ek has to
to be time-driven. occur, a state transition is caused from xk−1 to xk . Then,
In a discrete-state system, the states are only allowed to the same process repeats with the (k + 1)th event, ek+1 . Thus,
change from one discrete state value to another. The state a DES can be specified by the clock sequence of events, that
transitions are either synchronized by a clock or occurred is, Ev = {v1 , v2 , . . . , vk }.
asynchronously at some special time point due to events. A state x, including the initial state x0 , has clock
An event can occur instantaneously and cause state values yi where i ∈ 0(x). The triggering event e0 is the next
transitions. event which will occur at that state x, i.e., the event chosen
If state transitions in a discrete-state system are synchro- with the smallest clock value defined by:
nized by clock ticks, it is a discrete-state, time-driven system.
e0 = arg min {yi }, (5)
Otherwise, if state transitions occur asynchronously at vari- i∈0(x)
ous random time instants due to events, this system is referred
When event e0 occurs at state x, a new state x 0 is generated
as a discrete-state, event-driven system or, shortly, a discrete-
from the state transition function f (x, e0 ). The inter-event
event system (DES) as shown in Figure 2 . The set of events
time, y∗ , represents the amount of time spent at state x and
serves the purpose of driving a DES since each event may
is calculated by:
cause a state transition.
Even though a DES is defined as a discrete-state event- y∗ = min {yi }, (6)
i∈0(x)
driven system, it may be modeled as event-driven and/or
time-driven. In fact, a hybrid DES when both time-driven The updated time is obtained by t 0 = t + y∗. Once the new
and event-driven are present is more general, as shown state x 0 is generated, the clock values for all feasible events
in Figure 2. For example, the operating system (OS) in a are updated. If an event i ∈ 0(x 0 ) and i 6= e0 remains feasible
computer is designed to not only respond to asynchronous in the new state x 0 , the new clock value is y0i = yi − y∗. For
events that have occurred at any time but also process func- all events which are not feasible in x but become feasible
tions synchronized by the computer clock. in x 0 , i.e., e0 ∈ 0(x 0 ) but e0 ∈
/ 0(x), a set of new lifetimes
A continuous state system can be modeled either by dif- are supplied by the DES.
ferential equations (continuous time) or difference equations From a computer implementation standpoint, a DES simu-
(discrete time), while a discrete-state event driven can be lator should have an event scheduling scheme, i.e., a variation
analyzed by automata. For instance, suppose we have an of timed state automaton DES model, such that whenever an
event set E = {a, b, g}. The state space of the automation event i is enabled at time tn , its next occurrence is scheduled at
is X = {x, y, z}. The transition function of the automation time tn +vi , where vi is a lifetime sample supplied by the DES.
is denoted as f : X × E → X . For example, f (x, g) = y Thus, a Scheduled Event List (SEL) replaces maintaining the
means that the automation is in state x, after event g hap- clock values yi , i ∈ 0(x) defined by:
pened, the automation transits the state to y, i.e., x → y.
L = {(ek , tk )}, k = 1, 2, . . . , mL , (7)
The trigger event g may be either an external input to the
system, or an event generated by the system itself. The initial where m is the number of events in the events set E,
state is denoted by x0 . A deterministic automation, denoted mL is the number of feasible events for the current state,
by G, is defined in Eq. (3) [21]: i.e., m = |E|, mL = |0(x)|, mL ≤ m. The SEL is always
ordered on a smallest-scheduled-time-first basis. Additional
G = (X , E, f , 0, x0 ), (3)
research efforts on DES simulation concepts can be found in
where 0 is the active event set of G at x. Each state has a references [21]–[26].
feasible events set 0(x), the events from 0(x) are the only
events which may occur at this state. C. MATLAB DES SIMULATION FRAMEWORK
In order to simulate a specific DES of interest, there are
B. DISCRETE EVENT SIMULATION two options: either build a DES simulator or use an existing
In order to perform DES simulation, the events sequences DES simulator. Based on the event scheduling scheme and/or
need to be associated with clocks. Suppose we have a process-oriented scheme, it is possible to create a DES model
DES with a single event E = {α}. The feasible event set using standard computer languages such as C++. However,
0(x) = {α} for all x ∈ X . The event sequence in this DES building a DES simulator is outside of the scope of this
is Ee = {e1 , e2 , . . . , ek } and e1 = e2 = . . . = ek = α. paper. As our goal is to simulate vehicular network behaviors,
Event Lifetime denoted by vk is defined as the length of the choosing an existing DES simulator is preferred.
time interval of the two successive events. For the single event In this paper, the vehicular network simulator is developed
DES, the kth lifetime of the event is defined as: using SimEvents, which is a MATLAB toolbox from The
MathWorks, Inc. SimEvents needs to work with Simulink in
vk = tk − tk−1 , k = 1, 2, . . . , k, vk ∈ R+ , (4)
a time-driven simulation environment. The MATLAB DES
At time tk−1 , the kth event, ek , is enabled with a life- system object inside the SimEvents library allows users
time vk . A timer attached to ek starts to count down from vk . to create an event-driven system using MATLAB object
1) ENTITY
The elements flow in a DES are called entities. The entities
contain static information, which can be MATLAB built-in
data type or structured/bus data types. A MATLAB DES
may have one or more entity storages, with each storage
containing entities in certain order, such as a first-in, first-out
(FIFO) queue or a priority queue. A MATLAB DES can take
entities as input or output and entities can leave a MATLAB
DES and enter another MATLAB DES.
2) EVENT FIGURE 3. Example code on the implementation of the PHY links. The
PHY link DES receives a waveform entity, delays it for a predefined
Multiple types of events can be scheduled and executed period, and forward out to the receiver. The operations are achieved by
to an entity. These events model activities such as entity alternately activated events and actions.
creation, destroy, forward (send/receive), delay and search.
As of MATLAB/Simulink R2018a, MATLAB DES supports
five types of events: performed and, according to the type of the waveform entity,
• Generate: obj.eventGenerate( ) can generate an entity in i.e., data or Acknowledgment (ACK), two separate Timer
the target storage. events are created to delay the entity for a period. Once the
• Destroy: obj.eventDestroy( ) can destroy an entity in the delay is done, the Timer action is activated, in which the
target storage. waveform collision is simulated and the waveform entity is
• Timer: obj.eventTimer( ) delays an entity to a period of forwarded out of the DES via Forward event. After the wave-
time. form entity left the DES, the Exit action is triggered to reset
• Iterate: obj.eventIterate( ) iterates entities in the target the channel status. More details about the implementation of
storage with conditions. the PHY layer are provided in Section III.
• Forward:obj.eventForward( ) forwards entities to a stor- A MATLAB DES environment is suitable for simulating
age or an output port. network behaviors since the data flowing through differ-
ent network layers can be treated as entities. For example,
3) ACTION the data units of the PHY layer waveforms can be mod-
When an event is due for execution, actions are invoked. eled as waveform entities. The data generation, movement,
These actions are conducted by user-defined methods, which and destroy functions within a network can be implemented
may contain the algorithms. The flexibility characteris- by events. Users can further define more dynamic behav-
tics of actions make the developers to create varieties of iors, such as media access for the MAC layer and channel
DES modules. model for the PHY layer, using actions. In the next section,
Partial code of the PHY layer implementation is shown the implementation of each component in the proposed sim-
in Figure 3. In a communication environment, the transmitter ulation environment is presented with details.
sends out a waveform, which flows through the wireless
channel link and arrives at the receiver. The wireless chan- III. PROPOSED DES V2x SIMULATOR: VANET TOOLBOX
nel link can be modeled as a discrete-event system. In the Generally, a vehicular network simulation is a combination
figure, the Entry action is triggered when a waveform entity of a time-driven system and an event-driven system. Figure 4
enters the DES and stays inside the storage. In the Entry illustrates the design structure of two vehicular nodes com-
action method, a series of channel sensing related actions are municating over a wireless channel. The framework consists
FIGURE 4. Design Structure of VANET Toolbox. The APP layer integrating network model and vehicle mobility model is a hybrid of event-driven and time
driven. The MAC layer focuses on EDCA and is purely event-driven. The wireless channel link in PHY layer is a time-driven DES module.
of three DES modules: APP Layer DES Module (APP DES), Furthermore, the MAC layer is responsible for generating
MAC Layer DES Module (MAC DES) and PHY Layer DES frames, waiting for ACKs, and initiated retransmissions when
Module (PHY Link DES), among which APP DES inte- timeouts occur. All of these MAC layer behaviors are event-
grates vehicle mobility models with APP message generation driven. Additionally, the transmitter (Tx) and receiver (Rx)
operations, MAC DES includes MAC layer activities and of the PHY layer are integrated with the MAC Layer DES
PHY transmitter (Tx) / receiver (Rx) on bit-level processing Module. The PHY Tx is responsible for converting the binary
and PHY Link DES only simulates wireless propagation message information into wireless waveform symbols, while
channels. the PHY Rx is used to reverse the process. Both operations
The mobility models are integrated in the APP DES, which from the PHY Tx and Rx are based on bit-level processing,
makes our proposed simulator an integrated type simulator. i.e., users can manipulated every single bit of then data when
This design facilitates the information exchange between the necessary. The integration design of the MAC DES has two
vehicle mobility activities and the network communication purposes. First, the PHY operations of the bit-level process-
operations. The movements of vehicles are controlled by vari- ing is time-continuous instead of event-driven, thus the PHY
eties of mobility models such as car-following model (CFM) Tx/Rx cannot be implemented using DES. In our proposed
and lane-changing model (LCM). The mobility models are simulator, a series of functions are created to perform the bit-
implemented by different safety-related or non-safety appli- level processing operations. The second reason is to constrain
cations. According to the vehicular traffic scenario, the appli- the total number of DES units in the simulation model in
cations may generate messages and share with other vehicle order to enable simulation efficiency. The creation of a DES
nodes. This situation is event-driven pattern. Additionally, involves overhead computational costs, including assigning
the applications may create beacon messages such as Basic input/output ports and allocating queue memories. This over-
safety messages (BSMs) at 10 Hz, which is time-driven head may potentially lower the simulation speed. Thus, in our
pattern. Thus the APP DES is a hybrid of event driven and design process one of the most basic requirements is to use
time driven. These generated messages are disseminated via as few DES units as possible.
wireless network communication and reciprocally the perfor- The PHY link DES module only simulates the wireless
mance of network communication could affect the vehicle channel links since both PHY Tx and Rx are integrated
operations. The section only focuses on the design of network with the MAC DES module. The PHY link is a relatively
communication simulation environment, the discuss of the straightforward DES, as it is only responsible for accepting
mobility models is presented in Section IV. the incoming waveforms from the PHY transmitters and for-
The MAC layer of a vehicular network is different com- warding them to the PHY receivers after an air propagation
pared to other WLAN devices since it grants priorities to delay. This process is an event-driven pattern. During the
various messages such that the messages with higher priority air propagation delay, channel models such as AWGN and
have shorter deference in channel contentions. This mecha- two-ray ground reflection model can be applied to the wave-
nism is referred to as Enhanced Distributed Channel Access forms and this process is implemented by functions instead
(EDCA) and it is defined in the IEEE 802.11 standard [27]. of DES.
FIGURE 5. VANET PHY Link Modeling. The PHY Tx and Rx are for the data
encoding and decoding on bit-level processing. Wireless channel link is a
DES module with two-ray ground reflection model and AWGN as default.
1) DESIGN THE PHY LAYER ON BIT LEVEL transmission specifications. In MATLAB, wlanNonHTCon-
Figure 5 illustrates a basic wireless PHY link model that con- fig creates a Non-HT object in order to configure the
verts the received frame from the MAC layer into a wireless transmission parameters. It is configured for a 10 MHz chan-
waveform and lets the waveform pass through the wireless nel bandwidth with a single transmit antenna according to
channel. The interaction between the PHY layer and the MAC the IEEE 802.11p standard [27]. A Non-HT Orthogonal
layer is handled by the Physical Layer Convergence Protocol Frequency-Division Multiplexing (OFDM) symbol consists
(PLCP). A PLCP Service Data Unit (PSDU) is generated by of 64 sub-carriers with a 10 MHz bandwidth and symbol
serializing the MAC layer frame into a binary bit stream. period of 6.4µs. A 1.6µs guard interval (GI) is inserted
The PSDU bits along with the PLCP preamble and header between each symbols in order to prevent inter-symbol inter-
according to the IEEE 802.11 [27] are grouped into sym- ference (ISI). A PLCP header, including information of data
bols and finally becomes a waveform. The wireless chan- rate and PSDU length, is prepended to the PSDU. From the
nel consists of a two-ray Ground Reflection Channel model perspective of a waveform, the PLCP header is the Legacy
and an Additive White Gaussian Noise (AWGN) model by Signal (L-SIG) field and the PSDU along with a tail and
default. This design is based on the research of line-of-sight padding becomes the data field. Ahead of the L-SIG field,
(LOS) conditions specified in [32]. Additional channel mod- a PLCP amble is attached, which includes a Legacy Short
els including Rural_LOS and Urban_NLOS can be selected Training Field (L-STF) and a Legacy Long Training Field
during the simulation. The received waveform is decoded and (L-LTF). L-STF is used for the packet detection, initial fre-
verified using the bit-level receiver design in [33]. Only the quency offset estimation, and coarse timing synchroniza-
PHY channel link is designed in DES, both PHY Tx and Rx tion. The L-LTF is used for the fine time synchronization,
are implemented using functions from WLAN Toolbox and channel estimation, and fine frequency offset estimation.
are integrated with the MAC DES module. Thus, a complete waveform consists of a L-STF, a L-LTF,
Figure 6(a) illustrates the process of generating a waveform a L-SIG, as well as a data field. These fields are gener-
at the transmitter (Tx) at the bit level. The IEEE 802.11p ated separately and concatenated to form a complete Non-
PHY layer is derived from the IEEE 802.11a Non-HT HT transmit waveform. The Non-HT configuration object
FIGURE 9. Modeling the MAC layer using MATLAB DES. The MAC DES
module involves threes types of entities: Payload entity, frame entity and
waveform entity. It is responsible for the data streams sending to the PHY
layer and receiving from the PHY layer.
FIGURE 12. Notations for Highway Mobility Model based on V2V Communications. The green car is the target. The green car is surrounded by the yellow
cars, who may involve in the coordinated car-following and lane-changing operations. The grey cars are the predicted positions according to the
prediction algorithm.
TABLE 2. Notations used in the Highway mobility model. The deceleration, dec, is determined by the current vehicle
speed, road surface friction coefficient µ, as well as the fric-
tion type, i.e., static friction and kinetic friction. If a vehicle
is driving on a dry concrete road surface, then according
to [37] the static friction coefficient is µs = 1 and the kinetic
friction coefficient is µk = 0.8. When the vehicle brakes free
and slides, the kinetic friction deceleration deck only depends
on µk and the acceleration due to gravity g = 9.80 m/s2 ,
as indicated in Eq. (11).
For static friction, NHTSA was able to show a mapping
between speed and braking distance, based on which we
set the maximum static friction deceleration to decs =
−6.50 m/s2 [38]. For dec ∈ [decs , 0], we define this type of
braking as regular brake. For dec < decs , the brake action
is called as emergency (EMG) brake. During EMG brake
traffic flows without car collisions using the help of vehicular process, the wheels are drifting on road surface, the friction
communications. between them is kinetic friction, thus we set dec = deck .
In CFMs, the vehicle keeps monitoring the distance to
di,safe = Li + treact ∗ vxi (t) + dbrake , (8) the vehicle immediately ahead of it based on the received
vxi (t + 1t)2 − vxi (t)2 BSMs and adjusts its speed adaptively in order to maintain
dbrake = , (9) a safe distance. When the front vehicle is braking, the vehicle
2 · µs · dec
behind it will be aware of it using the BSM information and
−vxi (t)2
dbrake = , (10) it will start to brake.
2 · dec µs =1,vxi (t+1t)=0
deck = −µk ∗ g = −0.8 ∗ 9.8 = −7.84m/s2 , (11) 2) LANE CHANGING MODELS (LCMs)
LCMs are based on multi-lane traffic scenarios. A general
The safe distance of vehicle i is generally calculated by LCM should include three parts: the trigger for a lane chang-
Eq. (8), where Li is the length of vehicle i, treact is the reaction ing event, the feasibility of a lane changing event, and the
time either of the driver or from the autonomous vehicular scheme used during the lane changing process.
dynamics, dbrake is the braking distance and is calculated As an example, suppose we consider the situations and
in Eq. (9), vxi (t) is the instantaneous speed when brake is notations shown in Figure 12, which describes a basic lane
performed, and vxi (t +1t) is the velocity when braking action changing scenario involving four vehicles. The trigger for
is finished (for a complete stop, vxi (t + 1t) = 0). Therefore, vehicle i to change its lane is the distance to vehicle i+1 being
we have the full stop brake distance defined in Eq. (10). shorter than the safe distance, i.e., when 1di (t) < di,safe .
The lane changing feasibility of vehicle i is determined by for BPSK signal with different channel environment. Further-
the distance to vehicle j − 1, i.e., 1dj−1 (t + 1t), and the more, based on the case study of V2V communication in the
distance to vehicle j + 1, i.e., 1dj+1 (t + 1t) during the lane above section, we perform two sets of simulations focusing
changing process. Both distances should not violate the safe on the MAC layer behaviors and compare the performance
distance rule in order to avoid potential car collisions in the of EDCA with distributed coordination function (DCF).
adjacent lane when changing lanes. The speed boundary for
vehicle i is calculated as follows: A. PERFORMANCE OF VANET TOOLBOX
02 − vx,i(t)2 02
− vx,j+1(t)2 In this section, the performance of VANET Toolbox is ana-
| |<| | + di,j+1 (t), (12) lyzed and evaluated in terms of events numbers and the
2 · decs 2 · decs
execution time with different number of vehicles.
02 − vx,i (t)2
| | + di,j−1 (t)
2 · decs 1) COMPUTATIONAL COSTS IN TERMS OF EVENTS
02 − vx,j−1 (t)2 A detailed simulation of the entire vehicular network stack is
>| |, (13)
2 · decs time-consuming, especially with a large number of vehicles
q
max(vx,i (t)) = vx,j+1 (t)2 + 2 · |decs | · di,j+1 (t), (14) to simulate and taking into consideration large-scale vehic-
q ular communication effects. In this section, we show the
min(vx,i (t)) = vx,j−1 (t)2 − 2 · |decs | · di,j−1 (t), (15) computational costs in term of the number of events E in a
discrete event-based simulation model.
The lane changing prediction algorithm assumes the vehi- Suppose we have n vehicles in a vehicular communication
cle shifts to the adjacent lane at a y-speed of vy,i (t) while scenario, with each vehicle transmitting data at rate r in Hertz,
adjusting the x-speed xi (t) during the process. Eq. (12) cal- and the simulation time is t in seconds. When a vehicle is
culates the upper speed boundary of vehicle i. During the willing to send a message, events are scheduled in order to
lane changing process, vehicle j + 1 can perform a braking generate the message in the APP layer and forwarded to
operation and the shortest braking distance is determined the MAC layer, where the message is converted to a frame,
by decs , with di,j+1 being the distance on the x axis before experiences channel sensing, backoff, and finally sent to the
lane changing. The lane changing algorithm should predict PHY layer, all of which are conducted by different events.
whether di,j+1 is a safe distance for a lane change, i.e., In the PHY layer, the frame is transformed into a waveform
di,j+1 (t) should be greater than the difference of the brake and sent into the wireless channel by events. After receiving
trails from both vehicles. Similarly, the lower speed boundary a waveform, events are called in order to extract the informa-
is calculated by Eq. (13). The maximum and minimum speeds tion from the waveforms and send it way up to the APP layer
for vehicle i during a lane changing operation are defined by and process it in the mobility models. We assume the number
Eq. (14) and (15), respectively. of events E per transmission is e. The number of events E per
If the lane changing feasibility is not fulfilled, then vehicle simulation can be calculated by :
i will need to reduce its speed vx,i (t), i.e., brake, in order to
meet the safety constraint. If the feasibility check does allow E(n, r, t) = (nr) · e · (n − 1) · t, (16)
for a lane change, vehicle i will start to change lanes. The
trajectory model includes a lane changing period, target lane It is observed that the number of events E is linearly
chosen, etc. The validation and performance evaluation of the proportioned with the simulation time t and the data rate r, but
above mobility models have been presented in [39]. nonlinear with respect to the number of vehicles n. Figure 13
More sophisticated CFMs and LCMs have been proposed, shows the number of simulated events for each layer of the
including the Intelligent Driver Model (IDM) [40], Wiede- vehicular network and for the overall communication set.
mann Model [41], the Nagel-Schreckenberg model [42], and We choose the car following model (CFM) as the scenario
the Krauss (1998) Model [43]. These models can be imple- since for this CFM each vehicle broadcasts only BSMs at a
mented and used in VANET Toolbox if necessary. rate of 10 Hz and no other transmissions are involved. For a
600-second simulation when 4 vehicles are involved, the total
V. PERFORMANCE ANALYSIS number of events is around 2 × 106 . When the number of
In this section, the performance of the proposed simulation vehicles increases to 36, the total number of events is around
environment is evaluated. We first discuss the computational 1.5 × 108 , which represents an increase by a factor of 75.
costs of a full-stack vehicular network simulator in terms of In addition to the computational cost in terms of num-
the number of events scheduled during the simulation. Then, ber of events, we also profile the execution time for
we compare the packet success rate (PSR) of BPSK in a a 30-second simulation with 30 vehicles. The overall execu-
AWGN channel between MATLAB PHY layer implementa- tion time costs 8535 seconds, among which the PHY Tx func-
tion and NS-3 error rate model. Due to the bit level processing tion phy_psdu2waveform consumes 511 seconds (5.98%)
of the PHY layer, the channel tracking (CT) techniques can and the PHY Rx function phy_waveform2psdu consumes
be enabled on the L-LTF field in order to cope with the 4337 seconds (50.7%). These two functions include all bit-
high Doppler spread. The performance of CT is evaluated level processing operations of the PHY layer. As we have
FIGURE 13. Computational cost in terms of events for each layers. The
mono-color surfs indicate the number of events happened for the PHY 2) SimEvents CODE GENERATION
layer, the APP layer and the MAC layer (from bottom to top). The colorful MATLAB is a high-level interpreted type language and pro-
surf is the combination of events happened in all three layers.
vides an interactive programming environment. Compare
with lower-level languages such as C/C++, the execution
introduced in Section III-A, the PHY Tx function is straight- time is longer. Furthermore, the PHY layer includes bit-level
forward, i.e., serializing the PSDU to binary bits. While processing, which uses more numerical computations so that
most of the bit-level processing operations such as packet the execution speed is further slowed down.
detection, channel estimation and CRC verification are in In order to enhance the execution speed, MATLAB/
the PHY Rx function. Thus, the PHY Rx function costs Simulink supports converting MATLAB code into C/C++
more execution time than the PHY Tx function. Additionally, code using code generation techniques. Figure 14 presents a
the result also shows that even though the MAC layer creates comparison of the execution time with the code generation
the largest portion of events, the bit-level PHY layer costs (codegen) feature enabled and disabled. The computational
more computational cost in terms of execution time. testbed possesses the following characteristics: i7-6700k at
Among all the layers, the APP layer costs the fewest num- 4.0GHz (CPU), 32G DDR4 2133MHz (memory),Microsoft
ber of events since it is the top layer of the network stack Windows 10 (OS).
and it mainly deals with message generation and reception. In this figure, the execution time increases as the number
In our case, the BSM is the only application data generated in of vehicles increases. The red line indicates the simulations
the APP DES. If additionally applications are involved or the running in interpreted execution mode, i.e., without code
data generation rate is increased, the number of events will be generation. The blue line is the execution time with code
increased accordingly. The PHY link DES involves slightly generation. Based on this figure, the code generation shows
larger number of events relative to the APP layer because its advantage with respect to accelerating the execution speed.
whenever the APP DES generates one message and when For the simulation with 30 vehicles, interpreted execution
this message enters the PHY link DES module in the format costs 7945 seconds, while code generation execution costs
of a waveform entity, it triggers a series of events to deal 5185 seconds. The execution speed of 30 vehicles simulation
with activities such as delay, buffer, and waveform check. increases 53.23% because of code generation.
Therefore, the number of events in the PHY link DES cor-
relates to the number of messages generated in the APP B. PERFORMANCE OF THE PHY LAYER
DES module. The number of events increases dramatically In this section, the performance of the MATLAB PHY layer
in the MAC DES module. This is because the number of is evaluated and compared with the NIST error rate model of
events in the MAC DES module is not only correlated to NS-3, which is broadly adopted by iTETRIS and VSimRTI
the number of APP layer messages but also affected by the projects.
channel status. Suppose if the wireless channel is congested,
the channel sensing operation would be performed more 1) PRECISE PHY LAYER MODELING
frequently in order to monitor the channel status and seek NS-3 is a packet-based, discrete-event network simulator
a transmission opportunity. Consequently, the timer event equipped with several wireless models. When a waveform is
related to the channel sensing operation is called more fre- received, NS-3 calculates the signal to noise ratio (SNR) and
quently, which might cause a burst amount of events in the invokes its error rate model to decide the packet successful
MAC DES module. Additionally, since the PHY Tx and Rx reception rate. Two error rate models are integrated with
functions are integrated with the MAC/PHY DES Module, NS-3: the YANS [44] model and the NIST [45] model.
the events caused by PHY Tx/Rx are shown in the MAC/PHY The YANS model, which is based on an analytical bound
DES module surf instead of PHY Link DES module was replaced with NIST error model in 2010. In this paper,
surf. we only focus on the currently used NIST error rate model.
TABLE 4. Comparisons of features and limitations between proposed simulator and NS-3.
D. COMPARISONS BETWEEN PROPOSED SIMULATOR implementation is significantly slower than NS-3. Further-
AND NS-3 more, VANET Toolbox does not support parallel computing,
NS-3 is a well known discrete-event network simulator that i.e., the model created by VANET Toolbox cannot be oper-
supports full stack standards across a variety of networking ated across multiple cores. Even though SimEvents supports
applications. The NS-3 modules are robust and can operate C/C++ code generation since MATLAB R2017b, it still has
at a faster speed due to its C++ implementation. However, several limitations. For instance, C/C++ code generation
NS-3 potentially possessed several limitations. First, its PHY does not support hash map, persistent variables, or changing
layer is packet-based, which means the minimum data ele- the values of properties of an object inside another object.
ment is at the packet level instead of the bit level. Therefore, Those functions have to be declared as extrinsic functions
the bit-related operations such as channel tracking, channel and cannot enjoy the benefit of C/C++ code generation.
estimation, and frequency offset correction cannot be applied. Thus, the relatively slow execution speed is the major limi-
Additionally, NS-3 lacks supports for real radio hardware as it tation of the proposed simulator. Second, the movements of
is unable to convert information into bits or symbols. Second, entities among different DES modules require the support of
NS-3 was originally designed to operate in a pure network Simulink. Therefore, the VANET Toolbox inherits the limita-
simulation environment. In order to simulate vehicular traf- tions of Simulink. For example, parameters such as the total
fic, NS-3 either uses predefined route information or inter- number of vehicles cannot be changed during the simula-
acts with mobility simulators asynchronously with the help tion since Simulink locks all the parameters. Nevertheless,
of interfaces. The randomness of vehicular traffic scenario all of these limitations may be solved in future releases of
might not be able to be simulated in real-time. MATLAB/Simulink. Table 4 summarized the major features
Our proposed simulation environment compensates for and limitations for both simulators.
the limitations of NS-3. First, it provides a more accurate
PHY layer representation at the bit level. The simulator is VI. CONCLUSION
able to model the channel impairments such as noise, path In this paper, we presented an integrated vehicular net-
loss, or shadow fading on the bits. Moreover, the bits are work simulator called the VANET Toolbox that is based
converted into symbols, which are exactly the same format on MATLAB Discrete Event System (DES). This is the
in the real wireless communications. Thus, it is reasonable to first vehicular network simulator in the MATLAB/Simulink
infer the simulated wireless channel can be replaced by actual environment that supports a full stack of network proto-
software defined radios (SDR) such as the USRP. Real radio cols. The design structure of the main components namely,
transmissions will be evaluated in future research activities the APP layer, MAC layer, PHY layer, and basic mobility
of the authors. Furthermore, as the mobility models are inte- models, were proposed and were demonstrated to accu-
grated with the APP layer, the reciprocal interactions between rately simulate the inter-communications between vehi-
the traffic application and the network communication are cles in different scenarios but not without limitations. The
sufficiently supported. This feature makes the proposed sim- VANET Toolbox requires only MATLAB/Simulink to use it
ulator to simulate vehicular driving operations and network in addition to SimEvents, Communication and WLAN System
communications sufficiently synchronized in real time. Toolbox. The design purpose of the VANET Toolbox is to
On the other hand, the proposed simulator has several provide a framework and an opportunity to attract more
limitations. First, MATLAB is an interpreted programming researchers to improve it and finally benefit the vehicu-
language that aims for precision modeling. Compared with lar network development. The vehicular network simulator,
other compiled programming languages such as C++, which VANET Toolbox, is open source and can be down-
is used in NS-3, fast execution speeds or low computa- loaded from https://github.com/lewangwpi/vanet_toolbox
tional costs are often difficult to achieve in MATLAB, espe- or https://www.mathworks.com/matlabcentral/fileexchange/
cially with the PHY layer of VANET Toolbox, which is 684 37-vanet-toolbox-a-vehicular-network-simulator-based-
designed on bit level processing. It turns out that the proposed on-des.
ACKNOWLEDGMENT [22] T. K. Som and R. G. Sargent, ‘‘A probabilistic event scheduling policy
The authors would like to thank the generous support of for optimistic parallel discrete event simulation,’’ in Proc. 12th Workshop
Parallel Distrib. Simulation, May 1998, pp. 56–63.
the MathWorks and the Brazilian Government Science With- [23] K. Akesson, M. Fabian, H. Flordal, and R. Malik, ‘‘Supremica-an inte-
out Borders program. Furthermore, they would also like to grated environment for verification, synthesis and simulation of discrete
acknowledge the guidance and input for Mike McLernon of event systems,’’ in Proc. 8th Int. Workshop Discrete Event Syst., Jul. 2006,
pp. 384–385.
the MathWorks throughout these research activities. [24] R. Davidrajuh, ‘‘Developing a new Petri net tool for simulation of discrete
event systems,’’ in Proc. 2nd Asia Int. Conf. Modelling Simulation (AMS),
May 2008, pp. 861–866.
REFERENCES
[25] C.-H. Chen, ‘‘A hybrid approach of the standard clock method and event
[1] M. Müller, ‘‘WLAN 802.11 p measurements for vehicle to vehicle (V2V) scheduling approach for general discrete event simulation, ’’ in Proc. 27th
DSRC,’’ in Application Note Rohde Schwarz, vol. 1, pp. 1–25, 2009. Conf. Winter simulation, Dec. 1995, pp. 786–790.
[2] J. B. Kenney, ‘‘Dedicated short-range communications (DSRC) standards [26] S. Zhongyuea and G. Zhongliang, ‘‘Vehicle routing problem based on
in the United States,’’ Proc. IEEE, vol. 99, no. 7, pp. 1162–1182, Jul. 2011. object-oriented discrete event simulation,’’ in Proc. 2nd Int. Conf. Adv.
[3] H. Hartenstein and L. P. Laberteaux, ‘‘A tutorial survey on vehicular ad hoc Comput. Control, vol. 5, Mar. 2010, pp. 638–643.
networks,’’ IEEE Commun. Mag., vol. 46, no. 6, pp. 164–171, Jun. 2008. [27] IEEE Standard for Information Technology–Telecommunications and
[4] M. Chowdhury, ‘‘15th intelligent transportation systems world Information Exchange Between Systems Local and Metropolitan Area
congress,’’ J. Intell. Transp. Syst., vol. 14, no. 2, pp. 51–53, 2010. Networks–Specific Requirements - Part 11: Wireless LAN Medium Access
doi: 10.1080/15472451003738194. Control (MAC) and Physical Layer (PHY) Specifications, Standard,
[5] F. Ahmed-Zaid, H. Krishnan, M. Maile, L. Caminiti, S. Bai, and Dec. 2016.
S. VanSickle, ‘‘Vehicle safety communications—Applications: System [28] Vehicles in Network Simulation (VeinS). [Online]. Available: http://veins.
design & amp, objective testing results,’’ SAE Int. J. Passenger Cars Mech. car2x.org
Syst., vol. 4, pp. 417–434, Jun. 2011. [29] i TETRIS: The Open Simulation Paltform for Intelligent Transport
[6] G. Howe, G. Xu, D. Hoover, D. Elsasser, and F. Barickman, ‘‘Commercial System (ITS) Services. [Online]. Available: http://www.ictitetris.eu/
connected vehicle test procedure development and test results–emergency itetris_platform.html
electronic brake light,’’ Tech. Rep., 2016. [30] VSimRTI—Smart Mobility Simulation. [Online]. Available:
[7] G. Howe, G. Xu, D. Hoover, D. Elsasser, and F. Barickman, ‘‘Commercial https://www.dcaiti.tuberlin.de/research/simulation/
connected vehicle test procedure development and test results–blind spot [31] S. Papanastasiou, J. Mittag, E. G. Strom, and H. Hartenstein, ‘‘Bridg-
warning/lane change warning,’’ Tech. Rep., 2016. ing the gap between physical layer emulation and network simu-
[8] G. Howe, G. Xu, D. Hoover, D. Elsasser, and F. Barickman, ‘‘Commercial lation,’’ in Proc. IEEE Wireless Commun. Netw. Conf., Apr. 2010,
connected-vehicle test procedure development and test results–intersection pp. 1–6.
movement assist,’’ Tech. Rep., 2016. [32] B. Aygun, ‘‘Distributed adaptation techniques for connected vehicles,’’
[9] J. Harri, F. Filali, and C. Bonnet, ‘‘Mobility models for vehicular ad hoc Ph.D. dissertation, WPI, Worcester, MA, USA, 2016.
networks: A survey and taxonomy,’’ IEEE Commun. Surveys Tuts., vol. 11, [33] Mathworks. (May 2017). 802.11n Packet Error Rate Simulation for
no. 4, pp. 19–41, Dec. 2009. 2x2 TGn Channel. [Online]. Available: https://www.mathworks.com
/help/wlan/examples/802-11n-packet-error-rate-simulation-for-2x2-tgn-
[10] H. Hartenstein and K. Laberteaux, VANET: Vehicular Applications and
channel.html
Inter-Networking Technologies, vol. 1. Hoboken, NJ, USA: Wiley, 2009.
[34] C. Michaels, ‘‘DSRC implementatio guide–a guide to users of SAE
[11] D. O. Lazaro, E. Robert, L. Lan, J. Gozalvez, S. Turksma, F. Filali,
J2735 message sets over DSRC,’’ SAE, Pennsylvania, PA, USA, Tech.
F. Cartolano, M. A. Urrutia and Krajzewicz, ‘‘An integrated wireless
Rep., 2010.
and traffic platform for real-time road traffic management solutions,’’
[35] J2735 Dedicated Short Range Communications (DSRC) Message Set Dic-
in COMeSafety Newsletter, 2010.
tionary, Standard, SAE.
[12] L. Bononi, M. Di Felice, G. D’Angelo, M. Bracuto, and L. Donatiello,
[36] J2945 On-Board System Requirements for V2V Safety Communications,
‘‘MoVES: A framework for parallel and distributed simulation of wireless
Standard, SAE.
vehicular ad hoc networks,’’ Comput. Netw., vol. 52, no. 1, pp. 155–179,
[37] Static and Kineticfriction. [Online]. Available: http://ffden-
2008.
2.phys.uaf.edu/211_fall2002.web.dir/ben_townsend/staticandkineticfriction.
[13] M. Killat, F. Schmidt-Eisenlohr, H. Hartenstein, and C. Rössel, P. Vortisch, htm
S. Assenmacher, and F. Busch, ‘‘Enabling efficient and accurate large-scale
[38] NHTSA. (Sep. 1999). Federal Motor Vehicle Safety Standards; Stopping
simulations of VANETs for vehicular traffic management,’’ in Proc. 4th
Distance Table. [Online]. Available: https://www.gpo.gov/fdsys/pkg/FR-
ACM Int. workshop Vehiculr Ad Hoc Netw., Sep. 2007, pp. 29–38.
1999-09-07/pdf/99-23226.pdf
[14] S.-Y. Wang, C. L. Chou, C. H. Huang, C. C. Hwang, Z. M. Yang, [39] L. Wang, R. F. Iida, and A. M. Wyglinski, ‘‘Coordinated lane changing
C. C. Chiou, and C. C. Lin, ‘‘The design and implementation of using v2v communications,’’ in Proc. IEEE 88th Vehicular Technol. Conf.
the NCTUns 1.0 network simulator,’’ Comput. Netw., vol. 42, no. 2, (VTC-Fall), Aug. 2018, pp. 1–5.
pp. 175–197, 2003.
[40] A. Kesting, M. Treiber, and D. Helbing, ‘‘Enhanced intelligent driver
[15] D. Krajzewicz, J. Erdmann, M. Behrisch, and L. Bieker, ‘‘Recent devel- model to access the impact of driving strategies on traffic capacity,’’
opment and applications of SUMO-Simulation of Urban MObility,’’ Int. Philos. Trans. Roy. Soc. A, Math., Phys. Eng. Sci., vol. 368, no. 1928,
J. Adv. Syst. Meas., vol. 5, nos. 3–4, pp. 128–138, Dec. 2012. pp. 4585–4605, 2010.
[16] Nsnam. (Feb. 2017). NS-3 Project-Introduction to NS-3. [Online]. Avail- [41] B. Higgs, M. M. Abbas, and A. Medina, ‘‘Analysis of the wiedemann car
able: https://www.nsnam.org/docs/tutorial/html/introduction.html following model over different speeds using naturalistic data,’’ in Proc.
[17] G. Pongor, ‘‘Omnet: Objective modular network testbed,’’ in Proc. Int. Procedia RSS Conf., 2011, pp. 1–22.
Workshop Modeling, Anal., Simulation Comput. Telecommun. Syst., 1993, [42] A. Schadschneider, ‘‘The nagel-schreckenberg model revisited,’’ Eur.
pp. 323–326. Phys. J. B, Condens. Matter Complex Syst., vol. 10, no. 3, pp. 573–582,
[18] A. F. G. Gil, Traci4matlab: User’s Manual. Universidad Nacional De 1999.
Colombia, 2014. [43] S. Krauß, ‘‘Towards a unified view of microscopic traffic flow theories,’’
[19] C. Gorgorin, V. Gradinescu, R. Diaconescu, V. Cristea, and L. Ifode, IFAC Proc. Volumes, vol. 30, no. 8, pp. 901–905, 1997.
‘‘An integrated vehicular and network simulator for vehicular ad-hoc net- [44] M. Lacage and T. R. Henderson, ‘‘Yet another network simulator,’’ in Proc.
works,’’ in Proc. 20th Eur. Simulation Modelling Conf., vol. 59, May 2006, workshop ns-2, IP Netw. simulator, Oct. 2006, p. 12.
pp. 1–8. [45] G. Pei and T. R. Henderson, ‘‘Validation of OFDM error
[20] M. R. Stiglitz and C. Blanchard, IEEE Standard Dictionary of Electrical rate model in ns-3,’’ in Boeing Research Technology, 2010,
and Electronics Terms. 1992, Sec. 4. pp. 1–15.
[21] C. G. Cassandras and S. Lafortune, Introduction to Discrete Event Systems. [46] MathWorks. AWGN Channel. [Online]. Available: https://www.
Springer, 2009. mathworks.com/help/comm/ug/awgnchannelḣtml
[47] J. A. Fernandez, D. D. Stancil, and F. Bai, ‘‘Dynamic channel equal- RENATO IIDA received the B.Eng. degree in
ization for IEEE 802.11p waveforms in the vehicle-to-vehicle channel,’’ telecommunications engineering from the Univer-
in Proc. 48th Annu. Allerton Conf. Commun., Control, Comput. (Allerton), sity of Brasilia, Brazil, in 2002, and the M.Sc.
Sep./Oct. 2010, pp. 542–551. degree in electrical engineering from the Univer-
[48] P. Alexander, D. Haley, and A. Grant, ‘‘Cooperative intelligent transport sity of Brasilia, in 2006. He is currently pursuing
systems: 5.9-GHz field trials,’’ Proc. IEEE, vol. 99, no. 7, pp. 1213–1235, the Ph.D. degree in electrical engineering with the
Jul. 2011. Worcester Polytechnic Institute, Worcester, MA,
USA. From 2008 to 2014, he worked in system
level simulations with Nokia, and was involved in
the standardization of MUROS, VAMOS feature in
GSM network in 3GPP. His current research interests include V2V networks
and to improve the radio resource management in the type of networks. He
received an award from CAPES with science without borders program to
support his Ph.D.