Different TCP socket attribute

181 views
Skip to first unread message

Aniesh Chawla

unread,
Oct 14, 2014, 5:13:40 AM10/14/14
to ns-3-...@googlegroups.com
Hi,

I am trying to simulate a wifi environment in which one access point is connected to 4 nodes. 2 nodes I have made server(with packetsink helper) and other two as client(with BulkSend helper). I want to check if it is possible to make one node using TCP DelAckCount and other using the default value.

if I used Config::SetDefault ("ns3::TcpSocket::DelAckCount",UintegerValue(xyz)) - it sets this for all the nodes
If I try this way:
Ptr<Node> wifinode = wifinodes.Get(0);
  Ptr<Object> interface = wifinode->GetDevice(0);
  Ptr<Socket> socket = interface->GetObject<TcpSocket>();
  socket->SetDelAckMaxCount(4)

This does not let me set it as the variable is defined in private class.

Is there any way to do this?

Thanks in advance

regards
Aniesh

Tommaso Pecorella

unread,
Oct 14, 2014, 6:45:47 AM10/14/14
to ns-3-...@googlegroups.com

Konstantinos

unread,
Oct 14, 2014, 6:56:20 AM10/14/14
to ns-3-...@googlegroups.com
Also note that the sockets will be created at runtime, so be careful.

Aniesh Chawla

unread,
Oct 15, 2014, 2:39:28 AM10/15/14
to ns-3-...@googlegroups.com
Thanks Tommaso and Konstantinos,
I have read the manual before posting the question.

My question is more stupider in the sense that I am not able to decipher how to get the pointer to TcpSocket on a particular node.
(I hope you know its very embarrassing for me also to ask such stupid questions but I have literally got stuck)

Regards
Aniesh

Konstantinos

unread,
Oct 15, 2014, 4:19:03 AM10/15/14
to ns-3-...@googlegroups.com
The sockets are not an attribute of the node or device. Usually they are created by the application. So, either get the pointer from the application that created it or use the config path "/NodeList/[i]/$ns3::TcpL4Protocol/SocketList/[i]/" which as I mentioned in my previous post make sure it is called after the application has created the socket.

Aniesh Chawla

unread,
Oct 16, 2014, 2:16:04 AM10/16/14
to ns-3-...@googlegroups.com

Thanks K.

I has done this also earlier, but still was not able to change the values.
I think i should have been careful in reading your comment "Also note that the sockets will be created at runtime, so be careful"
I was just putting the code Config::Set( "/NodeList/[i]/$ns3::TcpL4Protocol/SocketList/[i]/$ns3::TcpSocket/DelAckCount, UintegerValue(xyz)" at the end of my main code and not scheduling it with start of application as you mentioned in lot of your answers to earlier questions.

Thanks a lot K

Aniesh
Reply all
Reply to author
Forward
0 new messages