netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Javier Cardona" <javier@cozybit.com>
To: netdev@vger.kernel.org
Subject: Proposed interface for per-packet mesh-ttl
Date: Tue, 3 Jul 2007 12:29:24 -0700	[thread overview]
Message-ID: <445f43ac0707031229m4ed60e0cg7960437c3e373c8e@mail.gmail.com> (raw)
In-Reply-To: <445f43ac0707031149o2b50fc0en48aef4130b4b60ec@mail.gmail.com>

David Woodhouse suggested that this list is a more appropriate forum
for my message...

---------- Forwarded message ----------
From: Javier Cardona <javier@cozybit.com>
Date: Jul 3, 2007 11:49 AM
Subject: Proposed interface for per-packet mesh-ttl
To: libertas-dev@lists.infradead.org


Libertas-dev,

I'm currently working on per-packet mesh ttl.  My plan is to register
new mesh sockopts through netfilter.  The user interface will be:

#include <sys/types.h>
#include <sys/socket.h>

/* in mesh.h ? */
#define MESH_SO_SET_TTL         77
#define MESH_SO_GET_TTL         77

int main()
{
    int sock;
    int optlen;
    unsigned char ttl;

    ttl = 7;
    optlen = sizeof(ttl);

    sock = socket (PF_INET, SOCK_STREAM, 0);
    setsockopt(sock, SOL_IP, MESH_SO_SET_TTL, &ttl, optlen);
    getsockopt(sock, SOL_IP, MESH_SO_GET_TTL, &ttl, &optlen);

    /* from here on, all traffic from sock will be sent to the mesh
with ttl=7 */

    return 0;
}


Pros:

* it is non-intrusive (only need to reserve the socket option values,
no other changes to the net stack are needed)
* runtime configurable (this options may be supported only when a
mesh_opts module is loaded).
* familiar and intuitive (at least to me :)

Cons:

* netfilter only has hooks for IPv4 and IPv6.  If we want to make mesh
parameters configurable at other layers (e.g. packet) we'll have to
create the hooks.
* It is debatable whether a mesh option should be set at SOL_IP, as it
is a layer 2 protocol.    We do want (some) mesh options to be applied
to flows a that level, and the {g,s}etsockopt interface does not
support setting lower layer options to higher layer sockets.

Speak up if you would like to see this done in a different way.

Cheers,

Javier

       reply	other threads:[~2007-07-03 19:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <445f43ac0707031149o2b50fc0en48aef4130b4b60ec@mail.gmail.com>
2007-07-03 19:29 ` Javier Cardona [this message]
2007-07-25 20:58   ` Proposed interface for per-packet mesh-ttl Dan Williams
2007-07-27 19:56   ` Christoph Hellwig
2007-07-27 22:22     ` Dan Williams
2007-07-28  6:31       ` Stephen Hemminger
2007-07-30 20:37         ` Javier Cardona
2007-07-30 20:53           ` Stephen Hemminger
2007-08-16 19:21             ` Luis Carlos Cobo
2007-08-16 21:19               ` Stephen Hemminger
2007-08-16 22:43                 ` Luis Carlos Cobo

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=445f43ac0707031229m4ed60e0cg7960437c3e373c8e@mail.gmail.com \
    --to=javier@cozybit.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).