[net2-wg] collection stuff
Philip Levis
pal at cs.stanford.edu
Thu Apr 20 16:50:08 PDT 2006
OK, I'm hacking on the forwarding engine. First issue I've run into:
headers and header sizing.
>From the component decomposition, it sounds like we really want to have
three separate headers. There's the network header, the routing header,
and the link estimation header. Some of them might want to share
information and so be coupled slightly.
The link estimation header contains the information necessary for... um,
link estimation. Depending on the link estimator, this could include
source address, sequence number, etc.
The routing header contains information necessary for, well, routing.
This includes the next hop and the previous hop (L2 source address),
ttl, etc.
The network layer contains information such as L3 source address,
dispatch ID, etc.
The routing and link estimation components can probable share the L2
source address, which might even be provided by the data link layer.
Depending on whether the data link layer supports snooping, there may or
may not be a need for a separate L2 destination address.
So I imagine something like this:
nx_struct link_est_header_t {
nx_uint8_t seqno;
nx_am_addr_t source;
nx_am_addr_t dest;
};
nx_struct routing_header_t {
// ???
};
nx_struct network_header_t {
nx_uint8_t id;
nx_am_addr_t source;
};
I imagine this decomposition because the link estimator can change based
on the link, and so that's the best place to change the headers that
could change depending on what the link provides. E.g., with SACK on the
CC2420, the link estimator doesn't need dest, and actually with the
current CC2420 stack you don't need source (it's already in the
header).
But let's start by implementing a link estimator that could work on any
radio, then worry about better ones for particular radios.
This header structure will require a particular layering of components,
at least for the calls to the Packet interface. It seems pretty
straightforward that the stack should be
Network -> Routing -> Link Estimator
The way I see this, the Network layer keeps a queue of packets. When it
is ready to send a packet, it calls into the routing layer to get next
hop info, then calls the LinkEstimationSenderC to actually send the
packet. So the call flow looks like this (I hope you are monospaced):
Forwarder Router LESender
|
A +----------->
|
B +------------------------>
Because the ForwardingEngine (FE) doesn't fill in the routing header
until the packet is about to be sent, changing parents are not a big
deal. I think that having the FE call a Send on the Routing Engine is
unnecessary, and will just make the Routing Engine more complicated with
little gain.
Thoughts? Apologies if this isn't totally coherent.
Phil
More information about the net2-wg
mailing list