Bug 409

Summary: Routing messages can exceed MTU, and fragmentation not supported
Product: ns-3 Reporter: Luis <cortes>
Component: internetAssignee: Mathieu Lacage <mathieu.lacage>
Status: RESOLVED FIXED    
Severity: critical CC: craigdo, mathieu.lacage, ns-bugs, tomh, tommaso.pecorella
Priority: P2 Keywords: bug
Version: ns-3-dev   
Hardware: PC   
OS: Linux   
Attachments: Script where sim fails

Description Luis 2008-11-14 20:57:25 UTC
Created attachment 303 [details]
Script where sim fails

Hi,

I am trying to run the following case:

TOPOLOGY:

     WIRED CSMA             WIRELESS CHANNEL
   ______________
   O            O  ))              (( O ))   RANDOMLY PLACED IN 500x500 map
   Nk           N0                N1 ..... N(k-1)


where nNodes = k-1

The following happens:

./waf --run "scratch/wifi-mesh -nNodes=10"  #Works
./waf --run "scratch/wifi-mesh -nNodes=39"  #Works
./waf --run "scratch/wifi-mesh -nNodes=40"  #Fails
./waf --run "scratch/wifi-mesh -nNodes=41"  #Works
./waf --run "scratch/wifi-mesh -nNodes=50"  #Fails
./waf --run "scratch/wifi-mesh -nNodes=100" #Fails

when it fails, I get:

assert failed. file=../src/internet-stack/ipv4-l3-protocol.cc, line=671, cond="packetCopy->GetSize () <= outInterface->GetMtu ()"
Command ['/home/cortes/ns3/ns-3-dev/build/debug/scratch/wifi-mesh', '-nNodes=40'] exited with code -11 

Thanks,
Comment 1 Tom Henderson 2008-11-17 18:38:28 UTC
I was able to verify and debug the cause.  The culprit is that OLSR is
occasionally sending packets greater than 1500 bytes.  In the specific case for
40 nodes, OLSR tries to send a 1484 byte packet (which becomes 1512 bytes after
UDP and IP headers) on a 1500 byte MTU link.

The fundamental problem is that ns-3 doesn't support IP fragmentation for UDP. 
We need to decide when we are going to solve this because it will crop up
again.

For now, the workaround in OLSR to avoid this is to scale back the number of
messages that can be inserted into a single packet, such as:

--- a/src/routing/olsr/olsr-agent-impl.cc       Sun Nov 09 12:34:48 2008 +0000
+++ b/src/routing/olsr/olsr-agent-impl.cc       Mon Nov 17 15:45:42 2008 -0800
@@ -121,7 +121,7 @@

 #define OLSR_PORT_NUMBER 698
 /// Maximum number of messages per packet.
-#define OLSR_MAX_MSGS          64
+#define OLSR_MAX_MSGS          24
Comment 2 Mathieu Lacage 2008-11-25 09:12:18 UTC
I moved this to the internet-stack module. I volunteer to add ip fragmentation support once the ipv4 restructuring is done.
Comment 3 Tom Henderson 2008-11-25 09:56:06 UTC
changed title to reflect the remaining open issue
Comment 4 Tom Henderson 2008-11-25 09:57:24 UTC
bumping priority down-- fragmentation will not be part of ns-3.3 release
Comment 5 Rajib Bhattacharjea 2008-12-19 13:35:19 UTC
Bumping priority since this is a target for 3.4, and assigning to Mathieu who volunteered.
Comment 6 Tom Henderson 2009-02-16 01:05:48 UTC
fragmentation not part of ns-3.4
Comment 7 Tommaso Pecorella 2011-04-25 11:03:44 UTC
Can we have an updates test case showing the bug? 

Ns-3 changed a "little" bit and I can't reproduce this bug anymore.

Thanks, T.
Comment 8 Tommaso Pecorella 2011-07-15 14:55:41 UTC
This bug might now be fixed as IPv4 does have fragmentation and reassembly support.

Shall we close it ?

Tommaso
Comment 9 Tom Henderson 2011-07-15 15:57:41 UTC
(In reply to comment #8)
> This bug might now be fixed as IPv4 does have fragmentation and reassembly
> support.
> 
> Shall we close it ?
> 
> Tommaso


I suggest to close this bug as the just committed patch should fix this.