From: Steve Chen <schen@mvista.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: mhuth@mvista.com, netdev@vger.kernel.org
Subject: Re: [Fwd: Re: [PATCH] Multicast packet reassembly can fail]
Date: Wed, 28 Oct 2009 13:25:39 -0500 [thread overview]
Message-ID: <1256754339.3153.481.camel@linux-1lbu> (raw)
In-Reply-To: <4AE87ECD.7080408@gmail.com>
On Wed, 2009-10-28 at 18:26 +0100, Eric Dumazet wrote:
> Steve Chen a écrit :
> > On Wed, 2009-10-28 at 16:32 +0100, Eric Dumazet wrote:
> >> If each fragment is received twice on host, once by eth0, once by eth1,
> >> should we deliver datagram once or twice ?
> >
> > The application received it once. IIRC the duplicate packet is drop in
> > the routing code.
> >
> >> Once should be enough, even if in the non fragmented case, it will
> >> be delivered twice (kernel cannot detect duplicates, user app might do itself)
> >
> > Routing code drops the duplicate packet for none-fragmented case as
> > well.
>
> Really ? How so ? Receiving two copies of the same packet is legal.
I will have to double check exactly where the packet drop happens. I
thought it was somewhere in routing, but it could be in netfilter.
>
> >
> >>
> >>> For this specific case, src/dst address, protocol, IP ID and fragment
> >>> offset are all identical. The only difference is the ingress interface.
> >>> A good follow up question would be why would anyone in their right mind
> >>> multicast to the same destination? well, I don't know. I can not get
> >>> the people who reported the problem to tell me either. Since someone
> >>> found the need to do this, perhaps others may find it useful too.
> >>>
> >> Then, if a 2000 bytes message is fragmented in two packets, one coming
> >> from eth0, one coming from eth1, I suspect your patch drops the message,
> >> unless eth0/eth1 are part of a bonding device...
> >
> > Actually, the patch tries to prevent packet drop for this exact
> > scenario. Please consider the following scenarios
> > 1. Packet comes in the fragment reassemble code in the following order
> > (eth0 frag1), (eth0 frag2), (eth1 frag1), (eth1 frag2)
> > Packet from both interfaces get reassembled and gets further processed.
>
> Yes your patch does this, so each multicast application receives two copies of the
> same datagram.
>
> >
> > 2. Packet can some times arrive in (perhaps other orders as well)
> > (eth0 frag1), (eth1 frag1), (eth0 frag2), (eth1 frag2)
> > Without this patch, eth0 frag 1/2 are overwritten by eth1 frag1/2, and
> > packet from eth1 is dropped in the routing code.
>
> Really ? how so ? I dont see how it can happen, unless you use RPF ?
>
> current situation should be :
>
> (eth0 frag1) : We create a context, store frag1 in it
> (eth1 frag1) : We find this context, and drop frag1 since we already have the data
> (maybe the bug is here, if we cannot cope with a duplicate ?)
> (eth0 frag2) : We find this context, store frag2 -> complete datagram and deliver it
> (eth1 frag2) : We find context, drop frag2 since datagram was completed.
Yes, this is exactly what is happening in the current code.
>
> (or maybe we create a new context that will timeout later, maybe this is your problem ?)
>
> Net effect : We deliver the datagram correctly.
>
>
> >
> >> That would break common routing setups, using two links to aggregate bandwidth ?
> >
> > I don't believe it would. The aggregate bandwidth will work the same as
> > before. The attributes (src/dst addr, protocol, interface, etc.) should
> > generate a unique hash key. If hash collision should happen with the
> > addition of iif << 5, the code still compare the original src addr along
> > with interface number, so there should be no issues.
>
> What about the obvious :
>
> (eth0 frag1), (eth1 frag2)
>
> Your patch creates two contexts since hashes are different,
> that will timeout and no packet delivered at all
>
I see the point you are making. I assumed, probably incorrectly, that
since eth0 and eth1 have different IP address. I would get a complete
series of fragments for each interface. Perhaps, I should really be
looking up the stack to see why packets were dropped. Please correct me
if I'm mistaken. The normal behavior is that application should be
receiving either 2 (scenario 1) or 1 (scenario 2) packets.
Regards,
Steve
next prev parent reply other threads:[~2009-10-28 18:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1256740748.3153.418.camel@linux-1lbu>
[not found] ` <4AE86420.3040607@gmail.com>
2009-10-28 17:05 ` [Fwd: Re: [PATCH] Multicast packet reassembly can fail] Steve Chen
2009-10-28 17:26 ` Eric Dumazet
2009-10-28 18:25 ` Steve Chen [this message]
2009-10-28 20:22 ` David Stevens
2009-10-28 21:11 ` Steve Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1256754339.3153.481.camel@linux-1lbu \
--to=schen@mvista.com \
--cc=eric.dumazet@gmail.com \
--cc=mhuth@mvista.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).