[Asterisk-Dev] IAX2 RFC and retries.

SteveK stevek at stevek.com
Fri May 20 16:03:43 MST 2005


On May 20, 2005, at 6:37 PM, Derek Smithies wrote:

>>
>>
>> You can't ack the wrong packet. If you get a packet out-of-order, you
>> must not ack it (I think you send VNAK in this case).
>>
>> I.e. you get seqs 0, 1, 2, 3, 5.
>> So, as you get 0,1,2,3 you ack them. Then, when you get 5, you send a
>> VNAK, and you otherwise drop the packet. Since you never acked 4, the
>> other side would eventually re-send it, and then re-send 5 (since you
>> haven't acked that either).
>>
>>
>
> Nope.
> According to the spec from splurge.peoples-wireless.com/iax/iax.txt
>
>  a VNAK is a "Video/Voice retransmit request"
>
>
>> From the code,
>>
> #define AST_IAX_COMMAND_VNAK     18      /* If we receive voice  
> before valid first voice frame, send this */
>
> Conclusion:: VNAK is not what you send if you receive out of order  
> frames.
> You simply ignore the out of order frames. The iax2 resend  
> mechanism will
> eventually get the right one to you.

That conclusion is only valid, if you assume that the draft you're  
reading is more accurate than the source code to the known  
implementations.

chan_iax2.c sends vnak in three places:

line 6787, if it gets any kind of full frame, before the preceeding  
full frame.
line 7719: if it gets a mini frame before the previous full voice  
frame (therefore, indicating that a full frame was lost or not  
received out of order)
line 7741: ditto, I think
line 6652: same thing for trunking.

Therefore, I conclude, that VNAK is designed to request  
retransmission of _any_ kind of lost frame, presumably to speed up  
retransmissions so they may be sent earlier than the retransmit timer.

-SteveK







More information about the asterisk-dev mailing list