[Ns-developers] questions about node address and socket implementation

Giuseppe Piro peppe.piro at gmail.com
Mon Jun 28 07:05:56 PDT 2010


Hi Mathieu,
thanks fou your immediate help!

On 28 June 2010 10:11, Mathieu Lacage <mathieu.lacage at sophia.inria.fr>wrote:

> On Mon, 2010-06-28 at 09:36 +0200, Giuseppe Piro wrote:
>
> > 1 - Node Address.
> >
> > It is not clear for me how it is possible to manage MAC address node in
> > ns-3. To all devices it is possible to assign IP address using
> >  Ipv4AddressHelper::Assign () function, calling it directly into the main
> > program. The question is: where, who, and how the MAC address is defined
> for
> > a particular device ?
>
> See CsmaHelper::InstallPriv
>
>
Yes, I saw. For this issue, I have set the MAC address correctly, using


device->SetAddress (Mac48Address::Allocate ());

in LteHelper::Install () function ;-)



> [snip]
>
> > When the NetDevice::Send() method will be called, the address of the
> > destination is already known. Why ? How the socket is able to obtain this
> > address starting from the IP address of the destination device ?
>
> The wonders of ARP if LteNetDevice::NeedsArp returns true. Otherwise,
> the destination is LteNetDevice::GetBroadcast.
>
>
> > LteNetDevice:Send(0x9aa17f8, 04-06-ff:ff:ff:ff:ff:ff, 2048)
>
> LteNetDevice::NeedsArp returns false then.
>
> > LteNetDevice:SendFrom(0x9aa17f8, 04-06-00:00:00:00:00:02,
> > 04-06-ff:ff:ff:ff:ff:ff, 2048)
> > EnbNetDevice:DoSend(0x9a9d258, 00:00:00:00:00:02, ff:ff:ff:ff:ff:ff,
> 2048)
> >
> > Why the destination address is equal to ff:ff:ff:ff:ff:ff:, instead
> > 00:00:00:00:00:01 ?
> > Where is the problem ? Have I done some configuration errors ?
>
> Make NeedsArp return true ?
>
>
I modified the value returned by LteNetDevice::NeedsArp () but the problem
is there yet. In particular, LteNetDevice::GetBroadcast () is called in any
case:

LteNetDevice:NeedsArp(0x9038258)
LteNetDevice:GetBroadcast(0x9038258)
LteNetDevice:GetAddress(0x9038258)
LteNetDevice:GetBroadcast(0x9038258)
LteNetDevice:Send(0x903d1a0, 04-06-ff:ff:ff:ff:ff:ff, 2054)
LteNetDevice:SendFrom(0x903d1a0, 04-06-00:00:00:00:00:02,
04-06-ff:ff:ff:ff:ff:ff, 2054)
EnbNetDevice:DoSend(0x9038258, 00:00:00:00:00:02, ff:ff:ff:ff:ff:ff, 2054)

So, do you think that I have done another error into the code ?


> [snip]
>
> > however, forwarding the packet to the upper layer, appears another error:
> >
> > LteNetDevice:ForwardUp(0x9a9b980)
> > packet 00:00:00:00:00:02 --> ff:ff:ff:ff:ff:ff (here: 00:00:00:00:00:01)
> > Received packet with erroneous context ; make sure the channels in use
> are
> > correctly updating events context when transfering events from one node
> to
> > another.
> >
> >
> > Is this error related to the incorrect address ? How I can revolve it ?
>
> That is a different issue. In LteChannel, use
> Simulator::ScheduleWithContext. See PointToPointChannel::TransmitStart
> for example.
>
>
Ok, I resolved the problem: the pointer to the device was not defined for
each spectrum model (DL and UL PHY layer of the device). Now seems to be
right.



Mathieu
> --
> Mathieu Lacage <mathieu.lacage at sophia.inria.fr>
> Tel: +33 4 9238 5056
>
>

Cheers,

Giuseppe


More information about the Ns-developers mailing list