How to modify segment Size of TCP-socket in application file

97 views
Skip to first unread message

Ruth T. Howell

unread,
May 10, 2016, 10:47:09 AM5/10/16
to ns-3-users
I work with application layer for research but I want to expand the research to lower layer (transport layer). I want to modify the attribute "SegmentSize" in tcp-socket.cc in my own file application. How I set new value of for it? 

Tommaso Pecorella

unread,
May 10, 2016, 10:58:32 AM5/10/16
to ns-3-users
Hi,

use the Attributes.

T.

Segue Diallo

unread,
May 23, 2019, 8:13:09 AM5/23/19
to ns-3-users

Hi,

I have 
Ptr<Packet> m_socket = Socket::CreateSocket(GetNode(), TcpSocketFactory::GetTypeId());

How can I call the method SetSegSize() to change the default TCP segment size?

Segue.

Chamnilu Narayana

unread,
May 23, 2019, 2:51:59 PM5/23/19
to ns-3-...@googlegroups.com
Hi,
As an addition to Tommaso. Use the following functions in side the application you are creating.
Ptr<SocketFactory> rxSocketFactory =this->m_node->GetObject<TcpSocketFactory>;
Ptr<Socket> socket = rxSocketFactory->CreateSocket();
socket->SetAttribute("SegmentSize", UintergerValue(1460)) //i used 1460 for segment size

--
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 post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at https://groups.google.com/group/ns-3-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/57cca904-063f-4341-baea-f5adffc46b01%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages