- Notifications
You must be signed in to change notification settings - Fork0
tkn-tub/ns3irs
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Before using the IRS module, ensure the following requirements are met:
- Tested with
ns-3.43
- This module has to be located in the
contrib/
directory - TheEigen3 library must be installed, and ns-3 must be built with the
--enable-eigen
flag. - A modification is required in the ns-3 source code:
// File: src/network/helper/node-container.h// Original:classNodeContainer;// Replace with:classNodeContainer :publicObject;
Create one or multiple IRS nodes usingNodeContainer
:
NodeContainer irsNodes;irsNodes.Create(1);
The IRS node(s) require a mobility model, which can be installed using theMobilityHelper
, just like any other node in ns3.While any mobility model can theoretically be applied, it is recommended to use a static mobility model for the IRS in multi-IRS scenarios.In these scenarios moving IRS nodes can lead to inaccurate results, as the optimization strategies for the possible paths with more than one IRS assume stationary IRS.
MobilityHelper mobility;Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator>();positionAlloc->Add({0,0,0});mobility.SetPositionAllocator(positionAlloc);mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");mobility.Install(irsNodes);
Use theIrsLookupHelper
to configure the IRS node with anIrsLookupModel
, utilizing a pre-generated csv file for the lookup data:
IrsLookupHelper irsHelper;irsHelper.SetDirection({0,1,0});irsHelper.SetLookupTable("path/to/lookup_table.csv");irsHelper.Install(irsNodes);
The lookup table can be generated using thegenerateIrsLookupTable
helper script in thematlab/
directory, as follows:
freq=5.15e9;% Frequency in HzNr=20;% Number of elements in rowsNc=20;% Number of elements in columnsap= [0;0;0];% AP positionue= [50;0;0];% UE positionris= [0.7;-0.7;0];% IRS positiondir= [0,1,0];% IRS direction[r_ap_ris,a_ap_ris,r_ris_ue,a_ris_ue]= calcangle(ap,ue,ris,dir);ris_table= generateIrsLookupTable( ... round(a_ap_ris(1)), round(a_ris_ue(1)),Nr,Nc,freq, ... abs(ue(1)- ap(1)),r_ap_ris,r_ris_ue,0,"constructive" ...);
Using theIrsSpectrumModel
, the IRS node can be configured as follows:
Ptr<IrsSpectrumModel> irs = CreateObjectWithAttributes<IrsSpectrumModel>("Direction",VectorValue({0,1,0}), "N", TupleValue<UintegerValue, UintegerValue>({20,20}), "Spacing", TupleValue<DoubleValue, DoubleValue>({0.05,0.05}), "Frequency", DoubleValue(5.21e9));irs->CalcRCoeffs(los_distance, irs_distance,Angles(in_az, in_el), Angles(out_az, out_el), 0);irsNodes.Get(0)->AggregateObject(irs);
los_distance
refers to the length of the LOS path in meters, whileirs_distance
represents the distance of the path reflected over the IRS in meters.The variablesin_az
andin_el
represent the optimized incoming azimuth and elevation angles, respectively, in radians.Similarly,out_az
andout_el
correspond to the optimized outgoing azimuth and elevation angles, respectively, in radians.The last argument in theCalcRCoeffs
function is set to zero, which calculates the reflection coefficients so they create constructive interference with the LOS path.
N represents the number of elements in both the row and column directions, whileSpacing denotes the distance between elements.Frequency indicates the operating frequency for which the IRS is designed.
About
This is the respository for our IRS extension for ns-3. With ns3IRS simulation of full-stack IRS scenarios becomes possible.
Resources
Uh oh!
There was an error while loading.Please reload this page.