the compressed result is not the same

Asked by regulararmy

         By using the src codes and other .c files for tests of rohc-1.5.1.tar.bz2 in Eclipse of Windows OS,I run the same logic as the simple_rohc_program.c with a real UDP/IP packet(opening the UDP profile) in cygwin, a compressed packet can be got. however, I run the same code in the Linux(Fedoral)OS with the same real UDP packet,the result packet has the same length each field,but is not the same value as the packet got in cygwin.is it right or wrong? or the random numbers generated by rand() in compression will make them different?
        Another question is that how much is the elapsed time of each packet in the test_performance.c ? did you test it ,I wonder whether I got a elapsed value. thank you.

Regards
regulararmy

Question information

Language:
English Edit question
Status:
Solved
For:
rohc Edit question
Assignee:
No assignee Edit question
Solved by:
Didier Barvaux
Solved:
Last query:
Last reply:
Revision history for this message
Didier Barvaux (didier-barvaux) said :
#1

Sorry, but your message is written in bad English. I'm not sure to understand it fully. I'll try to rephrase your question. Tell me if it matches what you were trying to say. For later questions/answers, please try to make shorter sentences.

> By using the src codes and other .c files for tests of rohc-1.5.1.tar.bz2 in
> Eclipse of Windows OS,I run the same logic as the simple_rohc_program.c
> with a real UDP/IP packet(opening the UDP profile) in cygwin, a compressed
> packet can be got.

You're using the Eclipse IDE on Windows/Cygwin to build the ROHC library and a small test program. That test program is based on the simple_rohc_program.c from the library. However it enables the UDP profile, then compresses one IP/UDP packet. As a result, you got a ROHC packet. Am I right?

> however, I run the same code in the Linux(Fedoral)OS with the same real
> UDP packet,the result packet has the same length each field,but is not
> the same value as the packet got in cygwin.is it right or wrong? or the
> random numbers generated by rand() in compression will make them different?

According to the ROHC standards, the initial Sequence Number (SN) for the UDP profile shall be chosen randomly. The ROHC library does not generate random numbers itself. This is done this way in order to be portable on several different OS.

The simple_rohc_program program implements a callback for random numbers and tells the ROHC library to use it. The random callback calls the rand() function. The rand() function (when initialized correctly by the srand() function) will give you a different result each time you start your program.

If you want the same result, either replace the call to rand() by a constant value or change the way srand() is called.

Regards,
Didier

Revision history for this message
regulararmy (regulararmy) said :
#2

sorry again.
            yes, what you rephrased is just what I wanted to say,you have given the answers.
 Another question is that how much is the elapsed time of each packet in the test_performance.c ? did you test it ,I wonder whether I got a elapsed value. thank you.

Revision history for this message
Best Didier Barvaux (didier-barvaux) said :
#3

> Another question is that how much is the elapsed time of each packet
> in the test_performance.c ? did you test it ,I wonder whether I got a
> elapsed value. thank you.

The test_performance.c program computes the average time needed to process one ROHC packet. You need to give it a PCAP capture of non-compressed (resp. compressed) packet to benchmark the ROHC compression (resp. decompression).

No PCAP capture is provided for this program because one wants to benchmark its own use case (data, VoIP, video streaming, mixed content...). You can create a network capture in the PCAP format on your local network with tools such as tcpdump or wireshark. For best accuracy, please ensure that the PCAP capture contains a large number of packets (100000 or more).

Regards,
Didier

Revision history for this message
regulararmy (regulararmy) said :
#4

Thanks Didier Barvaux, that solved my question.