On Wednesday 21 November 2012 16:08:37 liu muye wrote:
Thank you so much for your suggestions. Yes, we are using batman-adv. The one running as a kernel module. Just a few quick follow up questions.
Our goal is to build an ad hoc mesh network. Each node may not have IP address. I can use batctl ping functionality to ping my peer with MAC address. Just wondering if I can send data packet to my peers with MAC address.
Of course. This is the raw socket stuff I've mentioned before. Just bind a raw socket to your bat0 device and sent ethernet frames between your nodes (mac address as source/destionation). An easy example is rawsend [1].
But it is propably easier to use an actual transport protocol for communication.
I have noticed the packet.h file in the batctl source code contains several C structures. One of them is
struct batadv_unicast_packet { struct batadv_header header; uint8_t ttvn; /* destination translation table version number */ uint8_t dest[ETH_ALEN]; } __packed;
To send my data packet, I have to use this C structure. Is that correct? and where to look up the value for ttvn?
No, this is internal stuff used for the tunneling. Don't try to create packets from userspace with this format as you would have to implement a complete batman-adv replacement. And you still would have to create a valid ethernet packet followed by the unicast header anyway. So better use raw sockets when you just want to sent ethernet frames between bat0 devices of different nodes.
Kind regards, Sven
[1] https://lists.open-mesh.org/pipermail/b.a.t.m.a.n/attachments/20111206/52f06... https://lists.open-mesh.org/pipermail/b.a.t.m.a.n/2011-December/005865.html
b.a.t.m.a.n@lists.open-mesh.org