linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Bluez-users] L2CAP MTU and packet fragmentation?
@ 2006-06-23 12:36 Stephen Strowes
  2006-06-26 12:17 ` Marcel Holtmann
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen Strowes @ 2006-06-23 12:36 UTC (permalink / raw)
  To: bluez-users

Hi,

Forgive me if this has been answered time and again, but I can't seem to
access the archives just now. Google's not helping me much either.

I have a bit of BlueZ code, which I have to make use of L2CAP sockets to
communicate between devices. I've seen that I can alter the MTU for
packets, but I'm surprised that packets don't get fragmented as per
plain UDP when a packet larger than the MTU is passed to send().

Have I missed a configuration option somewhere?

I could live with the MTU being 64k with no fragmentation, but I seem to
get quite a lot of corrupt packets over around 2kB.


Cheers,
Stephen.



Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Bluez-users] L2CAP MTU and packet fragmentation?
  2006-06-23 12:36 [Bluez-users] L2CAP MTU and packet fragmentation? Stephen Strowes
@ 2006-06-26 12:17 ` Marcel Holtmann
  2006-06-26 15:03   ` Stephen Strowes
  0 siblings, 1 reply; 7+ messages in thread
From: Marcel Holtmann @ 2006-06-26 12:17 UTC (permalink / raw)
  To: BlueZ users

Hi Stephen,

> Forgive me if this has been answered time and again, but I can't seem to
> access the archives just now. Google's not helping me much either.
> 
> I have a bit of BlueZ code, which I have to make use of L2CAP sockets to
> communicate between devices. I've seen that I can alter the MTU for
> packets, but I'm surprised that packets don't get fragmented as per
> plain UDP when a packet larger than the MTU is passed to send().
> 
> Have I missed a configuration option somewhere?

the L2CAP socket is a SOCK_SEQPACKET and you have to honor that MTU. It
is not a stream or a connection-less socket.

> I could live with the MTU being 64k with no fragmentation, but I seem to
> get quite a lot of corrupt packets over around 2kB.

I have no idea what you are talking about. The L2CAP layer is reliable
and the underlaying ACL link, too.

Regards

Marcel



Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Bluez-users] L2CAP MTU and packet fragmentation?
  2006-06-26 12:17 ` Marcel Holtmann
@ 2006-06-26 15:03   ` Stephen Strowes
  2006-06-26 15:47     ` Marcel Holtmann
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen Strowes @ 2006-06-26 15:03 UTC (permalink / raw)
  To: BlueZ users

Hi,

On Mon, 2006-06-26 at 14:17 +0200, Marcel Holtmann wrote:
> > I could live with the MTU being 64k with no fragmentation, but I seem to
> > get quite a lot of corrupt packets over around 2kB.
> 
> I have no idea what you are talking about. The L2CAP layer is reliable
> and the underlaying ACL link, too.

Sorry, correction, I get a lot of lost packets. I assume either because
they've become corrupted, or perhaps because they never arrive.

I get between 20-40% packet loss with packet sizes around 3000 bytes,
and more loss as packet sizes increase. l2ping says 56% loss at 3500
bytes.

This loss is what prompted my question. This behaviour, actually, is why
I'm using L2CAP -- because it was likened to UDP in what I'd read
previously. Ironically, perhaps, it's just a little *too* lossy  :-)

I'll either bolt on some packet segmentation to my app, or use RFCOMM
for now.


Cheers,
S.



Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Bluez-users] L2CAP MTU and packet fragmentation?
  2006-06-26 15:03   ` Stephen Strowes
@ 2006-06-26 15:47     ` Marcel Holtmann
  2006-06-26 16:48       ` Stephen D. Strowes
  0 siblings, 1 reply; 7+ messages in thread
From: Marcel Holtmann @ 2006-06-26 15:47 UTC (permalink / raw)
  To: BlueZ users

Hi Stephen,

> > > I could live with the MTU being 64k with no fragmentation, but I seem to
> > > get quite a lot of corrupt packets over around 2kB.
> > 
> > I have no idea what you are talking about. The L2CAP layer is reliable
> > and the underlaying ACL link, too.
> 
> Sorry, correction, I get a lot of lost packets. I assume either because
> they've become corrupted, or perhaps because they never arrive.
> 
> I get between 20-40% packet loss with packet sizes around 3000 bytes,
> and more loss as packet sizes increase. l2ping says 56% loss at 3500
> bytes.
> 
> This loss is what prompted my question. This behaviour, actually, is why
> I'm using L2CAP -- because it was likened to UDP in what I'd read
> previously. Ironically, perhaps, it's just a little *too* lossy  :-)

with l2ping you use the L2CAP signal channel and it happens that some
remote implementation don't handle this very well. Hence you might see a
loss percentage. This actually means unanswered echo requests.

If you actually use L2CAP data channel with SOCK_SEQPACKET then you
won't see a loss at all. It is a reliable channel.

> I'll either bolt on some packet segmentation to my app, or use RFCOMM
> for now.

Or help Martin Roehricht to extend L2CAP with retransmission and flow
control. Once this has been implemented it will be possible to have a
SOCK_STREAM on L2CAP like you have with RFCOMM.

Regards

Marcel



Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Bluez-users] L2CAP MTU and packet fragmentation?
  2006-06-26 15:47     ` Marcel Holtmann
@ 2006-06-26 16:48       ` Stephen D. Strowes
  2006-06-26 17:21         ` Marcel Holtmann
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen D. Strowes @ 2006-06-26 16:48 UTC (permalink / raw)
  To: BlueZ users

[-- Attachment #1: Type: text/plain, Size: 694 bytes --]

Hi,

> If you actually use L2CAP data channel with SOCK_SEQPACKET then you
> won't see a loss at all. It is a reliable channel.

Yeah, this is what I'm doing, but I'm seeing loss.

I'm following the code from http://people.csail.mit.edu/albert/bluez-intro/x556.html, but not fiddling with anything related to unreliability in section 4.3.2.

Trying the same between two different machines gets me the reliable data transfer.

Am I dealing with bad hardware here? Hardware with bad drivers (I'm dealing with Bluetooth built into a HP iPaq running Familiar Linux, kernel version 2.6.12)? Or an out of date bluez-utils (bluez-utils-nodbus package is version 2.14-r4)?


Cheers,
S.

[-- Attachment #2: winmail.dat --]
[-- Type: application/ms-tnef, Size: 3006 bytes --]

[-- Attachment #3: Type: text/plain, Size: 299 bytes --]

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

[-- Attachment #4: Type: text/plain, Size: 164 bytes --]

_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Bluez-users] L2CAP MTU and packet fragmentation?
  2006-06-26 16:48       ` Stephen D. Strowes
@ 2006-06-26 17:21         ` Marcel Holtmann
  2006-06-26 17:39           ` Stephen D. Strowes
  0 siblings, 1 reply; 7+ messages in thread
From: Marcel Holtmann @ 2006-06-26 17:21 UTC (permalink / raw)
  To: BlueZ users

Hi Stephen,

> > If you actually use L2CAP data channel with SOCK_SEQPACKET then you
> > won't see a loss at all. It is a reliable channel.
> 
> Yeah, this is what I'm doing, but I'm seeing loss.
> 
> I'm following the code from http://people.csail.mit.edu/albert/bluez-intro/x556.html, but not fiddling with anything related to unreliability in section 4.3.2.
> 
> Trying the same between two different machines gets me the reliable data transfer.
> 
> Am I dealing with bad hardware here? Hardware with bad drivers (I'm dealing with Bluetooth built into a HP iPaq running Familiar Linux, kernel version 2.6.12)? Or an out of date bluez-utils (bluez-utils-nodbus package is version 2.14-r4)?

you can't see loss on the L2CAP data channel. This is impossible.

Regards

Marcel



Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Bluez-users] L2CAP MTU and packet fragmentation?
  2006-06-26 17:21         ` Marcel Holtmann
@ 2006-06-26 17:39           ` Stephen D. Strowes
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen D. Strowes @ 2006-06-26 17:39 UTC (permalink / raw)
  To: BlueZ users

[-- Attachment #1: Type: text/plain, Size: 442 bytes --]

Hi,
> > Am I dealing with bad hardware here? Hardware with bad drivers (I'm dealing with Bluetooth 
> built into a HP iPaq running Familiar Linux, kernel version 2.6.12)? Or an out of date 
> bluez-utils (bluez-utils-nodbus package is version 2.14-r4)?
> 
> you can't see loss on the L2CAP data channel. This is impossible.

I'll put the packet loss down to bad hardware support then, since it's not a bluez problem.


Cheers,
S.

[-- Attachment #2: winmail.dat --]
[-- Type: application/ms-tnef, Size: 2894 bytes --]

[-- Attachment #3: Type: text/plain, Size: 299 bytes --]

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

[-- Attachment #4: Type: text/plain, Size: 164 bytes --]

_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-06-26 17:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-23 12:36 [Bluez-users] L2CAP MTU and packet fragmentation? Stephen Strowes
2006-06-26 12:17 ` Marcel Holtmann
2006-06-26 15:03   ` Stephen Strowes
2006-06-26 15:47     ` Marcel Holtmann
2006-06-26 16:48       ` Stephen D. Strowes
2006-06-26 17:21         ` Marcel Holtmann
2006-06-26 17:39           ` Stephen D. Strowes

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).