[ns] [802.15.4] Possible bugs in MCPS_DATA_REQUEST Primitive
anurag d
anurag.bms at gmail.com
Sat Jun 14 12:44:03 PDT 2008
Dear All,
I am working on ns-allinone-2.33 and trying to develop an application
using the data primitives of 802.15.4 instead of the standard traffic
generators. I have come across the following possible errors in
implementation:
[1] The MAC header has not been initialised before sending the packet
as is done in constructCommandHeader() for beacon request, etc. Thus
the data was always destined to node 0. The following code is required
for setting the MAC header and can be placed in function
Mac802_15_4::mcps_data_request() before constructMPDU()
hdr_src((char *)HDR_MAC(msdu),index_);
if (DstAddr == 0xffff)
hdr_dst((char *)HDR_MAC(msdu),MAC_BROADCAST);
else
hdr_dst((char *)HDR_MAC(msdu),DstAddr);
[2] The msduHandle is not saved before sending the packet. As a
result, the MCPS_DATA_INDICATION in the SSCS layer is not called.
(note that according to the implementation, msduHandle must be
non-zero). We need to include the following code in
Mac802_15_4::mcps_data_request() before constructMPDU()
wph->msduHandle=msduHandle;
Although I think these are errors in the implementation, I am not sure
if they were expected to be included in the application programming
since the MCPS_DATA_REQUEST takes in the msdu as Packet type instead
of char as mentioned in the standard. The interface ideally should
take char* and build the Packet object including initialising the uid,
msduHandle and the MAC headers.
Any inputs on the reasons for the current implementation will be appreciated.
Thanks
Anurag D
IIM Calcutta
More information about the Ns-users
mailing list