pan link quality
Hi all!
I am currently playing around in setting up IP ad-hoc networks using bluez. olsr-over-bluetooth works, and pand -Q is a nice thing :)
The bad stuff is that inquiry & connecting can take some time, but its hard to really do something against that. (I have a few hacks in mind, but they wont scale)
What would be really nice is some link quality metric. On my mobile device hcitool lq always returns 255 (Even if the link goes bad and the other side sees it). But I have one metric in mind: the interface gets destroyed if a certain number of packets are not acknowledged by the receiver. Is there some way (other than writing a script that listens to hcidump) to measure this? ifconfig bnep0 shows errors:0 and dropped:0 until it is detroyed. I am not a kernel hacker, i looked around a bit in the bluez module, the library and pand, but couldnt really find anything...
Do you have any hints? Is there any "unacknoledged packets" metric accessible from userland? Where is the code that destroys the bnep interface after x packets?
Thanks in advance,
Kosta
PS: Are you interesed in a "zeroconf ip" patch for pand?
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Marcel Holtmann
maintainerHi Kosta,
Quoted 17 lines
I am currently playing around in setting up IP ad-hoc networks using bluez. olsr-over-bluetooth works, and
pand -Qis a nice thing :)The bad stuff is that inquiry & connecting can take some time, but its hard to really do something against that. (I have a few hacks in mind, but they wont scale)
What would be really nice is some link quality metric. On my mobile device
hcitool lqalways returns 255 (Even if the link goes bad and the other side sees it). But I have one metric in mind: the interface gets destroyed if a certain number of packets are not acknowledged by the receiver. Is there some way (other than writing a script that listens to hcidump) to measure this?ifconfig bnep0shows errors:0 and dropped:0 until it is detroyed. I am not a kernel hacker, i looked around a bit in the bluez module, the library and pand, but couldnt really find anything...
Quoted 3 lines
Do you have any hints? Is there any "unacknoledged packets" metric accessible from userland? Where is the code that destroys the bnep interface after x packets?
the link quality is vendor specific and we really only know how CSR implemented it. The RSSI might be another indicator, but I assume some chip manufacturers did a bad implementation. What chips are you using?
Quoted 1 line
PS: Are you interesed in a "zeroconf ip" patch for pand?
Go ahead and post the patch to the mailing list. We will review it.
Regards
Marcel
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
[Bluez-devel] patch: custom devup script
I changed the subject from "pan link quality" because it didnt really apply anymore.
Quoted 2 lines · Marcel Holtmann
Quoted 1 line
PS: Are you interesed in a "zeroconf ip" patch for pand?
Go ahead and post the patch to the mailing list. We will review it.
As my zeroconf implementation is incomplete (only generates an IP address, but does not check for conflicts), I instead added an option to run a custom devup script instead of /etc/bluetooth/pan/dev-up.
Why? Because the mobile phone running embedded linux has a read-only /etc. This way, I can move my devup-script anywhere I want, without needing to recompile if its location changes.
(In the unlikely case that anyone is interested in my zeroconf, here's the uri: http://lastpageofthe.net/zeroconf.test.c )
Here's the unified diff:
pand.h2006-01-18 00:49:23.000000000 +0000 renamed from bluez-utils-2.24-original/pand/pand.h2005-10-29 23:04:28.000000000 +0000 +1 -2
@@ -23,8 +23,7 @@ */ /* PAN scripts & commands */ -#define PAND_CONFIG_DIR "/etc/bluetooth/pan" -#define PAND_DEVUP_CMD "dev-up" +#define PAND_DEVUP_CMD "/etc/bluetooth/pan/dev-up" /* BNEP functions */ int bnep_init(void);
main.c2006-01-17 19:49:17.000000000 +0000 renamed from bluez-utils-2.20-original/pand/main.c2005-08-27 13:37:16.000000000 +0000 +13 -5
@@ -67,6 +67,7 @@ static int master; static int cleanup; static int search_duration = 10; +static char* devup_path = 0; static struct { int valid;
@@ -93,10 +94,13 @@ static void run_devup(char *dev, char *dst, int sk, int nsk) { -char *argv[4], prog[40]; +char *argv[4], *prog; struct sigaction sa; -sprintf(prog, "%s/%s", PAND_CONFIG_DIR, PAND_DEVUP_CMD); +if (devup_path) +prog = devup_path; +else +prog = PAND_DEVUP_CMD; if (access(prog, R_OK | X_OK)) return;
@@ -510,10 +514,11 @@ { "cache", 0, 0, 'C' }, { "pidfile", 1, 0, 'P' }, { "autozap", 0, 0, 'z' }, +{ "devup", 1, 0, 'u' }, { 0, 0, 0, 0 } }; -static char main_sopts[] = "hsc:k:Kr:d:e:i:lnp::DQ::AESMC::P:z"; +static char main_sopts[] = "hsc:k:Kr:d:e:i:lnp::DQ::AESMC::P:z:u"; static char main_help[] = "Bluetooth PAN daemon version " VERSION " \n"
@@ -539,7 +544,8 @@ "\t--nodetach -n Do not become a daemon\n" "\t--persist -p[interval] Persist mode\n" "\t--cache -C[valid] Cache addresses\n" -"\t--pidfile -P <pidfile> Create PID file\n"; +"\t--pidfile -P <pidfile> Create PID file\n" +"\t--devup <script> run script instead of usual dev-up\n"; int main(int argc, char **argv) {
@@ -642,7 +648,9 @@ case 'z': cleanup = 1; break; - +case 'u': +devup_path = optarg; +break; case 'h': default: printf(main_help);
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Marcel Holtmann
maintainerRe: [Bluez-devel] patch: custom devup script
Hi Kosta,
Quoted 7 lines
As my zeroconf implementation is incomplete (only generates an IP address, but does not check for conflicts), I instead added an option to run a custom devup script instead of
/etc/bluetooth/pan/dev-up.Why? Because the mobile phone running embedded linux has a read-only /etc. This way, I can move my devup-script anywhere I want, without needing to recompile if its location changes.
your email client eats all the whitespaces and tabs. Please resend it and attach it this time or use another (working) email client.
Regards
Marcel
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Re: [Bluez-devel] patch: custom devup script
Hi guys,
Some comments about zeroconf. I didn't read you whole discussion, sorry I am writing someting irrelevant.
If you want add support to a seamless local IP link address assigment to pand daemon. IMHO, it's better use a stable daemon like:
- HOWL (autoipd)
- UDHCP + zeroconf patch
I did some test with udhcp integrated to pand, it is working fine. I preffer UDHCP approach because it assign a local link address, but if a DHCP is available the IP local link address(zeroconf) will be overwritten and address conflict is supported.
Regards,
Claudio.
Quoted 4 lines · Marcel Holtmann
Hi Kosta,
Quoted 2 lines
As my zeroconf implementation is incomplete (only generates an IP address, but does not check for conflicts), I instead added an option t=
o
Quoted 11 lines
Quoted 5 lines
run a custom devup script instead of
/etc/bluetooth/pan/dev-up.Why? Because the mobile phone running embedded linux has a read-only /etc. This way, I can move my devup-script anywhere I want, without needing to recompile if its location changes.
your email client eats all the whitespaces and tabs. Please resend it and attach it this time or use another (working) email client.
Regards
Quoted 7 lines
Marcel
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi=
les
Quoted 3 lines
for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D103432&bid=3D230486&dat=
=3D121642
Quoted 5 lines
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
--
---------------------------------------------------------
Claudio Takahasi
Instituto Nokia de Tecnologia - INdT
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Re: [Bluez-devel] patch: custom devup script
Quoted 4 lines · Claudio Takahasi
If you want add support to a seamless local IP link address assigment to pand daemon. IMHO, it's better use a stable daemon like:
- HOWL (autoipd)
- UDHCP + zeroconf patch
I tried to do that, but they didn't work out-of-the-box on my mobile device. Also, due to my network layout, collision detection would not really have worked, so that I had to code a plugin for olsr. None of this matters anymore, because network layout has changed and I can use dhcp. But thanks for the input!
I still need to call a custom devup script, thou (dhcp, this time), so I hope this patch doesnt get corrupted this time.
pand/pand.h +1 -2
@@ -28,8 +28,7 @@*/ /* PAN scripts & commands */ -#define PAND_CONFIG_DIR "/etc/bluetooth/pan" -#define PAND_DEVUP_CMD "dev-up" +#define PAND_DEVUP_CMD "/etc/bluetooth/pan/dev-up"/* BNEP functions */ int bnep_init (void );
pand/main.c +13 -5
@@ -67,6 +67,7 @@static int master;static int cleanup;static int search_duration =10 ; +static char * devup_path =0 ; static struct { int valid;
@@ -93,10 +94,13 @@static void run_devup (char *dev,char *dst,int sk,int nsk) { -char *argv[4 ], prog[40 ]; +char *argv[4 ], *prog;struct sigaction sa; -sprintf (prog,"%s/%s" ,PAND_CONFIG_DIR ,PAND_DEVUP_CMD ); +if (devup_path) + prog = devup_path; +else + prog =PAND_DEVUP_CMD ;if (access (prog,R_OK |X_OK ))return ;
@@ -510,10 +514,11 @@ { "cache", 0, 0, 'C' }, { "pidfile", 1, 0, 'P' }, { "autozap", 0, 0, 'z' }, + { "devup", 1, 0, 'u' }, { 0, 0, 0, 0 } }; -static char main_sopts[] ="hsc:k:Kr:d:e:i:lnp::DQ::AESMC::P:z" ; +static char main_sopts[] ="hsc:k:Kr:d:e:i:lnp::DQ::AESMC::P:z:u" ;static char main_help[] ="Bluetooth PAN daemon version " VERSION " \n"
@@ -539,7 +544,8 @@"\t--nodetach -n Do not become a daemon\n" "\t--persist -p[interval] Persist mode\n" "\t--cache -C[valid] Cache addresses\n" -"\t--pidfile -P <pidfile> Create PID file\n" ; +"\t--pidfile -P <pidfile> Create PID file\n" +"\t--devup <script> run script instead of usual dev-up\n" ;int main (int argc,char **argv) {
@@ -642,7 +648,9 @@case 'z' : cleanup =1 ;break ; - +case 'u' : + devup_path = optarg; +break ;case 'h' :default :printf (main_help);
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Marcel Holtmann
maintainerRe: [Bluez-devel] patch: custom devup script
Hi Kosta,
Quoted 2 lines
I still need to call a custom devup script, thou (dhcp, this time), so I hope this patch doesnt get corrupted this time.
I like the idea. However I prefer to remove any default devup script at all and only call it when specified on the command line. Can you provide me with a patch for that?
pand/main.c line 521
Quoted 2 lines
pand/main.c +1
-1-static char main_sopts[] ="hsc:k:Kr:d:e:i:lnp::DQ::AESMC::P:z" ; +static char main_sopts[] ="hsc:k:Kr:d:e:i:lnp::DQ::AESMC::P:z:u" ;
And this must be ...zu: and not ...z:u
Regards
Marcel
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Re: [Bluez-devel] patch: custom devup script
Quoted 3 lines · Marcel Holtmann
I like the idea. However I prefer to remove any default devup script at all and only call it when specified on the command line. Can you provide me with a patch for that?
Sure :)
Quoted 1 line
And this must be ...zu: and not ...z:u
Yes, you are right. Funny thing is, if you omit the final : it will work with --devup but not with -u
pand.h renamed from ../bluez-utils-2.24-original/pand/pand.h +0 -4
@@ -22,10 +22,6 @@* */ -/* PAN scripts & commands */ -#define PAND_CONFIG_DIR "/etc/bluetooth/pan" -#define PAND_DEVUP_CMD "dev-up" -/* BNEP functions */ int bnep_init (void );int bnep_cleanup (void );
main.c renamed from ../bluez-utils-2.24-original/pand/main.c +18 -12
@@ -61,6 +61,7 @@static int master;static int cleanup;static int search_duration =10 ; +static char * devup_path =0 ; static struct { int valid;
@@ -87,13 +88,13 @@static void run_devup (char *dev,char *dst,int sk,int nsk) { -char *argv[4 ], prog[40 ]; +char *argv[4 ];struct sigaction sa; -sprintf (prog,"%s/%s" ,PAND_CONFIG_DIR ,PAND_DEVUP_CMD ); - -if (access (prog,R_OK |X_OK )) +if (devup_path &&access (devup_path,R_OK |X_OK )) { +syslog (LOG_ERR ,"could not rx open %s" , devup_path);return ; + }if (fork ())return ;
@@ -103,17 +104,20 @@if (nsk >=0 )close (nsk); - + +if (!devup_path) +exit (0 ); +memset (&sa,0 ,sizeof (sa)); sa.sa_handler =SIG_DFL ;sigaction (SIGCHLD , &sa,NULL );sigaction (SIGPIPE , &sa,NULL ); - argv[0 ] = prog; + argv[0 ] = devup_path; argv[1 ] = dev; argv[2 ] = dst; argv[3 ] =NULL ; -execv (prog, argv); +execv (devup_path, argv);exit (1 ); }
@@ -478,8 +482,6 @@fclose (f);return 0 ; } - -static struct option main_lopts[] = { {"help" ,0 ,0 ,'h' },
@@ -504,10 +506,11 @@ { "cache", 0, 0, 'C' }, { "pidfile", 1, 0, 'P' }, { "autozap", 0, 0, 'z' }, + { "devup", 1, 0, 'u' }, { 0, 0, 0, 0 } }; -static char main_sopts[] ="hsc:k:Kr:d:e:i:lnp::DQ::AESMC::P:z" ; +static char main_sopts[] ="hsc:k:Kr:d:e:i:lnp::DQ::AESMC::P:zu:" ;static char main_help[] ="Bluetooth PAN daemon version " VERSION " \n"
@@ -533,7 +536,8 @@"\t--nodetach -n Do not become a daemon\n" "\t--persist -p[interval] Persist mode\n" "\t--cache -C[valid] Cache addresses\n" -"\t--pidfile -P <pidfile> Create PID file\n" ; +"\t--pidfile -P <pidfile> Create PID file\n" +"\t--devup -u <script> run script when the interface comes up\n" ;int main (int argc,char **argv) {
@@ -636,7 +640,9 @@case 'z' : cleanup =1 ;break ; - +case 'u' : + devup_path = optarg; +break ;case 'h' :default :printf (main_help);
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Marcel Holtmann
maintainerRe: [Bluez-devel] patch: custom devup script
Hi Kosta,
Quoted 5 lines
Quoted 3 lines
I like the idea. However I prefer to remove any default devup script at all and only call it when specified on the command line. Can you provide me with a patch for that?
Sure :)
your patch never applied to the latest CVS and so I had to fix up everything by hand. Next time make sure the patch is against the CVS and not some old version you use.
The stuff is now in and you might wanna test it.
Regards
Marcel
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel