Bug 2254 - Ipv[4,6]RawSocket can return the wrong number of bytes sent.
Ipv[4,6]RawSocket can return the wrong number of bytes sent.
Status: CLOSED FIXED
Product: ns-3
Classification: Unclassified
Component: internet
ns-3-dev
All All
: P5 minor
Assigned To: Tommaso Pecorella
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-09 09:17 UTC by Tommaso Pecorella
Modified: 2016-01-17 17:16 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tommaso Pecorella 2016-01-09 09:17:58 UTC
Reported by Stefano Avallone <stavallo@gmail.com>.

The Send return value depends on how the NetDevice is adding its headers to the packet.
The number of sent bytes should be independent on the NetDevice operations.
Comment 1 Tommaso Pecorella 2016-01-09 09:30:17 UTC
changeset:   11810:a7f3de5f353c
Comment 2 Hajime Tazaki 2016-01-14 10:07:51 UTC
Tommaso,

this fix doesn't consider about the optional attribute of "IpHeaderInclude".

http://code.nsnam.org/ns-3-dev/file/a7f3de5f353c/src/internet/model/ipv4-raw-socket-impl.cc#l38

    37     // 
    38     //  from raw (7), linux, returned length of Send/Recv should be
    39     // 
    40     //            | IP_HDRINC on  |      off    |
    41     //  ----------+---------------+-------------+-
    42     //  Send(Ipv4)| hdr + payload | payload     |
    43     //  Recv(Ipv4)| hdr + payload | hdr+payload |
    44     //  ----------+---------------+-------------+-
    45     .AddAttribute ("IpHeaderInclude", 
    46                    "Include IP Header information (a.k.a setsockopt (IP_HDRINCL)).",
    47                    BooleanValue (false),
    48                    MakeBooleanAccessor (&Ipv4RawSocketImpl::m_iphdrincl),
    49                    MakeBooleanChecker ())


if this is option is true, the Send() should return "p->GetSize()" as the previous version. is it possible to address this issue while fixing the original issue you faced ?
Comment 3 Tommaso Pecorella 2016-01-15 16:07:50 UTC
changeset 11820	4700f632bc8f
Comment 4 Hajime Tazaki 2016-01-17 17:16:45 UTC
(In reply to Tommaso Pecorella from comment #3)
> changeset 11820	4700f632bc8f

Thanks. The fix is fine with DCE tests.