Bug 2801 - MTU is not set correctly
MTU is not set correctly
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: fd-net-device
ns-3-dev
All All
: P3 normal
Assigned To: ns-bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-10-17 06:32 UTC by Manuel Requena
Modified: 2018-05-03 10:13 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Manuel Requena 2017-10-17 06:32:07 UTC
There is a "typo" that makes that the MTU is not set correctly.

The "typo" is in line 189:
"device->SetMtu (ifr.ifr_mtu);"
of EmuFdNetDeviceHelper::SetFileDescriptor (Ptr<FdNetDevice> device).

ifr2 struct is used to get the MTU size with ioctl, but ifr is used to set the MTU with device->SetMtu. So, it must be:
"device->SetMtu (ifr2.ifr_mtu);"

The problem can be reproduced with the example fd-emu-onoff.cc.
The packetSize is equal to 10000 and the MTU size is set to around 4000. So, IP segments with size equal to 4000 are generated. As the real MTU size is equal to 1500, the firsts segments are not really sent by the physical interface.
Comment 1 Tom Henderson 2018-05-03 10:13:24 UTC
Pasquale confirmed this patch, so I pushed in changeset 13501:39141ec72933