[Ns-developers] DelayBox - ns-3
Joseph Kopena
tjkopena at cs.drexel.edu
Tue Apr 15 20:02:52 PDT 2008
On Tue, Apr 15, 2008 at 10:47 PM, Sam Jansen <sam.jansen at gmail.com> wrote:
> On 13/04/2008, Mathieu Lacage <mathieu.lacage at sophia.inria.fr> wrote:
> 2. Why do I need to copy and modify a packet to look at the IP header?
> Why can't I do something like "const Ipv4Header* ip_hdr =
> p->PeekHeader<Ipv4Header>();". I haven't followed all of the
> implementation of the packet, so I'm not sure if this is possible, but
> you get the idea.
I believe you can do exactly that via p->PeekData() if you wish.
> Inspecting a packet header in a packet is sure to be a very common
> operation for certain models. The discussion here suggests to me that
> doing so is neither obvious nor streamlined.
>
> Can we make simple operations in the real world simple in ns-3 please?
More importantly, I just wanted to note that the set of people
examining packet headers directly is much smaller than the set of
people working with sockets and network programming. Most people are
getting the metadata they need (the packet source) simply from
recvfrom(), and they'd do exactly the same sort of thing in the
current API (using the "from" parameter of the receive callback).
Thx
--
- joe kopena
right here and now
More information about the Ns-developers
mailing list