← Back to team overview

rohc team mailing list archive

Re: [Question #233909]: about feedback - rohc_feedback_flush()

 

Question #233909 on rohc changed:
https://answers.launchpad.net/rohc/+question/233909

    Status: Open => Answered

Didier Barvaux proposed the following answer:
Hi,

> In your simplified algo, what method or function do we use to know "no
> piggyback available" or "there is reverse compressed-packet to send"?

When your application calls the rohc_compress2() function.


> I don't have the full algo ready in mind yet, but the main thing is to
> have a balance between piggyback feedback (efficient) and standalone
> feedback (effective).
> 
> Check if there is a feedback packet to send,
>      if true,
>           Wait N cycles,
>                 if there is piggyback available during the N cycles,
> go with piggyback; if there is no piggyback available during the N
> cycles, send standalone feedback at N. if false,
>          Do not call rohc_feedback_flush().
> 
> N is configurable.  
> Therefore, I need to know how check such conditions as 
> "if there is a feedback packet to send"
> " if there is piggyback available"

What do you think of the algo below?

  Every N cycles:
    // check if there is feedback data to send
    // (if yes, retrieve it altogether)
    (bytes_nr, bytes) := rohc_feedback_flush()
    // if there is feedback data, send it now
    if bytes_nr > 0:
      send(bytes, bytes_nr)

That's not exactly your algorithm: this one does not wait N cycles
after the feedback data was generated (feedback data generated at
cycle N-1 will be sent at cycle N for example), but it balances
piggybacking vs. feedback-only packets.

If you prefer your algorithm, then we could add a new API function
such as:

  /**
   * @brief Whether there is unsent feedback data available at compressor
   *
   * @param comp  The ROHC compressor
   * @return      true if there is at least 1 byte of unsent feedback data,
   *              false if not
   *
   * @ingroup rohc_comp
   */
  bool rohc_feedback_avail(const struct rohc_comp *const comp)
    __attribute__((warn_unused_result));

Or:

  /**
   * @brief How many bytes of unsent feedback data are available at compressor?
   *
   * @param comp  The ROHC compressor
   * @return      The number of bytes of unsent feedback data,
   *              0 if no unsent feedback data is available
   *
   * @ingroup rohc_comp
   */
  size_t rohc_feedback_avail_bytes(const struct rohc_comp *const comp)
    __attribute__((warn_unused_result));

The second one seems to be a better choice: your algorithm could be
enhanced to take the amount of feedback data into account for example.

What do you think of?

Regards,
Didier

-- 
You received this question notification because you are a member of ROHC
Team, which is an answer contact for rohc.