Hi every one,
Because I want to simulate the MEC(mobile multi-access computing) to measure latency, I use a method(virtual tun net device) which connection type between S/P-GW and RemoteHost to apply eNBs to simulate MEC on eNB.
I add new variable tunDevice(enbVgsDevice) to "Epc-Enb-Application" and set the "SetSendCallBack" in the "pointer-to-point-epc-helper::AddEnb(...)" to create link .
![](https://lh3.googleusercontent.com/-N_A460W5xdQ/WYvrCOFNpPI/AAAAAAAACwg/4tYMbI3MgY8yFZjCynkHF9xLpBa3pNcuwCLcBGAs/s320/codeForSetSendBack.PNG)
This method which is imitated the connection type between S/P-GW and RemoteHost does not modify anything(changed just variable name).
In Epc-Enb-application, I add two function "SendToVgsSocket(..)" and "RecvFromEnbVgsDevice(...)" .
The "SendToVgsSocket(..)" is same the "epc-sgw-pgw-application::SendToTunDevice(...)" (But remove other useless parameters, just leave "->Receive(...)" to sned packet )
and in the "epc-enb-applicaiton::RecvFromLteSocket(...)" to forward packet to VM on the eNB(simulate MEC).
The "RecvFromEnbVgsDevice" is same the "epc-sgw-pgw-application::RecvFromTunDevice(...)" to receive the packet from VM on the eNB , and it is set the "SetSendCallBack" in "pointer-to-point-epc-helper".
(imitate the connection between S/P-GW and RemoteHost)
A problem is UE packets are received by "Epc-Enb-application::RecvFromLteSocket(..)" first ,but UE packets will received by "Epc-Enb-application::RecvFromEnbVgsDevice(..)" first after I set "SetSendCallBack" for "RecvFromEnbVgsDevice(...)" .
Can any one tell me how to solve it? Thank you!
Best regard
YX-H
IP :7.0.0.2 is UE, 192.168.10.2 is RemoteHost on the eNB(simulate MEC), I use the lena-simple-epc.cc to test it.
normal before set setSendCallBack:
![](https://lh3.googleusercontent.com/-4m8gCwsteDE/WYvmrU0YWII/AAAAAAAACwM/JlQ5OAD7swI5YhjG7DSOrpL0oNlrnef-QCLcBGAs/s320/normal-result.PNG)
unnormal after set setSendCallBack:
Packet will go "RecvFromEnbVgsDevice(..)" first.
![](https://lh3.googleusercontent.com/-U0r1q1-1E8U/WYvnT5D2cBI/AAAAAAAACwQ/mlrTapDsrOEUQKbmZtDU-lKwyTalBsHQgCLcBGAs/s320/setSendback%2B-%2Border%2Berror.PNG)