10

Recently I was puzzled by the following articles about Raw-Ethernet frames:

RAW ethernet vs. UDP
Message Passing Using Raw Ethernet Frames

Briefly, both of them discusses that it is possible to establish a point-to-point communication using only the Ethernet layer. In that case, the overhead of the IP and TCP layers would be avoided and the throughput would increase (roughtly 50% according to some benchmarks).

I would like to do a similar test but in a wireless environment. However, I have some issues:

1st Issue
Is there any hardware constraint (ie: the Wi-Fi card) that might undermine such effort?

2nd Issue
Both articles chose the following frame format:

Preamble | Delimiter | Mac Headers | Payload | Pad | CRC

As far as I know, preamble, delimiter, pad and CRC are added by the Ethernet device to every frame and can not be changed via software. I guess with Wi-Fi devices is similar. Therefore, is there any hardware constraint (ie: the Wi-Fi card) that would undermine removing the Mac Headers?

ps: consider that the communication will be on a point-to-point basis, ie., there will be no routers, switches, bridges, ... no internet connectivity.

1
8

First, Wi-Fi (IEEE 802.11) is not ethernet (IEEE 802.3) any more than token ring (IEEE 802.5) or any of the other IEEE LAN standards other than 802.3 are ethernet. The frame headers are different for Wi-Fi and ethernet.

Wi-Fi, ethernet, token ring, FDDI, etc. are all LAN standards for OSI layer-1 and layer2 which encapsulate datagrams for upper layer protocols. Each can transport layer-3 protocols, of which IP is merely one.

You are free to create your own or use one of the existing layer-3 protocols for one of the IEEE LAN protocols, but you will need to have the frame for the LAN protocol which you choose. Don't expect to be able to interoperate with any device which is not running your protocol stack, nor can you expect it to run over any routers which don't have your protocol stack (this means no Internet which uses IP). Bridges like ethernet switches or WAPs will transport your upper layer protocols since they work at layer-2, so you could create a LAN.

You will need to have the frame header for the type of LAN you are on. For one thing, how does one host actually send to another host without the layer-2 address in the frame. I think you are basically going back to serial communication like RS-232 which has no frame or header, but it relies on extra wires for data control.

1
7

Based on your questions and comments, I think you are missing the point of the two articles you are referencing.

When they are talking about "Raw Ethernet," they are talking about data frames that do not contain any IP (L3) or TCP/UDP (L4) headers. They are not talking about using L2 frames without L2 headers.

Without the L2 headers, a frame would be neither an 802.3 (Ethernet) nor an 802.11 frame. It would be something else entirely. A separate L2 protocol.

Is there any hardware constraint (ie: the Wi-Fi card) that might undermine such effort?

Of not including L2 headers? Absolutely. You would have to specify a specific adapter to get a specific answer, but I doubt you could even write drivers that would work with most 802.3 or 802.11 adapters that did not include the L2 headers. My guess is that most adapters would reject/drop the frame as malformed either before sending or upon receiving it.

Of sending just an 802.3 or 802.11 frame that doesn't include IP or TCP/UDP headers? No. This happens all the time as part of normal network operations and has for decades (at least for 802.3; 802.11 hasn't been around as long but at least a decade).

Therefore, is there any hardware constraint (ie: the Wi-Fi card) that would undermine removing the Mac Headers?

See above.

4
  • most adapters would reject/drop the frame I guess this answer my question. Later I will submit my own answer in order to not lose all the interesting 'ephemeral' comments. – Mark Messa Dec 18 '15 at 13:31
  • reject/drop the frame as malformed either before sending or upon receiving it. As far as I know, in monitor mode you can hear any kind of frames, even the malformed ones (ex: wrong CRC). However, curiously, the hardware doesn't allow you to broadcast frames without MAC headers. – Mark Messa Dec 18 '15 at 13:56
  • small correction: However, curiously, the adapter doesn't allow you to broadcast frames without MAC headers. – Mark Messa Dec 18 '15 at 14:07
  • 2
    @MarkMessa "As far as I know, in monitor mode you can hear any kind of frames, even the malformed ones (ex: wrong CRC)" This is entirely dependent on the device in question. Many adapters (including switches) will process and drop these even before sending them on to be captured/mirrored/spanned. Often you won't even see the Ethernet trailer with the CRC in captures. – YLearn Dec 18 '15 at 23:13
1

I would like to do a similar test but in a wireless environment.

Look at Wifibroadcast (Linux, some Android support) which does exactly that. Short summary: it uses a pair of wifi adapters, one in injection mode, the other in monitor mode, and transmits data using raw wifi frames. This is an unidirectional connection. While originally conceived as a method to transmit low latency video feed, it can of course be used for all kind of data.

Is there any hardware constraint (ie: the Wi-Fi card) that might undermine such effort?

Yes. There are adapters that work better, and adapters that work less well, if at all. Some adapters in raw mode cannot contain high throughput, some adapters need to have their firmware modified. Some adapters work in 2.4GHz band and some in 5GHz and some in both.

0

Yes. In theory, you can run point-to-point ethernet like that. Both endpoints would have to be in promiscuous mode to remove the 802.3 Ethernet MAC headers (otherwise the frames don't belong to either NIC and would be ignored.) Of course, doing this means you aren't running "ethernet".

2
  • promiscuous mode This is a very important issue that I was hoping to be raised. In promiscuous mode frames addressed to a different MAC address than yours would not be discarded by the Wi-Fi card. However, the same is not true for BSSID (correct me if I'm wrong). If the frame is not addressed to your BSSID, the Wi-Fi card will discard it. Is it possible to avoid that and receive ALL frames reaching your card? (monitor mode?) – Mark Messa Dec 18 '15 at 0:34
  • promiscuous mode to remove the 802.3 Ethernet MAC headers Based on @YLearn answer, it seems that the hardware won't accept frames without L2 headers. – Mark Messa Dec 18 '15 at 19:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.