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.

CC2652P: Source Routing will effect to MTU

Part Number: CC2652P


Tool/software:

My Coordinate send a 82-bytes APS-Payload frame to a router, it can be sent successful. But when Coordinate has sent filed to this router for many times, the Coordinate will change to source-routing mode, that can't send 82-bytes data to this router.

I want to add some processing in afDataReqMTU to deal with Source Routing

  • Hello,

    If source routing is used, then you won't be able to fit a max payload size of 82-bytes, due to intermediate addresses added to the overall packet.
    And generally, if the payload is too large for a single APS packet, then Fragmentation should resolve it.

    Note that the zstack_afDataReq_t has a way to specify no source routing, which will maximize the application data payload size in a single packet.
    See zstack_afDataReq_t --> n_relayList (/** Number of entries in relayList (use 0 for non-source routing) */)

    Thanks,
    Toby

  • How to calculate if the source routing would happen when "AF_DataRequestExt" sending message?

  • I have fixed “afDataReqMTU” like this, but it will trigger Fragment though there is no Source-Routing triggered.

    uint8_t afDataReqMTU( afDataReqMTU_t* fields )
    {
      uint8_t len;
      uint8_t hdr;
    
      if ( fields->kvp == TRUE )
      {
        hdr = AF_HDR_KVP_MAX_LEN;
      }
      else
      {
        hdr = AF_HDR_V1_1_MAX_LEN;
      }
    
      len = (uint8_t)(APSDE_DataReqMTU(&fields->aps) - hdr);
    
      //match rtg table to recalculate MTU, fixed by luoyiming 2025-01-04
      if(afRtgDstAddress != 0xFFFE)
      {
        rtgSrcEntry_t* rtgSrcEntry = afGetRtgSrcEntry(afRtgDstAddress);
        if(rtgSrcEntry)
        {
          if(rtgSrcEntry->relayCount)
          {
            len -= (2 + rtgSrcEntry->relayCount * sizeof(uint16_t));
          }
        }
        afRtgDstAddress = 0xFFFE;
      }
    
      return len;
    }

  • I have found that when Source Routing is needed in AF-sending,  the Fragment-sending will be not working.