NMRP (I don't know what this stands for — maybe NetGear Management Remote Protocol) is a way to force a Netgear router to run TFTP to grab a new firmware image. It may have other uses too.
The Ethernet code is 0x0912. Following the ethernet header, is a struct that looks like this:
struct {
ushort reserved;
uchar code;
uchar id;
ushort length;
int numOptions;
NMRP_PARSED_OPT options[NMRP_MAX_OPT_PER_MSG];
} nmrp_msg;
typedef struct {
ushort type;
ushort len;
union {
uchar magicno[MAGIC_NO_LEN];
struct{
uchar addr[IP_LEN];
uchar mask[IP_LEN];
}ip;
} value;
} NMRP_PARSED_OPT;
There are only two option types we care about: MAGIC_NO (value: 1) and DEV_IP (value: 2).
| Option Type | Values | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| MAGIC_NO |
| ||||||||||
| DEV_IP |
|
| Message Field | Description |
|---|---|
reserved | Always zero |
code | The packet type. See below |
id | Apparently unused |
length | total length of the packet |
options | See above |
Packet types correspond to actions. Some are sent to the device, some are sent by the device.
| Code (value) | Direction | Meaning |
|---|---|---|
| ADVERTISE (1) | To device | Turn on the NMRP stack; content should be MagicNumber option |
| CONF_REQ (2) | From Device | Ask for configuration from server |
| CONF_ACK (3) | To device | Contains IP address of TFTP server |
| CLOSE_REQ (4) | From device | Ask for connexion to close |
| CLOSE_ACK (5) | To device | Close connexion |
| KEEP_ALIVE_REQ (6) | Either | |
| KEEP_ALIVE_ACK (7) | Either | |
| TFTP_UL_REQ (16) | From device | Device has started a TFTP server, so upload a firmware image to it. |
The protocol works something like this (I think!):