Z-Stack Developer's Guide - Zigbee & Addressing

Zigbee Foundamental

Device Type

  • Coordinator
    • first device in network
    • scan RF env, choose a channel and a network identifier (PAN ID), then start network
    • also optionally to be used to assist in setting up security and application-level bindings
    • once start-up accomplished, Coordinator behaves like a Router node(or even go away)
  • Router
    • allow other devices to join the network
    • multi-hop routing
    • assisting in communication for its childs
    • general expected to be active all the time, have to be mains-powered
  • End-device
    • can sleep and wake up as chooses, battery-powered node
    • memory(RAM) requirements are lower
    • in Z-Stack, device type is usually determined at compile-time with compile options (ZDO-COORDINATOR and RTR_NWK)

Stack Profile

  • set of stack parameters that need to be configured to specific value. comprise the stack profile defiend by ZigBee Alliance
  • All devices in a network must conform to the same stack profile
  • 3 types
    • ZigBee
      • defined by ZigBee Alliance
    • ZigBee Pro
      • defined by ZigBee Alliance
    • network-specific profile
      • self defiend, closed network
      • ZigBee and ZigBee Pro profile device can not interoperate.
  • ID: 0 for network specified profile; 1 for ZigBee; 2 for ZigBee Pro.
    • configured by STACK_PROFILE_ID in nwk_globals.h
  • Normally, a device of 1 profile (ex. ZigBee PRO) joins a network with the same profile. If a router of 1 profile (ex. ZigBee PRO) joins a network with a different profile (ex. ZigBee-2007), it will join as a non-sleeping end device. An end device of 1 profile (ex. ZigBee PRO) will always be an end device in a network with a different profile. (这一段不是太看得懂)

Addressing

  • 2 types:
    • 64 bits IEEE(MAC address or Extended Address)
    • 16 bits network address(logical address or short address)
      • used on local network

Tree Addressing

  • uses a distributed addressing scheme: make sure unique; only has to communicate with its parent
  • defines: ZIgBee-2007 its(5, 20, 6)
    • MAX_DEPTH: max depth of network. coordinator=0,
    • MAX_CHILDREN;
    • MAX_ROUTERS: a subset of MAX_CHILDREN,
      • (MAX_CHILDREN-MAX_ROUTERS)= end devices
  • change tree addressing
    • ensure new value legal
    • ensure to use network-specific profile (change STACK_PROFILE_ID in nwk_globals.c to NETWORK_SPECIFIC), set MAX_DEPTH in nwk_global.s
    • set array’s CskipChldrn and CskipRtrs in nwk_globals.c

Stochastic(Random) Addressing – ZigBee PRO

  • random set a value, uses rest devices to unsure no duplicate
  • joins process
    • receives randomly addr from parent
    • the new network node generates “Device Announce” (contains short and extended addr) to others
    • if short addr confilct, a node(router) send out a broadcast “Network-Status - Address Conflict” to entire network
    • conflicted device change its short addr, then send its own “Device Announce” to check again
  • End device not participate “address conflict”, its parents do it for them
    • parent issue “Rejoin Response” to end device to change end devices short addr.
    • end device issues “Device Announce” to check new addr
  • “Device Announce” recieved, association and binding tables updates, routing table info not updated(new router must be established).

Addressing in Z-stack

  • AF_DataRequest() to send data to device. dest device is a type afAddrType_t(in zComDef.h)
  • defines in Z-Stack Developer’s Guide Sec 3.3 P10
  • send type
    • unicast: use Addr16Bit, dest addr is in packet
    • Indirect: use AddrNotPresent, dest addr is not specified. dest addr is looked up from “binding table”(in stack of sending device): its called Souce binding
    • when binding table looking up, it treated as a unicast packet.
  • Broadcast: use AddrBroadcast, dest addr sets as:
    • NWK_BROADCAST_SHORTADDR_DEVALL (0xFFFF) – to all devices(including sleeping one)
      • sleeping one, hold in its parents until wake up or time out(NWK_INDIRECT_MSG_TIMEOUT in f8wConfig.cfg)
    • NWK_BROADCAST_SHORTADDR_DEVRXON (0xFFFD) all devices when idle (RXONWHENIDLE). all devices except sleeping devices
    • NWK_BROADCAST_SHORTADDR_DEVZCZR (0xFFFC). to all routers(includes coordinator)
  • Group Addressing
    • send packet to a group of device: addr mode is afAddrGroup, addr.shortAddr=group identifier
    • group defination: aps_AddGroup() in the Z-Stack API doc
    • group used in conjunction with indirect addressing. dest in binding table can be unicast/group addr.

Addressing functions

  • NLME_GetShortAddr()
  • NLME_GetExtAddr()
  • NLME_GetCoordShortAddr() : get its parents addr
  • NLME_GetCoordExtAddr()
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值