This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Z-Stack fragmentation issue

Other Parts Discussed in Thread: Z-STACK

Hi all,

Our customer are doing some simulation about the max. payload size per transmission. We find some behaviors below and want to confirm with you that behavior is correct or not.

Below is Topology descriptions

PC --- ZC --- ZR1 --- ZR2 --- ZR3 --- ZR4 --- ZR5

 

Our testing environments with 1 to 5 hopping nodes.

Round 1. PC send 81 bytes to ZR1 (no fragmentation). Test result is ok.

Round 2. PC send 81 bytes to ZR2 (no fragmentation). Test result is fail and no packet output from ZC.

Round 3. PC send 78 bytes to ZR2 (no fragmentation). Test result is ok.

 

We find the difference between round 2 and round 3 is relay information. The round 2 have additional relay information (4 bytes) in the frame. Besides, the round 2 will return fail status (0x10) when it calling AF_DataRequest().


I check the AF_DataRequest will decide fragmentation at this layer then call lib of "(*apsfSendFragmented)( &req )", after next hop ZR1 to ZR2 will additinal relay information (4 bytes) in the frame that will over the len of afDataReqMTU( &mtu ),but no perform fragmentation then fail. Round3 reduce the size to 78 byte for hop to ZR2 will can succses.


Our questions are, 

  1. Routing will add relay information in the frame,Why the round 2 testing without using fragmentation?

  2. What is the maximum data length without doing fragmentation that can send the data from ZC to ZR5?

 

Please help check this issue.

Thank you.

 

Best Regards,

EthanChen


  • Additional descriptions:

    This situation is using source routing and security is enabled.

    According to the ZigBee specification, the relay information is added by network layer and the fragmentation is handled by APS layer. The round 1 testing result in the pattern length (81 bytes) does not need fragmentation. The round 2 testing still not needs fragmentation that pass through the APS layer. But, when data pass down to the network layer, it has to add relay information ZR1 to the destination ZR2. At this moment, the frame size is not enough to add it and the AF_DataRequst() return a error code 0x10 (memory fail). 

    1) Does this situation is a limitation or a known issue in the Zstack?

    2) Does coordinator need additional 10 bytes for relay information to ZR5? 

        (relay count 1 byte + relay index 1 byte + (short address 2 bytes x 4 hopping nodes))

    CYLin.

  • Hi CYLin,

    Do you use the MT command MT_AF_DATA_REQUEST_SRCRTG when you hand messages from the PC to the ZC?

    - Cetri
  • No, I don't use it.

    You mean if we are using source routing, it should call AF_DataRequestSrcRtg() API not the AF_DataRequest().

    CYLin.

  • Hi CYLin,

    No, I asked just to know how you are sending packets from the PC.
    This is a known Z-Stack problem, but unfortunately it's not easy to provide a quick fix. Since the stack development is looking at this, the fix will be made in some future version. In the meantime, please send safely shout packet considering the length of the relay information when you use source routing. Sorry for your inconvenience.

    - Cetri
  • The data is received by serial interface and then call the AF_DataRequest() to send out the packet.
    How to determine a safe data length if we have a network which depth is 5?

    CYLin.
  • Hi CYLin,

    Under the condition where only NWK-layer security is used and the packet is source-routed, the safe payload size for AF_DataRequest() would be calculated as
    MaxPayloadSize = 79 - 2 x (number of hops)

    - Cetri