Bugzilla – Bug 135
Ipv4 tracing events do not have enough parameters
Last modified: 2008-02-11 10:03:41 UTC
Regarding the trace event "/nodes/*/ipv4/drop", void Ipv4L3Protocol::SendRealOut (bool found, Ipv4Route const &route, Ptr<Packet> packet, Ipv4Header const &ipHeader) { NS_LOG_FUNCTION; NS_LOG_PARAMS (this << found << &route << packet << &ipHeader); if (!found) { NS_LOG_WARN ("No route to host. Drop."); m_dropTrace (packet); return; } [...] In the user callback, only the IPv4 payload is received, but there is not information regarding the payload type, so I do not know how to decode the packet (is it UDP, TCP, or...?). I propose to change the trace callback signature to include also the Ipv4 header: m_dropTrace (packet, ipHeader);
Oh, same thing applies for tx and rx events. Currently it is not possible to find out what kind of IPv4 packet I am receiving or sending. The Ipv4Header would allow that. PS: the code in question is in src/internet-node/ipv4-l3-protocol.{cc,h}.
is it really the same for tx/rx? It looks like the header is pushed on before those trace events are called. I don't mind expanding the callback but I am curious whether moving packet->AddHeader (ipHeader); to in front of the dropTrace() call would solve this also?
(In reply to comment #2) > is it really the same for tx/rx? It looks like the header is pushed on before > those trace events are called. You're right. > > I don't mind expanding the callback but I am curious whether moving > packet->AddHeader (ipHeader); > to in front of the dropTrace() call would solve this also? > It could. Thanks for the suggestions. I think you're right: rx/tx don't need to change; drop could be simply modified to add the IPv4 header before dropping. Shall I go ahead and make this change?
I support the change.
-> http://code.nsnam.org/ns-3-dev/rev/084b07dceafb