9

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.

  • 2
    Non-IP traffic over Ethernet has been a part of networking for decades so I am not really clear on what you are really trying to get answered and maybe you need to learn a bit more about the basics of networking. There is no such thing as a "Ethernet Wireless card" as 802.3 Ethernet and 802.11 wireless are two entirely different standards. As such, your frame format in the 2nd issue wouldn't apply at all to an 802.11 network, but frames have certain requirements according to the standards which is why many of the components of the frame you list are not configurable. – YLearn Dec 17 '15 at 19:26
  • @YLearn Non-IP traffic over Ethernet has been a part of networking for decades ok, but at that time the Ethernet devices were not as 'smart' as today, and a lot of the work was done by the CPU. I was wondering whether the cost of being 'smart' is losing flexibility. – Mark Messa Dec 17 '15 at 19:40
  • @YLearn wouldn't apply at all to an 802.11 network Ok, I'm aware that other computers connected in a standard 802.11 network would not recognize such frames as valid ones. However, is it possible to send/receive such frames? Or the hardware won't allow? – Mark Messa Dec 17 '15 at 19:53
  • @MarkMessa, frames from one host to another host on the same LAN will be received by the second host. The question is whether or not they will be passed to upper layers in the network stack inside the host. If the receiving host only has an IP stack and the frame payload is not IP, then the data will be ignored. You need to learn about the OSI model to get a general ideas about how data is passed from one host to another. – Ron Maupin Dec 17 '15 at 20:10
  • @MarkMessa, regarding your first comment, despite Ethernet devices being "smarter," Ethernet still operates as Ethernet. 802.3 never has nor never will require the use of IP. For example, while rare, Ethernet today will still support Appletalk or IPX/SPX just as happily as ever, or without any higher layer protocol at all (many things still use just L2 for communication). As for your second comment, I am not sure what you mean by "is it possible to send/receive such frames." You can't send 802.3 frames over 802.11, but there are 802.11 only communications not involving IP. – YLearn Dec 17 '15 at 20:29
7

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.

  • Wi-Fi (IEEE 802.11) is not ethernet (IEEE 802.3) Ok, I've just changed part of the question to avoid this confusion. Now, completely off the topic, just to think about it: several products are advertised as 'wireless ethernet LAN'. – Mark Messa Dec 17 '15 at 20:38
  • I have seen such things, but that doesn't mean it is correct. Wi-Fi and ethernet frames are different, and ethernet uses collision detection, but Wi-Fi uses collision avoidance. Other LANs use things like tokens to prevent collisions altogether. They are all different LANs, and some advertisement doesn't make them the same thing. – Ron Maupin Dec 17 '15 at 20:48
  • that doesn't mean it is correct. Ok, I agree with you. Thanks to correct me. I'm aware of such differences as CSMA/CD, CSMA/CA and tokens. However, I was blinded by ads like 'Wi-Fi is the wireless ethernet LAN'. – Mark Messa Dec 17 '15 at 21:09
  • nor can you expect it to run over any routers There will be no routers, switches or bridges, only point-to-point communication. I've just edited the question to avoid this confusion. – Mark Messa Dec 17 '15 at 21:20
  • 1
    @MarkMessa I don't want to avoid using frames, I'm just considering to avoid using the MAC header. That is why your request is confusing. You don't seem to understand that without the L2 headers they are no longer Ethernet or 802.11 frames. You would need to write your own L2 protocol to work without the L2 headers present in 802.3 or 802.11. – YLearn Dec 18 '15 at 1:35
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.

  • 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
  • @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
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".

  • 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
0

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.

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.