cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
7555
Views
2
Helpful
11
Replies

How to model interfaces with CTM?

Deniz AYDIN
Level 1
Level 1

Hi,

I am new to NEXT, and try to model IGP for BGP-LS application. My initial model is;

{:router}-[:CONTAINS]->(:interface)-[:CONNECTED]->(:interface)<-[:CONTAINS]<-{:router}

as seen i defined the link as unidirectional, and different node types for router and interface.

I wander how its defined in Next-UI topology model, especially for the interface is there any documentation how to model router with interfaces? do they defined as node or labels on links, like source/destination interface?

1 Accepted Solution

Accepted Solutions

Hi Deniz,

Christmas and New Year holidays are so long! I hope you've had a nice time

The CTM model implies each network component to be described as a JavaScript object. In your case you may want to specify the list of available interfaces for each node inside the node object, since there's no strict way to do so in NeXt.

{

     id: 0,

     name: "Router1",

     type: "router",

     interfaces: [

          "int1", "int2", "int3"

     ]

}

Thus, the link object should contain specific information about the connected interfaces

{

     id: 0,

     source: 0,

     target: 1,

     sourceInterface: "int2",

     targetInterface: "int100"

}   

Like I said, "interfaces" is not something that is built in NeXt. However, you can add your own attributes into the topology data object (like I did above) and go on to process the information as you need.

View solution in original post

11 Replies 11

alzverev
Cisco Employee
Cisco Employee

Hi Deniz,

Thanks for reaching out. I will prepare a detailed reply for you tomorrow.

I would also recommend you to get to know our tutorial: Understand Common Topology Model

Hi Aleksei,

Thanks for your reply. I am waiting for your answer. I also begin the tutorial section and try to use next ui over our model.

Hi Deniz,

Christmas and New Year holidays are so long! I hope you've had a nice time

The CTM model implies each network component to be described as a JavaScript object. In your case you may want to specify the list of available interfaces for each node inside the node object, since there's no strict way to do so in NeXt.

{

     id: 0,

     name: "Router1",

     type: "router",

     interfaces: [

          "int1", "int2", "int3"

     ]

}

Thus, the link object should contain specific information about the connected interfaces

{

     id: 0,

     source: 0,

     target: 1,

     sourceInterface: "int2",

     targetInterface: "int100"

}   

Like I said, "interfaces" is not something that is built in NeXt. However, you can add your own attributes into the topology data object (like I did above) and go on to process the information as you need.

By the way, that might be useful for you if you need to depict interface on the topology: http://codepen.io/NEXTSUPPORT/full/LNgYER/

To see the code: http://codepen.io/NEXTSUPPORT/pen/LNgYER

Hi Aleksei,

Thanks for your reply and also hapy new new year. I saw same examples as you mentioned in page nextsupport's Fiddles - JSFiddle - Online JavaScript Editor - jQuery, Angular, Backbone, Underscore, Knockout, YUI . I just begin the demos and using NEXT UI.

Also I am trying build network monitor application. I can change the node icon accourding to node's attribute (status:down/up) if its up I am using green router icon, if its down I am using the red one. Tring to apple same logic to nodeset. If one of the node's in the nodesset is down (status:down) change the nodeset icon type to red one. Currently i am digging to find it in the examples but it would be great if you can help on this subject.

Again thanks for your answer.

Hi Deniz,

I created a snippet for you: http://codepen.io/NEXTSUPPORT/pen/WRrxWM

That should be of help.

Hi Aleksei,

It looks fine but a little bir different than what I want. This requires additional function while construting topology data ( I am using graph database, neo4j and importing its data to next ui).

I am looking for a different approach. Let me explain over the data ;

  nodes: [{

    "id": 0,

    "x": 410,

    "y": 100,

    "name": "12K-1",

    "status":"down"

  }, {

    "id": 1,

    "x": 410,

    "y": 280,

    "name": "12K-2"

"status":"up"

  }

and the nodes is without nodeset

  nodeSet: [

    {

      id: 1001,

      nodes: [0,1],

      name: "Group 1",

      x: 100,

      y: 50

    },

for the nodeset config"

nodeSetConfig: {

    color: function(model){

   // iterate over node's status and if one of then is down set colour red and exit.

    },

This will be very useful in one the routers is down, it nodeset (city,pop or etc) will be red and alerted.

I may use your method while constructing the data from the database but i am trying to understand if its possible to iterate over the node's of the nodeset for this type of function.

Thanks a lot for your quick reply.

Deniz,

That is possible. I will need time to prepare the new example for you.

Hi Aleksei,

is it possible to change linkSet attribute like color based on members links. I am tring to change linkSet color if one of the member status shows down.

sanjaysingh12
Level 1
Level 1

Thanks,

BBBootstrap