Bug 2801

Summary: MTU is not set correctly
Product: ns-3 Reporter: Manuel Requena <manuel.requena>
Component: fd-net-deviceAssignee: ns-bugs <ns-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: tomh
Priority: P3    
Version: ns-3-dev   
Hardware: All   
OS: All   

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