[asterisk-dev] extend IAX2 IE proposal

Markku Korpi markku at korpi.de
Mon Dec 11 00:58:41 MST 2006



Tilghman Lesher wrote:
> On Sunday 10 December 2006 19:17, Russell Bryant wrote:
>> Derek Smithies wrote:
>>> Suppose someone uses this mechanism to send a 100 K datablock.
>> It would not be possible to send a block of data this size using this
>> proposal. The SEGMENT proposal as described would only allow a maximum of
>> 17 segments (0xF0 to 0xFF) of 255 bytes each.  This would be a maximum of
>> roughly 4.25 kB.
> 
> 16 segments, actually, for 4080 (4096 - 16) bytes.
> 
> I've just updated the iax2 vars implementation (bug 7619) to automatically
> segment variables into multiple IEs as necessary to encode the full value.
> Since the OP was using this implementation originally to do what he wanted,
> this should obviate the need to go any further along this path.
> 
> My objections to sending variables inside IAX2 packets has lessened a bit in
> the past several months (although I still think many proposed uses are
> cockamamie), so this could probably be committed to trunk in the next several
> weeks.
> 

I thought that 16 segments would be plenty, and tried to save one 
octet... However the concern about exceeding the limit is certainly 
legitimate in (not so distant) future applications.

We could raise the max number of segments by moving the sequence number 
to Octet 4 and using only one IE element identifier (This means that the 
Segment IE is repeated). The IAX protocol itself takes care of message 
retransmission, so numbering of the segments should be sufficient. This 
gives us max. 256 segments (i.e. ~64k total length of the IE).
The format would then look like this:

                         1
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |   SEGMENT     | Data Length   | SEGMENT IE identifier (e.g. 0xF0)
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    | Segmented IE  | Segment No    | Segmented IE
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    : Segmented IE DATA             :
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

We should also define that the segmented data (i.e. Octets 5 and 6 of 
the first segment) needs to include the total length field of the 
segmented IE. This would allow better checking of message integrity.

Markku


More information about the asterisk-dev mailing list