Professional Documents
Culture Documents
LAB No.3 - CN 428 - Spring 2022
LAB No.3 - CN 428 - Spring 2022
LAB No.3 - CN 428 - Spring 2022
2. Download VANET toolbox from the link below and extract the files to your
workspace. We will use VANET_Toolbox_multiChannel_2019b_release version.
https://www.mathworks.com/matlabcentral/fileexchange/68437-vanet-toolbox-a-
vehicular-network-simulator-based-on-des
4. Open demo_4cars.slx.
a. Double click Parameter Control Panel box and check only Graphic UI option.
Run the simulation for 10 seconds. Observe the simulation.
b. Double click Parameter Control Panel and check both Graphic UI and Show
APP Text process options. Run the simulation for 3 seconds.
Click view diagnostics label at the bottom of the UI. Observe that the vehicles
send BSM (basic safety messages) at a constant rate. It contains a general
information about vehicle position and speed. On the other hand, there are also
safety critical messages, for example, the ones that are sent before a lane
changing event.
In Diagnostic Viewer, find the messages for the lane changing event (simply,
search for the word ‘LaneChanging’). Describe the process. How much is the
LClatency? What does latency refer to? Why is low latency important?
User data with different importance levels are grouped into 4 Access Categories (ACs) as
AC0, AC1, AC2, and AC3. In these simulations, we will only observe AC2 and AC3 type
messages. BSMs are in AC2. Safety critical messages are in AC3.
c. Double click Parameter Control Panel. Also check Show mac_phy text process
option. Run the simulation for 3 seconds. Check the message between
“Vehicle1 predict track in the next lane” and
“Car1^^START^^LANE^^CHANGING^^”. Briefly describe the process.
What is an ACK? When is it sent or not sent?
As it is hard to design large simulations via GUI, we continue with the script implementation.
Run simulations with the following MATLAB command:
simLC (5, 5 , 'con' , 1) % simLC (vehicleNo, simTime, LaneChangingType, GUIon)
The simLC script simulates the same environment with default settings.
5. Run the simulations without GUI during 5s. Change number of vehicles starting from
the last digit of your student ID with step size 5. Take at least 6 points.
Example: If your student ID ends with 2, the number of vehicles to simulate: 2, 7, 12,
17, 22, 27.
6. Check the results folder for statistic information. Load one of the statistic data. There
are 4 columns for each variable representing AC0-AC1-AC2-AC3 packets,
respectively. Therefore, we are interested in the data in the 3rd and 4th columns.
The metric delay is defined as the period from the moment when the message is
created to the moment that the receivers receive it correctly. You can see the delay
values when you load statistics files. Plot the normalized histogram, i.e. pdf, of delay
for AC2 and AC3 for the number of vehicles equal to “ID last digit +10”. (Hint: You
need to use the MATLAB function “histogram” with appropriate ‘Normalization’
option.)
7. Check what is CRC error and packet collusion. Crcerrcnt keeps the number of CRC
errors; whereas pktcolcnt keeps the number of collusions. Rcvcnt is the total number
of received messages and sndcnt is the number of the transmitted messages.
8. Your report should include the answers to the 4th question, plots and comments to the
6th and 7th questions. Please upload your report and your codes (.m file) to the
blackboard.