Unipisa / Simu5G

Simu5G - 5G NR and LTE/LTE-A user-plane simulation model for OMNeT++ & INET
https://simu5g.org
Other
147 stars 83 forks source link

Issue instantiating different apps on one MEC #130

Closed juansebastiani2cat closed 1 year ago

juansebastiani2cat commented 1 year ago

Dear all,

Hello, I am experiencing some difficulties and would greatly appreciate your assistance with the following matter. I have a configuration consisting of several MEC Hosts, and I would like to pass multiple applications so that the MEC Orchestrator can select the best MEC from the available options. To achieve this, I have configured one application per user equipment (UE) as follows:

*.ue[*].numApps = 2
*.ue[*].app[0].typename = "DeviceApp"
*.ue[*].app[0].localPort = 4500
*.ue[*].app[0].UALCMPAddress = "ualcmp"
*.ue[*].app[0].UALCMPPort = 1000
*.ue[0].app[0].appPackageSource = "/ApplicationDescriptors/WarningAlertApp0.json"
*.ue[*].app[1].typename = "UEWarningAlertApp"
*.ue[*].app[1].deviceAppAddress = "ue["+string(ancestorIndex(1))+"]"
*.ue[*].app[1].deviceAppPort = 4500
*.ue[0].app[1].startTime = 1.0s
*.ue[0].app[1].stopTime = 30s

*.ue[*].app[0].typename = "DeviceApp"
*.ue[*].app[0].localPort = 4500
*.ue[*].app[0].UALCMPAddress = "ualcmp"
*.ue[*].app[0].UALCMPPort = 1000
*.ue[1].app[0].appPackageSource = "/ApplicationDescriptors/WarningAlertApp2.json"
*.ue[*].app[1].typename = "UEWarningAlertApp"
*.ue[*].app[1].deviceAppAddress = "ue["+string(ancestorIndex(1))+"]"
*.ue[*].app[1].deviceAppPort = 4500
*.ue[1].app[1].startTime = 1.2s
*.ue[1].app[1].stopTime = 30s

And also modified the line with the lists of MEC app descriptors to be onboarded at, as follows: *.mecOrchestrator.mecApplicationPackageList = "WarningAlertApp0, WarningAlertApp2" # List of MEC app descriptors to be onboarded at I have modified the original WarningAlertApp.json and duplicated with different values in order to have two files under mec/MultiMecHost/ApplicationDescriptors: WarningAlertApp0.json and WarningAlertApp2.json. However, when I start the simulation, the following error arises:

ApplicationDescriptor file: /ApplicationDescriptors/WarningAlertApp0.json does not exist -- in module (MecOrchestrator) MultiMecHost.mecOrchestrator (id=54), at t=1.034001284575s, event #98477

I have two questions that I hope you can help me with:

  1. Do I need to modify any other configuration settings or am I missing something that could be causing this error to occur?
  2. Is it possible to assign multiple applications to a single UE? Thank you very much for your assistance and guidance.
zazim13 commented 1 year ago

Hi, I have been working with simu5g for a few month and I worked with MEC examples. I precise that I am not an expert. From what I understand for now: DeviceApp is not a MecApp neither an "UEapp". It is a kind of API running in the UE that can communicate with the UALCMP to instanciate a MecAPP. It is well explained in this paper in particular in figure 5.

The example NR/mec/singleMecHost shows how to implement one MecAPP. You need for each UE an "UEApp" in this example UEWarningAlertApp, and a DeviceApp. than, the MecApp itself (in this example MECWarningAlertApp) is specified in a descriptorfile here (ApplicationsDescriptors/WarningAlertApp). This descriptor file is declared in the parameter appPackageSource of DeviceApp.

For one MECApp as you can find in NR/mec/singleMecHost example, a DeviceApp is needed:

*.ue[*].app[0].typename = "DeviceApp" 
*.ue[*].app[0].localPort = 4500
*.ue[*].app[0].UALCMPAddress = "ualcmp"
*.ue[*].app[0].UALCMPPort = 1000
*.ue[*].app[0].appPackageSource = "ApplicationDescriptors/WarningAlertApp.json"

and an UEApp also

*.ue[*].app[1].typename = "UEWarningAlertApp"        
*.ue[*].app[1].deviceAppAddress = "ue["+string(ancestorIndex(1))+"]"                          
*.ue[*].app[1].deviceAppPort = 4500                          
*.ue[*].app[1].startTime = 1s                                                                                    
*.ue[*].app[1].stopTime = 30s  

To instanciate more than one MECApp for each UE, I tried different posibilities but the one that seems to be working is to duplicate deviceApp and UEapp. For each MECApp that has to be instanciated I am instanciating one DeviceApp and one UEApp. For instance, to instanciate 2 MECApp:

One DeviceApp for the first MecApp

*.ue[*].app[0].typename = "DeviceApp" 
*.ue[*].app[0].localPort = 4500                          
*.ue[*].app[0].UALCMPAddress = "ualcmp"                          
*.ue[*].app[0].UALCMPPort = 1000                          
*.ue[*].app[0].appPackageSource = "ApplicationDescriptors/WarningAlertApp.json"

One UEApp for the first MecApp

*.ue[*].app[1].deviceAppAddress = "ue["+string(ancestorIndex(1))+"]"                          
*.ue[*].app[1].deviceAppPort = 4500                     
*.ue[*].app[1].localPort=4000     
*.ue[*].app[1].startTime = 1s                                                                                    
*.ue[*].app[1].stopTime = 30s                
*.ue[*].app[1].typename = "UEWarningAlertApp"       

One DeviceApp for the second MecApp

*.ue[*].app[2].typename = "DeviceApp" 
*.ue[*].app[2].localPort = 4502                         
*.ue[*].app[2].UALCMPAddress = "ualcmp"                          
*.ue[*].app[2].UALCMPPort = 1000                          
*.ue[*].app[2].appPackageSource = "ApplicationDescriptors/WarningAlertApp.json"

One UEApp for the second MecApp

*.ue[*].app[3].deviceAppAddress = "ue["+string(ancestorIndex(1))+"]"                          
*.ue[*].app[3].deviceAppPort = 4502       
*.ue[*].app[1].localPort=4002                   
*.ue[*].app[3].startTime = 1s                                                                                    
*.ue[*].app[3].stopTime = 30s                
*.ue[*].app[3].typename = "UEWarningAlertApp"   

Here I am using the same appdescriptor file meaning that I am instanciating two times the same MECApp (the code behind is the same)

It should work with these modifications, but not sure if it is the way it is supposed to be implemented, it would be great to have advices from other users about how to properly implement multiple MecAPP.

linofex commented 1 year ago

@juansebastiani2cat I think the error is due to the path (there is the first "/" that is parsed as root ). Have you tried appPackageSource = "ApplicationDescriptors/WarningAlertApp0.json" ? For what concern your second question, the answer from @zazim13 is correct. Currently, there is a 1-to-1 relationship between MEC apps and Device App.

Best regards, Alessandro

juansebastiani2cat commented 1 year ago

Yeah, thanks to both of you for your answers. Now is working.