Replies: 13 comments 9 replies
-
currently, I wrote a "bridge" which connect to 2 routers, and registered different prefix topic and forward message if hit. e.g. router A have "neuedu.dnui." topics, and router B have "neuedu.nuit." topics, a "bridge" registered to both of them, so, if a client call "neuedu.nuit.*" on router A, the message will received by "bridge" and forward to router B, then return result back. |
Beta Was this translation helpful? Give feedback.
-
Well.... R2R Links are not as easy as someone might expect... Let me refresh my thoughts and post them so we can discuss them. |
Beta Was this translation helpful? Give feedback.
-
well, yes, "how they connect" at the networking level (which is the easy part), and then of course how they create the illusion of regular/unified realms on top of distributed meshes of router nodes (full, tree, etc) of both a single operator, and nodes by different operators ("federated meshes"), which was always the ultimate end-goal rgd WAMP (at least in my mind). fwiw, Crossbar.io has a working implementation of this stuff - it does "work", but there are bugs left, both implementation wise, and I'm pretty sure rgd design gaps as well, e.g. when you start to combine r2r links with other complex WAMP features like meta API etc I had a quick look at the "text" you've linked: forget it, this is not even close to what is actually already there in Crossbar.io ;) anyways, stopped working on the text some time ago, sorry, I need to earn money, and this stuff isn't doing that.
sure. that is probably the most simple topology supported. 3 nodes, one of them network reachable from the others (with a public routable IP address). I call that "core-node/edge tree". what I used when developing was already going further: "core-mesh/edge tree" with a HA / scale-out full mesh at core in cloud, and off-hanging (hierarchical) trees of edge nodes distributed in WAN - and this does indeed work. it's pretty cool already, and I'm not aware of anything else that does similar. I'm also not aware of any other implementation of r2r besides Crossbar.io anyways, hope this helps! |
Beta Was this translation helpful? Give feedback.
-
Just wanted to note here that I think R2R should not be part of the WAMP definition. I don't see a reason why one would use 2 different router implementations to establish a router network. So I see R2R as something that should be router implementation specific. WAMP is quite a complex but therefore very powerful protocol. Adding this much more complexity will most probably stop people from implementing it. This is just an opinion, no offence! |
Beta Was this translation helpful? Give feedback.
-
thanks a lot for your comment and perspective, and yes, this is definitely one way to look at it, no offense taken;) let me nevertheless comment, give my personal view, but in any case, this stuff isn't in the spec (there is an AP "draft" which hasn't even the full proposal -.- so it is WIP) as of today
say you want to mesh between two networks operated by different operators / parties each preferring their router implementation
we had discussed this specific point among implementors quite some time ago .. can't find it now .. but it is true;) as a consequence of this discussion we have split the spec into Basic Profile (BP) and Advanced Profile (AP) to achieve both goals:
|
Beta Was this translation helpful? Give feedback.
-
I see that point. But I also see, that most super-heavy-advanced users will most probably go with crossbar anyway. If I would start over today, I wouln't bother to write my own router anymore. That was more a challange to me. I could have also just contributed to crossbar. It is what it is now. I do see why one would write a client implementation. But as we talk R2R I don't see it in the specs. But still this is a good point and since you started it why not finish it one day. My biggest SASS solution has more than 100k users per day, max. 1.6Gbit throughput and I don't need R2R atm. |
Beta Was this translation helpful? Give feedback.
-
Of course contributing to Crossbar.io would have been nice, but another router implementation is highly welcome too! Implementation diversity is good! And all WAMP implementations (clients and routers) - which make an honest effort to comply to the spec - are welcome, closed source and OSS!
Yeah, that's because R2R is compatible with any client implementation! Crossbar.io implements that, as well as E2E, and uses that also in R2R ... but that wouldn't be necessary I think - now that I think about triggered by our discussion. What does absolutely build on / require R2R with E2E is federated R2R - because trust needs to be established not only between router nodes of different ops, but even more importantly between clients connected to different nodes by different ops (potentially). without relying on any one router op. Alice trusts Bob (both clients), and neither Alice nor Bob trusts or cares about David and Erin (see above PDF) Of course, without E2E, has this consequence: clients MUST trust router operators. be it alone, or together with R2R (without E2E) |
Beta Was this translation helpful? Give feedback.
-
Okay. I finally got time to write some my thoughts on the topic. It is mostly brainstorming ideas rather than ready-made solutions. But I hope they still might be useful and together we can really create a cool and reliable design and specification (and of course implementation then) |
Beta Was this translation helpful? Give feedback.
-
At the moment Router-to-router links (R2RL) are not described in the WAMP specification and are implemented in Crossbar WAMP Router only and are based on regular WAMP connections between routers. The current implementation in Crossbar works something like this (@oberstet correct me if I’m wrong):
This approach wastes some resources: memory for storing runtime objects, CPU for finding related peers, multiple independent network TCP connections, and serializing/deserializing WAMP messages. Real R2RL should work differently. Here are the main ideas:
Known problemsThere are some questions that need to be solved in the proposal above to achieve success:
|
Beta Was this translation helpful? Give feedback.
-
That is one aspect of WAMP that is regrettable and is too late to change. Payloads should never have been embedded in the "control message" structure. There should have been distinct headers and payloads in the way WAMP messages are framed. By "headers" I mean at the WAMP level, and not to be confused with raw socket headers. That is,
would have been preferable to
|
Beta Was this translation helpful? Give feedback.
-
just a quick note (need to catch some sleep, really) on this single aspect .. which seems to indicate you both believe in the same thing ... which isn't true though;) sorry, or lucky? the flatbuffers WAMP serializer (implemented in autobahn/crossbar) allows zero touch / serialization / copy for application payloads (args/kwargs). please note, true zero copy means: octets within app payload are DMA'ed by the NIC into main memory, and from there again into the NIC via DMA, without the CPU ever touching those bytes, but they are still moved over PCIe bus and into/from main memory (thus, increase bus and memory pressure). this is not in ABPy/CB, mostly as it requires dealing with new kernel APIs (rings etc) and no GC. however, there is no deserialization or serialization happening or any CPU involvement for that, even today, and on ABPy/CB. one downside of course is: the transparency of WAMP wrt to the serializer used by clients, and the normalization of serializations wrt to the implementation used by the router is gone .. obviously. anyways, I hope I find time to reply to the other things, and also to the limits stuff soonish ... |
Beta Was this translation helpful? Give feedback.
-
my view:
|
Beta Was this translation helpful? Give feedback.
-
I'm not going to answer to your whole post (which is awesome feedback and great for discussion!) as I need to work on other stuff right now still, but I will comment more .. this is just to "correct" some misunderstandings rgd R2R in Crossbar.io ..
yes, Crossbar.io is currently to the best of my knowledge the only router that implements R2R, and yes, R2R is based on as much/many already existing other WAMP features as possible - this is by design most importantly, it reuses WAMP itself to transport R2R, it reuses WAMP meta API to keep routing data in sync, it reuses opaque payloads for "no touch of app payload" possibility of R2R routing (!) - true zero copy R2R when using R2R with Flatbuffers and WAMP opaque payloads (or E2E payloads which are opaque by nature) - and it reuses E2E for both a) zero-trust R2R (from client PoV), as well as federated WAMP (multiple router ops) - this is again only in Crossbar.io, but also in AutobahnPython and AutobahnJS for the real final deal: zero trust decentralized app messaging
Crossbar.io can move R2R over any WAMP transport it supports. This includes TCP, TLS, Unix domain sockets (one-time-copy), serial COM ports and ... also function-based transport (zero-copy in-process/thread .. essentially "WAMP-over-Stack") the latter is obviously tied to the language run-time of the router then though - if there is any, like in CB. A WAMP router based on WASM (eg the new Crossbar.io Metal) will provide zero-copy zero-serialization via stack (it doesn't get more efficient, since stack based communication also provides zero-context-switch), and (due to the nature of WASM) is able to do so across different languages. E.g. you can call a WAMP procedure from Python (on WASM) in C++ (on WASM), and have the results returned, both with zero copy and zero serialization, and within the same process or thread, thus zero context switching Of course this then needs a static type description in Flatbuffers (via FB IDL) - at least for the 2 clients, not necessarily the router if e.g. using E2E as well .. "zero trust decentralized messaging for the win!" ;) - as Python is pretty dynamic by nature, so processing the result in Python requires you to dump the idea of "get the result as a regular Python" object, but an exposed object (rather than deserialized and put into a native language general object) result which "looks like" an object for normal situations though
yeah, I got that! which is why I said: " and only does so "ad-hoc" and for selective elements ..". so in essence, for me (my view), this is pointless. but at the same time: the original itch is already solved! just use Flatbuffers WAMP serializer |
Beta Was this translation helpful? Give feedback.
-
Hi all,
for a long time, Router-to-Router Links still in state "write me".
could we discuss how does R2R working? I have multiple data center, both of them have at least one router, and have central router on cloud.
will this chapter talk about how to connect them?
Beta Was this translation helpful? Give feedback.
All reactions