← Back to team overview

rohc team mailing list archive

Re: [Question #228535]: result of rohc_compress() is not correct

 

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

    Status: Open => Answered

Didier Barvaux proposed the following answer:
Wei,

> However, the result is not right. Can you please take a look one more
> time? The original IP packet size is 38 (20 IP header bytes + 18 fake
> payload size) and the size after rohc_compress() is 39

The result is fully correct. Many compression schemes require to
transmit more bits than the uncompressed data on the first packets. It
may happen with ROHC too. Try compressing 10 packets in a row, the
result will seem you more "right".

You are warned of that fact by the "simple_rohc_program". It prints the
following conclusion at the very end of its execution: "The program
ended successfully. The ROHC packet is larger than the IP packet (39
bytes versus 38 bytes). This is expected since we only compress one
packet in this simple example. Keep in mind that ROHC is designed to
compress streams of packets not one single packet."


> Do you mean, the first 3 bytes are the result by ROHC compressor?

When the ROHC Uncompressed profile is used, the ROHC compressor adds 3
bytes before the non-compressed packet. The first 3 bytes are generated
by the ROHC compressor, the remaining bytes are a copy of the non-
compressed packet. All of them compose the ROHC packet.


> Another question is, I commented out the uncompress profile
> and the original bytes are still there.

The IPv4 header bytes should not be present. Maybe are you confused by
the payload bytes. Payload bytes will always be copied from the non-
compressed packet to the ROHC packet since ROHC algorithms only apply to
the protocol headers.

Regards,
Didier

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