[Interop-dev] netjson for meshviewer

Moritz Warning (spam-protected)
Wed Dec 20 12:47:30 CET 2017


Hey Federico,

I have implemented NetJSON Network graph support in my project now:
https://github.com/mwarning/MeshNetSimulator

It is not well tested, but it works for importing and exporting.
The current MeshViewer format is also supported.

- Moritz

On 12/11/2017 11:45 AM, Nemesis wrote:
> Hey Moritz,
> 
> here's an example, I added some comments although they are not valid
> according to the JSON spec, but I added them anyway for explaination
> purposes. Keep in mind the spec allows flexibility in placing custom
> properties and attributes:
> 
> {
>     "type": "NetworkGraph",
>     "protocol": "batman-adv",
>     "version": "batman-adv version here",
>     "metric": "tq",
>     // custom attributes are allowed
>     "timestamp": "2017-09-10T21:15:01",
>     "directed": false,
>     "multigraph": false,
>     "nodes": [
>         {
>             "id": "62:e3:27:ff:8a:64",
>             "node_id": "62e327ff8a64",
>             "flags": {
>                 "gateway": false,
>                 "online": false
>             },
>             "properties": {
>                 "firstseen": "2017-09-04T12:40:29",
>                 "hardware": {
>                     "model": "TP-Link TL-WA901N/ND v4"
>                 },
>                 "hostname": "FreeHemp1",
>                 "location": {
>                     "latitude": 48.396396,
>                     "longitude": 9.98526335
>                 },
>                 "network": {
>                     "mac": "62:e3:27:ff:8a:64"
>                 },
>                 "node_id": "62e327ff8a64",
>                 "owner": {
>                     "contact": "(spam-protected)"
>                 },
>                 "software": {
>                     "firmware": {
>                         "release": "ffulm-0.6.5"
>                     }
>                 },
>                 "system": {
>                     "role": "node",
>                     "site_code": "gotham"
>                 },
>                 "lastseen": "2017-09-10T05:20:01"
>             },
>             "statistics": {
>                 "clients": 0,
>                 "memory_usage": 0.589754,
>                 "rootfs_usage": 0.83,
>                 "uptime": 10487.19
>             }
>         },
>         {
>             "id": "ea:de:27:b7:8d:be",
>             "node_id": "eade27b78dbe",
>             "flags": {
>                 "gateway": false,
>                 "online": false
>             },
>             "properties": {
>                 "firstseen": "2017-09-04T12:40:29",
>                 "hardware": {
>                     "model": "TP-Link TL-WA901N/ND v4"
>                 },
>                 "hostname": "FreeHemp2",
>                 "location": {
>                     "latitude": 49.396396,
>                     "longitude": 10.00
>                 },
>                 "network": {
>                     "mac": "ea:de:27:b7:8d:be"
>                 },
>                 "node_id": "eade27b78dbe",
>                 "software": {
>                     "firmware": {
>                         "release": "ffulm-0.6.5"
>                     }
>                 },
>                 "system": {
>                     "role": "node",
>                     "site_code": "gotham"
>                 },
>                 "lastseen": "2017-09-10T05:20:01"
>             },
>             "statistics": {
>                 "clients": 0,
>                 "memory_usage": 0.589754,
>                 "rootfs_usage": 0.83,
>                 "uptime": 10487.19
>             }
>         }
>     ],
>     "links": [
>         {
>             "source": "62:e3:27:ff:8a:64",
>             "target": "ea:de:27:b7:8d:be",
>             "cost": 1.008,
>             "properties": {
>                 "vpn": true
>             }
>             // vpn may also be here if preferred
>             // it depends on implementation details
>             "vpn": true
>         }
>     ]
> }
> 
> I suggest you to read the NetworkGraph section of the spec, is basically
> just a page and if you read it you will understand the purpose of the
> NetworkGraph object:
> http://netjson.org/rfc.html#rfc.section.4
> 
> I would really like to rewrite the frontend library
> https://github.com/netjson/netjsongraph.js so it would have some of the
> features of meshviwer but we haven't been able to accomplish yet and the
> attempt to rewrite it in WebGL did not produce the result we are hoped,
> but I will keep insisting in the near future when I get a chance.
> 
> Federico
> 
> 
> On 12/07/2017 01:06 PM, Moritz Warning wrote:
>> Hi,
>>
>> I like to evaluate netjson for a meshviewer implementation.
>> It would be helpful if somebody could tell me how the attached graph.json and nodes.json would look like in netjson.
>>
>> thanks,
>> mwarning
> 
> 
> 
> _______________________________________________
> Interop-dev mailing list
> (spam-protected)
> https://lists.funkfeuer.at/mailman/listinfo/interop-dev
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.funkfeuer.at/pipermail/interop-dev/attachments/20171220/7c26fa2d/attachment.sig>


More information about the Interop-dev mailing list