NS3 DCE: accessing TCP socket information

844 views
Skip to first unread message

Hassan

unread,
Jan 14, 2014, 4:21:41 PM1/14/14
to ns-3-...@googlegroups.com
Hello everyone,

I am new to the NS3 DCE architecture and had a question. I am familiar with NS3, however, now that I want to use the Linux MPTCP implementation I decided to move forward with NS3 DCE. So my question is am I able to directly access TCP socket information with NS3 DCE? With NS3 I was able to directly access TCP socket information such as printing and setting TCP parameters. Is this possible with NS3 DCE? If so, can someone inform me how I would be able to lets say, print out or set the current congestion windows size, or the current RTT value.

Thank you!

Konstantinos

unread,
Jan 14, 2014, 5:44:57 PM1/14/14
to ns-3-...@googlegroups.com
Hi Hassan,

I haven't used it, but you should be able to do it using the getsockopt() and setsockopt().


In principle you are using it already when you set the type of socket and attributes for creating the socket.
Perhaps not all parameters are available to get.

Regards,
K.

Hassan

unread,
Jan 15, 2014, 1:30:50 AM1/15/14
to ns-3-...@googlegroups.com
Thanks Konstantinos. I'll take a look at that. I also came across DCE Cradle. Have you had experience with that? Will that allow me to do the same?

Hajime Tazaki

unread,
Jan 15, 2014, 9:18:49 AM1/15/14
to ns-3-...@googlegroups.com

hi,

DCE has an access to kernel code via sysctl-like interface.

LinuxStack::SysctlSet and SysctlGet will give you that.
http://www.nsnam.org/docs/dce/doxygen/classns3_1_1_linux_stack_helper.html#a2dfac9387bbd038a841d510f42432973

the following example (line 109) configures debug flag of
MPTCP code.

http://code.nsnam.org/ns-3-dce/file/297f41572c12/example/dce-cradle-mptcp.cc#l109


as for more detail information in TCP stack like the size of
cwnd, measured rtt, etc, we have an experimental code,
called libaspect, to allow to direct access to any code
including kernel.

http://www.nsnam.org/docs/dce/manual/html/dce-user-aspect-trace.html
https://www.nsnam.org/bugzilla/show_bug.cgi?id=1598

we can put callbacks to arbitrary functions in kernel and
look at some states like variables of struct, during packet
reception etc.

libaspect is really *alpha* code and need more experiences
but it would be powerful tool to inspect such internals.

and, here is a brief document for DCE cradle.
http://www.nsnam.org/docs/dce/manual/html/dce-cradle.html

-- Hajime

At Tue, 14 Jan 2014 22:30:50 -0800 (PST),
Hassan wrote:
>
> [1 <text/plain; UTF-8 (7bit)>]
> --
> You received this message because you are subscribed to the Google Groups "ns-3-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
> To post to this group, send email to ns-3-...@googlegroups.com.
> Visit this group at http://groups.google.com/group/ns-3-users.
> For more options, visit https://groups.google.com/groups/opt_out.
> [2 <text/html; UTF-8 (quoted-printable)>]
>

Hassan

unread,
Jan 15, 2014, 5:41:38 PM1/15/14
to ns-3-...@googlegroups.com
Thanks Hajime!

Is there a specific bake configuration to make libaspect work with mptcp? I tried adding the libaspect dependency in dce-linux-mptcp as well as --with libaspect=$INSTALLDIR but I am getting a hook-manager.h file not found error. Suggestions?

Thanks again.

Hajime Tazaki

unread,
Jan 15, 2014, 6:45:48 PM1/15/14
to ns-3-...@googlegroups.com

the error not getting hook-manager.h was from build failure
of libaspect, I guess.

there was an error in building libaspect (which I fixed
right now). ns-3-dce with bake built should detect libaspect
automatically.

http://code.nsnam.org/thehajime/libaspect/rev/715f97b27a4c

-- Hajime

At Wed, 15 Jan 2014 14:41:38 -0800 (PST),
> > an email to ns-3-users+...@googlegroups.com <javascript:>.
> > > To post to this group, send email to ns-3-...@googlegroups.com<javascript:>.

Hassan

unread,
Jan 15, 2014, 8:12:42 PM1/15/14
to ns-3-...@googlegroups.com
Thanks Hajime!

libaspect is downloaded and indicates that it has been built correctly however the hook-manager.h problem still exists. I Inspected the bake config.log file I see this:

Checking for header hook-manager.h
==>
#include <hook-manager.h>
int main() {
return 0;
}
<==
[1/2] [32mcxx: build/.conf_check_9ac17a4889618e56ca03e3bdd93deaa9/test.cpp -> build/.conf_check_9ac17a4889618e56ca03e3bdd93deaa9/testbuild/test.cpp.1.o
[0m
['/usr/bin/g++', '-g', '-I/usr/include/python2.6', '-I/home/hassan/dce/build/include', '-DNS3_LOG_ENABLE', '-DNS3_ASSERT_ENABLE', '-DHAVE_NS3_CORE=1', '-DHAVE_NS3_NETWORK=1', '-DHAVE_NS3_INTERNET=1', '-DHAVE_NS3_POINT_TO_POINT=1', '-DHAVE_NS3_TAP_BRIDGE=1', '-DHAVE_NS3_NETANIM=1', '-DHAVE_NS3_WIFI=1', '-DHAVE_NS3_CSMA=1', '-DHAVE_NS3_MOBILITY=1', '-DHAVE_NS3_POINT_TO_POINT_LAYOUT=1', '-DHAVE_NS3_MPI=1', '-DHAVE_NS3_LTE=1', '-DHAVE_NS3_VISUALIZER=1', '-DHAVE_NS3_APPLICATIONS=1', '-DHAVE_STDINT_H=1', '-DHAVE_INTTYPES_H=1', '-DHAVE_SYS_TYPES_H=1', '-DHAVE_SYS_STAT_H=1', '-DHAVE_DIRENT_H=1', '-DHAVE_GETCPUFEATURES=1', '-DHAVE___SECURE_GETENV=1', '-DHAVE_SIM_H=1', '-DKERNEL_STACK=Y', '-DHAVE_NS3_TOPOLOGY_READ=1', '-DHAVE_NS3_FLOW_MONITOR=1', '-DHAVE_NS3_EMU=1', '../test.cpp', '-c', '-o', 'test.cpp.1.o']
err: ../test.cpp:1:26: fatal error: hook-manager.h: No such file or directory
compilation terminated.
from /home/hassan/dce/source/ns-3-dce: Test does not build: Traceback (most recent call last):
  File "/home/hassan/dce/source/ns-3-dce/.waf-1.6.11-30618c54883417962c38f5d395f83584/waflib/Tools/c_config.py", line 445, in run_c_code
    bld.compile()
  File "/home/hassan/dce/source/ns-3-dce/.waf-1.6.11-30618c54883417962c38f5d395f83584/waflib/Build.py", line 190, in compile
    raise Errors.BuildError(self.producer.error)
BuildError: Build failed
 -> task in 'testprog' failed (exit status 1): 
{task 28328080: cxx test.cpp -> test.cpp.1.o}
['/usr/bin/g++', '-g', '-I/usr/include/python2.6', '-I/home/hassan/dce/build/include', '-DNS3_LOG_ENABLE', '-DNS3_ASSERT_ENABLE', '-DHAVE_NS3_CORE=1', '-DHAVE_NS3_NETWORK=1', '-DHAVE_NS3_INTERNET=1', '-DHAVE_NS3_POINT_TO_POINT=1', '-DHAVE_NS3_TAP_BRIDGE=1', '-DHAVE_NS3_NETANIM=1', '-DHAVE_NS3_WIFI=1', '-DHAVE_NS3_CSMA=1', '-DHAVE_NS3_MOBILITY=1', '-DHAVE_NS3_POINT_TO_POINT_LAYOUT=1', '-DHAVE_NS3_MPI=1', '-DHAVE_NS3_LTE=1', '-DHAVE_NS3_VISUALIZER=1', '-DHAVE_NS3_APPLICATIONS=1', '-DHAVE_STDINT_H=1', '-DHAVE_INTTYPES_H=1', '-DHAVE_SYS_TYPES_H=1', '-DHAVE_SYS_STAT_H=1', '-DHAVE_DIRENT_H=1', '-DHAVE_GETCPUFEATURES=1', '-DHAVE___SECURE_GETENV=1', '-DHAVE_SIM_H=1', '-DKERNEL_STACK=Y', '-DHAVE_NS3_TOPOLOGY_READ=1', '-DHAVE_NS3_FLOW_MONITOR=1', '-DHAVE_NS3_EMU=1', '../test.cpp', '-c', '-o', 'test.cpp.1.o']
not found
from /home/hassan/dce/source/ns-3-dce: The configuration failed

Hajime Tazaki

unread,
Jan 15, 2014, 9:17:32 PM1/15/14
to ns-3-...@googlegroups.com

I fixed again for the error; hook-manager.h and related
files were not installed at all. please try to
download/build again.

thanks.

-- Hajime

At Wed, 15 Jan 2014 17:12:42 -0800 (PST),

Hassan

unread,
Jan 16, 2014, 4:15:50 AM1/16/14
to ns-3-...@googlegroups.com
That worked out perfectly thanks. Now that its working I see that we have hooks for functions within source files. Are there methods for accessing variables as well?

Hajime Tazaki

unread,
Jan 16, 2014, 9:02:31 AM1/16/14
to ns-3-...@googlegroups.com

Hi,

I told a wrong thing: libaspect has a potential to access
variables of source files, but doesn't support such a thing
right now. I didn't come up with any ideas how to implement
it either.

nice patch proposal is of course welcome !
-- Hajime

At Thu, 16 Jan 2014 01:15:50 -0800 (PST),
Message has been deleted
Message has been deleted

Hassan

unread,
Apr 2, 2014, 3:22:31 PM4/2/14
to ns-3-...@googlegroups.com
Hello all,

Just wondering if there has there been any progress with libaspect? Or is there an alternative method to obtain MPTCP variables such as congestion window and rtt measurements?

Thanks.

Hajime Tazaki

unread,
Apr 3, 2014, 5:36:34 AM4/3/14
to ns-3-...@googlegroups.com

At Wed, 2 Apr 2014 12:22:31 -0700 (PDT),
Hassan wrote:
>
> [1 <text/plain; UTF-8 (7bit)>]
> Hello all,
>
> Just wondering if there has there been any progress with libaspect? Or is
> there an alternative method to obtain MPTCP variables such as congestion
> window and rtt measurements?

no progress after that. unfortunately.

-- Hajime

Hassan

unread,
Apr 7, 2014, 3:25:51 PM4/7/14
to ns-3-...@googlegroups.com
Thanks Hajime. Does the flowmonitor module work with dce mptcp?

-Hassan.

Hajime Tazaki

unread,
Apr 23, 2014, 8:45:44 PM4/23/14
to ns-3-...@googlegroups.com

Hi,

At Mon, 7 Apr 2014 12:25:51 -0700 (PDT),
Hassan wrote:
>
> [1 <text/plain; UTF-8 (7bit)>]
> Thanks Hajime. Does the flowmonitor module work with dce mptcp?

flowmonitor doesn't work with DCE, unfortunately.

-- Hajime

binh nguyen

unread,
May 7, 2014, 7:40:21 PM5/7/14
to ns-3-...@googlegroups.com
Hi Guys,
I am waking up this dead thread again.
I also want to retrieve TCP socket information such as cwnd, rtt, etc in DCE.
So far none of the following is working for me:

1. Simply use printk() to print cwnd/rtt’s values in kernel log. However, I can 
neither find the kernel messages nor be able to run dmesg or access /var/log/dmesg 
on a DCE node.
2. libaspect won’t work because it can track only functions but not variables. 
3. tcpprobe is a kernel module can do the job but DCE won’t allow installing 
a kernel module or run the module. 

Do you know how to solve this or is there any thought of how to do this?
Thanks
Binh

Hassan Sinky

unread,
May 12, 2014, 5:19:31 AM5/12/14
to ns-3-...@googlegroups.com
Hello Hajime,

In NS3 DCE are we able to use propagation loss models on wifi channels (i.e. as the distance between nodes increases throughput gradually decreases)? I am using three log distance and I don't see any affect on the throughput within NS3 DCE.



-- Hajime

--
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/0XeVyozFgYM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.

To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

Hajime Tazaki

unread,
May 16, 2014, 9:38:57 PM5/16/14
to ns-3-...@googlegroups.com

At Mon, 12 May 2014 02:19:31 -0700,
Hassan Sinky wrote:
>
> [1 <text/plain; UTF-8 (7bit)>]
> Hello Hajime,
>
> In NS3 DCE are we able to use propagation loss models on wifi channels
> (i.e. as the distance between nodes increases throughput gradually
> decreases)? I am using three log distance and I don't see any affect on the
> throughput within NS3 DCE.

yes, it should work.

though i guess the throughput is not simply the product of
distance between two wireless stations. did you see non-DCE
traffic affects throughput with the distance ?

-- Hajime

>
> On Wed, Apr 23, 2014 at 5:45 PM, Hajime Tazaki <theh...@gmail.com> wrote:
>
> >
> > Hi,
> >
> > At Mon, 7 Apr 2014 12:25:51 -0700 (PDT),
> > Hassan wrote:
> > >
> > > [1 <text/plain; UTF-8 (7bit)>]
> > > Thanks Hajime. Does the flowmonitor module work with dce mptcp?
> >
> > flowmonitor doesn't work with DCE, unfortunately.
> >
> > -- Hajime
> >
> > --
> > You received this message because you are subscribed to a topic in the
> > Google Groups "ns-3-users" group.
> > To unsubscribe from this topic, visit
> > https://groups.google.com/d/topic/ns-3-users/0XeVyozFgYM/unsubscribe.
> > To unsubscribe from this group and all its topics, send an email to
> > ns-3-users+...@googlegroups.com.
> > To post to this group, send email to ns-3-...@googlegroups.com.
> > Visit this group at http://groups.google.com/group/ns-3-users.
> > For more options, visit https://groups.google.com/d/optout.
> >
>
> --
> You received this message because you are subscribed to the Google Groups "ns-3-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
> To post to this group, send email to ns-3-...@googlegroups.com.
> Visit this group at http://groups.google.com/group/ns-3-users.
> For more options, visit https://groups.google.com/d/optout.
> [2 <text/html; UTF-8 (quoted-printable)>]
>

Hajime Tazaki

unread,
May 16, 2014, 9:42:46 PM5/16/14
to ns-3-...@googlegroups.com

At Wed, 7 May 2014 17:40:21 -0600,
binh nguyen wrote:
>
> Hi Guys,
> I am waking up this dead thread again.
> I also want to retrieve TCP socket information such as cwnd, rtt, etc in DCE.
> So far none of the following is working for me:
>
> 1. Simply use printk() to print cwnd/rtt's values in kernel log. However, I can
> neither find the kernel messages nor be able to run dmesg or access /var/log/dmesg
> on a DCE node.

the printk will appear in files-X/var/log/message found in
the executed directory of your simulation. not in the
system's dmesg etc.

> 2. libaspect won't work because it can track only functions but not variables.

right.

> 3. tcpprobe is a kernel module can do the job but DCE won't allow installing
> a kernel module or run the module.

right now, DCE doesn't have a capability to load lkm.
if tcpprobe can build as built-in module, it could be used.

if you can put tcpprobe code into net-next-sim and can
configure as [*] with "make menuconfig ARCH=sim", this would
be the first step.

-- Hajime

> Do you know how to solve this or is there any thought of how to do this?
> Thanks
> Binh
>
> On Apr 3, 2014, at 3:36 AM, Hajime Tazaki <theh...@gmail.com> wrote:
>
> > At Wed, 2 Apr 2014 12:22:31 -0700 (PDT),
> > Hassan wrote:
> >>
> >> [1 <text/plain; UTF-8 (7bit)>]
> >> Hello all,
> >>
> >> Just wondering if there has there been any progress with libaspect? Or is
> >> there an alternative method to obtain MPTCP variables such as congestion
> >> window and rtt measurements?
> >
> > no progress after that. unfortunately.
> >
> > -- Hajime
>
> --
> You received this message because you are subscribed to the Google Groups "ns-3-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
> To post to this group, send email to ns-3-...@googlegroups.com.
> Visit this group at http://groups.google.com/group/ns-3-users.
> For more options, visit https://groups.google.com/d/optout.

Siddharth

unread,
May 22, 2014, 4:57:43 PM5/22/14
to ns-3-...@googlegroups.com
I am also working on the same problem and currently trying to use tcpprobe to trace the TCP parameters.

tcpprobe actually is present in net-next-sim-2.6.36 as tcp_probe.c. I found the corresponding config parameter to be NET_TCPPROBE from https://github.com/direct-code-execution/net-next-sim/blob/sim-ns3-dev-branch/net/Kconfig#L309

I tried enabling the same in arch/sim/defconfig with NET_TCPPROBE=y to include the module during the build process and was built successfully.

tcpprobe dumps information in /proc/net/tcpprobe and thus was not sure where I should be searching for this. I tried looking into files-* but was not able to locate any tcpprobe output.

Am I missing something here?

Cheers,
Siddharth

Hajime Tazaki

unread,
Jun 1, 2014, 7:36:23 PM6/1/14
to ns-3-...@googlegroups.com

DCE right now has no capability of whole proc filesystem
(only /proc/sys is partially supported in some sense): thus
tcpprobe as-is doesn't enable to output the result.

so possible solution would be,
to replace proc read handler to printk (or similar) and
generate read event instead of 'cat /proc/xxx'.


-- Hajime

At Thu, 22 May 2014 13:57:43 -0700 (PDT),
Siddharth wrote:
>
> [1 <text/plain; UTF-8 (7bit)>]
> > > On Apr 3, 2014, at 3:36 AM, Hajime Tazaki <theh...@gmail.com<javascript:>>
> > wrote:
> > >
> > > > At Wed, 2 Apr 2014 12:22:31 -0700 (PDT),
> > > > Hassan wrote:
> > > >>
> > > >> [1 <text/plain; UTF-8 (7bit)>]
> > > >> Hello all,
> > > >>
> > > >> Just wondering if there has there been any progress with libaspect?
> > Or is
> > > >> there an alternative method to obtain MPTCP variables such as
> > congestion
> > > >> window and rtt measurements?
> > > >
> > > > no progress after that. unfortunately.
> > > >
> > > > -- Hajime
> > >
> > > --
> > > You received this message because you are subscribed to the Google
> > Groups "ns-3-users" group.
> > > To unsubscribe from this group and stop receiving emails from it, send
> > an email to ns-3-users+...@googlegroups.com <javascript:>.
> > > To post to this group, send email to ns-3-...@googlegroups.com<javascript:>.
> >
> > > Visit this group at http://groups.google.com/group/ns-3-users.
> > > For more options, visit https://groups.google.com/d/optout.
> >
>
> --
> You received this message because you are subscribed to the Google Groups "ns-3-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
> To post to this group, send email to ns-3-...@googlegroups.com.
> Visit this group at http://groups.google.com/group/ns-3-users.
> For more options, visit https://groups.google.com/d/optout.
> [2 <text/html; UTF-8 (quoted-printable)>]
>

Hajime Tazaki

unread,
Dec 12, 2014, 6:40:37 AM12/12/14
to ns-3-...@googlegroups.com, binhng...@gmail.com

At Thu, 11 Dec 2014 03:24:17 -0800 (PST),
Eneko Atxutegi Narbona wrote:
>
> [1 <multipart/alternative (7bit)>]
> [1.1 <text/plain; UTF-8 (quoted-printable)>]
> Hi everybody.
>
> I've been trying to get the congestion window size, both with ns-3+NSC and
> DCE. Unfortunately, it has been impossible.
> My two main ways to try it, have been the use of printk() and the catching
> of TCP information through the kernel module (tcpprobe).
>
> Is there any new development in those ways to access the TCP parameters
> values?

there is no news on that.

what is the exact problem for you with printk () ?
it should print to files-X/var/log/messages (X is the node
number).


-- Hajime


> Thanks in advance!!!
>
> Eneko Atxutegi.
>
>
> El jueves, 8 de mayo de 2014 01:40:21 UTC+2, binh nguyen escribió:
> >
> > Hi Guys,
> > I am waking up this dead thread again.
> > I also want to retrieve TCP socket information such as cwnd, rtt, etc in
> > DCE.
> > So far none of the following is working for me:
> >
> > 1. Simply use printk() to print cwnd/rtt’s values in kernel log. However,
> > I can
> > neither find the kernel messages nor be able to run dmesg or access
> > /var/log/dmesg
> > on a DCE node.
> > 2. libaspect won’t work because it can track only functions but not
> > variables.
> > 3. tcpprobe is a kernel module can do the job but DCE won’t allow
> > installing
> > a kernel module or run the module.
> >
> > Do you know how to solve this or is there any thought of how to do this?
> > Thanks
> > Binh
> >
> > On Apr 3, 2014, at 3:36 AM, Hajime Tazaki <theh...@gmail.com <javascript:>>
> > wrote:
> >
> > At Wed, 2 Apr 2014 12:22:31 -0700 (PDT),
> > Hassan wrote:
> >
> >
> > [1 <text/plain; UTF-8 (7bit)>]
> > Hello all,
> >
> > Just wondering if there has there been any progress with libaspect? Or is
> > there an alternative method to obtain MPTCP variables such as congestion
> > window and rtt measurements?
> >
> >
> > no progress after that. unfortunately.
> >
> > -- Hajime
> >
> >
> >
>
> --
> You received this message because you are subscribed to the Google Groups "ns-3-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
> To post to this group, send email to ns-3-...@googlegroups.com.
> Visit this group at http://groups.google.com/group/ns-3-users.
> For more options, visit https://groups.google.com/d/optout.
> [1.2 <text/html; UTF-8 (quoted-printable)>]
>

Eneko Atxutegi Narbona

unread,
Dec 11, 2014, 6:24:17 AM12/11/14
to ns-3-...@googlegroups.com, binhng...@gmail.com
Hi everybody.

I've been trying to get the congestion window size, both with ns-3+NSC and DCE. Unfortunately, it has been impossible.
My two main ways to try it, have been the use of printk() and the catching of TCP information through the kernel module (tcpprobe).

Is there any new development in those ways to access the TCP parameters values?

Thanks in advance!!!

Eneko Atxutegi.


El jueves, 8 de mayo de 2014 01:40:21 UTC+2, binh nguyen escribió:

Jianwei Liu

unread,
Jan 7, 2016, 2:55:15 PM1/7/16
to ns-3-...@googlegroups.com
Hajime Tazaki <thehajime@...> writes:

>
>
> DCE right now has no capability of whole proc filesystem
> (only /proc/sys is partially supported in some sense): thus
> tcpprobe as-is doesn't enable to output the result.
>
> so possible solution would be,
> to replace proc read handler to printk (or similar) and
> generate read event instead of 'cat /proc/xxx'.
>

Hi Hajime,

I am wondering what is the current status of the proc fs of the
development version of DCE. Can I read some entry from /proc/net/mptcp inside
NS3 now. If yes, could you please give some hints on how?

Thanks,
Jianwei



neha thakur

unread,
Feb 7, 2020, 12:22:48 PM2/7/20
to ns-3-users
Is there any hints on how to achieve tracing TCP socket information?

neha thakur

unread,
Feb 8, 2020, 12:59:24 AM2/8/20
to ns-3-users
Hi,

Were you able to finally get the solution for Tracing TCP socket information.

regards,
Rupesh
Reply all
Reply to author
Forward
0 new messages