1. 程式人生 > >ZigBee Link Status 理解

ZigBee Link Status 理解

以下內容摘自ZigBee 2015 Pro文件《docs-05-3474-21-0csg-zigbee-specification》
3.6.3.4 Link Status Messages
Wireless links may be asymmetric, that is, they may work well in one direction but not the other. This can cause route replies to fail, since they travel backwards along the links discovered by the route request.For many-to-one routing and two-way route discovery (nwkSymLink = TRUE), it is a requirement to discover routes that are reliable in both directions. To accomplish this, routers exchange link cost measurements with their neighbors by periodically transmitting link status frames as a one-hop broadcast. The reverse link cost information is then used during route discovery to ensure that discovered routes use high-quality links in both directions.

譯:
3.6.3.4鏈路狀態訊息
無線鏈路可以是不對稱的,也就是說,它們可以在一個方向上工作但在另一個方向上不能工作。 這可能導致路由回覆失敗,因為它們沿著路由請求發現的鏈路向後傳播。對於多對一路由和雙向路由發現(nwkSymLink = TRUE),需要發現可靠的路由 在兩個方向。 為實現此目的,路由器通過週期性地傳送鏈路狀態幀作為單跳廣播來與其鄰居交換鏈路成本測量。 然後在路由發現期間使用反向鏈路成本資訊,以確保發現的路由在兩個方向上使用高質量鏈路。

在Z-Stack 3.0.2的定義
typedef struct
{
uint8 txCounter; // Counter of transmission success/failures
uint8 txCost; // Average of sending rssi values if link staus is enabled
// i.e. NWK_LINK_STATUS_PERIOD is defined as non zero
uint8 rxLqi; // average of received rssi values
// needs to be converted to link cost (1-7) before used
uint8 inKeySeqNum; // security key sequence number
uint32 inFrmCntr; // security frame counter…
uint16 txFailure; // higher values indicate more failures
} linkInfo_t;

在抓包中,我們可以開到的資訊有:
link status

  1. txCost:
    Average of sending rssi values if link staus is enabled, i.e. NWK_LINK_STATUS_PERIOD is defined as non zero.Average of sending rssi values if link staus is enabled, i.e. NWK_LINK_STATUS_PERIOD is defined as non zero.

  2. rxLqi:
    average of received rssi values, needs to be converted to link cost (1-7) before used

  3. 在上圖中,該路由的Link Status只有一個鄰居0x0000,Outgoing cost:它到0x0000的link cost為1,Incoming cost:0x0000到它的link cost也是為1。
    這兩個資料都是根據LQI來計算的,也就是說間接的反映了鏈路接收質量。1代表最好,7代表最差,0代表沒有記錄。

  4. Each link status entry contains the network address of a router neighbor:表明Link Status只包含鄰居表中的Router,Coordinator資訊。

  5. 路由廣播Link Status 的預設週期為15s,一般不用改動,因為廣播半徑為1(在其訊號範圍內路由可以接收到,但不會轉發),不會對網路造成很大影響,除非將很多路由放在空間很小的地方。