我正在尝试在Contiki OS上使用Cooja Simulator来实现我的论文。我使用uip协议栈在exp5438节点之间发送数据。我尝试了Aodv路由协议,该协议在https://github.com/contiki-os/contiki/tree/master/core/net/ipv4中实现 在与Aodv相关的代码中,我无法从sendto函数发送rrep消息,该函数的实现方式如下{在uaodv.c文件中的上方链接的第128行}:
static void sendto(const uip_ipaddr_t *dest, const void *buf, int len)
{
/* XXX: this is a HACK! We're updating the uIP UDP connection
"unicastconn" so that the destination address is the next-hop,
and we're patching the "uip_udp_conn" variable so that it points
the this connection instead. THIS IS NOT A NICE WAY TO DO THIS,
but it is currently nicer than the alternative (requesting a new
poll, and remembering the state, etc.). */
uip_ipaddr_copy(&unicastconn->ripaddr, dest);
uip_udp_conn = unicastconn;
uip_udp_packet_send(unicastconn, buf, len);
}
虽然我可以广播rrep数据包,但我需要单播连接才能使Aodv工作。 单播连接定义如下:
unicastconn = udp_broadcast_new(UIP_HTONS(UAODV_UDPPORT), NULL);
如果您能帮助我解决此问题,我将不胜感激。