Hi Vladim.
Thanks a lot for your reply.
Looking at the example packet you sent, I made a change into my config file.
I changed the MAC destination address to 0xFF 0xFF (broadcast).
Then, I receive the packet successfully thru the loopback interface.
Same thing if I use 0x00...0x00 instead of 0xFF0xFF.
Thanks a lot for all your help and regards.
-Bob
El miércoles, 2 de noviembre de 2016, 6:36:29 (UTC+1), Vadim Kochan
escribió:
>
> On Thu, Oct 27, 2016 at 11:49 AM, > wrote:
> > El miércoles, 19 de octubre de 2016, 17:23:40 (UTC+2),
> emacsu...@gmail.com escribió:
> >> El miércoles, 19 de octubre de 2016, 12:46:45 (UTC+2), Vadim Kochan
> escribió:On Wed, Oct 19, 2016 at 1:38 PM, wrote:
> >>
> >> > Hello.
> >>
> >> >
> >>
> >> > I'm having a problem when trying to send packets with trafgen to the
> loopback interface.
> >>
> >> >
> >>
> >> > Packets sent this way do not reach their destination.
> >>
> >> >
> >>
> >> > However, if packets are sent from an external machine, then I have no
> problem at all to receive these packets at the destination application.
> >>
> >> >
> >>
> >> > I use "-o lo" option on the command line when executing trafgen.
> >>
> >> >
> >>
> >> > I suspect the problem is that I'm building an incorrect packet, and
> the kernel is discarding it.
> >>
> >> >
> >>
> >> > The ethernet header on my cfg file looks like the following:
> >>
> >> >
> >>
> >> > --
> >>
> >> > #include
> >>
> >> >
> >>
> >> > {
> >>
> >> > fill(0x00, ETH_ALEN),
> >>
> >> > fill(0x00, ETH_ALEN),
> >>
> >> > c16(ETH_P_LOOP),
> >>
> >> > c32(0x00),
> >>
> >> >
> >>
> >> > ..
> >>
> >> >
> >>
> >> > (Both source and destination IP addresses are set to 127.0.0.1)
> >>
> >> > --
> >>
> >> >
> >>
> >> > I have tried other combinations, like removing the ethernet header
> completely, for instance.
> >>
> >> >
> >>
> >> > None of them worked.
> >>
> >> >
> >>
> >> > How does the ethernet header have to to look like, when you want
> trafgen to generate a valid packet to be sent thru the loopback interface?
> >>
> >> >
> >>
> >> > Thanks a lot.
> >>
> >> > -Bob
> >>
> >> >
> >>
> >> > --
> >>
> >> > You received this message because you are subscribed to the Google
> Groups "netsniff-ng" group.
> >>
> >> > To unsubscribe from this group and stop receiving emails from it,
> send an email to netsniff-ng...@googlegroups.com.
> >>
> >> > For more options, visit https://groups.google.com/d/optout.
> >>
> >>
> >>
> >> Hi Bob,
> >>
> >>
> >>
> >> Does it work if to increase packet length to 64 bytes length ?
> >>
> >>
> >>
> >> Sorry, I have no time to check it right now, will do it later if the
> >>
> >> above's approach did not help.
> >>
> >>
> >>
> >> Regards,
> >>
> >> Vadim Kochan
> >>
> >>
> >>
> >>
> >>
> >>
> >> Hi Vadim.
> >>
> >>
> >> Thanks for the prompt response.
> >>
> >>
> >> So far, I have been using the ETH_P_LOOP value (96), to indicate that
> the packet corresponds to a loopback packet.
> >> Given that that field is used for both type and length, if I'm
> understanding you correctly, you want me to change it to a value indicating
> the length of my entire packet, and not the value of ETH_P_LOOP.
> >> I suppose you said 64 as an example, and the value there should in fact
> correspond to my actual packet length.
> >>
> >>
> >> I have followed this approach, but the packet does not reach my
> application, still.
> >>
> >>
> >> In fact, on second thoughts, I cannot see the point on using ETH_P_LOOP
> value at all in the ethernet header, since its value is 96, which means
> that we have to interpret that value as a length, but the packet length can
> be anything.
> >>
> >>
> >> Not sure if I'm missing something here
> >>
> >>
> >> Any idea?
> >>
> >>
> >> Thanks.
> >> -Bob
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >
> >
> > Hello.
> >
> > Any idea on why I'm not able to make traffic get to its destination thru
> the loopback interface?
> >
> > Not sure if the problem is the ethernet header I'm using. I guess so,
> but I have tried all combinations with no success.
> >
> > Thanks.
> > -Bob
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "netsniff-ng" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to netsniff-ng...@googlegroups.com .
> > For more options, visit https://groups.google.com/d/optout.
>
> Sorry for such a delay, I am very busy with my regular job ...
>
> But do you have an issue with sniffing such loopback packet ?
> For example I tried the following trafgen packet and I did receive it
> via w-shark:
>
> $ sudo trafgen/trafgen --dev lo '{ fill(0xff, 6), 0x00, 0x02, 0xb3,
> rnd(3), c16(0x0060), fill(0xca, 64) }' -n 1
> $ uname -a
>