Must I install sink-applications while installing on-off-applications(TCP)?

192 views
Skip to first unread message

avon yan

unread,
Jan 31, 2015, 11:28:10 PM1/31/15
to ns-3-...@googlegroups.com
Hi, all~

Must I install sink-applications while installing on-off-applications?

Some of my test code is:

        uint32_t port = 8080;
        MyOnOffHelper oo = MyOnOffHelper("ns3::TcpSocketFactory",Address(InetSocketAddress(interfaces.GetAddress (0), port))); // ip address of server
 oo.SetAttribute("OnTime",StringValue("ns3::ExponentialRandomVariable[Mean=1]"));
        oo.SetAttribute("OffTime",StringValue("ns3::ExponentialRandomVariable[Mean=1]"));
        oo.SetAttribute("PacketSize",UintegerValue (packetSize));
        oo.SetAttribute("DataRate",DataRateValue(dataRate_OnOff));     
        oo.SetAttribute("MaxBytes",UintegerValue (maxBytes));
        ApplicationContainer serverApps = oo.Install (nodes.Get (1));
        serverApps.Start (Seconds (1.0));
        serverApps.Stop (Seconds (10.0));

I didn't installed sink-applications at the receiver node, but it also workes, I can view the traffic with NetAnim.

So, my question is, must I install sink-applications while installing on-off-applications(TCP)?
Seems that the on-off-application donot need the installation of the echoServer-application, however, some codes I found in the group have somthing to do with sink-applications, why, are there some special reasons?

Looking forward to your help!

Tommaso Pecorella

unread,
Feb 1, 2015, 4:03:08 AM2/1/15
to ns-3-...@googlegroups.com
Hi,

yes, you must install Siink app or any other app opening a receiving socket.
If you don't do this, the receiver node should refuse the connection. This doesn't mean that packets will not be exchanged, of course. The source node will send a SYN and the reply will be an RST.

If the connection is opened no matter what, then you found a bug. Check that te wrong behaviour in ns-3-dev and send us a small script showing the bug.

Thanks,

T.

avon yan

unread,
Feb 1, 2015, 9:59:41 PM2/1/15
to ns-3-...@googlegroups.com
Thanks for your reply!
Seems I have made some mistakes! I will correct my code.Thank you!
And I have another question, UDP is  connectionless, so I neednot install echoServer-application while installing on-off-application in UDP?
Are there any differences between TCP's on-off-application and UDP's on-off-application?

在 2015年2月1日星期日 UTC+8下午5:03:08,Tommaso Pecorella写道:

Tommaso Pecorella

unread,
Feb 2, 2015, 2:57:54 AM2/2/15
to ns-3-...@googlegroups.com
Hi,

answers in line.

On Monday, February 2, 2015 at 3:59:41 AM UTC+1, avon yan wrote:
Thanks for your reply!
Seems I have made some mistakes! I will correct my code.Thank you!

You're welcome.
 
And I have another question, UDP is  connectionless, so I neednot install echoServer-application while installing on-off-application in UDP?

Technically you don't need. However, you want to.
If you don't have an app opening the socket (you could do it manually as well), the node will send back an ICMP error message for each packet you send. That's not something you want to have (normally).
 
Are there any differences between TCP's on-off-application and UDP's on-off-application?

The only differences are in the L4 protocol used. This may lead to evident differences in the sent packets. E.g., UDP will send packets as soon as they're created and with the size they were created, while TCP uses all its congestion avoidance/recovery mechanisms and uses its own packet size. The normal TCP Vs UDP behaviour.

Cheers,

T.

avon yan

unread,
Feb 2, 2015, 4:01:36 AM2/2/15
to ns-3-...@googlegroups.com
Thanks!O(∩_∩)O

在 2015年2月2日星期一 UTC+8下午3:57:54,Tommaso Pecorella写道:
Reply all
Reply to author
Forward
0 new messages