diff --git a/CHANGES.md b/CHANGES.md index 242ffd23c..f017380be 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -23,6 +23,7 @@ Changes from ns-3.37 to ns-3.38 * (core) Added several macros in **warnings.h** to silence compiler warnings in specific sections of code. Their use is discouraged, unless really necessary. * (internet-apps) Add class `Ping` for a ping model that works for both IPv4 and IPv6. * In `src/spectrum`, a new fast-fading model `TwoRaySpectrumPropagationLossModel` has been added. This model serves as a performance-oriented alternative to the `ThreeGppSpectrumPropagationLossModel` and `ThreeGppChannelModel` classes, and it has been designed with the goal of providing end-to-end channel samples which are statistically close to the ones generated by the latter. +* (lr-wpan) `LrWpanNetDevice::SetPanAssociation` is introduced to create more complex topologies (multi-hop) using a manual association. ### Changes to existing API @@ -35,6 +36,7 @@ Changes from ns-3.37 to ns-3.38 * (lr-wpan) Adds beacon payload handle support (MLME-SET.request) in **LrWpanMac**. * (core) Now test-runner exits if no TestSuite is specified. * (lr-wpan) Adds the possibility to modify the Rx sensitivity in **LrWpanPhy**. +* (lr-wpan) `LrWpanHelper::CreateAssociatedPan` replace `LrWpanHelper::AssociateToPan` and is able to create an associated PAN of the devices with both short addresses (16-bits) and extended addresses (EUI-64 bits). ### Changes to build system diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 0b1ba74b9..758d2d511 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -43,6 +43,7 @@ Release 3-dev - (core) !1236 - Deprecation warnings are silenced while calling `NS_OBJECT_ENSURE_REGISTERED` - (wifi) Fixed multiple issues about setting the TXOP holder - (wifi) #861 - bianchi validation script can't run with 11ax +- (lr-wpan) #636 - Ext address, short address and manual assoc adjustments Release 3.37 ------------ diff --git a/examples/ipv6/wsn-ping6.cc b/examples/ipv6/wsn-ping6.cc index 14a4cc6e9..54d81a575 100644 --- a/examples/ipv6/wsn-ping6.cc +++ b/examples/ipv6/wsn-ping6.cc @@ -88,7 +88,7 @@ main(int argc, char** argv) // Add and install the LrWpanNetDevice for each node // lrWpanHelper.EnableLogComponents(); NetDeviceContainer devContainer = lrWpanHelper.Install(nodes); - lrWpanHelper.AssociateToPan(devContainer, 10); + lrWpanHelper.CreateAssociatedPan(devContainer, 10); std::cout << "Created " << devContainer.GetN() << " devices" << std::endl; std::cout << "There are " << nodes.GetN() << " nodes" << std::endl; diff --git a/src/lr-wpan/examples/lr-wpan-bootstrap.cc b/src/lr-wpan/examples/lr-wpan-bootstrap.cc index e6a137caa..28b17279d 100644 --- a/src/lr-wpan/examples/lr-wpan-bootstrap.cc +++ b/src/lr-wpan/examples/lr-wpan-bootstrap.cc @@ -30,6 +30,9 @@ * on the LQI results of the scan. A node may not find any beacons if the coordinator is outside its * communication range. An association request may not be send if LQI is too low for an association. * + * The coordinator in PAN 5 runs in extended addressing mode and do not assign short addresses. + * The coordinator in PAN 7 runs in short addressing mode and assign short addresses. + * * At the end of the simulation, an animation is generated (lrwpan-bootstrap.xml), showing the * results of the association with each coordinator. This simulation can take a few seconds to * complete. @@ -104,11 +107,22 @@ ScanConfirm(Ptr device, MlmeScanConfirmParams params) // Only request association if the coordinator is permitting association at this moment. if (params.m_panDescList[panDescIndex].m_superframeSpec.IsAssocPermit()) { + std::string addressing; + if (params.m_panDescList[panDescIndex].m_coorAddrMode == SHORT_ADDR) + { + addressing = "Short"; + } + else if (params.m_panDescList[panDescIndex].m_coorAddrMode == EXT_ADDR) + { + addressing = "Ext"; + } + std::cout << Simulator::Now().As(Time::S) << " Node " << device->GetNode()->GetId() << " [" << device->GetMac()->GetShortAddress() << " | " << device->GetMac()->GetExtendedAddress() << "]" << " MLME-scan.confirm: Selected PAN ID " - << params.m_panDescList[panDescIndex].m_coorPanId << " | LQI " + << params.m_panDescList[panDescIndex].m_coorPanId + << "| Coord addressing mode: " << addressing << " | LQI " << static_cast(params.m_panDescList[panDescIndex].m_linkQuality) << "\n"; @@ -126,6 +140,7 @@ ScanConfirm(Ptr device, MlmeScanConfirmParams params) assocParams.m_coordAddrMode = LrWpanAddressMode::SHORT_ADDR; assocParams.m_coordShortAddr = params.m_panDescList[panDescIndex].m_coorShortAddr; + assocParams.m_capabilityInfo.SetShortAddrAllocOn(true); } else if (assocParams.m_coordAddrMode == LrWpanAddressMode::EXT_ADDR) { @@ -133,6 +148,7 @@ ScanConfirm(Ptr device, MlmeScanConfirmParams params) assocParams.m_coordExtAddr = params.m_panDescList[panDescIndex].m_coorExtAddr; assocParams.m_coordShortAddr = Mac16Address("ff:fe"); + assocParams.m_capabilityInfo.SetShortAddrAllocOn(false); } Simulator::ScheduleNow(&LrWpanMac::MlmeAssociateRequest, @@ -169,13 +185,14 @@ ScanConfirm(Ptr device, MlmeScanConfirmParams params) static void AssociateIndication(Ptr device, MlmeAssociateIndicationParams params) { - // This is typically implemented by the Coordinator next layer (3rd layer or higher). + // This is typically implemented by the coordinator next layer (3rd layer or higher). // The steps described below are out of the scope of the standard. // Here the 3rd layer should check: - // a) Whether or not the device was previously associated with this PAN (the coordinator - // keeps a list). b) The coordinator have sufficient resources available to allow the - // association. + // a) Whether or not the device was previously associated with this PAN + // (the coordinator keeps a list). + // b) The coordinator have sufficient resources available to allow the + // association. // If the association fails, status = 1 or 2 and assocShortAddr = FFFF. // In this example, the coordinator accepts every association request and have no association @@ -360,7 +377,8 @@ main(int argc, char* argv[]) NetDeviceContainer lrwpanDevices = lrWpanHelper.Install(nodes); lrwpanDevices.Add(lrWpanHelper.Install(coordinators)); - lrWpanHelper.AssociateToPan(lrwpanDevices, 0xffff); + // Set the extended address to all devices (EUI-64) + lrWpanHelper.SetExtendedAddresses(lrwpanDevices); // Devices hooks & MAC MLME-scan primitive set for (NodeContainer::Iterator i = nodes.Begin(); i != nodes.End(); i++) @@ -417,6 +435,16 @@ main(int argc, char* argv[]) Ptr netDeviceCoor2 = coor2->GetDevice(0); Ptr coor2Device = DynamicCast(netDeviceCoor2); + // Coordinators require that their short address is explicitly set. + // Either FF:FE to indicate that only extended addresses will be used in the following + // data communications or any other value (except for FF:FF) to indicate that the coordinator + // will use the short address in these communications. + // The default short address for all devices is FF:FF (unassigned/no associated). + + // coor1 (PAN 5) = extended addressing mode coor2 (PAN 7) = short addressing mode + coor1Device->GetMac()->SetShortAddress(Mac16Address("FF:FE")); + coor2Device->GetMac()->SetShortAddress(Mac16Address("CA:FE")); + // PAN coordinator 1 (PAN 5) transmits beacons on channel 12 MlmeStartRequestParams params; params.m_panCoor = true; diff --git a/src/lr-wpan/helper/lr-wpan-helper.cc b/src/lr-wpan/helper/lr-wpan-helper.cc index abd114979..a4d72efe9 100644 --- a/src/lr-wpan/helper/lr-wpan-helper.cc +++ b/src/lr-wpan/helper/lr-wpan-helper.cc @@ -231,85 +231,80 @@ LrWpanHelper::AssignStreams(NetDeviceContainer c, int64_t stream) } void -LrWpanHelper::AssociateToPan(NetDeviceContainer c, uint16_t panId) +LrWpanHelper::CreateAssociatedPan(NetDeviceContainer c, uint16_t panId) { NetDeviceContainer devices; uint16_t id = 1; - uint8_t idBuf[2]; + uint8_t idBuf[2] = {0, 0}; + uint8_t idBuf2[8] = {0, 0, 0, 0, 0, 0, 0, 0}; + Mac16Address address16; + Mac64Address address64; + Mac16Address coordShortAddr; + Mac64Address coordExtAddr; for (NetDeviceContainer::Iterator i = c.Begin(); i != c.End(); i++) { + if (id < 0x0001 || id > 0xFFFD) + { + NS_ABORT_MSG("Only 65533 addresses supported. Range [00:01]-[FF:FD]"); + } + Ptr device = DynamicCast(*i); if (device) { idBuf[0] = (id >> 8) & 0xff; idBuf[1] = (id >> 0) & 0xff; - Mac16Address address; - address.CopyFrom(idBuf); + address16.CopyFrom(idBuf); + + idBuf2[6] = (id >> 8) & 0xff; + idBuf2[7] = (id >> 0) & 0xff; + address64.CopyFrom(idBuf2); + + if (address64 == Mac64Address("00:00:00:00:00:00:00:01")) + { + // We use the first device in the container as coordinator + coordShortAddr = address16; + coordExtAddr = address64; + } + + // TODO: Change this to device->GetAddress() if GetAddress can guarantee a + // an extended address (currently only gives 48 address or 16 bits addresses) + device->GetMac()->SetExtendedAddress(address64); + device->SetPanAssociation(panId, coordExtAddr, coordShortAddr, address16); - device->GetMac()->SetPanId(panId); - device->GetMac()->SetShortAddress(address); id++; } } } void -LrWpanHelper::AssociateToBeaconPan(NetDeviceContainer c, - uint16_t panId, - Mac16Address coor, - uint8_t bcnOrd, - uint8_t sfrmOrd) +LrWpanHelper::SetExtendedAddresses(NetDeviceContainer c) { NetDeviceContainer devices; - uint16_t id = 1; - uint8_t idBuf[2]; - Mac16Address address; - - if (bcnOrd > 14) - { - NS_LOG_DEBUG("The Beacon Order must be an int between 0 and 14"); - return; - } - - if ((sfrmOrd > 14) || (sfrmOrd > bcnOrd)) - { - NS_LOG_DEBUG("The Superframe Order must be an int between 0 and 14, and less or equal to " - "Beacon Order"); - return; - } + uint64_t id = 1; + uint8_t idBuf[8] = {0, 0, 0, 0, 0, 0, 0, 0}; + Mac64Address address64; for (NetDeviceContainer::Iterator i = c.Begin(); i != c.End(); i++) { Ptr device = DynamicCast(*i); if (device) { - idBuf[0] = (id >> 8) & 0xff; - idBuf[1] = (id >> 0) & 0xff; - address.CopyFrom(idBuf); + idBuf[0] = (id >> 56) & 0xff; + idBuf[1] = (id >> 48) & 0xff; + idBuf[2] = (id >> 40) & 0xff; + idBuf[3] = (id >> 32) & 0xff; + idBuf[4] = (id >> 24) & 0xff; + idBuf[5] = (id >> 16) & 0xff; + idBuf[6] = (id >> 8) & 0xff; + idBuf[7] = (id >> 0) & 0xff; - device->GetMac()->SetShortAddress(address); + address64.CopyFrom(idBuf); - if (address == coor) - { - MlmeStartRequestParams params; - params.m_panCoor = true; - params.m_PanId = panId; - params.m_bcnOrd = bcnOrd; - params.m_sfrmOrd = sfrmOrd; + // TODO: Change this to device->SetAddress() if GetAddress can guarantee + // to set only extended addresses + device->GetMac()->SetExtendedAddress(address64); - Ptr uniformRandomVariable = - CreateObject(); - ; - Time jitter = Time(MilliSeconds(uniformRandomVariable->GetInteger(0, 10))); - - Simulator::Schedule(jitter, &LrWpanMac::MlmeStartRequest, device->GetMac(), params); - } - else - { - device->GetMac()->SetPanId(panId); - device->GetMac()->SetAssociatedCoor(coor); - } id++; } } diff --git a/src/lr-wpan/helper/lr-wpan-helper.h b/src/lr-wpan/helper/lr-wpan-helper.h index 78f28c914..3621c130f 100644 --- a/src/lr-wpan/helper/lr-wpan-helper.h +++ b/src/lr-wpan/helper/lr-wpan-helper.h @@ -109,29 +109,23 @@ class LrWpanHelper : public PcapHelperForDevice, public AsciiTraceHelperForDevic NetDeviceContainer Install(NodeContainer c); /** - * \brief Associate the nodes to the same PAN + * \brief Creates an PAN with associated nodes and assigned addresses(16 and 64) + * from the nodes in the node container. + * The first node in the container becomes the PAN coordinator. * - * \param c a set of nodes - * \param panId the PAN Id + * \param c a The node container with the nodes that will form the PAN. + * \param panId The PAN identifier. */ - void AssociateToPan(NetDeviceContainer c, uint16_t panId); + void CreateAssociatedPan(NetDeviceContainer c, uint16_t panId); /** - * \brief Associate the nodes to the same PAN and initiate beacon enabled mode. + * \brief Set the extended 64 bit addresses (EUI-64) for a group of + * LrWpanNetDevices + * + * \param c The NetDevice container. * - * \param c a set of nodes - * \param panId the PAN id - * \param coor the address of the PAN coordinator - * \param bcnOrd indicates the interval between beacons. - * The value must be an int between 0 and 14. - * \param sfrmOrd indicates the length of the superframe. - * The value must be an int between 0 and 14 and less or equal to the bcnOrd */ - void AssociateToBeaconPan(NetDeviceContainer c, - uint16_t panId, - Mac16Address coor, - uint8_t bcnOrd, - uint8_t sfrmOrd); + void SetExtendedAddresses(NetDeviceContainer c); /** * Helper to enable all LrWpan log components with one statement diff --git a/src/lr-wpan/model/lr-wpan-mac.cc b/src/lr-wpan/model/lr-wpan-mac.cc index 712ba2180..8a330757b 100644 --- a/src/lr-wpan/model/lr-wpan-mac.cc +++ b/src/lr-wpan/model/lr-wpan-mac.cc @@ -216,7 +216,7 @@ LrWpanMac::LrWpanMac() m_macBsn = SequenceNumber8(uniformVar->GetValue()); m_macBeaconPayload = nullptr; m_macBeaconPayloadLength = 0; - m_shortAddress = Mac16Address("00:00"); + m_shortAddress = Mac16Address("FF:FF"); // FF:FF = The address is not assigned. } LrWpanMac::~LrWpanMac() @@ -2894,12 +2894,12 @@ LrWpanMac::PdDataConfirm(LrWpanPhyEnumeration status) case CommandPayloadHeader::SUCCESSFUL: confirmParams.m_status = LrWpanMlmeAssociateConfirmStatus::MLMEASSOC_SUCCESS; - confirmParams.m_assocShortAddr = - GetShortAddress(); // the original short address used in the association - // request - SetShortAddress( - receivedMacPayload - .GetShortAddr()); // the assigned short address by the coordinator + // The original short address used in the association + // used in the association request + confirmParams.m_assocShortAddr = GetShortAddress(); + + // The assigned short address by the coordinator + SetShortAddress(receivedMacPayload.GetShortAddr()); m_macPanId = receivedMacHdr.GetSrcPanId(); break; case CommandPayloadHeader::FULL_CAPACITY: diff --git a/src/lr-wpan/model/lr-wpan-mac.h b/src/lr-wpan/model/lr-wpan-mac.h index 88ed98fdf..29c432488 100644 --- a/src/lr-wpan/model/lr-wpan-mac.h +++ b/src/lr-wpan/model/lr-wpan-mac.h @@ -1990,7 +1990,7 @@ class LrWpanMac : public Object /** * The packet which is currently being sent by the MAC layer. */ - Ptr m_txPkt; // XXX need packet buffer instead of single packet + Ptr m_txPkt; /** * The command request packet received. Briefly stored to proceed with operations @@ -1999,15 +1999,14 @@ class LrWpanMac : public Object Ptr m_rxPkt; /** - * The short address used by this MAC. Currently we do not have complete - * extended address support in the MAC, nor do we have the association - * primitives, so this address has to be configured manually. + * The short address (16 bit address) used by this MAC. If supported, + * the short address must be assigned to the device by the coordinator + * during the association process. */ Mac16Address m_shortAddress; /** - * The extended address used by this MAC. Extended addresses are currently not - * really supported. + * The extended 64 address (IEEE EUI-64) used by this MAC. */ Mac64Address m_selfExt; diff --git a/src/lr-wpan/model/lr-wpan-net-device.cc b/src/lr-wpan/model/lr-wpan-net-device.cc index 0bb121f44..9fe5efd4d 100644 --- a/src/lr-wpan/model/lr-wpan-net-device.cc +++ b/src/lr-wpan/model/lr-wpan-net-device.cc @@ -257,6 +257,10 @@ LrWpanNetDevice::SetAddress(Address address) { m_mac->SetShortAddress(Mac16Address::ConvertFrom(address)); } + else if (Mac64Address::IsMatchingType(address)) + { + m_mac->SetExtendedAddress(Mac64Address::ConvertFrom(address)); + } else if (Mac48Address::IsMatchingType(address)) { uint8_t buf[6]; @@ -292,6 +296,19 @@ LrWpanNetDevice::GetAddress() const return pseudoAddress; } +void +LrWpanNetDevice::SetPanAssociation(uint16_t panId, + Mac64Address coordExtAddr, + Mac16Address coordShortAddr, + Mac16Address assignedShortAddr) +{ + NS_LOG_FUNCTION(this); + m_mac->SetPanId(panId); + m_mac->SetAssociatedCoor(coordExtAddr); + m_mac->SetAssociatedCoor(coordShortAddr); + m_mac->SetShortAddress(assignedShortAddr); +} + bool LrWpanNetDevice::SetMtu(const uint16_t mtu) { diff --git a/src/lr-wpan/model/lr-wpan-net-device.h b/src/lr-wpan/model/lr-wpan-net-device.h index e1d3208cc..7c6758ad5 100644 --- a/src/lr-wpan/model/lr-wpan-net-device.h +++ b/src/lr-wpan/model/lr-wpan-net-device.h @@ -135,6 +135,36 @@ class LrWpanNetDevice : public NetDevice * \returns The short address. */ Address GetAddress() const override; + + /** + * This method is use to manually configure the coordinator through + * which the device or coordinator is associated. When assigning a short address + * the extended address must also be present. + * + * \param panId The id of the PAN used by the coordinator device. + * + * \param coordExtAddr The coordinator extended address (EUI-64) through which this + * device or coordinator is associated. + * + * \param coordShortAddr The coordinator assigned short address through which this + * device or coordinator is associated. + * [FF:FF] address indicates that the value is unknown. + * [FF:FE] indicates that the associated coordinator is using only + * its extended address. + * + * + * \param assignedShortAddr The assigned short address for this device. + * [FF:FF] address indicates that the device have no short address + * and is not associated. + * [FF:FE] address indicates that the devices has associated but + * has not been allocated a short address. + * + */ + void SetPanAssociation(uint16_t panId, + Mac64Address coordExtAddr, + Mac16Address coordShortAddr, + Mac16Address assignedShortAddr); + bool SetMtu(const uint16_t mtu) override; uint16_t GetMtu() const override; bool IsLinkUp() const override; diff --git a/src/sixlowpan/examples/example-ping-lr-wpan-beacon.cc b/src/sixlowpan/examples/example-ping-lr-wpan-beacon.cc index e820166b0..438b36932 100644 --- a/src/sixlowpan/examples/example-ping-lr-wpan-beacon.cc +++ b/src/sixlowpan/examples/example-ping-lr-wpan-beacon.cc @@ -31,14 +31,14 @@ using namespace ns3; static void -dataSentMacConfirm(McpsDataConfirmParams params) +DataSentMacConfirm(Ptr device, McpsDataConfirmParams params) { // In the case of transmissions with the Ack flag activated, the transaction is only // successful if the Ack was received. if (params.m_status == LrWpanMcpsDataConfirmStatus::IEEE_802_15_4_SUCCESS) { - NS_LOG_UNCOND("**********" << Simulator::Now().As(Time::S) - << " | Transmission successfully sent"); + std::cout << Simulator::Now().As(Time::S) << " | Node " << device->GetNode()->GetId() + << " | Transmission successfully sent\n"; } } @@ -53,8 +53,7 @@ main(int argc, char** argv) if (verbose) { - LogComponentEnableAll(LOG_PREFIX_TIME); - LogComponentEnableAll(LOG_PREFIX_FUNC); + LogComponentEnableAll(LogLevel(LOG_PREFIX_TIME | LOG_PREFIX_FUNC | LOG_PREFIX_NODE)); LogComponentEnable("LrWpanMac", LOG_LEVEL_INFO); LogComponentEnable("LrWpanCsmaCa", LOG_LEVEL_INFO); LogComponentEnable("LrWpanHelper", LOG_LEVEL_ALL); @@ -89,15 +88,13 @@ main(int argc, char** argv) Ptr dev1 = lrwpanDevices.Get(0)->GetObject(); Ptr dev2 = lrwpanDevices.Get(1)->GetObject(); - McpsDataConfirmCallback cb1; - cb1 = MakeCallback(&dataSentMacConfirm); - dev1->GetMac()->SetMcpsDataConfirmCallback(cb1); - dev2->GetMac()->SetMcpsDataConfirmCallback(cb1); + dev1->GetMac()->SetMcpsDataConfirmCallback(MakeBoundCallback(&DataSentMacConfirm, dev1)); - // Fake PAN association, coordinator assignment, short address assignment and initialization + dev2->GetMac()->SetMcpsDataConfirmCallback(MakeBoundCallback(&DataSentMacConfirm, dev2)); + + // Manual PAN association, coordinator assignment, short address assignment and initialization // of beacon-enabled mode in 802.15.4-2011. - // This is needed because the lr-wpan module does not provide (yet) - // a full PAN association procedure. + // Association using the MAC functions can also be used instead of a manual association. // AssociateToBeaconPan (devices, PAN ID, Coordinator Address, Beacon Order, Superframe Order) @@ -113,7 +110,22 @@ main(int argc, char** argv) // Beacon Interval = 251.65 secs // |-----------------------------------------------------------------------------------------| - lrWpanHelper.AssociateToBeaconPan(lrwpanDevices, 0, Mac16Address("00:01"), 14, 13); + // Manually set an associated PAN, Pan id = 1 the first device (dev1) is used as coordinator + lrWpanHelper.CreateAssociatedPan(lrwpanDevices, 5); + + // Start the beacon mode from the MAC layer of the coordinator (dev1) + MlmeStartRequestParams params; + params.m_panCoor = true; + params.m_PanId = 5; + params.m_bcnOrd = 14; + params.m_sfrmOrd = 13; + params.m_logCh = 11; + + Simulator::ScheduleWithContext(dev1->GetNode()->GetId(), + Seconds(0), + &LrWpanMac::MlmeStartRequest, + dev1->GetMac(), + params); InternetStackHelper internetv6; internetv6.Install(nodes); @@ -140,13 +152,13 @@ main(int argc, char** argv) ApplicationContainer apps = ping.Install(nodes.Get(0)); apps.Start(Seconds(2.0)); - apps.Stop(Seconds(20.0)); + apps.Stop(Seconds(7.0)); AsciiTraceHelper ascii; lrWpanHelper.EnableAsciiAll(ascii.CreateFileStream("Ping-6LoW-lr-wpan-beacon.tr")); lrWpanHelper.EnablePcapAll(std::string("Ping-6LoW-lr-wpan-beacon"), true); - Simulator::Stop(Seconds(600)); + Simulator::Stop(Seconds(7)); Simulator::Run(); Simulator::Destroy(); diff --git a/src/sixlowpan/examples/example-ping-lr-wpan-mesh-under.cc b/src/sixlowpan/examples/example-ping-lr-wpan-mesh-under.cc index 66349f9f6..083d3b608 100644 --- a/src/sixlowpan/examples/example-ping-lr-wpan-mesh-under.cc +++ b/src/sixlowpan/examples/example-ping-lr-wpan-mesh-under.cc @@ -81,10 +81,9 @@ main(int argc, char** argv) // Add and install the LrWpanNetDevice for each node NetDeviceContainer lrwpanDevices = lrWpanHelper.Install(wsnNodes); - // Fake PAN association and short address assignment. - // This is needed because the lr-wpan module does not provide (yet) - // a full PAN association procedure. - lrWpanHelper.AssociateToPan(lrwpanDevices, 0); + // Manual PAN association and extended and short address assignment. + // Association using the MAC functions can also be used instead of this step. + lrWpanHelper.CreateAssociatedPan(lrwpanDevices, 0); InternetStackHelper internetv6; internetv6.Install(wsnNodes); diff --git a/src/sixlowpan/examples/example-ping-lr-wpan.cc b/src/sixlowpan/examples/example-ping-lr-wpan.cc index 4e99b1e5b..1314f53ea 100644 --- a/src/sixlowpan/examples/example-ping-lr-wpan.cc +++ b/src/sixlowpan/examples/example-ping-lr-wpan.cc @@ -81,10 +81,9 @@ main(int argc, char** argv) // Add and install the LrWpanNetDevice for each node NetDeviceContainer lrwpanDevices = lrWpanHelper.Install(nodes); - // Fake PAN association and short address assignment. - // This is needed because the lr-wpan module does not provide (yet) - // a full PAN association procedure. - lrWpanHelper.AssociateToPan(lrwpanDevices, 1); + // Manual PAN association and extended and short address assignment. + // Association using the MAC functions can also be used instead of this step. + lrWpanHelper.CreateAssociatedPan(lrwpanDevices, 1); InternetStackHelper internetv6; internetv6.Install(nodes);