I've run some tests, and I think it's good to update the post.
The following procedure is not the correct one.
> // getting the MTU value
> uint16_t Mtu = wifiDevices.Get (0)->GetMtu ();
> // setting MSS to MTU-40 for all nodes
> Config::Set ("/NodeList/*/$ns3::TcpL4Protocol/SocketList/*/
> SegmentSize", UintegerValue (Mtu-40))
As stated in bug #579 (
http://www.nsnam.org/bugzilla/show_bug.cgi?
id=579), to change the segment size you can:
a) either pass it as a command line parameter: --
ns3::TcpSocket::SegmentSize=1460
b) or set it by means of SetDefault: Config::SetDefault
("ns3::TcpSocket::SegmentSize", UintegerValue (1460));
> 1) The path *should be* right; as a matter of fact, if I set the
> Attribute *after* the application starts:
> Simulator::Schedule (Seconds (1.5), Config::Set, "/NodeList/*/
> $ns3::TcpL4Protocol/SocketList/*/SegmentSize", UintegerValue
> (Mtu-40));
> I get this error:
> file=../src/internet-stack/tcp-socket-impl.cc, line=1670, abort on="!
> (m_state == CLOSED)", msg="TcpSocketImpl::SetSegSize(): Cannot change
> segment size dynamically."
This, quoting Craig Dowell, is to prevent users like me from "shooting
themselves in the foot" :)
Regards,
Christian