LAB No.3 - CN 428 - Spring 2022

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

ELEC 428/528 COMMUNICATION NETWORKS – LAB 3 MANUAL

Due Date: 12 May 2022


Please be aware of that the installation of the software and the simulations take time.
The goal of this project is to observe the OSI network layers on vehicular networks.
The students are expected to use a MATLAB Simulink toolbox to simulate V2V
communication with the lane changing and car following events.
Follow the instructions given below and submit a lab report.
1. Download MATLAB 2022a (or any version you already have) with the following
toolboxes (our institution has the license for everything here, just create and use your
Mathworks account with your @ku.edu.tr mail address and download!)
• MATLAB Coder
• Simulink
• Simulink Coder
• SimEvents Toolbox
• WLAN System Toolbox
• Communications System Toolbox
• DSP System Toolbox

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

3. Watch the video to get general information:


https://www.youtube.com/watch?v=wIohwbSk68I

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.

simLC (2, 5, 'con', 0)




simLC (27, 5, 'con', 0)

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.

Vehicles broadcast their messages. So, when 1 message is broadcasted by a vehicle,


“the number of vehicles – 1” messages are received.
Packet delivery rate (PDR) is the ratio of the number of packets delivered with no
CRC error to the total number of received packets. Collusion rate (CR) is the ratio of
the packet collisions to the total sent packets. Plot vehicle number vs PDR and vehicle
number vs CR graphs. Clearly indicate the axes labels and titles of the graphs
Comment in the graphs.

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.

You might also like