Menu

#335 MD UDP notification sometimes dropped at listener side

2.0.3.0
closed
None
2020-08-21
2020-05-08
No

When receiving MD UDP notify message, looks like occasionally message is dropped at trdp_mdHandleRequest(), code snapshot below.

trdp_mdcom.c

trdp_mdHandleRequest()

    for ( iterMD = appHandle->pMDRcvQueue; iterMD != NULL; iterMD = iterMD->pNext )
    {
        numOfReceivers++; /* count the list items here */
        if ( 0 == memcmp(iterMD->pPacket->frameHead.sessionID, pH->sessionID, TRDP_SESS_ID_SIZE)) 
        /* KK-PROPOSAL: COULD THIS HAVE ANOTHER CONDITION, ONLY IF sessionID != 0 */
        {
            /* According IEC61375-2-3 A.7.7.1 */
            /* encountered a matching session */
            if ((pH->sequenceCounter == iterMD->pPacket->frameHead.sequenceCounter)
                ||
                (isTCP == TRUE) /* include TCP as topmost discard criterium */
                ||
                (iterMD->addr.mcGroup != 0))  /* discard multicasts anyway */
            {

Best regards, Kari

Discussion

  • Bernd Löhr

    Bernd Löhr - 2020-07-30
    • status: open --> accepted
    • assigned_to: Bernd Löhr
     
  • Bernd Löhr

    Bernd Löhr - 2020-07-30

    MD notification have their sessionId set to zero, thus the if-clause will always evaluate to false. By additionally comparing to pH->sessionID[16] with all zeros we will not gain much, I assume. But I also don't understand where and why notifications are dropped? Do you have any logs? Are there possibly receivers with sessionID==0?

     
  • Kari Keinanen

    Kari Keinanen - 2020-08-04

    In our use case multiple MD notifications (each with different content) are sometimes sent in sequence and this seems to cause the issue. I think the problem happens when old session with sessionId=0 exist, for example:

    1. Receive notification 1, replier session 1 is created (sessionId=0)
    2. Receive notification 2, replier session with sessionId=0 already exist -> message is dropped
    3. Freeing replier session 1
    4. Receive notification 3, OK

    Snapshot from logs below.

    [90158.893] Received UDP MD packet (type: 'Mn' UUID: 0000000000000000 Data len: 21) at trdp_mdcom.c, line 2019
    [90158.893] Creating UDP MD replier session '0000000000000000' at trdp_mdcom.c, line 1745
    [90158.893] vos_memAlloc() 0x7f44ef6c09e8, size 264 at vos_mem.c, line 479
    [90158.893] vos_memAlloc() 0x7f44ef6c0bf8, size 1480 at vos_mem.c, line 479
    [90158.893] Received UDP MD packet (type: 'Mn' UUID: 0000000000000000 Data len: 23) at trdp_mdcom.c, line 2019
    [90158.893] trdp_mdRecv: Repeated request discarded! at trdp_mdcom.c, line 1577
    [90158.894] Freeing MD UDP replier session '0000000000000000' at trdp_mdcom.c, line 765

     
  • Bernd Löhr

    Bernd Löhr - 2020-08-10
    • status: accepted --> pending
     
  • Bernd Löhr

    Bernd Löhr - 2020-08-10

    Couldn't replicate your error, but excluded the for-loop searching for existing sessions in case of notifications.

     
  • Kari Keinanen

    Kari Keinanen - 2020-08-11

    Just tested trunk-code, I'm afraid the fix doesn't work, some notifications are still dropped.

    trdp_mdcom.c: trdp_mdHandleRequest()
       ...
        /* Only if no Notification */
        if (state != TRDP_ST_TX_NOTIFY_ARM)
        /* In my application, state is TRDP_ST_RX_NOTIFY_RECEIVED
           which cause "trdp_mdRecv: Repeated request discarded!"
           TRDP_ST_TX_NOTIFY_ARM -> TRDP_ST_RX_NOTIFY_RECEIVED ?
        */
    
     
  • Bernd Löhr

    Bernd Löhr - 2020-08-12

    Of course, you're right. TRDP_ST_RX_NOTIFY_RECEIVED is the state...

     
  • Kari Keinanen

    Kari Keinanen - 2020-08-19

    Just tested current trunk, looks good.
    This ticket can be closed.

     
  • Bernd Löhr

    Bernd Löhr - 2020-08-21
    • Status: pending --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB