Linux Network Performance

RAW ethernet vs. UDP

Andreas Schaufler

Abstract

This document describes how to do RAW ethernet programming on Linux and gives a comparison of Linux' networking performance on UDP and ethernet layer.

A visitor of my website has pointed out to me that there is a mistake in the performance measuring code. This means the figures presented are very likely wrong. Currently I do not have the time to rerun the tests. The value of this article is therefore reduced to that it is a tutorial for RAW Ethernet programming on Linux but nothing more.


Table of Contents

1. RAW ethernet programming
Networking layers
UDP
RAW ethernet
ethernet Frame Spec (IEEE 802.3)
Example Code
2. Testing Environment
Equipment
What was measured ?
3. Testing Results
Results in numbers
Comparison of UDP results
Comparison of RAW results
Comparison of UDP and RAW ethernet results
A.
Contact
B.
Source Code

List of Tables

3.1. Results

List of Examples

1.1. Create a UDP socket
1.2. Use a UDP socket to send a message
1.3. Use a UDP socket to receive a message
1.4. Create a RAW ethernet socket
1.5. Send a RAW ethernet frame
1.6. Receive a RAW ethernet frame