OpenWrt Forum Archive

Topic: OpenRRPC Strange behaviour

The content of this topic has been archived on 3 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I've one RTL8316CP pseudo-smart switch.
Calling it "pseudo", because it could be configured via RRCP (Realtek Remote Control Protocol). This protocol is broadcast one.

The device is understanding VLAN/Tagging and has some control over ethernet ports.

However I am not able to control it with openrrcp package compiled for MIPS.

I've a device which is x86 and running OpenWRT Barrier Breaker r42625
The command is as follows:

rtl83xx eth0 scan

Here's the frame sent from it and the switch responds correctly:

destination  source              Protocol  Type  Data
ffffffffffff       090027e10025 8899       02      0000000000000000000000000000000000

The whole frame is as follows:

ffffffffffff080027e100258899020000000000000000000000000000000000

However when I tried with my MIPS device: TL-WR1043ND running the same version of OpenWRT with the same command:

rtl83xx eth1 scan

Eth1 is the internal Switch interface on my setup it is not bridged with the wifi

I've got this frame:

Dest          Src               Protocol Type  ?????                           Cookie           
ffffffffffff 10feede9461e 8899       02      00000000037fa80890 76f8dc8000000025

Data
00000000000000000000000000000000000000000000000000000000

And the whole frame is as follows:

ffffffffffff0feede9461e88990200000000037fa8089076f8dc800000002500000000000000000000000000000000000000000000000000000000

This frame is not recognized by my smart-switch. It is larger and is omitted by the device.

I decided to execute the same command but using an usb lan adapter. The result was the same. The frame was almost the same.

I am almost certain that the problem is not with the rtl83xx program itself, it is with this cookie part and the one marked with "?????".

How can I run this OpenRRCP on MIPS?

Should I post a ticket on the dev.openwrt.org for openrrcp?

I am not certain where exactly is the problem.

Slight update:
My bad regarding the network stack. It turns out that the device responds to the sent packets:

Here is the dump for Hello requests:

00:60:6e:43:e1:e8 > ff:ff:ff:ff:ff:ff, RRCP query: hello, auth=0x2379
        0x0000:  ffff ffff ffff 0060 6e43 e1e8 8899 0100  .......`nC......
        0x0010:  2379 0002 7fb7 43c0 7730 5c80 0000 0025  #y....C.w0\....%
e4:8d:8c:4a:2c:c9 > 00:60:6e:43:e1:e8, RRCP reply: hello, auth=0x2379 downlink_port=2, uplink_port=2, uplink_mac=00:00:00:00:00:00, vendor_id=40414243 ,chip_id=0c00
        0x0000:  0060 6e43 e1e8 e48d 8c4a 2cc9 8899 0180  .`nC.....J,.....
        0x0010:  2379 0202 0000 0000 0000 0c00 4041 4243  #y..........@ABC
        0x0020:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0030:  0000 0000 0000 0000 0000 0000 

and here is the dump for the REP requests:

00:60:6e:43:e1:e8 > ff:ff:ff:ff:ff:ff, RRCP-REP query, cookie=0x0000002577305c80
        0x0000:  ffff ffff ffff 0060 6e43 e1e8 8899 0200  .......`nC......
        0x0010:  0000 0002 7fb7 43c0 7730 5c80 0000 0025  ......C.w0\....%
e4:8d:8c:4a:2c:c9 > 00:60:6e:43:e1:e8, RRCP-REP reply, cookie=0x0000002577305c80
        0x0000:  0060 6e43 e1e8 e48d 8c4a 2cc9 8899 0280  .`nC.....J,.....
        0x0010:  0000 0002 33de 0c59 7730 5c80 0000 0025  ....3..Yw0\....%
        0x0020:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0030:  0000 0000 0000 0000 0000 0000            ............

It looks like the problem is in the openrrcp program itself. It work correctly under ARM, x86 but not on MIPS.

Did a small test - chrooted into a Debian installation on my router and nativelly compiled the rrcp program. The result was the same:
it sent the requests, receives replies from the switch, however it is not able to decode them correctly.

Will submit a ticket to the developer.

The discussion might have continued from here.