brianmc95 / OpenCV2X

OMNeT++ V2X simulation framework for ETSI ITS-G5
GNU General Public License v2.0
37 stars 15 forks source link

Adjacency scenario #8

Open MounaKaroui opened 4 years ago

MounaKaroui commented 4 years ago

Hi @brianmc95 ,

I am testing Non-adjacent mode. I obtain a segmentation fault, so I tried to understand why this is occurs. I observed that in LTEPhyVUeMode4 :

sciRbs[it->first][jt->first] = 1; // line that causes the bug, because jt and it can be null, so that 's why segmentation fault can occur

I rectified the problem using the line of code as follow:

           //sciRbs[remote][band] = assigned Rb
               if((it->first!=0)&&(jt->first!=0))
               {
                sciRbs[it->first][jt->first] = 1;  
                ++allocatedRbs;
               }

I obtained the following results: image

For Channel busy ratio, it seems logical that we obtain the better result with non-adjacent mode since this latter uses separate resource pools for sending SCI and TB messages. So collisions due to SCI will be reduced compared to adjacent mode.

However, what I didn't understand that with non-adjacent mode, we obtain worse results in terms of packet delivery ratio.

image

Have you an idea about that ?

brianmc95 commented 4 years ago

Hi @MounaKaroui,

Thanks for all the detail in the above, really helpful.

First, can I ask which scenario are you running? So I can replicate too.

Personally I don't see any reason why CBR would be reduced in a non-adjacent mode, CBR is based on subchannels used at each time, so unless non-adjacent is incorrectly recording the subchannels then used then CBR should be the same.

The same may apply on the PDR side, it's possible that a bug in the non-adjacent mode is causing some subchannels not to be used and therefore more collisions and a lower overall PDR.

I'll investigate using your solution first and then update this with more information.

Brian

MounaKaroui commented 4 years ago

@brianmc95 Thanks for your reply. I am using highway congested scenario. For adjacent and non adjacent, DCC is not activated.

*.traci.launcher.sumocfg = "highway/congested/congested.sumo.cfg"
### start simul
*.traci.core.startTime = 500s
sim-time-limit = 512s

[Config adjacency]
*.node[*].d2dCapable = true
*.node[*].mode4D2D = true
**.amcMode = "D2D"
*.node[*].nicType = "LteNicVUeMode4"
*.node[*].lteNic.d2dCapable = true
*.node[*].lteNic.pdcpRrc.ipBased = false
*.node[*].lteNic.rlc.ipBased = false
*.node[*].lteNic.mac.subchannelSize = 16
*.node[*].lteNic.mac.numSubchannels = 3
*.node[*].lteNic.mac.probResourceKeep = 0.4
*.node[*].lteNic.mac.resourceReservationInterval = 1
*.node[*].lteNic.mac.maximumLatency = 100
*.node[*].lteNic.mac.minSubchannelNumberPssch = 1
*.node[*].lteNic.mac.maxSubchannelNumberPssch = 10
*.node[*].lteNic.mac.minMcsPssch = 1
*.node[*].lteNic.mac.maxMcsPssch = 28
*.node[*].lteNic.mac.allowedRetxNumberPssch = 0
*.node[*].lteNic.mac.reselectAfter = 1
*.node[*].lteNic.mac.useCbr = false
*.node[*].lteNic.phy.subchannelSize = 16
*.node[*].lteNic.phy.numSubchannels = 3
*.node[*].lteNic.phy.selectionWindowStartingSubframe = 1
*.node[*].lteNic.phy.adjacencyPSCCHPSSCH = false
*.node[*].lteNic.phy.pStep = 100
*.node[*].ueTxPower = 23
**.usePreconfiguredTxParams = true
*.node[*].application.typename = "artery.lte.Mode4.Mode4Application"
*.node[*].application.middleware.updateInterval = 0.1s
*.node[*].application.middleware.datetime = "2013-06-01 12:35:00"
*.node[*].application.middleware.services = xmldoc("services.xml")
**.lteNic.mac.txConfig = xmldoc("sidelink_configuration.xml")

*.node[*].middleware.updateInterval = 0.1 s
*.node[*].middleware.datetime = "2018-01-17 13:44:00"
*.node[*].middleware.services = xmldoc("services.xml")

*.node[*].middleware.CaService.withDccRestriction = false
*.node[*].vanetza.dcc.TransmitRateControl = "NoTransmitRateControl"
*.node[*].middleware.CaService.fixedRate = true
*.node[*].middleware.CaService.minInterval = 0.1 s
*.node[*].middleware.CaService.maxInterval = 1 s
brianmc95 commented 4 years ago

Thanks for that, I will do my best to replicate and debug everything and get back to you once I have more detail.

brianmc95 commented 4 years ago

Hi @MounaKaroui,

Sorry for the delay in getting back to you on this. I figured out the issue though and have made a correction based. This I will add into master today.

The issue was one due to my own concentration on adjacent configurations and the system for non-adjacent had obviously not been maintained. As such incorrect RBs were assigned to SCIs and TBs which lead to a larger number of collisions and as such meant that there was reduced PDR. See below for the new graphs which I believe to be corrected. This is only based on 3 simulation runs so the minor difference is negligible I believe.

If you want to check it out for yourself then please in the extern/simulte pull the adjacency-fix branch and run the simulations from there and it should work for you too. I will update master of both repositories and then close this issue unless you disagree.

Adjacency-CBR-2020-02-17-10_46_06

Adjacency-PDR-TB-2020-02-17-10_46_06

MounaKaroui commented 4 years ago

Hi @brianmc95 , Thanks for your answer. I will test your new code. Results seem more logical now. Regards, Mouna

MounaKaroui commented 4 years ago

Hi @brianmc95 , I reproduced results from adjacency-fix. For CBR I obtain approximately like you as shown in the figure below: image

But, I don't obtain the same result in term of PDR image

I used these python functions for PDR extraction:

def selectTBdecoded(conn): df=pd.read_sql_query("SELECT vd.simTimeRaw*0.000000000001 time,v.moduleName nodeId, vd.value tb FROM vector v INNER JOIN vectordata vd ON vd.vectorId=v.vectorId where v.vectorName='tbDecoded:vector'",conn) return df

def selectTxRXDistanceTB(conn): df=pd.read_sql_query("SELECT vd.simTimeRaw*0.000000000001 time, v.moduleName nodeId, vd.value dist FROM vector v INNER JOIN vectordata vd ON vd.vectorId=v.vectorId where v.vectorName='txRxDistanceTB:vector'",conn) return df

def getVectorData(pathVector): conex=create_connection(pathVector) cbr_vec=selectCBR(conex) tbDecoded=selectTBdecoded(conex) distance_df=selectTxRXDistanceTB(conex) distance="dist" stat='tb' max_distance = min(510, distance_df[distance].max()) distance_df[stat]=tbDecoded[stat] distance_df = distance_df[distance_df[stat] > -1] distance_df = distance_df.groupby( pd.cut(distance_df[distance], np.arange(0, max_distance, 10))).agg( {stat:['mean', 'std']}) distance_df = distance_df.apply(lambda x: x * 100, axis=1) return cbr_vec,distance_df

brianmc95 commented 4 years ago

Hi @MounaKaroui glad I hadn't closed this then. It's very possible that I forgot to push the latest changes. If you pull now and rerun then it should work the same as mine. So sorry for such a silly mistake and wasting your time.

MounaKaroui commented 4 years ago

Hi @brianmc95,

Sorry for the delay.
You find below the following results after running scenario from your branch: https://github.com/brianmc95/OpenCV2X/tree/adjacency-fix

image

image

brianmc95 commented 4 years ago

Hi @MounaKaroui, Yours are a little more diverse than mine are but they seem fairly similar. Are you happy if I merge that branch to master that we can close this issue or do you think more investigation is needed?

MounaKaroui commented 4 years ago

I exactly tested your branch without any modification. Indeed, It 's a little bit wired that I couldn't find exactly your results. I only used one repetition for that results, what about you ?

brianmc95 commented 4 years ago

I did about 3 simulations so nothing significant either if I'm honest. I'll do a few simulations again and post the results in the next couple days to double check.

MounaKaroui commented 4 years ago

Ok, I will also try to do more repetitions as much as I can, and we will see. Maybe we obtain similar results.