From: Sven Eckelmann <sven@narfation.org>
To: "b.a.t.m.a.n@lists.open-mesh.org" <b.a.t.m.a.n@lists.open-mesh.org>
Cc: "Martin Hundebøll" <martin@hundeboll.net>
Subject: Re: [B.A.T.M.A.N.] Fragmentation and padding in batman-adv
Date: Mon, 01 Dec 2014 14:31:05 +0100 [thread overview]
Message-ID: <10739765.2rCRvcyX7s@sven-edge> (raw)
In-Reply-To: <4472936.imSdHEx948@sven-edge>
[-- Attachment #1: Type: text/plain, Size: 2539 bytes --]
On Monday 01 December 2014 08:49:34 Sven Eckelmann wrote:
> Hi,
>
> I've just noticed that the padding by the underlying network protocol seems
> not to be handled by the fragmentation. Maybe Martin can correct me. I will
> now use following assumptions:
>
> * the fragmentation code is sending first the last part of the packet and
> tries to fill the complete skb (max 1400 byte)
> * the mtu of the underlying device is 1400
> * the minimum packet size (user data + eth header) of the underlying device
> is 70
> * the packet send by the user would end up to be 1401 bytes before
> fragmentation
>
> Ok, then I would guess that the fragmentation code would try to generate
> fragments with the max_fragment_size 1366 (+headers of course, not sure why
> the code assumes that the ethernet header is part of the MTU). This would
> mean that the 1401 byte packet is split into a 1366 byte fragment (+header)
> and a 35 byte fragment (+header).
>
> But the 35 byte fragment containing the first part of the packet is (even
> with the headers) still smaller than the required packet size of the
> underlying device. Now some extra bytes are added as padding to the last
> fragment (containing the first part of the original packet).
The calculation of the fragment sizes was unified in patch
https://lists.open-mesh.org/pipermail/b.a.t.m.a.n/2014-December/012620.html
My knowledge about the fragmentation code is now a little bit better and I
have to correct the numbers above. The max_fragment_size is now 1380 (after
the patch). The split of the 1401 bytes packet would be 1380 bytes and 21
bytes. The size with all headers would be: 1414 bytes and 55 bytes. 55 is even
smaller than 60 (minimal 802.3 frame size). Therefore, splitting packets into
fragments for 802.3 devices with MTU <= 1400 bytes is problematic when the
batman-adv packet to split is larger than the MTU but less than 6 bytes larger
than the MTU. For devices with 1400 < MTU <= 1405 it is problematic for
batman-adv packets larger than the MTU but smaller than 1406 bytes.
There are even more problematic situations possible when the batman-adv packet
has to be split into more than two packets.
Just for reference: An unicast ethernet frame (with ethernet header) of 1514
bytes would end up as batman-adv unicast packet of 1538 bytes. The underlying
device must have at least the MTU of 1524 bytes (The 14 byte ethernet header
is not part of the MTU) to allow batman-adv to transport the packet without
fragmentation.
Kind regards,
Sven
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
prev parent reply other threads:[~2014-12-01 13:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-01 7:49 [B.A.T.M.A.N.] Fragmentation and padding in batman-adv Sven Eckelmann
2014-12-01 12:25 ` Martin Hundebøll
2014-12-01 13:31 ` Sven Eckelmann [this message]
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=10739765.2rCRvcyX7s@sven-edge \
--to=sven@narfation.org \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
--cc=martin@hundeboll.net \
/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