How to run and execute the rohc sources

Asked by Rockzstar on 2013-08-29

Hi,
    I have downloaded the the version rohc-1.6.1. And i have done "./confiure" it is creating make file in the src directory. When i do Make, it is compiling successfully. But i didn't see any exe file. Where is the exe file will create. And how to execute the application. For example, if i want to compress the data, is it like this, $ exefile inputfile outputfile. where input file is to be compress date and outfile is compressed data.
                             And one more i noticed in this forum most of the members were discussing about sending the data through client and server system,Whether this application does that also. Excuse for my simple and basic query, i am newbie. I will be thankful. if some one help me out.

Question information

Language:
English Edit question
Status:
Solved
For:
rohc Edit question
Assignee:
No assignee Edit question
Solved by:
Didier Barvaux
Solved:
2013-09-13
Last query:
2013-09-13
Last reply:
2013-09-12

This question was reopened

Hi Rockzstar,

> I have downloaded the the version rohc-1.6.1. And i have done
> "./confiure" it is creating make file in the src directory. When i do
> Make, it is compiling successfully. But i didn't see any exe file.
> Where is the exe file will create. And how to execute the
> application.

The ROHC library is a library, so the main target is the 3 librohc_*.so library files, not executables. However there are some tools or side-projects that may interest you (see below).

> For example, if i want to compress the data, is it like
> this, $ exefile inputfile outputfile. where input file is to be
> compress date and outfile is compressed data.

See the non-regression tool:
http://rohc-lib.org/wiki/doku.php?id=library-tests#running_one_specific_non-regression_test_manually1

> And one more i noticed
> in this forum most of the members were discussing about sending the
> data through client and server system,Whether this application does
> that also.

See those tools:
- IP/ROHC tunnel: http://rohc-lib.org/wiki/doku.php#ip_rohc_tunnel
- IP over UDP tunnel: http://rohc-lib.org/wiki/doku.php#rohc_over_udp_tunnel

Regards,
Didier

Rockzstar (allenpoper) said : #2

Thanks for your answer Didier. .so file i shared library right? that might be link while executing. Then how i should execute? the link which you have gave is testing the rohc. Then which is the original source code for header compression. the files which is in src folder or in test. Still confused.

1).confure will create a make file
2)make will create a .lo file
3)execute will link to that .so file.

whether my understanding is correct?. if not can u correct me.

Hi,

> .so file i shared library right?

yes.

> that might be link while executing.

yes.

> Then how i should execute? the link which you have gave is testing the rohc.
> Then which is the original source code for header compression. the files
> which is in src folder or in test. Still confused.

The release archive you downloaded contains 3 things:
 - the source code of the library in the src/ subdirectory.
 - some tools that help testing the library in the test/ subdirectory.
 - some small applications in the apps/ subdirectory.

The test tools or apps are executables that you can run.

The non-regression test tool does what you want to do in your first message:
  $ ./test_non_regression -o outputfilepcap smallcid inputfilepcap

> 1).confure will create a make file

yes

> 2)make will create a .lo file

The .lo files are temporary files. Ignore them. Interesting files are *.so files in src/common/.libs/ , src/comp/.libs/ and src/decomp/.libs/

> 3)execute will link to that .so file.

yes.

Regards,
Didier

Rockzstar (allenpoper) said : #4

Nice answer. one last thing, Compiling the src will create .so file. How the .so file is used in the real time application of LTE.
                    IP data need to compress and decompress. The packet from the IP, how it will link to that .so file.
and how the .so file will do the job?
                     If i want to send my own data with my own test file. how can i proceed, any suggestion???

> IP data need to compress and decompress. The packet from the IP,
> how it will link to that .so file. and how the .so file will do the job?
> If i want to send my own data with my own test file. how can i proceed, any suggestion???

Do it like for any other dynamic library. You use the library API in your application and then link with the library.

See the tutorial for creating a small application using the ROHC compressor or decompressor:
http://rohc-lib.org/wiki/doku.php?id=library-first-application

See also the simple full example located at examples/simple_rohc_program.c in library sources.

See also the API of the library: http://rohc-lib.org/wiki/doku.php?id=library-api

Regards,
Didier

Rockzstar (allenpoper) said : #6

make -C test check, fails for me.

some where pass some fails which lead to error. the fails message are.

# TOTAL: 328
# PASS: 0
# SKIP: 0
# XFAIL: 0
# FAIL: 328
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: test_non_regression_malformed-too-short_wlsb4_smallcid.sh
===============================================================

source capture './inputs/malformed-too-short///source.pcap' not found!

FAIL: test_non_regression_unknown_wlsb4_smallcid.sh
===================================================

source capture './inputs/unknown///source.pcap' not found!

FAIL: test_non_regression_ipvx_wlsb4_smallcid.sh
================================================

source capture './inputs/ipvx///source.pcap' not found!

FAIL: test_non_regression_ipv4fragmented_wlsb4_smallcid.sh
==========================================================

source capture './inputs/ipv4fragmented///source.pcap' not found!

FAIL: test_non_regression_ipv4-with-options_wlsb4_smallcid.sh
=============================================================

source capture './inputs/ipv4-with-options///source.pcap' not found!

FAIL: test_non_regression_ipv4_icmp_wlsb4_smallcid.sh
=====================================================

source capture './inputs/ipv4/icmp///source.pcap' not found!.

There are many FAIL like this.
 I have confiure with an option --enable-rohc-tests. Then why still i am getting this?

Rockzstar (allenpoper) said : #8

I have done step 5 also. After untaring that test directory, it is creating the same directory name as source directory "rohc-1.6.1"

In source directory "rohc-1.6.1.tar.bz2"(after untar rohc-1.6.1), i have done all the steps.

In the test directory "rohc-tests-1.6.1.tar.bz2"(after untar rohc-1.6.1). This contains the subdirectory statistics and test. How this will be use, if i do make -C test check, which will fix the error as i mentioned in last post.

Rockzstar (allenpoper) said : #9

After some steps, now it was successfully compiled. if i do

./test/non_regression/test_non_regression -c comparison.pcap smallcid source.pcap

source.pcap is not there? what is source.pcap?

Rockzstar (allenpoper) said : #10

After some steps, now it was successfully compiled. if i do

./test/non_regression/test_non_regression -c comparison.pcap smallcid source.pcap

source.pcap is not there? what is source.pcap?

Hello,

Follow all the instructions from http://rohc-lib.org/wiki/doku.php?id=library-install-sources#native_build_on_unix-like_systems . You seem to have extracted the test files in the wrong directory.

The source.pcap files are capture files with some IP packets that will be compressed with ROHC by the ./test/non_regression/test_non_regression application. The rohc-tests-1.6.1.tar.bz2 archive contains plenty of them.

Regards,
Didier

The command you're asking for is in the installation documentation. I gave you the link to the documentation 2 times in the last few days. You just have to copy/paste the commands from your web browser to your terminal. RTFM.

Rockzstar (allenpoper) said : #14

I followed the steps
   -> created one directory called Rohc
   -> $cd Rohc
   -> Now Rohc consists of rohc-1.6.1.tar.bz2 and rohc-tests-1.6.1.tar.bz2
   -> tar xvjf rohc-1.6.1.tar.bz2
   -> tar xvjf rohc-tests-1.6.1.tar.bz2
   -> $cd rohc-1.6.1
   -> ./configure --enable-rohc-tests
   -> make all
   ->sudo make install
   ->make -C test check
   ->./test/non_regression/test_non_regression -c comparison.pcap smallcid source.pcap
any correction.

Rockzstar (allenpoper) said : #15

Even though i follwed these steps, i am getting same error.

manish shivare (mshivare13) said : #16

hello Rockzstar (allenpoper),
u did not add the path prefix. if u want to add rohc library in rohc directory u need to set a path prefix .
before --enable-rohc-tests first u perform
$./configure prefix=/home/rohc/rohc-1.6.1
or simply follow the instruction from http://rohc-lib.org/wiki/doku.php?id=library-install-sources.

manish shivare (mshivare13) said : #17

sorry about syntex mismatch use
$./configure --prefix=/home/rohc/rohc-1.6.1

> ->./test/non_regression/test_non_regression -c comparison.pcap smallcid source.pcap
> any correction.

Ok, I finally understood what you didn't understand... In tutorial [1], the 'comparison.pcap' and 'source.pcap' arguments to the './test/non_regression/test_non_regression' program are _examples_. No file named 'comparison.pcap' or 'source.pcap' exists at the root of sources.

You have to take a source.pcap and rohc_smallcid.pcap (or rohc_largecid.pcap) files in one of the sub-directory of the ./test/non_regression/inputs/ directory. For example:

  $ ./test/non_regression/test_non_regression \
     -c ./test/non_regression/inputs/ipv4/udp/rtp/voip/rohc_smallcid.pcap smallcid \
     ./test/non_regression/inputs/ipv4/udp/rtp/voip/source.pcap

Everything I explain here is written in the documentation [1]. There is even an example with an ICMP flow that you may copy/paste. Please read it carefully.

Regards,
Didier

[1] http://rohc-lib.org/wiki/doku.php?id=library-tests#running_one_specific_non-regression_test_manually1

Rockzstar (allenpoper) said : #19

Thanks Didier Barvaux, that solved my question.

Rockzstar (allenpoper) said : #20

I will try to create my own app. Before that i need to go some concepts of networking. After that, i found any difficulties, i will come back for your help. And once again thanks for Spending time for my threads.

Rockzstar (allenpoper) said : #21

sorry for typo "if found any difficulties"

Rockzstar (allenpoper) said : #22

Is there any test app,that compress the IP data(data file) and should store it in to file(compressed file) and that compress data should decompress, that store in other file(decompressed file). The result should be data file = decompressed file.

In steps:
    ->Take a IP data
    ->compress it,store in file
    ->decompress the compress data
    ->compare the original data with decompressed data.

I want to run this app only in local host not in remote host(i.e Just compress the data and decompress without transfering the data's).

Input Data:- I found some data's in the test subdirectory , i will take any of those as input data.

The test_non_regression application does exactly what you describe.

Didier

Rockzstar (allenpoper) said : #24

In the test_non_regression, I have noticed option -o which will save in the file. and -c compare the rohc packet with generated packet.
   Then what is the option for compressing and what is option for decompressing. I mean,

 for compressing:-
     $ ./test/non_regression/test_non_regression \
     -o compress.pcap \
     ./test/non_regression/inputs/ipv4/udp/rtp/voip/source.pcap

for decompressing:-
     $ ./test/non_regression/test_non_regression \
     -o decompress.pcap compress.pcap

for comparing:-
   $ ./test/non_regression/test_non_regression \
   -c decompress.pcap \
./test/non_regression/inputs/ipv4/udp/rtp/voip/source.pcap

Is this correct? I u notice i didn't mentioned smallcid or largecid. Can u tell me what is that?

The non-regression tool compresses IP packets into ROHC packets, then decompresses these ROHC packets into IP packets. It does so at once. It does compare the output IP packets with the input IP packets. If option -o if specified, the ROHC packets are written in the given file. If option -c is given, the ROHC packets generated by the tool are compared with the ones found in the file given by the -c option.

More details in source header http://bazaar.launchpad.net/~didier-barvaux/rohc/1.6.x/view/head:/test/non_regression/test_non_regression.c#L23 and with ./test/non_regression/test_non_regression -h

So, if you already have the IP packets and the related ROHC packets (the source.pcap and rohc_*.pcap files found in the inputs/ subdirs), use option -c. If you don't have ROHC packets, use the -o option to generate them. The generated file could be used later to check that the ROHC library still generates the same ROHC packets, ie. check for the lack of regression.

For small CIDs vs large CID, see https://tools.ietf.org/html/rfc3095#section-5.1.3

Rockzstar (allenpoper) said : #26

After refering http://bazaar.launchpad.net/~didier-barvaux/rohc/1.6.x/view/head:/test/non_regression/test_non_regression.c#L23 this only i post early comment, then only i came to know there is -o option to write in a file.

Now this question be a simple. How can i get both compressed file and decompressed file

compressing will get ROHC packet, want to store in one file(compress.pcap)
 decompressing will revert back IP data, that want to store in other file(decompress.pcap).

Rockzstar (allenpoper) said : #27

Mr.Didier thanks for helping me out so far. Can u just reply to my prev post please.

And creating library while compiling src are
librohc_common.so
librohc_decomp.so
librohc_comp.so

how does librohc_common.so creates:
       By compiling only the sources in common folder
how does librohc_decomp.so creates:
      By compiling the sources in common folder and decomp folder.

These 2 question is my last question. If u clear this 2. Then i will be thankful to you.

Rockzstar (allenpoper) said : #28

Mr.didier, i have tried a lot, i didn't found ant results. so i request to help me. i will be thankfull to you.

Hello,

Please don't be impatient. I answer when I have time. Asking several times in a row for an answer won't speed up things...

The non-regression application doesn't write decompressed IP packets in file. That isn't useful since they are the same as in the original input file. If you want to do it anyway, update the source code to fit your own needs.

The rohc_common.so library is built from sources in the common/ directory.
The rohc_comp.so library is built from sources in the comp/ directory.
The rohc_decomp.so library is built from sources in the decomp/ directory.

Regards,
Didier

Rockzstar (allenpoper) said : #30

Thank you..
          K i will update the code to write decompress IP packet in a file.

You told that non-regression app will compress and decompress the IP packets in one shot. How this can be done. From where IP packet(as original input) should take.

In the directory /test/non_regression/inputs/ipv4/udp/rtp/voip/rohc_smallcid.pcap/, is this ROHC packet or IP?

In the directory ./test/non_regression/inputs/ipv4/udp/rtp/voip/source.pcap. is this ROHC packet or IP??

The command $ ./test/non_regression/test_non_regression \
     -c ./test/non_regression/inputs/ipv4/udp/rtp/voip/rohc_smallcid.pcap smallcid \
     ./test/non_regression/inputs/ipv4/udp/rtp/voip/source.pcap
will just compare the two pcap's??

Or this app is generating IP packets? if yes, how?

And i don't know how it is compressing and decompressing on one shot??what is the command to do so?

Hello,

> You told that non-regression app will compress and decompress
> the IP packets in one shot. How this can be done.

Don't get me wrong. Oneshot here means that you run the application once and packets get compressed and decompressed. The application has to call different functions in the source code.

> From where IP packet(as original input) should take.

Any source.pcap in any test/non_regression/inputs/ subdir is OK.

> In the directory /test/non_regression/inputs/ipv4/udp/rtp/voip/
> rohc_smallcid.pcap/, is this ROHC packet or IP?

ROHC packets, encoded with small CIDs.

> In the directory ./test/non_regression/inputs/ipv4/udp/rtp/voip/
> source.pcap. is this ROHC packet or IP??

IP packets.

> The command $ ./test/non_regression/test_non_regression \
> -c ./test/non_regression/inputs/ipv4/udp/rtp/voip/rohc_smallcid.pcap smallcid \
> ./test/non_regression/inputs/ipv4/udp/rtp/voip/source.pcap
> will just compare the two pcap's??

No, it will read IP packets from source.pcap, compresses them into ROHC packets (with small CIDs), compares the generated ROHC packets with the ones in rohc_smallcid.pcap, then decompresses the ROHC packets, and compares the generated IP packets with the ones in source.pcap.

> Or this app is generating IP packets? if yes, how?

No, IP packets are not generated. They are read from source.pcap.

> And i don't know how it is compressing and decompressing on one
> shot??what is the command to do so?

See the answer to your first question.

Regards,
Didier

Rockzstar (allenpoper) said : #32

Thanks for your kind reply. Now clearly got the process of this application.

I have given this command:
 $./test/non_regression/test_non_regression -c ./test/non_regression/inputs/ipv4/udp/rtp/voip/rohc_wlsb64_smallcid.pcap smallcid ./test/non_regression/inputs/ipv4/udp/rtp/voip/source.pcap

The status is ok till packet id "16".After that is giving

packet id="17" comp="1">
                <compression>
                        <log>
                        </log>
                        <status>ok</status>
                </compression>

                <rohc_comparison>
                        <log>
------------------------------ Compare ------------------------------
--------- reference ---------- ----------- new --------------
packets have different sizes (57 != 55), compare only the 55 first bytes
#0xcc# #0x9d# #0x46# #0xa3# #0x6e# #0xa3# #0xb3# #0x2a#
#0xb3# #0x2a# #0x36# #0x33# #0x36# #0x33# #0x56# #0x62#
#0x56# #0x62# #0x60# #0x77# #0x60# #0x77# #0x78# #0xc4#
#0x78# #0xc4# #0x73# #0x88# #0x73# #0x88# #0x58# #0x85#
#0x58# #0x85# #0x83# #0x6f# #0x83# #0x6f# #0x88# #0xb5#
#0x88# #0xb5# #0x48# #0x07# #0x48# #0x07# #0x80# #0xe2#
#0x88# #0xb5# #0x48# #0x07# #0x48# #0x07# #0x80# #0xe2#
#0x80# #0xe2# #0xc1# #0x9b# #0xc1# #0x9b# #0xc4# #0x5f#
#0xc4# #0x5f# #0xe1# #0x7d# #0xe1# #0x7d# #0x17# #0xd0#
#0x17# #0xd0# #0xef# #0x96# #0xef# #0x96# #0xc7# #0x50#
#0xc7# #0x50# #0x52# #0xb9# #0x52# #0xb9# #0x32# #0x92#
#0x32# #0x92# #0xaa# #0x3b# #0xaa# #0x3b# #0x62# #0xb6#
#0x62# #0xb6# #0x6d# #0x92# #0x6d# #0x92# #0xb5# #0xad#
#0xb5# #0xad# #0x63# #0xb5# #0x63# #0xb5# #0xad# #0x63#
#0xad# #0x63# #0xb5# #0xb5# #0xad# #0x67#
----------------------- packets are different -----------------------
                        </log>
                        <status>failed</status>
                </rohc_comparison>

                <decompression>
                        <log>
                        </log>
                        <status>ok</status>
                </decompression>

                <ip_comparison>

Is any thing have done wrong.

Rockzstar (allenpoper) said : #33

If i create a shared library rohc_common.so is enough or else i have to create .so.0.1 also. What is the diffrence between these two? Practically i have seen that,both are same.

Rockzstar (allenpoper) said : #34

I am trying to take only common directory and trying to build and create .so files with my makefile. Since this directory didn't have main(). It's giving undefined refrence to main. Then how common/subdirectory will create .so file.
  Even decomp also don't have main function

> I have given this command:
> $./test/non_regression/test_non_regression -c \
> ./test/non_regression/inputs/ipv4/udp/rtp/voip/rohc_wlsb64_smallcid.pcap \
> smallcid ./test/non_regression/inputs/ipv4/udp/rtp/voip/source.pcap

For the *_wlsb64_*.pcap files, add the "--wlsb-width 64" parameters to the command line. By default the W-LSB width is set to 4.

> If i create a shared library rohc_common.so is enough or else i have
> to create .so.0.1 also. What is the diffrence between these two?
> Practically i have seen that,both are same.

One is a link to the other. That helps the dynamic linker to load the correct version of the .so file at runtime if several of them are available on the system. See libtool documentation for more details: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html

> I am trying to take only common directory and trying to build and
> create .so files with my makefile. Since this directory didn't have
> main(). It's giving undefined refrence to main. Then how common/
> subdirectory will create .so file.
> Even decomp also don't have main function

Libraries don't require a main() function. Your application will provide it.

Why do you want to build the ROHC library with your own Makefile? What do you try to achieve?

Regards,
Didier

> > I have given this command:
> > $./test/non_regression/test_non_regression -c \
> > ./test/non_regression/inputs/ipv4/udp/rtp/voip/rohc_wlsb64_smallcid.pcap \
> > smallcid ./test/non_regression/inputs/ipv4/udp/rtp/voip/source.pcap
>
> For the *_wlsb64_*.pcap files, add the "--wlsb-width 64" parameters to the
> command line. By default the W-LSB width is set to 4.

I have just updated the wiki to mention the --wlsb-width option:
http://rohc-lib.org/wiki/doku.php?id=library-tests#running_one_specific_non-regression_test_manually1

Rockzstar (allenpoper) said : #37

I will tell you what i want to achieve. I have to one project in my college of ME. So, i have choosen this topic, Because i am interested in LTE, which use rohc library. So i am using the test app(non regression) to build as standalone. I am writing a make file to buils this app(Make file is main objective i.e scripting). Since that app linking to three .so files. That app will search .so files. If he didn't find, then that make file has to create .so files by compiling src directory(i.e common, comp. decomp). So this the first step to entering the lte. For that only i am seeking help from you. and thanks for helping so far.

Rockzstar (allenpoper) said : #38

After deep watch, i have noticed that. you are using libtool for creating .so file. Can you give any best tutorial or doc for creating .so files using libtool

Hello,

I still don't understand why you want to build the ROHC libraries in your project. Build them before your application, then use them as is. If they are not on the target system, install them before your application. Or choose static linking if you don't want to care about dependencies on external libraries.

Regards,
Didier

Rockzstar (allenpoper) said : #40

Hi,
    I the subdirectory of each src folder i.e
    src/common/test
    src/comp/test
    src/decomp/test

These test directory is necessary for .so files?

Sorry, I don't understand your problem or question. Please rephrase.

Didier

Rockzstar (allenpoper) said : #42

There is a test directory in the src/common, src/comp, here it is

user@ubuntu:~/rohc-1.6.1/src/common$ cd
.deps/ .libs/ protocols/ test/

user@ubuntu:~/rohc-1.6.1/src/comp$ cd
.deps/ .libs/ test/

whether these test directory also include while creating librohc_comp.so, librohc_common.so.

The test/ sub-directories are not needed for creating *.so files. The src/common/protocols/ however is.

Rockzstar (allenpoper) said : #44

Thank you....

Rockzstar (allenpoper) said : #45

Thanks Didier Barvaux, that solved my question.

Rockzstar (allenpoper) said : #46

what is w-lsb4 and w-lsb64?

> what is w-lsb4 and w-lsb64?

Width 4 and 64 for the W-LSB algortihm. See https://tools.ietf.org/html/rfc3095#page-28

Rockzstar (allenpoper) said : #48

Thanks Didier Barvaux, that solved my question.

Rockzstar (allenpoper) said : #49

if rohc_wlsb4_smallcid.pcap is compressed file, then why the size of this file is more than that of source.pcap which is IP packet.

> if rohc_wlsb4_smallcid.pcap is compressed file, then why the size of this file
> is more than that of source.pcap which is IP packet.

As stated in the description of the non-regression application, the test writes
2 ROHC packets per uncompressed packet.

Rockzstar (allenpoper) said : #51

I didn't get. The rohc_wlsb4_smallcid.pcap has two rohc packets?????

Not "2 ROHC packets", but "2 ROHC packets per uncompressed packet". See http://bazaar.launchpad.net/~didier-barvaux/rohc/1.6.x/view/head:/test/non_regression/test_non_regression.c#L24 for details.

Rockzstar (allenpoper) said : #53

Is my flow is correct
                                       IP packet
         compressed |
                        ----------------------------------
                        | |
              rohc packet rohc packet
                        | |
                        -----------------------------------
              decompress | decompress
                                         IP packet

Which means IP packet is compressed with 2 rohc packets. In decompression stage both 2 rohc combines to make as IP packet???

No, you didn't understand at all. There are 2 couples of ROHC compressor/decompressor. Every IP packet is compressed then decompressed with the first couple, then it is compressed then decompressed with the second couple. That emulates a both-way traffic, and it checks the behaviour of the bidirectionnal mode of the ROHC library.

If there are N packets in the source.pcap file, there are 2 * N ROHC packets in rohc*.pcap. Even ROHC packets were generated by the first compressor. Odd ROHC packets were generated by the 2nd compressor. Those 2 ROHC packets are equal, except for feedback data that one compressor may add while the other don't.

Rockzstar (allenpoper) said : #55

Thanks Didier Barvaux, that solved my question.