public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] mac address from packet
@ 2012-10-04 16:21 Dominic Follett-Smith
  2012-10-04 16:30 ` Sven Eckelmann
  2012-10-04 16:38 ` Gui Iribarren
  0 siblings, 2 replies; 7+ messages in thread
From: Dominic Follett-Smith @ 2012-10-04 16:21 UTC (permalink / raw)
  To: b.a.t.m.a.n

Hi,

is there a way to get the mac address of the station that sent the bat_packet?
We want to get hold of parameters such as signal strength. We could do
this by using the radiotap header, or by looking at the iw station
dump of a neighbour. The second option requires the use of the mac
address.

Regards
Dominic
UCT, SA

-- 
If you are going to achieve excellence in big things, you develop the
habit in little matters. Excellence is not an exception, it is a
prevailing attitude.
Colin Powell

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [B.A.T.M.A.N.] mac address from packet
  2012-10-04 16:21 [B.A.T.M.A.N.] mac address from packet Dominic Follett-Smith
@ 2012-10-04 16:30 ` Sven Eckelmann
  2012-10-04 16:32   ` Sven Eckelmann
  2012-10-04 16:38 ` Gui Iribarren
  1 sibling, 1 reply; 7+ messages in thread
From: Sven Eckelmann @ 2012-10-04 16:30 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Dominic Follett-Smith

[-- Attachment #1: Type: text/plain, Size: 514 bytes --]

On Thursday 04 October 2012 18:21:02 Dominic Follett-Smith wrote:
> Hi,
> 
> is there a way to get the mac address of the station that sent the
> bat_packet? We want to get hold of parameters such as signal strength. We
> could do this by using the radiotap header, or by looking at the iw station
> dump of a neighbour. The second option requires the use of the mac address.

Hm? What is a bat_packet? And the sender is encoded in the ethernet mac header 
before any batman-adv header fields.

Kind regards,
	Sven

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [B.A.T.M.A.N.] mac address from packet
  2012-10-04 16:30 ` Sven Eckelmann
@ 2012-10-04 16:32   ` Sven Eckelmann
  2012-10-04 19:30     ` Dominic Follett-Smith
  0 siblings, 1 reply; 7+ messages in thread
From: Sven Eckelmann @ 2012-10-04 16:32 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Dominic Follett-Smith

[-- Attachment #1: Type: text/plain, Size: 767 bytes --]

On Thursday 04 October 2012 18:30:25 Sven Eckelmann wrote:
> On Thursday 04 October 2012 18:21:02 Dominic Follett-Smith wrote:
> > Hi,
> > 
> > is there a way to get the mac address of the station that sent the
> > bat_packet? We want to get hold of parameters such as signal strength. We
> > could do this by using the radiotap header, or by looking at the iw
> > station
> > dump of a neighbour. The second option requires the use of the mac
> > address.
> 
> Hm? What is a bat_packet? And the sender is encoded in the ethernet mac
> header before any batman-adv header fields.

Ok, next time please write that you are speaking about batmand. But it is 
still the same. The mac is part of the ethernet mac header at the beginning of 
the frame.

Kind regards,
	Sven

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [B.A.T.M.A.N.] mac address from packet
  2012-10-04 16:21 [B.A.T.M.A.N.] mac address from packet Dominic Follett-Smith
  2012-10-04 16:30 ` Sven Eckelmann
@ 2012-10-04 16:38 ` Gui Iribarren
       [not found]   ` <CA+h5VgobQQZWN+Vr_+UbQaxLw6qV=G6C0XYGLvHA+88QRzGQwQ@mail.gmail.com>
  1 sibling, 1 reply; 7+ messages in thread
From: Gui Iribarren @ 2012-10-04 16:38 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

AFAIU batman is unaware of the PHY layer mac address, so your only
option is sniffing that out of a pcap dump.

Or, i misundestood your objective. Can you explain a little bit more
what you're trying to do?

On 10/4/12, Dominic Follett-Smith <dominicfollett@gmail.com> wrote:
> Hi,
>
> is there a way to get the mac address of the station that sent the
> bat_packet?
> We want to get hold of parameters such as signal strength. We could do
> this by using the radiotap header, or by looking at the iw station
> dump of a neighbour. The second option requires the use of the mac
> address.
>
> Regards
> Dominic
> UCT, SA
>
> --
> If you are going to achieve excellence in big things, you develop the
> habit in little matters. Excellence is not an exception, it is a
> prevailing attitude.
> Colin Powell
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [B.A.T.M.A.N.] mac address from packet
  2012-10-04 16:32   ` Sven Eckelmann
@ 2012-10-04 19:30     ` Dominic Follett-Smith
  2012-10-05  7:11       ` Sven Eckelmann
  0 siblings, 1 reply; 7+ messages in thread
From: Dominic Follett-Smith @ 2012-10-04 19:30 UTC (permalink / raw)
  To: Sven Eckelmann; +Cc: b.a.t.m.a.n

Hi,

We have set up a 4x4 test bed composed of  Alix PC engines routers,
with debian 2.6.32 OS,  CM9 Atheros pci cards with ath5k driver. We
are using batmand, in this mesh.

We have set the txpower level to 0dBm to enforce mutli-hopping in the
testbed. We have the pci cards operating in ad-hoc mode.

What we are trying to do is use the physical interference model for a
new interference metric we have made. In order to do this, we need to
obtain the received signal strength of an OGM that a station has
received from a neighbour.

We initially thought that a simple method would be to use the iw tool
as follows:

iw dev wlan0 station get <mac address of neighbour station>

However we need the mac address of the neighbouring station that sent
the OGM. But we are not sure how to go about retrieving the mac
address which is part of the ethernet mac header at the beginning of
the frame.

I am happy to provide more details, if I have left anything out.

Kind Regards
Dominic

On Thu, Oct 4, 2012 at 6:32 PM, Sven Eckelmann <sven@narfation.org> wrote:
> On Thursday 04 October 2012 18:30:25 Sven Eckelmann wrote:
>> On Thursday 04 October 2012 18:21:02 Dominic Follett-Smith wrote:
>> > Hi,
>> >
>> > is there a way to get the mac address of the station that sent the
>> > bat_packet? We want to get hold of parameters such as signal strength. We
>> > could do this by using the radiotap header, or by looking at the iw
>> > station
>> > dump of a neighbour. The second option requires the use of the mac
>> > address.
>>
>> Hm? What is a bat_packet? And the sender is encoded in the ethernet mac
>> header before any batman-adv header fields.
>
> Ok, next time please write that you are speaking about batmand. But it is
> still the same. The mac is part of the ethernet mac header at the beginning of
> the frame.
>
> Kind regards,
>         Sven



-- 
If you are going to achieve excellence in big things, you develop the
habit in little matters. Excellence is not an exception, it is a
prevailing attitude.
Colin Powell

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [B.A.T.M.A.N.] Fwd:  mac address from packet
       [not found]     ` <CAHD-aq+BO6JZtojFHNgZ+pyHd_9nLviTUi9+xbenpFwyaPM3jw@mail.gmail.com>
@ 2012-10-04 21:11       ` Gui Iribarren
  0 siblings, 0 replies; 7+ messages in thread
From: Gui Iribarren @ 2012-10-04 21:11 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

---------- Forwarded message ----------
From: Gui Iribarren <gui@altermundi.net>
Date: Thu, 4 Oct 2012 16:46:30 -0300
Subject: Re: [B.A.T.M.A.N.] mac address from packet
To: Dominic Follett-Smith <dominicfollett@gmail.com>

Add a wireless interface in monitor mode, and start a wireshark/tcpdump on that.

If the driver and chipset are cooperative enough, The first header
will contain the signal, noise, bssid and phy mac src/dst, etc for
*each* packet. Look for ogm packets and voilà.

Ogms are no different from any other data packet on this layer.
So this went way offtopic for this list. You should inform yourself
(elsewhere :) ) about the validity of those rssi/noise numbers, for
your particular chipset & driver.

On 10/4/12, Dominic Follett-Smith <dominicfollett@gmail.com> wrote:
> Thanks,
>
> Sven says that , "The mac is part of the ethernet mac header at the
> beginning of
> the frame." But I still don't know how to access this.
>
> We are trying to get the received signal strength from the OGM we have
> received, in order to do interference calculations.
>
> Kind Regards
> Dominic
>
>
>
> On Thu, Oct 4, 2012 at 6:38 PM, Gui Iribarren <gui@altermundi.net> wrote:
>> AFAIU batman is unaware of the PHY layer mac address, so your only
>> option is sniffing that out of a pcap dump.
>>
>> Or, i misundestood your objective. Can you explain a little bit more
>> what you're trying to do?
>>
>> On 10/4/12, Dominic Follett-Smith <dominicfollett@gmail.com> wrote:
>>> Hi,
>>>
>>> is there a way to get the mac address of the station that sent the
>>> bat_packet?
>>> We want to get hold of parameters such as signal strength. We could do
>>> this by using the radiotap header, or by looking at the iw station
>>> dump of a neighbour. The second option requires the use of the mac
>>> address.
>>>
>>> Regards
>>> Dominic
>>> UCT, SA
>>>
>>> --
>>> If you are going to achieve excellence in big things, you develop the
>>> habit in little matters. Excellence is not an exception, it is a
>>> prevailing attitude.
>>> Colin Powell
>>>
>
>
>
> --
> If you are going to achieve excellence in big things, you develop the
> habit in little matters. Excellence is not an exception, it is a
> prevailing attitude.
> Colin Powell
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [B.A.T.M.A.N.] mac address from packet
  2012-10-04 19:30     ` Dominic Follett-Smith
@ 2012-10-05  7:11       ` Sven Eckelmann
  0 siblings, 0 replies; 7+ messages in thread
From: Sven Eckelmann @ 2012-10-05  7:11 UTC (permalink / raw)
  To: Dominic Follett-Smith, b.a.t.m.a.n

[-- Attachment #1: Type: text/plain, Size: 1552 bytes --]

On Thursday 04 October 2012 21:30:24 you wrote:
> However we need the mac address of the neighbouring station that sent
> the OGM. But we are not sure how to go about retrieving the mac
> address which is part of the ethernet mac header at the beginning of
> the frame.

You don't have this information when you receive the data through an UDP 
socket (this is one of the reasons why all development is now done in batman-
adv). What you can do is to rewrite the batmand socket handling stuff using 
PF_PACKET. Small hint: you should use BPF to reduce the amount of packets 
received by userspace since your HW doesn't look really powerful. Even better 
hint: BPF codes can be created using tcpdump. Here an example for udp port 
4305:

$ tcpdump -dd 'ip and udp and port 4305'
{ 0x28, 0, 0, 0x0000000c },
{ 0x15, 0, 10, 0x00000800 },
{ 0x30, 0, 0, 0x00000017 },
{ 0x15, 0, 8, 0x00000011 },
{ 0x28, 0, 0, 0x00000014 },
{ 0x45, 6, 0, 0x00001fff },
{ 0xb1, 0, 0, 0x0000000e },
{ 0x48, 0, 0, 0x0000000e },
{ 0x15, 2, 0, 0x000010d1 },
{ 0x48, 0, 0, 0x00000010 },
{ 0x15, 0, 1, 0x000010d1 },
{ 0x6, 0, 0, 0x0000ffff },
{ 0x6, 0, 0, 0x00000000 },

This code has to be attached to the "PF_PACKET, SOCK_RAW"-socket using 
setsockopt's SO_ATTACH_FILTER.

The packets can be received using recvmsg (don't forget to use MSG_TRUNC or 
you will get problems to differentiate different packets. Your biggest problem 
will be the handling of fragmented IP packets... but you should not get them 
when you listen for these broadcast announcements.

Kind regards,
	Sven

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-10-05  7:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-04 16:21 [B.A.T.M.A.N.] mac address from packet Dominic Follett-Smith
2012-10-04 16:30 ` Sven Eckelmann
2012-10-04 16:32   ` Sven Eckelmann
2012-10-04 19:30     ` Dominic Follett-Smith
2012-10-05  7:11       ` Sven Eckelmann
2012-10-04 16:38 ` Gui Iribarren
     [not found]   ` <CA+h5VgobQQZWN+Vr_+UbQaxLw6qV=G6C0XYGLvHA+88QRzGQwQ@mail.gmail.com>
     [not found]     ` <CAHD-aq+BO6JZtojFHNgZ+pyHd_9nLviTUi9+xbenpFwyaPM3jw@mail.gmail.com>
2012-10-04 21:11       ` [B.A.T.M.A.N.] Fwd: " Gui Iribarren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox