SDN 下用ODL实现QoS保障(5)-获取拓扑

来源:互联网 发布:英语视频翻译软件 编辑:程序博客网 时间:2024/05/21 22:49

在postman里面发送如下请求

URL=http://127.0.0.1:8181/restconf/operational/network-topology:network-topology/topology/flow:1
ACTION=GET
其他参数与以前保持一致

返回结果如下:

{    "topology": [        {            "topology-id": "flow:1",            "node": [                {                    "node-id": "openflow:3",                    "opendaylight-topology-inventory:inventory-node-ref": "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:3']",                    "termination-point": [                        {                            "tp-id": "openflow:3:5",                            "opendaylight-topology-inventory:inventory-node-connector-ref": "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:3']/opendaylight-inventory:node-connector[opendaylight-inventory:id='openflow:3:5']"                        },                        {                            "tp-id": "openflow:3:LOCAL",                            "opendaylight-topology-inventory:inventory-node-connector-ref": "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:3']/opendaylight-inventory:node-connector[opendaylight-inventory:id='openflow:3:LOCAL']"                        },                        {                            "tp-id": "openflow:3:2",                            "opendaylight-topology-inventory:inventory-node-connector-ref": "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:3']/opendaylight-inventory:node-connector[opendaylight-inventory:id='openflow:3:2']"                        },                        {                            "tp-id": "openflow:3:1",                            "opendaylight-topology-inventory:inventory-node-connector-ref": "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:3']/opendaylight-inventory:node-connector[opendaylight-inventory:id='openflow:3:1']"                        },                        {                            "tp-id": "openflow:3:4",                            "opendaylight-topology-inventory:inventory-node-connector-ref": "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:3']/opendaylight-inventory:node-connector[opendaylight-inventory:id='openflow:3:4']"                        },                        {                            "tp-id": "openflow:3:3",                            "opendaylight-topology-inventory:inventory-node-connector-ref": "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:3']/opendaylight-inventory:node-connector[opendaylight-inventory:id='openflow:3:3']"                        }                    ]                },                {                    "node-id": "openflow:4",                    "opendaylight-topology-inventory:inventory-node-ref": "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:4']"                },                {                    "node-id": "openflow:1",                    "opendaylight-topology-inventory:inventory-node-ref": "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:1']"                },                {                    "node-id": "openflow:2",                    "opendaylight-topology-inventory:inventory-node-ref": "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:2']",                    "termination-point": [                        {                            "tp-id": "openflow:2:1",                            "opendaylight-topology-inventory:inventory-node-connector-ref": "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:2']/opendaylight-inventory:node-connector[opendaylight-inventory:id='openflow:2:1']"                        },                        {                            "tp-id": "openflow:2:LOCAL",                            "opendaylight-topology-inventory:inventory-node-connector-ref": "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:2']/opendaylight-inventory:node-connector[opendaylight-inventory:id='openflow:2:LOCAL']"                        },                        {                            "tp-id": "openflow:2:3",                            "opendaylight-topology-inventory:inventory-node-connector-ref": "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:2']/opendaylight-inventory:node-connector[opendaylight-inventory:id='openflow:2:3']"                        },                        {                            "tp-id": "openflow:2:2",                            "opendaylight-topology-inventory:inventory-node-connector-ref": "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:2']/opendaylight-inventory:node-connector[opendaylight-inventory:id='openflow:2:2']"                        },                        {                            "tp-id": "openflow:2:5",                            "opendaylight-topology-inventory:inventory-node-connector-ref": "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:2']/opendaylight-inventory:node-connector[opendaylight-inventory:id='openflow:2:5']"                        },                        {                            "tp-id": "openflow:2:4",                            "opendaylight-topology-inventory:inventory-node-connector-ref": "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:2']/opendaylight-inventory:node-connector[opendaylight-inventory:id='openflow:2:4']"                        }                    ]                },                {                    "node-id": "host:00:00:00:00:00:02",                    "termination-point": [                        {                            "tp-id": "host:00:00:00:00:00:02"                        }                    ],                    "host-tracker-service:attachment-points": [                        {                            "tp-id": "openflow:1:2",                            "corresponding-tp": "host:00:00:00:00:00:02",                            "active": true                        }                    ],                    "host-tracker-service:id": "00:00:00:00:00:02",                    "host-tracker-service:addresses": [                        {                            "id": 1,                            "mac": "00:00:00:00:00:02",                            "last-seen": 1510303270225,                            "ip": "10.0.0.2",                            "first-seen": 1510303270225                        }                    ]                },                {                    "node-id": "host:00:00:00:00:00:01",                    "termination-point": [                        {                            "tp-id": "host:00:00:00:00:00:01"                        }                    ],                    "host-tracker-service:attachment-points": [                        {                            "tp-id": "openflow:1:1",                            "corresponding-tp": "host:00:00:00:00:00:01",                            "active": true                        }                    ],                    "host-tracker-service:id": "00:00:00:00:00:01",                    "host-tracker-service:addresses": [                        {                            "id": 0,                            "mac": "00:00:00:00:00:01",                            "last-seen": 1510303270184,                            "ip": "10.0.0.1",                            "first-seen": 1510303270184                        }                    ]                },                {                    "node-id": "host:00:00:00:00:00:06",                    "termination-point": [                        {                            "tp-id": "host:00:00:00:00:00:06"                        }                    ],                    "host-tracker-service:attachment-points": [                        {                            "tp-id": "openflow:3:2",                            "corresponding-tp": "host:00:00:00:00:00:06",                            "active": true                        }                    ],                    "host-tracker-service:id": "00:00:00:00:00:06",                    "host-tracker-service:addresses": [                        {                            "id": 5,                            "mac": "00:00:00:00:00:06",                            "last-seen": 1510303270726,                            "ip": "10.0.0.6",                            "first-seen": 1510303270726                        }                    ]                },                {                    "node-id": "host:00:00:00:00:00:05",                    "termination-point": [                        {                            "tp-id": "host:00:00:00:00:00:05"                        }                    ],                    "host-tracker-service:attachment-points": [                        {                            "tp-id": "openflow:3:1",                            "corresponding-tp": "host:00:00:00:00:00:05",                            "active": true                        }                    ],                    "host-tracker-service:id": "00:00:00:00:00:05",                    "host-tracker-service:addresses": [                        {                            "id": 4,                            "mac": "00:00:00:00:00:05",                            "last-seen": 1510303270554,                            "ip": "10.0.0.5",                            "first-seen": 1510303270554                        }                    ]                },                {                    "node-id": "openflow:5",                    "opendaylight-topology-inventory:inventory-node-ref": "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:5']",                    "termination-point": [                        {                            "tp-id": "openflow:5:4",                            "opendaylight-topology-inventory:inventory-node-connector-ref": "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:5']/opendaylight-inventory:node-connector[opendaylight-inventory:id='openflow:5:4']"                        },                        {                            "tp-id": "openflow:5:LOCAL",                            "opendaylight-topology-inventory:inventory-node-connector-ref": "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:5']/opendaylight-inventory:node-connector[opendaylight-inventory:id='openflow:5:LOCAL']"                        },                        {                            "tp-id": "openflow:5:3",                            "opendaylight-topology-inventory:inventory-node-connector-ref": "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:5']/opendaylight-inventory:node-connector[opendaylight-inventory:id='openflow:5:3']"                        },                        {                            "tp-id": "openflow:5:2",                            "opendaylight-topology-inventory:inventory-node-connector-ref": "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:5']/opendaylight-inventory:node-connector[opendaylight-inventory:id='openflow:5:2']"                        },                        {                            "tp-id": "openflow:5:1",                            "opendaylight-topology-inventory:inventory-node-connector-ref": "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:5']/opendaylight-inventory:node-connector[opendaylight-inventory:id='openflow:5:1']"                        }                    ]                },                {                    "node-id": "host:00:00:00:00:00:04",                    "termination-point": [                        {                            "tp-id": "host:00:00:00:00:00:04"                        }                    ],                    "host-tracker-service:attachment-points": [                        {                            "tp-id": "openflow:2:2",                            "corresponding-tp": "host:00:00:00:00:00:04",                            "active": true                        }                    ],                    "host-tracker-service:id": "00:00:00:00:00:04",                    "host-tracker-service:addresses": [                        {                            "id": 3,                            "mac": "00:00:00:00:00:04",                            "last-seen": 1510303270415,                            "ip": "10.0.0.4",                            "first-seen": 1510303270415                        }                    ]                },                {                    "node-id": "host:00:00:00:00:00:03",                    "termination-point": [                        {                            "tp-id": "host:00:00:00:00:00:03"                        }                    ],                    "host-tracker-service:attachment-points": [                        {                            "tp-id": "openflow:2:1",                            "corresponding-tp": "host:00:00:00:00:00:03",                            "active": true                        }                    ],                    "host-tracker-service:id": "00:00:00:00:00:03",                    "host-tracker-service:addresses": [                        {                            "id": 2,                            "mac": "00:00:00:00:00:03",                            "last-seen": 1510303270281,                            "ip": "10.0.0.3",                            "first-seen": 1510303270281                        }                    ]                },                {                    "node-id": "host:00:00:00:00:00:08",                    "termination-point": [                        {                            "tp-id": "host:00:00:00:00:00:08"                        }                    ],                    "host-tracker-service:attachment-points": [                        {                            "tp-id": "openflow:4:2",                            "corresponding-tp": "host:00:00:00:00:00:08",                            "active": true                        }                    ],                    "host-tracker-service:id": "00:00:00:00:00:08",                    "host-tracker-service:addresses": [                        {                            "id": 7,                            "mac": "00:00:00:00:00:08",                            "last-seen": 1510303271138,                            "ip": "10.0.0.8",                            "first-seen": 1510303271138                        }                    ]                },                {                    "node-id": "host:00:00:00:00:00:07",                    "termination-point": [                        {                            "tp-id": "host:00:00:00:00:00:07"                        }                    ],                    "host-tracker-service:attachment-points": [                        {                            "tp-id": "openflow:4:1",                            "corresponding-tp": "host:00:00:00:00:00:07",                            "active": true                        }                    ],                    "host-tracker-service:id": "00:00:00:00:00:07",                    "host-tracker-service:addresses": [                        {                            "id": 6,                            "mac": "00:00:00:00:00:07",                            "last-seen": 1510303270916,                            "ip": "10.0.0.7",                            "first-seen": 1510303270916                        }                    ]                }            ],            "link": [                {                    "link-id": "openflow:2:2/host:00:00:00:00:00:04",                    "destination": {                        "dest-node": "host:00:00:00:00:00:04",                        "dest-tp": "host:00:00:00:00:00:04"                    },                    "source": {                        "source-tp": "openflow:2:2",                        "source-node": "openflow:2"                    }                },                {                    "link-id": "host:00:00:00:00:00:02/openflow:1:2",                    "destination": {                        "dest-node": "openflow:1",                        "dest-tp": "openflow:1:2"                    },                    "source": {                        "source-tp": "host:00:00:00:00:00:02",                        "source-node": "host:00:00:00:00:00:02"                    }                },                {                    "link-id": "openflow:4:1/host:00:00:00:00:00:07",                    "destination": {                        "dest-node": "host:00:00:00:00:00:07",                        "dest-tp": "host:00:00:00:00:00:07"                    },                    "source": {                        "source-tp": "openflow:4:1",                        "source-node": "openflow:4"                    }                },                {                    "link-id": "host:00:00:00:00:00:01/openflow:1:1",                    "destination": {                        "dest-node": "openflow:1",                        "dest-tp": "openflow:1:1"                    },                    "source": {                        "source-tp": "host:00:00:00:00:00:01",                        "source-node": "host:00:00:00:00:00:01"                    }                },                {                    "link-id": "openflow:4:4",                    "destination": {                        "dest-node": "openflow:1",                        "dest-tp": "openflow:1:4"                    },                    "source": {                        "source-tp": "openflow:4:4",                        "source-node": "openflow:4"                    }                },                {                    "link-id": "openflow:3:5",                    "destination": {                        "dest-node": "openflow:5",                        "dest-tp": "openflow:5:3"                    },                    "source": {                        "source-tp": "openflow:3:5",                        "source-node": "openflow:3"                    }                },                {                    "link-id": "openflow:5:3",                    "destination": {                        "dest-node": "openflow:3",                        "dest-tp": "openflow:3:5"                    },                    "source": {                        "source-tp": "openflow:5:3",                        "source-node": "openflow:5"                    }                },                {                    "link-id": "openflow:5:2",                    "destination": {                        "dest-node": "openflow:2",                        "dest-tp": "openflow:2:5"                    },                    "source": {                        "source-tp": "openflow:5:2",                        "source-node": "openflow:5"                    }                },                {                    "link-id": "openflow:2:5",                    "destination": {                        "dest-node": "openflow:5",                        "dest-tp": "openflow:5:2"                    },                    "source": {                        "source-tp": "openflow:2:5",                        "source-node": "openflow:2"                    }                },                {                    "link-id": "openflow:3:4",                    "destination": {                        "dest-node": "openflow:4",                        "dest-tp": "openflow:4:3"                    },                    "source": {                        "source-tp": "openflow:3:4",                        "source-node": "openflow:3"                    }                },                {                    "link-id": "openflow:4:3",                    "destination": {                        "dest-node": "openflow:3",                        "dest-tp": "openflow:3:4"                    },                    "source": {                        "source-tp": "openflow:4:3",                        "source-node": "openflow:4"                    }                },                {                    "link-id": "host:00:00:00:00:00:05/openflow:3:1",                    "destination": {                        "dest-node": "openflow:3",                        "dest-tp": "openflow:3:1"                    },                    "source": {                        "source-tp": "host:00:00:00:00:00:05",                        "source-node": "host:00:00:00:00:00:05"                    }                },                {                    "link-id": "openflow:4:5",                    "destination": {                        "dest-node": "openflow:5",                        "dest-tp": "openflow:5:4"                    },                    "source": {                        "source-tp": "openflow:4:5",                        "source-node": "openflow:4"                    }                },                {                    "link-id": "openflow:5:4",                    "destination": {                        "dest-node": "openflow:4",                        "dest-tp": "openflow:4:5"                    },                    "source": {                        "source-tp": "openflow:5:4",                        "source-node": "openflow:5"                    }                },                {                    "link-id": "openflow:1:3",                    "destination": {                        "dest-node": "openflow:2",                        "dest-tp": "openflow:2:3"                    },                    "source": {                        "source-tp": "openflow:1:3",                        "source-node": "openflow:1"                    }                },                {                    "link-id": "openflow:1:1/host:00:00:00:00:00:01",                    "destination": {                        "dest-node": "host:00:00:00:00:00:01",                        "dest-tp": "host:00:00:00:00:00:01"                    },                    "source": {                        "source-tp": "openflow:1:1",                        "source-node": "openflow:1"                    }                },                {                    "link-id": "openflow:3:1/host:00:00:00:00:00:05",                    "destination": {                        "dest-node": "host:00:00:00:00:00:05",                        "dest-tp": "host:00:00:00:00:00:05"                    },                    "source": {                        "source-tp": "openflow:3:1",                        "source-node": "openflow:3"                    }                },                {                    "link-id": "openflow:1:5",                    "destination": {                        "dest-node": "openflow:5",                        "dest-tp": "openflow:5:1"                    },                    "source": {                        "source-tp": "openflow:1:5",                        "source-node": "openflow:1"                    }                },                {                    "link-id": "openflow:5:1",                    "destination": {                        "dest-node": "openflow:1",                        "dest-tp": "openflow:1:5"                    },                    "source": {                        "source-tp": "openflow:5:1",                        "source-node": "openflow:5"                    }                },                {                    "link-id": "openflow:3:3",                    "destination": {                        "dest-node": "openflow:2",                        "dest-tp": "openflow:2:4"                    },                    "source": {                        "source-tp": "openflow:3:3",                        "source-node": "openflow:3"                    }                },                {                    "link-id": "openflow:2:4",                    "destination": {                        "dest-node": "openflow:3",                        "dest-tp": "openflow:3:3"                    },                    "source": {                        "source-tp": "openflow:2:4",                        "source-node": "openflow:2"                    }                },                {                    "link-id": "openflow:1:4",                    "destination": {                        "dest-node": "openflow:4",                        "dest-tp": "openflow:4:4"                    },                    "source": {                        "source-tp": "openflow:1:4",                        "source-node": "openflow:1"                    }                },                {                    "link-id": "openflow:2:3",                    "destination": {                        "dest-node": "openflow:1",                        "dest-tp": "openflow:1:3"                    },                    "source": {                        "source-tp": "openflow:2:3",                        "source-node": "openflow:2"                    }                },                {                    "link-id": "host:00:00:00:00:00:04/openflow:2:2",                    "destination": {                        "dest-node": "openflow:2",                        "dest-tp": "openflow:2:2"                    },                    "source": {                        "source-tp": "host:00:00:00:00:00:04",                        "source-node": "host:00:00:00:00:00:04"                    }                },                {                    "link-id": "host:00:00:00:00:00:03/openflow:2:1",                    "destination": {                        "dest-node": "openflow:2",                        "dest-tp": "openflow:2:1"                    },                    "source": {                        "source-tp": "host:00:00:00:00:00:03",                        "source-node": "host:00:00:00:00:00:03"                    }                },                {                    "link-id": "openflow:2:1/host:00:00:00:00:00:03",                    "destination": {                        "dest-node": "host:00:00:00:00:00:03",                        "dest-tp": "host:00:00:00:00:00:03"                    },                    "source": {                        "source-tp": "openflow:2:1",                        "source-node": "openflow:2"                    }                },                {                    "link-id": "host:00:00:00:00:00:06/openflow:3:2",                    "destination": {                        "dest-node": "openflow:3",                        "dest-tp": "openflow:3:2"                    },                    "source": {                        "source-tp": "host:00:00:00:00:00:06",                        "source-node": "host:00:00:00:00:00:06"                    }                },                {                    "link-id": "host:00:00:00:00:00:07/openflow:4:1",                    "destination": {                        "dest-node": "openflow:4",                        "dest-tp": "openflow:4:1"                    },                    "source": {                        "source-tp": "host:00:00:00:00:00:07",                        "source-node": "host:00:00:00:00:00:07"                    }                },                {                    "link-id": "host:00:00:00:00:00:08/openflow:4:2",                    "destination": {                        "dest-node": "openflow:4",                        "dest-tp": "openflow:4:2"                    },                    "source": {                        "source-tp": "host:00:00:00:00:00:08",                        "source-node": "host:00:00:00:00:00:08"                    }                },                {                    "link-id": "openflow:4:2/host:00:00:00:00:00:08",                    "destination": {                        "dest-node": "host:00:00:00:00:00:08",                        "dest-tp": "host:00:00:00:00:00:08"                    },                    "source": {                        "source-tp": "openflow:4:2",                        "source-node": "openflow:4"                    }                },                {                    "link-id": "openflow:1:2/host:00:00:00:00:00:02",                    "destination": {                        "dest-node": "host:00:00:00:00:00:02",                        "dest-tp": "host:00:00:00:00:00:02"                    },                    "source": {                        "source-tp": "openflow:1:2",                        "source-node": "openflow:1"                    }                },                {                    "link-id": "openflow:3:2/host:00:00:00:00:00:06",                    "destination": {                        "dest-node": "host:00:00:00:00:00:06",                        "dest-tp": "host:00:00:00:00:00:06"                    },                    "source": {                        "source-tp": "openflow:3:2",                        "source-node": "openflow:3"                    }                }            ]        }    ]}

在返回结果的link节点,我们可以看到其中罗列出了主机或者交换机的一个端口与另一个交换机或者主机的端口之间连接关系。
这里写图片描述
用这些数据我们可以轻易的画出,交换机之间的拓扑关系如下图所示。

这里写图片描述

至此,获取拓扑就告一段落了。

原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 联通合约机丢了怎么办 集团v网取消不了怎么办 退订了集团v网怎么办 苹果id两个串号怎么办 无线固话的号码怎么办 手机电话键没了怎么办 翼支付密码忘了怎么办 滴滴驾龄不够3年怎么办 百度云下的太慢怎么办 百度云下的好慢怎么办 网盘下载速度慢怎么办 4g移动卡网速慢怎么办 天翼校园开wifi怎么办 校园卡不给销户怎么办 吃腻了难受恶心怎么办 深夜吃撑了难受怎么办 吃撑了肚子难受怎么办 喝水喝撑了难受怎么办 晚饭吃撑了难受怎么办 吃多了肚子难受怎么办 电信4g信号变3g怎么办 五险交了3月离职怎么办 怎么办工行携程灵通卡 易买得消费卡怎么办 贷款回执单丢了怎么办 医院挂号过号了怎么办 脑子里总是胡思乱想睡不着怎么办 被妹夫给睡了怎么办 被妹夫抱了下怎么办 最里面牙齿烂了怎么办 老公有外遇不承认怎么办 对老公疑心太重怎么办 当你发现老公出轨怎么办 发现自己老婆出轨了怎么办 笔袋密码忘记了怎么办 海关锁密码忘了怎么办 800度近视献了血怎么办 当老公有了外遇妻子该怎么办 妻子有外遇我该怎么办 喜欢拔粗的头发怎么办 小腿长水泡很痒怎么办