guibaraujo / ndn4ivc

A Framework for Simulations of Realistic VANETs Applications through NDN
6 stars 2 forks source link

Creating different range of wifi for RSU and Vehicle #15

Open sangitatukai opened 3 years ago

sangitatukai commented 3 years ago

vndn-example-tms.txt @guibaraujo Here I am trying to creates different range of wifi for RSU and Vehicle modifying ndn4ivc/Helper/wifi-setup-helper.cc. I pass a boolean value through NetDeviceContainer WifiSetupHelper::ConfigureDevices (NodeContainer &nodes, bool enablePcap, int s)
and modified the lines if(s==1){ wifiPhy.Set ("TxPowerStart", DoubleValue (60)); //Minimum available transmission level (dbm) wifiPhy.Set ("TxPowerEnd", DoubleValue (60)); //Maximum available transmission level (dbm) } if(s==2){

wifiPhy.Set ("TxPowerStart", DoubleValue (24)); //Minimum available transmission level (dbm) wifiPhy.Set ("TxPowerEnd", DoubleValue (24)); //Maximum available transmission level (dbm) }

Now I call this function from vndn-example-tms.c In the original code where all the nodes are installed with the same networking devices has the following lines:

/std::cout << "Installing networking devices for every node..." << std::endl; ndn::WifiSetupHelper wifi; NetDeviceContainer devices = wifi.ConfigureDevices (nodePool, enablePcap, 1); // making wi fi range different with this boolean value /

I cahnged this as following for installing networking devices separately for RSU nodes and Vehicles nodes:

NodeContainer allOtherNodes, rsuNodes; //store the RSU nodes and vehilces node in different container

for (NodeList::Iterator i = NodeList::Begin(); i != NodeList::End(); ++i) { if ((i==nodePool.Get(0))||(i==nodePool.Get(1))||(i==nodePool.Get(2))||(i==nodePool.Get(3))||(i==nodePool.Get(4))||(i==nodePool.Get(5))){ rsuNodes.Add(i); } else allOtherNodes.Add(i);

    }

std::cout << "Installing networking devices for every RSU..." << std::endl; ndn::WifiSetupHelper wifi; NetDeviceContainer devices = wifi.ConfigureDevices (rsuNodes, enablePcap, 1); // making wi fi range different with this boolean value

std::cout << "Installing networking devices for every Vehicles..." << std::endl; ndn::WifiSetupHelper wifi1; NetDeviceContainer devices1 = wifi1.ConfigureDevices (allOtherNodes, enablePcap, 2); //change: /ndn4vc/helper/wifi-setup-helper.cc configureDvice()

Though it is not showing any error, when I pass the nodePool to .ConfigureDevices(), I found there is 4538 Forwarder:onContentStoreHit() But when I pass the rsuNodes and allOtherNodes seperately to ConfigureDevices, I found 0 onContentStoreHit().

Im not understanding why there is no content hit while I install the network device seperately to RSU and Vehicles. Are the RSU nodes are fail to work as content provider ? I am not getting where I made the mistake.

Here Im attaching the modified files of vndn-example-tms.cc in text version

fgfxf commented 6 months ago

可以尝试修改这个wifi-setup-helper.cc文件,按照install+参数选择的方式安装给节点。从而达到设置参数的目的。它原本dbm值是固定的。

image