Bug 2646

Summary: The lena-simple-eps-emu example will never work.
Product: ns-3 Reporter: Tommaso Pecorella <tommaso.pecorella>
Component: lteAssignee: Biljana Bojović <bbojovic>
Status: RESOLVED FIXED    
Severity: normal CC: mmiozzo, ns-bugs
Priority: P3    
Version: ns-3-dev   
Hardware: All   
OS: All   

Description Tommaso Pecorella 2017-01-31 21:20:42 UTC
... because the "emu" module is no more.

The problem is: the example is part of the LTE documentation. As a consequence we should either:
1) Change the documentation and remove the example, or
2) Update the documentation and the example to use FdNetDevice

I'd suggest to go for option 2.
Comment 1 Marco Miozzo 2017-02-01 05:21:19 UTC
Hi Tommaso,

may I ask you a few more detail regarding the "emu" module?
LTE is currently using EmuFdNetDeviceHelper of the FdNetDevice module for working in "emu" mode.
Comment 2 Tommaso Pecorella 2017-02-01 05:53:45 UTC
(In reply to Marco Miozzo from comment #1)
> Hi Tommaso,
> 
> may I ask you a few more detail regarding the "emu" module?
> LTE is currently using EmuFdNetDeviceHelper of the FdNetDevice module for
> working in "emu" mode.

Hi Marco,

in waf there is this statement:
    obj = bld.create_ns3_program('lena-simple-epc-emu',
                                 ['lte', 'emu'])
    obj.source = 'lena-simple-epc-emu.cc'

Since there's no "emu" module, the example is not compiled.
I didn't check if it works simply by fixing the dependency (and if the documentation explicitly points to commands for the "emu" module).
Comment 3 Marco Miozzo 2017-02-01 06:30:27 UTC
got it! Thanks Tommaso.

It should be just matter of naming, I've tried with

    obj = bld.create_ns3_program('lena-simple-epc-emu',
                                 ['lte', 'fd-net-device'])


and it returned to work.
Comment 4 Marco Miozzo 2017-02-02 10:38:17 UTC
Commites, see changeset:   12609:96bed9b104c0
Comment 5 Tommaso Pecorella 2017-02-02 11:38:50 UTC
Sorry... not yet perfect.

On MacOS (and other architectures I think) FdNetDevice is built with reduced functionalities.
In particular, the EmuFdNetDevice is only compiled if ..

        conf.env['ENABLE_EMU'] = conf.check_nonfatal(
           header_name='netpacket/packet.h',
           define_name='HAVE_PACKET_H') and have_sysioctl and have_netif

MacOS, of course, returns false.
Still, FdNetDevice is built, and the example is (now) trying to be compiled - with obvious errors:

../src/lte/examples/lena-simple-epc-emu.cc:89:7: error: unknown type name 'EmuEpcHelper'; did you mean 'EpcHelper'?
  Ptr<EmuEpcHelper>  epcHelper = CreateObject<EmuEpcHelper> ();
Comment 6 Tommaso Pecorella 2017-02-02 17:05:43 UTC
Fixed for good (I hope) with a conditional compile.

changeset:   12616:2d1a1a4934e7