Home > Uncategorized > #Arduino Packet Sniffer using w5100 ethernet shield.

#Arduino Packet Sniffer using w5100 ethernet shield.


It is often surprising how busy your home network is, even when you think nothing much is happening on it, our homes are filled with smart devices that chat constantly on the network, constantly announcing technical details about themselves. If you run Wireshark on your computer, you can see just how noisy the network is.

This bit of code sniffs packets off the network, using a Arduino and a W5100 based ethernet shield. Note that this is  will only pick up packets directed at the arduino, or broadcast packets, and since the serial interface is way slower than your network connection, expect plenty of dropped packets.

I’ve got the output to show human-readable text where possible, – filtering out the null character (0), which interfered with copy and pasting the output. There’s not much intellegence going on here, so there’s going to be IPv4 mixed with IPv6 and ARP frames here.

The code is based on Nicolas Humfrey’s W5100 Mac Raw project here https://github.com/njh/W5100MacRaw

#include “w5100.h”

const byte mac_address[] = {
0xae, 0x03, 0xf3, 0xc7, 0x08, 0x78

Wiznet5100 w5100;

void setup() {
// Setup serial port for debugging
uint8_t buffer[800];
void loop() {
uint16_t len = w5100.readFrame(buffer, sizeof(buffer));
if ( len > 0 ) {
for(uint16_t i=0; i<len; i++)
if (buffer[i]>0)

For more information on Packet Sniffing, check out chapter 10 in my book


Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: