How to print (know) the current TCP version being used

80 views
Skip to first unread message

inam

unread,
Jul 10, 2017, 2:44:48 AM7/10/17
to ns-3-users
Hi all,
I know that it is possible to set TCP version as:
Config::SetDefault ("ns3::TcpL4Protocol::SocketType", TypeIdValue (TcpNewReno::GetTypeId ()));

But I want to do the reverse: know which version of TCP is being used. That is, I want to have something like:
Config::GetDefault ("ns3::TcpL4Protocol::SocketType", ...)

Also, I tried to get an object of TcpL4Protocol, so that I can get the SocketType from the attributes list of the object. But I couldn't find from where should I get such an object.

Is there a way to do that?

Regards.
Inam

Muge Erel

unread,
Jul 11, 2017, 9:25:14 AM7/11/17
to ns-3-users
Hi,

I am not sure that it is the answer of your question but you can check available tcp_congestion control in linux with following command:

sysctl net.ipv4.tcp_congestion_control

also change with following command:
sysctl -w net.ipv4.tcp_congestion_control=vegas

Best,
Muge EREL OZCEVIK

10 Temmuz 2017 Pazartesi 14:44:48 UTC+8 tarihinde inam yazdı:

inam

unread,
Jul 12, 2017, 4:39:46 AM7/12/17
to ns-3-users
Thanks Muge for your reply.

But, that is not my question. I am trying to find the TCP version being used in an ns-3 simulation. In fact, I want to either know an object to SocketType or to TcpL4Protocol from within my code, or a way to get the Sockettype as an attribute from the attribute system of ns-3.

Can anyone help?
Regards.
Inam

Rediet

unread,
Jul 13, 2017, 3:40:08 AM7/13/17
to ns-3-users
Hello Inam,

You can follow this example to get the aggregated TcpL4Protocol object attribute:
  Ptr<TcpL4Protocol> tcp = node->GetObject<TcpL4Protocol> ();
 
TypeIdValue socketId;
  tcp
->GetAttribute ("SocketType", socketId);
  std
::cout << socketId.Get ().GetName () << std::endl;

Cheers,

Rediet

inam

unread,
Jul 23, 2017, 3:28:44 AM7/23/17
to ns-3-users
Thanks a lot, Rediet. Sorry for being so late in thanking you. This happened because I shifted briefly from ns-3 to some other stuff. 

Thank you again. Your solution will really help me.

Warm regards
Inam
Reply all
Reply to author
Forward
0 new messages