[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ns] Broadcasting to all neighbors



I hate to ask a naive question, but how do you broadcast to
all a node's neighbors?  I am writing a layer 3 agent, and
trying to send a packet to an explicit port on all the
neighboring nodes.  Here is my current code snippet:

  ...// this is all in the command function for my agent

  Packet* pkt = allocpkt();
  hdr_cmn* cmnhdr = (hdr_cmn*)pkt->access(off_cmn_);
  hdr_ip* iphdr = (hdr_ip*)pkt->access(off_ip_);

  ...// setting up all my new header information

  cmnhdr->next_nop_ = -1;  // according to the docs, this is
broadcast
  iphdr->daddr() = IP_BROADCAST;
  iphdr->dport() = 254;  // this is the port number all my
agents run on

  ...// just some things I do to track queue lengths, etc.

  send(pkt, 0);


This doesn't work.  I get the following error from the
classifier object's classify() method:

_o11: no target for slot -1

This is the address classifier saying that it doesn't have
anything on that slot in the hash table.

I could take the brute force and ignorance approach and get
the list of neighbors and send duplicate packets addressed
to each of them, but this is ugly and defeats the purpose of
having layers like IP provide services like broadcast.

Thanks for any help I can get.

Jeff Boleng
[email protected]