Regarding Tcp client server program

98 views
Skip to first unread message

RESHU VERMA

unread,
May 9, 2023, 5:34:54 AM5/9/23
to ns-3-...@googlegroups.com
Hello Everyone,

I am a beginner in NS3 and I am trying to develop a TCP client-server
program. To achieve this, I have studied several classes such as
PacketSinkHelper, OnOffApplication, UDPEchoServer, and UDPEchoClient.
I am currently working with NS-3 version 3.38. I have attached my TCP
client-server program along with output, but I am encountering an
issue where the client is unable to connect to the server, resulting
in a "connection refused" error message. I would appreciate any
guidance or assistance in resolving this issue.

Thanks and regards
Reshu Verma

--


Disclaimer:- This footer text is to convey that this email is sent by one
of the users of IITH. So, do not mark it as SPAM.
app.cc
tcp_client.h
tcp_server.cc
tcp_server.h
tcp_client.cc
output1.png

Tommaso Pecorella

unread,
May 9, 2023, 5:48:56 AM5/9/23
to ns-3-users
You have to tell the client what's the address of the server...

RESHU VERMA

unread,
May 9, 2023, 6:00:47 AM5/9/23
to ns-3-...@googlegroups.com
Thankyou for your reply sir

But i have mentioned address and port of the server in SetRemote function of tcp_client. In the output we can see the address and port are same for client and server.

Regards
Reshu Verma 

--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
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 view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/50b7a03e-0cae-41a2-b28e-41367ab71161n%40googlegroups.com.

Tommaso Pecorella

unread,
May 9, 2023, 6:13:58 AM5/9/23
to ns-3-users
102.102.102.102 is the uninitialised address, and SetRemote is commented in your script. 

RESHU VERMA

unread,
May 9, 2023, 10:06:34 AM5/9/23
to ns-3-...@googlegroups.com
Thankyou for your guidance sir

Could you please provide some guidance on how to resolve the issue? I
have made some modifications to the code and specified the IP address,
but I am still receiving a "connection refused" error.
(I have attached updated file and output)
Thank you for your help.

Regards
Reshu
> To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/102c1e71-78e6-4976-b6ea-e5bf2267ac54n%40googlegroups.com.
tcp_client.cc
tcp_server.cc
o1.png

RESHU VERMA

unread,
May 10, 2023, 1:53:51 AM5/10/23
to ns-3-...@googlegroups.com
Thank you for your guidance.

I have managed to resolve the issue, and I am now able to establish
communication among nodes and even modify the contents within the
packet.

regards
Reshu Verma

On Tue, May 9, 2023 at 3:44 PM Tommaso Pecorella <tomm...@gmail.com> wrote:
>
> To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/102c1e71-78e6-4976-b6ea-e5bf2267ac54n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages