Are there any Client Server request applications?

212 views
Skip to first unread message

Yida

unread,
Jul 20, 2010, 3:22:54 PM7/20/10
to ns-3-users
Hi Everyone,

I was wondering if there was an ns3 application that did basically
this:

A client sends a request to a server for a certain amount of data.
Then, the server sends the requested data via UDP to the client.

Thanks for the help!

Yida

unread,
Jul 20, 2010, 6:26:53 PM7/20/10
to ns-3-users
Or does anyone have an application they created which can do this?

Pallavi Tuli

unread,
Jul 20, 2010, 11:41:17 PM7/20/10
to ns-3-...@googlegroups.com
ya u can n its simple to do using a unix code..

--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To post to this group, send email to ns-3-...@googlegroups.com.
To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.


Abhishek sagar

unread,
Jul 21, 2010, 4:33:55 PM7/21/10
to ns-3-...@googlegroups.com
echo application does that. you can modify it a little bit if you want according to your needs


Abhishek Sagar



--

Yida Gao

unread,
Jul 21, 2010, 7:37:59 PM7/21/10
to ns-3-...@googlegroups.com
Hi,

I tried altering udp-echo using this HOWTO: http://www.nsnam.org/wiki/index.php/HOWTO_make_and_use_a_new_application
but I keep getting the same error when I try to run the request-response.cc example

ygao@Terilogy:~/ns-3-allinone/
ns-3.8-pyviz$ ./waf --run scratch/request-response
Waf: Entering directory `/home/ygao/ns-3-allinone/ns-3.8-pyviz/build'
'/home/ygao/ns-3-allinone/ns-3.8-pyviz/bindings/python/ns3/__init__.py' -> '/home/ygao/ns-3-allinone/ns-3.8-pyviz/build/debug/bindings/python/ns3/__init__.py'
[454/958] cxx: scratch/request-response.cc -> build/debug/scratch/request-response_3.o
../scratch/request-response.cc: In function ‘int main(int, char**)’:
../scratch/request-response.cc:88: error: ‘RequestResponseServerHelper’ was not declared in this scope
../scratch/request-response.cc:88: error: expected ‘;’ before ‘server’
../scratch/request-response.cc:89: error: ‘server’ was not declared in this scope
../scratch/request-response.cc:100: error: ‘RequestResponseClientHelper’ was not declared in this scope
../scratch/request-response.cc:100: error: expected ‘;’ before ‘client’
../scratch/request-response.cc:101: error: ‘client’ was not declared in this scope
cc1plus: warnings being treated as errors
../scratch/request-response.cc:87: error: unused variable ‘port’
Waf: Leaving directory `/home/ygao/ns-3-allinone/ns-3.8-pyviz/build'
Build failed:  -> task failed (err #1):
    {task: cxx request-response.cc -> request-response_3.o}

It seems like something about declaring the helper and applications.

Thanks for your help!


--
Yida Gao
Massachusetts Institute of Technology | Class of 2013
Department of Mathematics and Management Science (18c & 15)

Lalith Suresh

unread,
Jul 21, 2010, 11:50:17 PM7/21/10
to ns-3-...@googlegroups.com
Hello,

On Thu, Jul 22, 2010 at 5:07 AM, Yida Gao <yid...@gmail.com> wrote:
Hi,

I tried altering udp-echo using this HOWTO: http://www.nsnam.org/wiki/index.php/HOWTO_make_and_use_a_new_application
but I keep getting the same error when I try to run the request-response.cc example

ygao@Terilogy:~/ns-3-allinone/
ns-3.8-pyviz$ ./waf --run scratch/request-response
Waf: Entering directory `/home/ygao/ns-3-allinone/ns-3.8-pyviz/build'
'/home/ygao/ns-3-allinone/ns-3.8-pyviz/bindings/python/ns3/__init__.py' -> '/home/ygao/ns-3-allinone/ns-3.8-pyviz/build/debug/bindings/python/ns3/__init__.py'
[454/958] cxx: scratch/request-response.cc -> build/debug/scratch/request-response_3.o
../scratch/request-response.cc: In function ‘int main(int, char**)’:
../scratch/request-response.cc:88: error: ‘RequestResponseServerHelper’ was not declared in this scope
../scratch/request-response.cc:88: error: expected ‘;’ before ‘server’
../scratch/request-response.cc:89: error: ‘server’ was not declared in this scope
../scratch/request-response.cc:100: error: ‘RequestResponseClientHelper’ was not declared in this scope
../scratch/request-response.cc:100: error: expected ‘;’ before ‘client’
../scratch/request-response.cc:101: error: ‘client’ was not declared in this scope
cc1plus: warnings being treated as errors
../scratch/request-response.cc:87: error: unused variable ‘port’
Waf: Leaving directory `/home/ygao/ns-3-allinone/ns-3.8-pyviz/build'
Build failed:  -> task failed (err #1):
    {task: cxx request-response.cc -> request-response_3.o}

It seems like something about declaring the helper and applications.

Yes. You'll need to implement a helper if you're trying to use one! Look inside src/helper/.

But if you're comfortable with the Object system, you can simply do something like:

Ptr<ur_type> your_app = CreateObject<ur_type>();
node->AggregateObject(your_app);

That what is internally done by the helpers.

Yida

unread,
Jul 22, 2010, 12:23:11 PM7/22/10
to ns-3-users
I did implement the helpers:


// Create a RequestResponseServer application on node one.
//
uint16_t port = 9; // well-known echo port number
RequestResponseServerHelper server (port);
ApplicationContainer apps = server.Install (n.Get(1));
apps.Start (Seconds (1.0));
apps.Stop (Seconds (10.0));

//
// Create a RequestResponseClient application to send UDP datagrams
from node zero to
// node one.
//
uint32_t packetSize = 1024;
uint32_t maxPacketCount = 1;
Time interPacketInterval = Seconds (1.);
RequestResponseClientHelper client (i.GetAddress (1), port);
client.SetAttribute ("MaxPackets", UintegerValue (maxPacketCount));
client.SetAttribute ("Interval", TimeValue (interPacketInterval));
client.SetAttribute ("PacketSize", UintegerValue (packetSize));
apps = client.Install (n.Get (0));
apps.Start (Seconds (2.0));
apps.Stop (Seconds (10.0));


It still doesn't work. I followed the steps verbatim from
http://www.google.com/url?sa=D&q=http://www.nsnam.org/wiki/index.php/HOWTO_make_and_use_a_new_application&usg=AFQjCNEKhXUesb--jJXd0oouldmaTJtktw
> > On Wed, Jul 21, 2010 at 4:33 PM, Abhishek sagar <sagar23...@gmail.com>wrote:
>
> >> echo application does that. you can modify it a little bit if you want
> >> according to your needs
>
> >> Abhishek Sagar
>
> >> On Wed, Jul 21, 2010 at 12:52 AM, Yida <yid...@gmail.com> wrote:
>
> >>> Hi Everyone,
>
> >>> I was wondering if there was an ns3 application that did basically
> >>> this:
>
> >>> A client sends a request to a server for a certain amount of data.
> >>> Then, the server sends the requested data via UDP to the client.
>
> >>> Thanks for the help!
>
> >>> --
> >>> You received this message because you are subscribed to the Google Groups
> >>> "ns-3-users" group.
> >>> To post to this group, send email to ns-3-...@googlegroups.com.
> >>> To unsubscribe from this group, send email to
> >>> ns-3-users+...@googlegroups.com<ns-3-users%2Bunsu...@googlegroups.com>
> >>> .
> >>> For more options, visit this group at
> >>>http://groups.google.com/group/ns-3-users?hl=en.
>
> >>  --
> >> You received this message because you are subscribed to the Google Groups
> >> "ns-3-users" group.
> >> To post to this group, send email to ns-3-...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> ns-3-users+...@googlegroups.com<ns-3-users%2Bunsu...@googlegroups.com>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/ns-3-users?hl=en.
>
> > --
> > Yida Gao
> > Massachusetts Institute of Technology | Class of 2013
> > Department of Mathematics and Management Science (18c & 15)
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "ns-3-users" group.
> > To post to this group, send email to ns-3-...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > ns-3-users+...@googlegroups.com<ns-3-users%2Bunsu...@googlegroups.com>
> > .

Abhishek sagar

unread,
Jul 22, 2010, 1:56:13 PM7/22/10
to ns-3-...@googlegroups.com
you sure you followed the sixth step ??
****

6. Make a new helper for your new application

   a.  change directory into ns-3-dev/src/helper
cd src/helper
b. create a new helper from the existing UDP echo helper
cp udp-echo-helper.cc request-response-helper.cc
cp udp-echo-helper.h request-response-helper.h
c. Edit the new helper files and make the same substitutions as in step 3
above.
d. Edit the helper wscript file and add a module dependency for your new helper file.
Add the string "'request-response'," in the call to create_ns3_module, like,
'udp-echo', 'request-response'])
e. Add the new dependency files to the wscript
Add a line 'request-response-helper.cc', in the helper.source assignments. Like
'udp-echo-helper.cc',
'request-response-helper.cc',
Add a line, 'request-response-helper.h', in the headers.source assignments. Like
'udp-echo-helper.h',
'request-response-helper.h',

****

Abhishek Sagar


To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.

Yida

unread,
Jul 22, 2010, 2:15:52 PM7/22/10
to ns-3-users
Yes, I did that step.
Please see the files:

http://groups.google.com/group/ns-3-users/web/wscript
http://groups.google.com/group/ns-3-users/web/request-response-helper.h
http://ns-3-users.googlegroups.com/web/request-response-helper.cc?gda=kcDn70wAAADuh8e3sYBD1UqdsXMgVq3B9I8uQ-9ybXduzUKpSB0C30hEmTkRwlUuFbGToo3C4sqfPbihC81lk867TZaiCS7i_Vpvmo5s1aABVJRO3P3wLQ&gsc=pmY6aAsAAABkBmgWtF0xvhqTbtOKRzEU
> >http://www.google.com/url?sa=D&q=http://www.nsnam.org/wiki/index.php/...
> > <ns-3-users%2Bunsu...@googlegroups.com<ns-3-users%252Buns...@googlegroups.com>
>
> > > >>> .
> > > >>> For more options, visit this group at
> > > >>>http://groups.google.com/group/ns-3-users?hl=en.
>
> > > >>  --
> > > >> You received this message because you are subscribed to the Google
> > Groups
> > > >> "ns-3-users" group.
> > > >> To post to this group, send email to ns-3-...@googlegroups.com.
> > > >> To unsubscribe from this group, send email to
> > > >> ns-3-users+...@googlegroups.com<ns-3-users%2Bunsu...@googlegroups.com>
> > <ns-3-users%2Bunsu...@googlegroups.com<ns-3-users%252Buns...@googlegroups.com>
>
> > > >> .
> > > >> For more options, visit this group at
> > > >>http://groups.google.com/group/ns-3-users?hl=en.
>
> > > > --
> > > > Yida Gao
> > > > Massachusetts Institute of Technology | Class of 2013
> > > > Department of Mathematics and Management Science (18c & 15)
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "ns-3-users" group.
> > > > To post to this group, send email to ns-3-...@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > > ns-3-users+...@googlegroups.com<ns-3-users%2Bunsu...@googlegroups.com>
> > <ns-3-users%2Bunsu...@googlegroups.com<ns-3-users%252Buns...@googlegroups.com>
Reply all
Reply to author
Forward
0 new messages