Merge pull request #9938 from Orange-OpenSource/isis_ls

isisd: Add Link State Traffic Engineering support
This commit is contained in:
Russ White 2022-01-18 10:12:08 -05:00 committed by GitHub
commit 18ed776ca2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
45 changed files with 7740 additions and 311 deletions

View File

@ -318,6 +318,11 @@ Traffic Engineering
.. note::
IS-IS-TE supports RFC 5305 (base TE), RFC 6119 (IPv6) and RFC 7810 / 8570
(Extended Metric) with or without Multi-Topology. All Traffic Engineering
information are stored in a database formally named TED. However, best
acccuracy is provided without Multi-Topology due to inconsistency of Traffic
Engineering Advertisement of 3rd party commercial routers when MT is enabled.
At this time, FRR offers partial support for some of the routing protocol
extensions that can be used with MPLS-TE. FRR does not currently support a
complete RSVP-TE solution.
@ -330,6 +335,15 @@ Traffic Engineering
Configure stable IP address for MPLS-TE.
.. clicmd:: mpls-te router-address ipv6 <X:X::X:X>
Configure stable IPv6 address for MPLS-TE.
.. clicmd:: mpls-te export
Export Traffic Engineering DataBase to other daemons through the ZAPI
Opaque Link State messages.
.. clicmd:: show isis mpls-te interface
.. clicmd:: show isis mpls-te interface INTERFACE
@ -340,6 +354,16 @@ Traffic Engineering
Show Traffic Engineering router parameters.
.. clicmd:: show isis [vrf <NAME|all>] mpls-te database [detail|json]
.. clicmd:: show isis [vrf <NAME|all>] mpls-te database vertex [WORD] [detail|json]
.. clicmd:: show isis [vrf <NAME|all>] mpls-te database edge [A.B.C.D|X:X::X:X] [detail|json]
.. clicmd:: show isis [vrf <NAME|all>] mpls-te database subnet [A.B.C.D/M|X:X::X:X/M] [detail|json]
Show Traffic Engineering Database
.. seealso::
:ref:`ospf-traffic-engineering`
@ -445,6 +469,10 @@ Debugging ISIS
Update related packets.
.. clicmd:: debug isis te-events
IS-IS Traffic Engineering events
.. clicmd:: debug isis sr-events

View File

@ -168,7 +168,7 @@ void isis_delete_adj(void *arg)
XFREE(MTYPE_ISIS_ADJACENCY_INFO, adj->area_addresses);
XFREE(MTYPE_ISIS_ADJACENCY_INFO, adj->ipv4_addresses);
XFREE(MTYPE_ISIS_ADJACENCY_INFO, adj->ipv6_addresses);
XFREE(MTYPE_ISIS_ADJACENCY_INFO, adj->ll_ipv6_addrs);
adj_mt_finish(adj);
list_delete(&adj->adj_sids);
@ -420,11 +420,11 @@ void isis_adj_print(struct isis_adjacency *adj)
zlog_debug("%pI4", &adj->ipv4_addresses[i]);
}
if (adj->ipv6_address_count) {
if (adj->ll_ipv6_count) {
zlog_debug("IPv6 Address(es):");
for (unsigned int i = 0; i < adj->ipv6_address_count; i++) {
for (unsigned int i = 0; i < adj->ll_ipv6_count; i++) {
char buf[INET6_ADDRSTRLEN];
inet_ntop(AF_INET6, &adj->ipv6_addresses[i], buf,
inet_ntop(AF_INET6, &adj->ll_ipv6_addrs[i], buf,
sizeof(buf));
zlog_debug("%s", buf);
}
@ -583,12 +583,21 @@ void isis_adj_print_vty(struct isis_adjacency *adj, struct vty *vty,
vty_out(vty, " %pI4\n",
&adj->ipv4_addresses[i]);
}
if (adj->ipv6_address_count) {
if (adj->ll_ipv6_count) {
vty_out(vty, " IPv6 Address(es):\n");
for (unsigned int i = 0; i < adj->ipv6_address_count;
for (unsigned int i = 0; i < adj->ll_ipv6_count; i++) {
char buf[INET6_ADDRSTRLEN];
inet_ntop(AF_INET6, &adj->ll_ipv6_addrs[i],
buf, sizeof(buf));
vty_out(vty, " %s\n", buf);
}
}
if (adj->global_ipv6_count) {
vty_out(vty, " Global IPv6 Address(es):\n");
for (unsigned int i = 0; i < adj->global_ipv6_count;
i++) {
char buf[INET6_ADDRSTRLEN];
inet_ntop(AF_INET6, &adj->ipv6_addresses[i],
inet_ntop(AF_INET6, &adj->global_ipv6_addrs[i],
buf, sizeof(buf));
vty_out(vty, " %s\n", buf);
}

View File

@ -88,8 +88,10 @@ struct isis_adjacency {
struct in_addr *ipv4_addresses;
unsigned int ipv4_address_count;
struct in_addr router_address;
struct in6_addr *ipv6_addresses;
unsigned int ipv6_address_count;
struct in6_addr *ll_ipv6_addrs; /* Link local IPv6 neighbor address */
unsigned int ll_ipv6_count;
struct in6_addr *global_ipv6_addrs; /* Global IPv6 neighbor address */
unsigned int global_ipv6_count;
struct in6_addr router_address6;
uint8_t prio[ISIS_LEVELS]; /* priorityOfNeighbour for DIS */
int circuit_t; /* from hello PDU hdr */
@ -127,9 +129,11 @@ void isis_adj_process_threeway(struct isis_adjacency *adj,
enum isis_adj_usage adj_usage);
DECLARE_HOOK(isis_adj_state_change_hook, (struct isis_adjacency *adj), (adj));
DECLARE_HOOK(isis_adj_ip_enabled_hook,
(struct isis_adjacency *adj, int family), (adj, family));
(struct isis_adjacency * adj, int family, bool global),
(adj, family, global));
DECLARE_HOOK(isis_adj_ip_disabled_hook,
(struct isis_adjacency *adj, int family), (adj, family));
(struct isis_adjacency * adj, int family, bool global),
(adj, family, global));
void isis_log_adj_change(struct isis_adjacency *adj,
enum isis_adj_state old_state,
enum isis_adj_state new_state, const char *reason);

View File

@ -81,7 +81,7 @@ static void bfd_handle_adj_up(struct isis_adjacency *adj)
*/
if (circuit->ipv6_router
&& (listcount(circuit->ipv6_link) == 0
|| adj->ipv6_address_count == 0)) {
|| adj->ll_ipv6_count == 0)) {
if (IS_DEBUG_BFD)
zlog_debug(
"ISIS-BFD: skipping BFD initialization on adjacency with %s because IPv6 is enabled but not ready",
@ -93,9 +93,9 @@ static void bfd_handle_adj_up(struct isis_adjacency *adj)
* If IS-IS is enabled for both IPv4 and IPv6 on the circuit, prefer
* creating a BFD session over IPv6.
*/
if (circuit->ipv6_router && adj->ipv6_address_count) {
if (circuit->ipv6_router && adj->ll_ipv6_count) {
family = AF_INET6;
dst_ip.ipv6 = adj->ipv6_addresses[0];
dst_ip.ipv6 = adj->ll_ipv6_addrs[0];
local_ips = circuit->ipv6_link;
if (!local_ips || list_isempty(local_ips)) {
if (IS_DEBUG_BFD)
@ -181,10 +181,11 @@ void isis_bfd_circuit_cmd(struct isis_circuit *circuit)
}
}
static int bfd_handle_adj_ip_enabled(struct isis_adjacency *adj, int family)
static int bfd_handle_adj_ip_enabled(struct isis_adjacency *adj, int family,
bool global)
{
if (family != AF_INET6)
if (family != AF_INET6 || global)
return 0;
if (adj->bfd_session)

View File

@ -335,8 +335,16 @@ void isis_circuit_add_addr(struct isis_circuit *circuit,
if (IN6_IS_ADDR_LINKLOCAL(&ipv6->prefix))
listnode_add(circuit->ipv6_link, ipv6);
else
else {
listnode_add(circuit->ipv6_non_link, ipv6);
/* Update Local IPv6 address param. if MPLS TE is on */
if (circuit->ext && circuit->area
&& IS_MPLS_TE(circuit->area->mta)) {
IPV6_ADDR_COPY(&circuit->ext->local_addr6,
&ipv6->prefix);
SET_SUBTLV(circuit->ext, EXT_LOCAL_ADDR6);
}
}
if (circuit->area)
lsp_regenerate_schedule(circuit->area, circuit->is_type,
0);

View File

@ -1140,6 +1140,43 @@ void cli_show_isis_mpls_te_router_addr(struct vty *vty,
yang_dnode_get_string(dnode, NULL));
}
/*
* XPath: /frr-isisd:isis/instance/mpls-te/router-address-v6
*/
DEFPY_YANG(isis_mpls_te_router_addr_v6, isis_mpls_te_router_addr_v6_cmd,
"mpls-te router-address ipv6 X:X::X:X",
MPLS_TE_STR
"Stable IP address of the advertising router\n"
"IPv6 address\n"
"MPLS-TE router address in IPv6 address format\n")
{
nb_cli_enqueue_change(vty, "./mpls-te/router-address-v6", NB_OP_MODIFY,
ipv6_str);
return nb_cli_apply_changes(vty, NULL);
}
DEFPY_YANG(no_isis_mpls_te_router_addr_v6, no_isis_mpls_te_router_addr_v6_cmd,
"no mpls-te router-address ipv6 [X:X::X:X]",
NO_STR MPLS_TE_STR
"Delete IP address of the advertising router\n"
"IPv6 address\n"
"MPLS-TE router address in IPv6 address format\n")
{
nb_cli_enqueue_change(vty, "./mpls-te/router-address-v6", NB_OP_DESTROY,
NULL);
return nb_cli_apply_changes(vty, NULL);
}
void cli_show_isis_mpls_te_router_addr_ipv6(struct vty *vty,
const struct lyd_node *dnode,
bool show_defaults)
{
vty_out(vty, " mpls-te router-address ipv6 %s\n",
yang_dnode_get_string(dnode, NULL));
}
DEFPY_YANG(isis_mpls_te_inter_as, isis_mpls_te_inter_as_cmd,
"[no] mpls-te inter-as [level-1|level-1-2|level-2-only]",
NO_STR MPLS_TE_STR
@ -1152,6 +1189,36 @@ DEFPY_YANG(isis_mpls_te_inter_as, isis_mpls_te_inter_as_cmd,
return CMD_SUCCESS;
}
/*
* XPath: /frr-isisd:isis/instance/mpls-te/export
*/
DEFPY_YANG(isis_mpls_te_export, isis_mpls_te_export_cmd, "mpls-te export",
MPLS_TE_STR "Enable export of MPLS-TE Link State information\n")
{
nb_cli_enqueue_change(vty, "./mpls-te/export", NB_OP_MODIFY, "true");
return nb_cli_apply_changes(vty, NULL);
}
DEFPY_YANG(no_isis_mpls_te_export, no_isis_mpls_te_export_cmd,
"no mpls-te export",
NO_STR MPLS_TE_STR
"Disable export of MPLS-TE Link State information\n")
{
nb_cli_enqueue_change(vty, "./mpls-te/export", NB_OP_MODIFY, "false");
return nb_cli_apply_changes(vty, NULL);
}
void cli_show_isis_mpls_te_export(struct vty *vty, const struct lyd_node *dnode,
bool show_defaults)
{
if (!yang_dnode_get_bool(dnode, NULL))
vty_out(vty, " no");
vty_out(vty, " mpls-te export\n");
}
/*
* XPath: /frr-isisd:isis/instance/default-information-originate
*/
@ -3125,7 +3192,11 @@ void isis_cli_init(void)
install_element(ISIS_NODE, &no_isis_mpls_te_on_cmd);
install_element(ISIS_NODE, &isis_mpls_te_router_addr_cmd);
install_element(ISIS_NODE, &no_isis_mpls_te_router_addr_cmd);
install_element(ISIS_NODE, &isis_mpls_te_router_addr_v6_cmd);
install_element(ISIS_NODE, &no_isis_mpls_te_router_addr_v6_cmd);
install_element(ISIS_NODE, &isis_mpls_te_inter_as_cmd);
install_element(ISIS_NODE, &isis_mpls_te_export_cmd);
install_element(ISIS_NODE, &no_isis_mpls_te_export_cmd);
install_element(ISIS_NODE, &isis_default_originate_cmd);
install_element(ISIS_NODE, &isis_redistribute_cmd);

View File

@ -1443,9 +1443,8 @@ static mpls_label_t rlfa_nexthop_label(struct isis_spftree *spftree,
}
break;
case AF_INET6:
for (unsigned int j = 0; j < adj->ipv6_address_count;
j++) {
struct in6_addr addr = adj->ipv6_addresses[j];
for (unsigned int j = 0; j < adj->ll_ipv6_count; j++) {
struct in6_addr addr = adj->ll_ipv6_addrs[j];
if (!IPV6_ADDR_SAME(
&addr,

View File

@ -124,6 +124,8 @@ static void lsp_destroy(struct isis_lsp *lsp)
ISIS_FLAGS_CLEAR_ALL(lsp->SSNflags);
isis_te_lsp_event(lsp, LSP_DEL);
lsp_clear_data(lsp);
if (!LSP_FRAGMENT(lsp->hdr.lsp_id)) {
@ -335,6 +337,7 @@ void lsp_inc_seqno(struct isis_lsp *lsp, uint32_t seqno)
lsp_pack_pdu(lsp);
isis_spf_schedule(lsp->area, lsp->level);
isis_te_lsp_event(lsp, LSP_INC);
}
static void lsp_purge_add_poi(struct isis_lsp *lsp,
@ -570,8 +573,10 @@ void lsp_update(struct isis_lsp *lsp, struct isis_lsp_hdr *hdr,
lsp_link_fragment(lsp, lsp0);
}
if (lsp->hdr.seqno)
if (lsp->hdr.seqno) {
isis_spf_schedule(lsp->area, lsp->level);
isis_te_lsp_event(lsp, LSP_UPD);
}
}
/* creation of LSP directly from what we received */
@ -636,8 +641,10 @@ struct isis_lsp *lsp_new(struct isis_area *area, uint8_t *lsp_id,
void lsp_insert(struct lspdb_head *head, struct isis_lsp *lsp)
{
lspdb_add(head, lsp);
if (lsp->hdr.seqno)
if (lsp->hdr.seqno) {
isis_spf_schedule(lsp->area, lsp->level);
isis_te_lsp_event(lsp, LSP_ADD);
}
}
/*
@ -1030,6 +1037,10 @@ static void lsp_build(struct isis_lsp *lsp, struct isis_area *area)
cap.srlb.lower_bound = srdb->config.srlb_lower_bound;
/* And finally MSD */
cap.msd = srdb->config.msd;
} else {
/* Disable SR Algorithm */
cap.algo[0] = SR_ALGORITHM_UNSET;
cap.algo[1] = SR_ALGORITHM_UNSET;
}
isis_tlvs_set_router_capability(lsp->tlvs, &cap);
@ -1067,6 +1078,14 @@ static void lsp_build(struct isis_lsp *lsp, struct isis_area *area)
area->area_tag);
}
if (IS_MPLS_TE(area->mta)
&& !IN6_IS_ADDR_UNSPECIFIED(&area->mta->router_id_ipv6)) {
lsp_debug("ISIS (%s): Adding IPv6 TE Router ID tlv.",
area->area_tag);
isis_tlvs_set_te_router_id_ipv6(lsp->tlvs,
&area->mta->router_id_ipv6);
}
lsp_debug("ISIS (%s): Adding circuit specific information.",
area->area_tag);
@ -1601,6 +1620,7 @@ static void lsp_build_pseudo(struct isis_lsp *lsp, struct isis_circuit *circuit,
struct list *adj_list;
struct listnode *node;
struct isis_area *area = circuit->area;
uint16_t mtid;
lsp_clear_data(lsp);
lsp->tlvs = isis_alloc_tlvs();
@ -1630,8 +1650,11 @@ static void lsp_build_pseudo(struct isis_lsp *lsp, struct isis_circuit *circuit,
LSP_PSEUDO_ID(ne_id));
}
if (circuit->area->newmetric) {
isis_tlvs_add_extended_reach(lsp->tlvs, ISIS_MT_IPV4_UNICAST,
ne_id, 0, NULL);
if (area_is_mt(circuit->area))
mtid = ISIS_MT_IPV4_UNICAST;
else
mtid = ISIS_MT_DISABLE;
isis_tlvs_add_extended_reach(lsp->tlvs, mtid, ne_id, 0, NULL);
lsp_debug(
"ISIS (%s): Adding %s.%02x as te-style neighbor (self)",
area->area_tag, sysid_print(ne_id),
@ -2000,6 +2023,7 @@ int lsp_tick(struct thread *thread)
/* 7.3.16.4 c) record the time to purge
* FIXME */
isis_spf_schedule(lsp->area, lsp->level);
isis_te_lsp_event(lsp, LSP_TICK);
}
if (lsp->age_out == 0) {
@ -2154,7 +2178,7 @@ int isis_lsp_iterate_ip_reach(struct isis_lsp *lsp, int family, uint16_t mtid,
if (lsp->hdr.seqno == 0 || lsp->hdr.rem_lifetime == 0)
return LSP_ITER_CONTINUE;
/* Parse main LSP. */
/* Parse LSP */
if (lsp->tlvs) {
if (!fabricd && !pseudo_lsp && family == AF_INET
&& mtid == ISIS_MT_IPV4_UNICAST) {
@ -2224,13 +2248,17 @@ int isis_lsp_iterate_ip_reach(struct isis_lsp *lsp, int family, uint16_t mtid,
}
}
/* Parse LSP fragments. */
for (ALL_LIST_ELEMENTS_RO(lsp->lspu.frags, node, frag)) {
if (!frag->tlvs)
continue;
/* Parse LSP fragments if it is not a fragment itself */
if (!LSP_FRAGMENT(lsp->hdr.lsp_id))
for (ALL_LIST_ELEMENTS_RO(lsp->lspu.frags, node, frag)) {
if (!frag->tlvs)
continue;
isis_lsp_iterate_ip_reach(frag, family, mtid, cb, arg);
}
if (isis_lsp_iterate_ip_reach(frag, family, mtid, cb,
arg)
== LSP_ITER_STOP)
return LSP_ITER_STOP;
}
return LSP_ITER_CONTINUE;
}
@ -2251,7 +2279,7 @@ int isis_lsp_iterate_is_reach(struct isis_lsp *lsp, uint16_t mtid,
if (lsp->hdr.seqno == 0 || lsp->hdr.rem_lifetime == 0)
return LSP_ITER_CONTINUE;
/* Parse main LSP. */
/* Parse LSP */
if (lsp->tlvs) {
if (pseudo_lsp || mtid == ISIS_MT_IPV4_UNICAST) {
head = lsp->tlvs->oldstyle_reach.head;
@ -2283,13 +2311,16 @@ int isis_lsp_iterate_is_reach(struct isis_lsp *lsp, uint16_t mtid,
}
}
/* Parse LSP fragments. */
for (ALL_LIST_ELEMENTS_RO(lsp->lspu.frags, node, frag)) {
if (!frag->tlvs)
continue;
/* Parse LSP fragments if it not a fragment itself. */
if (!LSP_FRAGMENT(lsp->hdr.lsp_id))
for (ALL_LIST_ELEMENTS_RO(lsp->lspu.frags, node, frag)) {
if (!frag->tlvs)
continue;
isis_lsp_iterate_is_reach(frag, mtid, cb, arg);
}
if (isis_lsp_iterate_is_reach(frag, mtid, cb, arg)
== LSP_ITER_STOP)
return LSP_ITER_STOP;
}
return LSP_ITER_CONTINUE;
}

View File

@ -515,6 +515,17 @@ static void tlvs_add_mt_set(struct isis_area *area, struct isis_tlvs *tlvs,
uint8_t *id, uint32_t metric,
struct isis_ext_subtlvs *ext)
{
/* Check if MT is enable for this area */
if (!area_is_mt(area)) {
lsp_debug(
"ISIS (%s): Adding %s.%02x as te-style neighbor (MT disable)",
area->area_tag, sysid_print(id), LSP_PSEUDO_ID(id));
isis_tlvs_add_extended_reach(tlvs, ISIS_MT_DISABLE, id, metric,
ext);
return;
}
/* Process Multi-Topology */
for (unsigned int i = 0; i < mt_count; i++) {
uint16_t mtid = mt_set[i];
if (mt_set[i] == ISIS_MT_IPV4_UNICAST) {

View File

@ -33,6 +33,8 @@
#define ISIS_MT_IPV6_MULTICAST 4
#define ISIS_MT_IPV6_MGMT 5
#define ISIS_MT_IPV6_DSTSRC 3996 /* FIXME: IANA */
/* Use first Reserved Flag to indicate that there is no MT Topology active */
#define ISIS_MT_DISABLE 4096
#define ISIS_MT_NAMES \
"<ipv4-unicast" \

View File

@ -566,6 +566,21 @@ const struct frr_yang_module_info frr_isisd_info = {
.modify = isis_instance_mpls_te_router_address_modify,
},
},
{
.xpath = "/frr-isisd:isis/instance/mpls-te/router-address-v6",
.cbs = {
.cli_show = cli_show_isis_mpls_te_router_addr_ipv6,
.destroy = isis_instance_mpls_te_router_address_ipv6_destroy,
.modify = isis_instance_mpls_te_router_address_ipv6_modify,
}
},
{
.xpath = "/frr-isisd:isis/instance/mpls-te/export",
.cbs = {
.cli_show = cli_show_isis_mpls_te_export,
.modify = isis_instance_mpls_te_export_modify,
},
},
{
.xpath = "/frr-isisd:isis/instance/segment-routing/enabled",
.cbs = {

View File

@ -211,6 +211,11 @@ int isis_instance_mpls_te_destroy(struct nb_cb_destroy_args *args);
int isis_instance_mpls_te_router_address_modify(struct nb_cb_modify_args *args);
int isis_instance_mpls_te_router_address_destroy(
struct nb_cb_destroy_args *args);
int isis_instance_mpls_te_router_address_ipv6_modify(
struct nb_cb_modify_args *args);
int isis_instance_mpls_te_router_address_ipv6_destroy(
struct nb_cb_destroy_args *args);
int isis_instance_mpls_te_export_modify(struct nb_cb_modify_args *args);
int lib_interface_isis_create(struct nb_cb_create_args *args);
int lib_interface_isis_destroy(struct nb_cb_destroy_args *args);
int lib_interface_isis_area_tag_modify(struct nb_cb_modify_args *args);
@ -463,6 +468,11 @@ void cli_show_isis_mpls_te(struct vty *vty, const struct lyd_node *dnode,
void cli_show_isis_mpls_te_router_addr(struct vty *vty,
const struct lyd_node *dnode,
bool show_defaults);
void cli_show_isis_mpls_te_router_addr_ipv6(struct vty *vty,
const struct lyd_node *dnode,
bool show_defaults);
void cli_show_isis_mpls_te_export(struct vty *vty, const struct lyd_node *dnode,
bool show_defaults);
void cli_show_isis_def_origin_ipv4(struct vty *vty,
const struct lyd_node *dnode,
bool show_defaults);

View File

@ -33,6 +33,7 @@
#include "lib_errors.h"
#include "vrf.h"
#include "ldp_sync.h"
#include "link_state.h"
#include "isisd/isisd.h"
#include "isisd/isis_nb.h"
@ -51,6 +52,7 @@
#include "isisd/isis_redist.h"
#include "isisd/isis_ldp_sync.h"
#include "isisd/isis_dr.h"
#include "isisd/isis_zebra.h"
DEFINE_MTYPE_STATIC(ISISD, ISIS_MPLS_TE, "ISIS MPLS_TE parameters");
DEFINE_MTYPE_STATIC(ISISD, ISIS_PLIST_NAME, "ISIS prefix-list name");
@ -1827,12 +1829,19 @@ int isis_instance_mpls_te_create(struct nb_cb_create_args *args)
new->inter_as = off;
new->interas_areaid.s_addr = 0;
new->router_id.s_addr = 0;
new->ted = ls_ted_new(1, "ISIS", 0);
if (!new->ted)
zlog_warn("Unable to create Link State Data Base");
area->mta = new;
} else {
area->mta->status = enable;
}
/* Initialize Link State Database */
if (area->mta->ted)
isis_te_init_ted(area);
/* Update Extended TLVs according to Interface link parameters */
for (ALL_LIST_ELEMENTS_RO(area->circuit_list, node, circuit))
isis_link_params_update(circuit, circuit->interface);
@ -1858,6 +1867,9 @@ int isis_instance_mpls_te_destroy(struct nb_cb_destroy_args *args)
else
return NB_OK;
/* Remove Link State Database */
ls_ted_del_all(area->mta->ted);
/* Flush LSP if circuit engage */
for (ALL_LIST_ELEMENTS_RO(area->circuit_list, node, circuit)) {
if (!IS_EXT_TE(circuit->ext))
@ -1929,6 +1941,88 @@ int isis_instance_mpls_te_router_address_destroy(
return NB_OK;
}
/*
* XPath: /frr-isisd:isis/instance/mpls-te/router-address-v6
*/
int isis_instance_mpls_te_router_address_ipv6_modify(
struct nb_cb_modify_args *args)
{
struct in6_addr value;
struct isis_area *area;
if (args->event != NB_EV_APPLY)
return NB_OK;
area = nb_running_get_entry(args->dnode, NULL, true);
/* only proceed if MPLS-TE is enabled */
if (!IS_MPLS_TE(area->mta))
return NB_OK;
yang_dnode_get_ipv6(&value, args->dnode, NULL);
/* Update Area IPv6 Router ID if different */
if (!IPV6_ADDR_SAME(&area->mta->router_id_ipv6, &value)) {
IPV6_ADDR_COPY(&area->mta->router_id_ipv6, &value);
/* And re-schedule LSP update */
lsp_regenerate_schedule(area, area->is_type, 0);
}
return NB_OK;
}
int isis_instance_mpls_te_router_address_ipv6_destroy(
struct nb_cb_destroy_args *args)
{
struct isis_area *area;
if (args->event != NB_EV_APPLY)
return NB_OK;
area = nb_running_get_entry(args->dnode, NULL, true);
/* only proceed if MPLS-TE is enabled */
if (!IS_MPLS_TE(area->mta))
return NB_OK;
/* Reset Area Router ID */
IPV6_ADDR_COPY(&area->mta->router_id_ipv6, &in6addr_any);
/* And re-schedule LSP update */
lsp_regenerate_schedule(area, area->is_type, 0);
return NB_OK;
}
/*
* XPath: /frr-isisd:isis/instance/mpls-te/export
*/
int isis_instance_mpls_te_export_modify(struct nb_cb_modify_args *args)
{
struct isis_area *area;
if (args->event != NB_EV_APPLY)
return NB_OK;
area = nb_running_get_entry(args->dnode, NULL, true);
/* only proceed if MPLS-TE is enabled */
if (!IS_MPLS_TE(area->mta))
return NB_OK;
area->mta->export = yang_dnode_get_bool(args->dnode, NULL);
if (area->mta->export) {
if (IS_DEBUG_EVENTS)
zlog_debug("MPLS-TE: Enabled Link State export");
if (isis_zebra_ls_register(true) != 0)
zlog_warn("Unable to register Link State\n");
} else {
if (IS_DEBUG_EVENTS)
zlog_debug("MPLS-TE: Disable Link State export");
if (isis_zebra_ls_register(false) != 0)
zlog_warn("Unable to register Link State\n");
}
return NB_OK;
}
/*
* XPath: /frr-isisd:isis/instance/segment-routing/enabled
*/

View File

@ -1971,6 +1971,11 @@ int send_hello(struct isis_circuit *circuit, int level)
if (circuit->ipv6_router && circuit->ipv6_link)
isis_tlvs_add_ipv6_addresses(tlvs, circuit->ipv6_link);
/* RFC6119 section 4 define TLV 233 to provide Global IPv6 address */
if (circuit->ipv6_router && circuit->ipv6_non_link)
isis_tlvs_add_global_ipv6_addresses(tlvs,
circuit->ipv6_non_link);
if (isis_pack_tlvs(tlvs, circuit->snd_stream, len_pointer,
circuit->pad_hellos, false)) {
isis_free_tlvs(tlvs);

View File

@ -145,8 +145,8 @@ void adjinfo2nexthop(int family, struct list *nexthops,
}
break;
case AF_INET6:
for (unsigned int i = 0; i < adj->ipv6_address_count; i++) {
ip.ipv6 = adj->ipv6_addresses[i];
for (unsigned int i = 0; i < adj->ll_ipv6_count; i++) {
ip.ipv6 = adj->ll_ipv6_addrs[i];
if (!nexthoplookup(nexthops, AF_INET6, &ip,
adj->circuit->interface->ifindex)) {

View File

@ -1186,14 +1186,13 @@ static int isis_snmp_adj_helper(struct isis_adjacency *adj, int data_id,
break;
case ISIS_SNMP_ADJ_DATA_IP_ADDR:
if (data_off
>= (adj->ipv4_address_count + adj->ipv6_address_count))
if (data_off >= (adj->ipv4_address_count + adj->ll_ipv6_count))
return 0;
if (data_off >= adj->ipv4_address_count) {
data = (uint8_t *)&adj->ipv6_addresses
data = (uint8_t *)&adj->ll_ipv6_addrs
[data_off - adj->ipv4_address_count];
data_len = sizeof(adj->ipv6_addresses[0]);
data_len = sizeof(adj->ll_ipv6_addrs[0]);
} else {
data = (uint8_t *)&adj->ipv4_addresses[data_off];
data_len = sizeof(adj->ipv4_addresses[0]);

View File

@ -661,10 +661,10 @@ void sr_adj_sid_add_single(struct isis_adjacency *adj, int family, bool backup,
nexthop.ipv4 = adj->ipv4_addresses[0];
break;
case AF_INET6:
if (!circuit->ipv6_router || !adj->ipv6_address_count)
if (!circuit->ipv6_router || !adj->ll_ipv6_count)
return;
nexthop.ipv6 = adj->ipv6_addresses[0];
nexthop.ipv6 = adj->ll_ipv6_addrs[0];
break;
default:
flog_err(EC_LIB_DEVELOPMENT,
@ -880,12 +880,14 @@ static int sr_adj_state_change(struct isis_adjacency *adj)
*
* @param adj IS-IS Adjacency
* @param family Inet Family (IPv4 or IPv6)
* @param global Indicate if it concerns the Local or Global IPv6 addresses
*
* @return 0
*/
static int sr_adj_ip_enabled(struct isis_adjacency *adj, int family)
static int sr_adj_ip_enabled(struct isis_adjacency *adj, int family,
bool global)
{
if (!adj->circuit->area->srdb.enabled)
if (!adj->circuit->area->srdb.enabled || global)
return 0;
sr_adj_sid_add(adj, family);
@ -899,15 +901,17 @@ static int sr_adj_ip_enabled(struct isis_adjacency *adj, int family)
*
* @param adj IS-IS Adjacency
* @param family Inet Family (IPv4 or IPv6)
* @param global Indicate if it concerns the Local or Global IPv6 addresses
*
* @return 0
*/
static int sr_adj_ip_disabled(struct isis_adjacency *adj, int family)
static int sr_adj_ip_disabled(struct isis_adjacency *adj, int family,
bool global)
{
struct sr_adjacency *sra;
struct listnode *node, *nnode;
if (!adj->circuit->area->srdb.enabled)
if (!adj->circuit->area->srdb.enabled || global)
return 0;
for (ALL_LIST_ELEMENTS(adj->adj_sids, node, nnode, sra))
@ -1148,7 +1152,7 @@ int isis_sr_start(struct isis_area *area)
for (ALL_LIST_ELEMENTS_RO(area->adjacency_list, node, adj)) {
if (adj->ipv4_address_count > 0)
sr_adj_sid_add(adj, AF_INET);
if (adj->ipv6_address_count > 0)
if (adj->ll_ipv6_count > 0)
sr_adj_sid_add(adj, AF_INET6);
}

File diff suppressed because it is too large Load Diff

View File

@ -88,8 +88,10 @@ typedef enum _interas_mode_t { off, region, as, emulate } interas_mode_t;
&& e->status != EXT_ADJ_SID \
&& e->status != EXT_LAN_ADJ_SID)
#define IS_MPLS_TE(a) (a && a->status == enable)
#define IS_EXPORT_TE(a) (a->export)
/* Per area MPLS-TE parameters */
struct ls_ted;
struct mpls_te_area {
/* Status of MPLS-TE: enable or disable */
status_t status;
@ -101,13 +103,30 @@ struct mpls_te_area {
interas_mode_t inter_as;
struct in_addr interas_areaid;
/* MPLS_TE router ID */
/* MPLS_TE IPv4 & IPv6 Router IDs */
struct in_addr router_id;
struct in6_addr router_id_ipv6;
/* Link State Database */
struct ls_ted *ted;
bool export;
};
/* Structure to provide parameters to lsp iterate callback function */
struct isis_te_args {
struct ls_ted *ted;
struct ls_vertex *vertex;
bool export;
};
enum lsp_event { LSP_UNKNOWN, LSP_ADD, LSP_UPD, LSP_DEL, LSP_INC, LSP_TICK };
/* Prototypes. */
void isis_mpls_te_init(void);
void isis_link_params_update(struct isis_circuit *, struct interface *);
int isis_mpls_te_update(struct interface *);
void isis_te_lsp_event(struct isis_lsp *lsp, enum lsp_event event);
int isis_te_sync_ted(struct zapi_opaque_reg_info dst);
void isis_te_init_ted(struct isis_area *area);
#endif /* _ZEBRA_ISIS_MPLS_TE_H */

View File

@ -99,6 +99,7 @@ static const struct pack_order_entry pack_order[] = {
PACK_ENTRY(OLDSTYLE_IP_REACH_EXT, ISIS_ITEMS, oldstyle_ip_reach_ext),
PACK_ENTRY(IPV4_ADDRESS, ISIS_ITEMS, ipv4_address),
PACK_ENTRY(IPV6_ADDRESS, ISIS_ITEMS, ipv6_address),
PACK_ENTRY(GLOBAL_IPV6_ADDRESS, ISIS_ITEMS, global_ipv6_address),
PACK_ENTRY(EXTENDED_IP_REACH, ISIS_ITEMS, extended_ip_reach),
PACK_ENTRY(MT_IP_REACH, ISIS_MT_ITEMS, mt_ip_reach),
PACK_ENTRY(IPV6_REACH, ISIS_ITEMS, ipv6_reach),
@ -128,27 +129,41 @@ struct isis_ext_subtlvs *isis_alloc_ext_subtlvs(void)
}
/*
* mtid parameter is used to determine if Adjacency is related to IPv4 or IPv6.
* A negative value could be used to skip copy of Adjacency SID.
* mtid parameter is used to determine if Adjacency is related to IPv4 or IPv6
* Multi-Topology. Special 4096 value i.e. first R flag set is used to indicate
* that MT is disabled i.e. IS-IS is working with a Single Topology.
*/
static struct isis_ext_subtlvs *
copy_item_ext_subtlvs(struct isis_ext_subtlvs *exts, int16_t mtid)
copy_item_ext_subtlvs(struct isis_ext_subtlvs *exts, uint16_t mtid)
{
struct isis_ext_subtlvs *rv = XCALLOC(MTYPE_ISIS_SUBTLV, sizeof(*rv));
struct isis_adj_sid *adj;
struct isis_lan_adj_sid *lan;
/* Copy the Extended IS main part */
memcpy(rv, exts, sizeof(struct isis_ext_subtlvs));
/* Disable IPv4 / IPv6 advertisement in function of MTID */
if (mtid == ISIS_MT_IPV4_UNICAST) {
UNSET_SUBTLV(rv, EXT_LOCAL_ADDR6);
UNSET_SUBTLV(rv, EXT_NEIGH_ADDR6);
}
if (mtid == ISIS_MT_IPV6_UNICAST) {
UNSET_SUBTLV(rv, EXT_LOCAL_ADDR);
UNSET_SUBTLV(rv, EXT_NEIGH_ADDR);
}
/* Prepare (LAN)-Adjacency Segment Routing ID*/
init_item_list(&rv->adj_sid);
init_item_list(&rv->lan_sid);
UNSET_SUBTLV(rv, EXT_ADJ_SID);
UNSET_SUBTLV(rv, EXT_LAN_ADJ_SID);
/* Copy Adj SID and LAN Adj SID list for IPv4 if needed */
/* Copy Adj SID list for IPv4 & IPv6 in function of MT ID */
for (adj = (struct isis_adj_sid *)exts->adj_sid.head; adj != NULL;
adj = adj->next) {
if ((mtid != -1)
if ((mtid != ISIS_MT_DISABLE)
&& (((mtid == ISIS_MT_IPV4_UNICAST)
&& (adj->family != AF_INET))
|| ((mtid == ISIS_MT_IPV6_UNICAST)
@ -166,9 +181,10 @@ copy_item_ext_subtlvs(struct isis_ext_subtlvs *exts, int16_t mtid)
SET_SUBTLV(rv, EXT_ADJ_SID);
}
/* Same for LAN Adj SID */
for (lan = (struct isis_lan_adj_sid *)exts->lan_sid.head; lan != NULL;
lan = lan->next) {
if ((mtid != -1)
if ((mtid != ISIS_MT_DISABLE)
&& (((mtid == ISIS_MT_IPV4_UNICAST)
&& (lan->family != AF_INET))
|| ((mtid == ISIS_MT_IPV6_UNICAST)
@ -196,8 +212,6 @@ static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts,
uint16_t mtid)
{
char ibuf[PREFIX2STR_BUFFER];
/* Standard metrics */
if (IS_SUBTLV(exts, EXT_ADM_GRP))
sbuf_push(buf, indent, "Administrative Group: 0x%x\n",
@ -212,16 +226,17 @@ static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts,
sbuf_push(buf, indent, "Local Interface IP Address(es): %pI4\n",
&exts->local_addr);
if (IS_SUBTLV(exts, EXT_NEIGH_ADDR))
sbuf_push(buf, indent, "Remote Interface IP Address(es): %pI4\n",
sbuf_push(buf, indent,
"Remote Interface IP Address(es): %pI4\n",
&exts->neigh_addr);
if (IS_SUBTLV(exts, EXT_LOCAL_ADDR6))
sbuf_push(buf, indent, "Local Interface IPv6 Address(es): %s\n",
inet_ntop(AF_INET6, &exts->local_addr6, ibuf,
PREFIX2STR_BUFFER));
sbuf_push(buf, indent,
"Local Interface IPv6 Address(es): %pI6\n",
&exts->local_addr6);
if (IS_SUBTLV(exts, EXT_NEIGH_ADDR6))
sbuf_push(buf, indent, "Remote Interface IPv6 Address(es): %s\n",
inet_ntop(AF_INET6, &exts->local_addr6, ibuf,
PREFIX2STR_BUFFER));
sbuf_push(buf, indent,
"Remote Interface IPv6 Address(es): %pI6\n",
&exts->neigh_addr6);
if (IS_SUBTLV(exts, EXT_MAX_BW))
sbuf_push(buf, indent, "Maximum Bandwidth: %g (Bytes/sec)\n",
exts->max_bw);
@ -289,11 +304,6 @@ static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts,
for (adj = (struct isis_adj_sid *)exts->adj_sid.head; adj;
adj = adj->next) {
if (((mtid == ISIS_MT_IPV4_UNICAST)
&& (adj->family != AF_INET))
|| ((mtid == ISIS_MT_IPV6_UNICAST)
&& (adj->family != AF_INET6)))
continue;
sbuf_push(
buf, indent,
"Adjacency-SID: %u, Weight: %hhu, Flags: F:%c B:%c, V:%c, L:%c, S:%c, P:%c\n",
@ -319,10 +329,6 @@ static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts,
for (lan = (struct isis_lan_adj_sid *)exts->lan_sid.head;
lan; lan = lan->next) {
if (((mtid == ISIS_MT_IPV4_UNICAST)
&& (lan->family != AF_INET))
|| ((mtid == ISIS_MT_IPV6_UNICAST)
&& (lan->family != AF_INET6)))
continue;
sbuf_push(buf, indent,
"Lan-Adjacency-SID: %u, Weight: %hhu, Flags: F:%c B:%c, V:%c, L:%c, S:%c, P:%c\n"
@ -1839,12 +1845,12 @@ static int pack_item_ipv6_address(struct isis_item *i, struct stream *s,
{
struct isis_ipv6_address *a = (struct isis_ipv6_address *)i;
if (STREAM_WRITEABLE(s) < 16) {
*min_len = 16;
if (STREAM_WRITEABLE(s) < IPV6_MAX_BYTELEN) {
*min_len = IPV6_MAX_BYTELEN;
return 1;
}
stream_put(s, &a->addr, 16);
stream_put(s, &a->addr, IPV6_MAX_BYTELEN);
return 0;
}
@ -1865,7 +1871,7 @@ static int unpack_item_ipv6_address(uint16_t mtid, uint8_t len,
}
struct isis_ipv6_address *rv = XCALLOC(MTYPE_ISIS_TLV, sizeof(*rv));
stream_get(&rv->addr, s, 16);
stream_get(&rv->addr, s, IPV6_MAX_BYTELEN);
format_item_ipv6_address(mtid, (struct isis_item *)rv, log, indent + 2);
append_item(&tlvs->ipv6_address, (struct isis_item *)rv);
@ -1873,6 +1879,70 @@ static int unpack_item_ipv6_address(uint16_t mtid, uint8_t len,
}
/* Functions related to TLV 233 Global IPv6 Interface addresses */
static struct isis_item *copy_item_global_ipv6_address(struct isis_item *i)
{
struct isis_ipv6_address *a = (struct isis_ipv6_address *)i;
struct isis_ipv6_address *rv = XCALLOC(MTYPE_ISIS_TLV, sizeof(*rv));
rv->addr = a->addr;
return (struct isis_item *)rv;
}
static void format_item_global_ipv6_address(uint16_t mtid, struct isis_item *i,
struct sbuf *buf, int indent)
{
struct isis_ipv6_address *a = (struct isis_ipv6_address *)i;
char addrbuf[INET6_ADDRSTRLEN];
inet_ntop(AF_INET6, &a->addr, addrbuf, sizeof(addrbuf));
sbuf_push(buf, indent, "Global IPv6 Interface Address: %s\n", addrbuf);
}
static void free_item_global_ipv6_address(struct isis_item *i)
{
XFREE(MTYPE_ISIS_TLV, i);
}
static int pack_item_global_ipv6_address(struct isis_item *i, struct stream *s,
size_t *min_len)
{
struct isis_ipv6_address *a = (struct isis_ipv6_address *)i;
if (STREAM_WRITEABLE(s) < IPV6_MAX_BYTELEN) {
*min_len = IPV6_MAX_BYTELEN;
return 1;
}
stream_put(s, &a->addr, IPV6_MAX_BYTELEN);
return 0;
}
static int unpack_item_global_ipv6_address(uint16_t mtid, uint8_t len,
struct stream *s, struct sbuf *log,
void *dest, int indent)
{
struct isis_tlvs *tlvs = dest;
sbuf_push(log, indent, "Unpack Global IPv6 Interface address...\n");
if (len < IPV6_MAX_BYTELEN) {
sbuf_push(
log, indent,
"Not enough data left.(Expected 16 bytes of IPv6 address, got %hhu)\n",
len);
return 1;
}
struct isis_ipv6_address *rv = XCALLOC(MTYPE_ISIS_TLV, sizeof(*rv));
stream_get(&rv->addr, s, IPV6_MAX_BYTELEN);
format_item_global_ipv6_address(mtid, (struct isis_item *)rv, log,
indent + 2);
append_item(&tlvs->global_ipv6_address, (struct isis_item *)rv);
return 0;
}
/* Functions related to TLV 229 MT Router information */
static struct isis_item *copy_item_mt_router_info(struct isis_item *i)
{
@ -2273,6 +2343,77 @@ static int unpack_tlv_dynamic_hostname(enum isis_tlv_context context,
return 0;
}
/* Functions related to TLV 140 IPv6 TE Router ID */
static struct in6_addr *copy_tlv_te_router_id_ipv6(const struct in6_addr *id)
{
if (!id)
return NULL;
struct in6_addr *rv = XCALLOC(MTYPE_ISIS_TLV, sizeof(*rv));
memcpy(rv, id, sizeof(*rv));
return rv;
}
static void format_tlv_te_router_id_ipv6(const struct in6_addr *id,
struct sbuf *buf, int indent)
{
if (!id)
return;
char addrbuf[INET6_ADDRSTRLEN];
inet_ntop(AF_INET6, id, addrbuf, sizeof(addrbuf));
sbuf_push(buf, indent, "IPv6 TE Router ID: %s\n", addrbuf);
}
static void free_tlv_te_router_id_ipv6(struct in6_addr *id)
{
XFREE(MTYPE_ISIS_TLV, id);
}
static int pack_tlv_te_router_id_ipv6(const struct in6_addr *id,
struct stream *s)
{
if (!id)
return 0;
if (STREAM_WRITEABLE(s) < (unsigned)(2 + sizeof(*id)))
return 1;
stream_putc(s, ISIS_TLV_TE_ROUTER_ID_IPV6);
stream_putc(s, IPV6_MAX_BYTELEN);
stream_put(s, id, IPV6_MAX_BYTELEN);
return 0;
}
static int unpack_tlv_te_router_id_ipv6(enum isis_tlv_context context,
uint8_t tlv_type, uint8_t tlv_len,
struct stream *s, struct sbuf *log,
void *dest, int indent)
{
struct isis_tlvs *tlvs = dest;
sbuf_push(log, indent, "Unpacking IPv6 TE Router ID TLV...\n");
if (tlv_len != IPV6_MAX_BYTELEN) {
sbuf_push(log, indent, "WARNING: Length invalid\n");
return 1;
}
if (tlvs->te_router_id_ipv6) {
sbuf_push(
log, indent,
"WARNING: IPv6 TE Router ID present multiple times.\n");
stream_forward_getp(s, tlv_len);
return 0;
}
tlvs->te_router_id_ipv6 = XCALLOC(MTYPE_ISIS_TLV, IPV6_MAX_BYTELEN);
stream_get(tlvs->te_router_id_ipv6, s, IPV6_MAX_BYTELEN);
format_tlv_te_router_id_ipv6(tlvs->te_router_id_ipv6, log, indent + 2);
return 0;
}
/* Functions related to TLV 150 Spine-Leaf-Extension */
static struct isis_spine_leaf *copy_tlv_spine_leaf(
@ -3640,6 +3781,7 @@ struct isis_tlvs *isis_alloc_tlvs(void)
init_item_list(&result->oldstyle_ip_reach_ext);
init_item_list(&result->ipv4_address);
init_item_list(&result->ipv6_address);
init_item_list(&result->global_ipv6_address);
init_item_list(&result->extended_ip_reach);
RB_INIT(isis_mt_item_list, &result->mt_ip_reach);
init_item_list(&result->ipv6_reach);
@ -3696,8 +3838,14 @@ struct isis_tlvs *isis_copy_tlvs(struct isis_tlvs *tlvs)
copy_items(ISIS_CONTEXT_LSP, ISIS_TLV_IPV6_ADDRESS, &tlvs->ipv6_address,
&rv->ipv6_address);
copy_items(ISIS_CONTEXT_LSP, ISIS_TLV_GLOBAL_IPV6_ADDRESS,
&tlvs->global_ipv6_address, &rv->global_ipv6_address);
rv->te_router_id = copy_tlv_te_router_id(tlvs->te_router_id);
rv->te_router_id_ipv6 =
copy_tlv_te_router_id_ipv6(tlvs->te_router_id_ipv6);
copy_items(ISIS_CONTEXT_LSP, ISIS_TLV_EXTENDED_IP_REACH,
&tlvs->extended_ip_reach, &rv->extended_ip_reach);
@ -3751,6 +3899,7 @@ static void format_tlvs(struct isis_tlvs *tlvs, struct sbuf *buf, int indent)
format_tlv_dynamic_hostname(tlvs->hostname, buf, indent);
format_tlv_te_router_id(tlvs->te_router_id, buf, indent);
format_tlv_te_router_id_ipv6(tlvs->te_router_id_ipv6, buf, indent);
format_tlv_router_cap(tlvs->router_cap, buf, indent);
format_items(ISIS_CONTEXT_LSP, ISIS_TLV_EXTENDED_REACH,
@ -3771,6 +3920,9 @@ static void format_tlvs(struct isis_tlvs *tlvs, struct sbuf *buf, int indent)
format_items(ISIS_CONTEXT_LSP, ISIS_TLV_IPV6_ADDRESS,
&tlvs->ipv6_address, buf, indent);
format_items(ISIS_CONTEXT_LSP, ISIS_TLV_GLOBAL_IPV6_ADDRESS,
&tlvs->global_ipv6_address, buf, indent);
format_items(ISIS_CONTEXT_LSP, ISIS_TLV_EXTENDED_IP_REACH,
&tlvs->extended_ip_reach, buf, indent);
@ -3828,7 +3980,10 @@ void isis_free_tlvs(struct isis_tlvs *tlvs)
&tlvs->ipv4_address);
free_items(ISIS_CONTEXT_LSP, ISIS_TLV_IPV6_ADDRESS,
&tlvs->ipv6_address);
free_items(ISIS_CONTEXT_LSP, ISIS_TLV_GLOBAL_IPV6_ADDRESS,
&tlvs->global_ipv6_address);
free_tlv_te_router_id(tlvs->te_router_id);
free_tlv_te_router_id_ipv6(tlvs->te_router_id_ipv6);
free_items(ISIS_CONTEXT_LSP, ISIS_TLV_EXTENDED_IP_REACH,
&tlvs->extended_ip_reach);
free_mt_items(ISIS_CONTEXT_LSP, ISIS_TLV_MT_IP_REACH,
@ -4035,6 +4190,14 @@ static int pack_tlvs(struct isis_tlvs *tlvs, struct stream *stream,
copy_tlv_te_router_id(tlvs->te_router_id);
}
rv = pack_tlv_te_router_id_ipv6(tlvs->te_router_id_ipv6, stream);
if (rv)
return rv;
if (fragment_tlvs) {
fragment_tlvs->te_router_id_ipv6 =
copy_tlv_te_router_id_ipv6(tlvs->te_router_id_ipv6);
}
rv = pack_tlv_threeway_adj(tlvs->threeway_adj, stream);
if (rv)
return rv;
@ -4255,10 +4418,12 @@ ITEM_TLV_OPS(ipv4_address, "TLV 132 IPv4 Interface Address");
TLV_OPS(te_router_id, "TLV 134 TE Router ID");
ITEM_TLV_OPS(extended_ip_reach, "TLV 135 Extended IP Reachability");
TLV_OPS(dynamic_hostname, "TLV 137 Dynamic Hostname");
TLV_OPS(te_router_id_ipv6, "TLV 140 IPv6 TE Router ID");
TLV_OPS(spine_leaf, "TLV 150 Spine Leaf Extensions");
ITEM_TLV_OPS(mt_router_info, "TLV 229 MT Router Information");
TLV_OPS(threeway_adj, "TLV 240 P2P Three-Way Adjacency");
ITEM_TLV_OPS(ipv6_address, "TLV 232 IPv6 Interface Address");
ITEM_TLV_OPS(global_ipv6_address, "TLV 233 Global IPv6 Interface Address");
ITEM_TLV_OPS(ipv6_reach, "TLV 236 IPv6 Reachability");
TLV_OPS(router_cap, "TLV 242 Router Capability");
@ -4279,12 +4444,14 @@ static const struct tlv_ops *const tlv_table[ISIS_CONTEXT_MAX][ISIS_TLV_MAX] = {
[ISIS_TLV_OLDSTYLE_IP_REACH_EXT] = &tlv_oldstyle_ip_reach_ops,
[ISIS_TLV_IPV4_ADDRESS] = &tlv_ipv4_address_ops,
[ISIS_TLV_TE_ROUTER_ID] = &tlv_te_router_id_ops,
[ISIS_TLV_TE_ROUTER_ID_IPV6] = &tlv_te_router_id_ipv6_ops,
[ISIS_TLV_EXTENDED_IP_REACH] = &tlv_extended_ip_reach_ops,
[ISIS_TLV_DYNAMIC_HOSTNAME] = &tlv_dynamic_hostname_ops,
[ISIS_TLV_SPINE_LEAF_EXT] = &tlv_spine_leaf_ops,
[ISIS_TLV_MT_REACH] = &tlv_extended_reach_ops,
[ISIS_TLV_MT_ROUTER_INFO] = &tlv_mt_router_info_ops,
[ISIS_TLV_IPV6_ADDRESS] = &tlv_ipv6_address_ops,
[ISIS_TLV_GLOBAL_IPV6_ADDRESS] = &tlv_global_ipv6_address_ops,
[ISIS_TLV_MT_IP_REACH] = &tlv_extended_ip_reach_ops,
[ISIS_TLV_IPV6_REACH] = &tlv_ipv6_reach_ops,
[ISIS_TLV_MT_IPV6_REACH] = &tlv_ipv6_reach_ops,
@ -4427,6 +4594,26 @@ void isis_tlvs_add_ipv6_addresses(struct isis_tlvs *tlvs,
}
}
void isis_tlvs_add_global_ipv6_addresses(struct isis_tlvs *tlvs,
struct list *addresses)
{
struct listnode *node;
struct prefix_ipv6 *ip_addr;
unsigned int addr_count = 0;
for (ALL_LIST_ELEMENTS_RO(addresses, node, ip_addr)) {
if (addr_count >= 15)
break;
struct isis_ipv6_address *a =
XCALLOC(MTYPE_ISIS_TLV, sizeof(*a));
a->addr = ip_addr->prefix;
append_item(&tlvs->global_ipv6_address, (struct isis_item *)a);
addr_count++;
}
}
typedef bool (*auth_validator_func)(struct isis_passwd *passwd,
struct stream *stream,
struct isis_auth *auth, bool is_lsp);
@ -4606,10 +4793,12 @@ static void tlvs_protocols_supported_to_adj(struct isis_tlvs *tlvs,
memcpy(adj->nlpids.nlpids, reduced.nlpids, reduced.count);
}
DEFINE_HOOK(isis_adj_ip_enabled_hook, (struct isis_adjacency *adj, int family),
(adj, family));
DEFINE_HOOK(isis_adj_ip_enabled_hook,
(struct isis_adjacency * adj, int family, bool global),
(adj, family, global));
DEFINE_HOOK(isis_adj_ip_disabled_hook,
(struct isis_adjacency *adj, int family), (adj, family));
(struct isis_adjacency * adj, int family, bool global),
(adj, family, global));
static void tlvs_ipv4_addresses_to_adj(struct isis_tlvs *tlvs,
struct isis_adjacency *adj,
@ -4620,7 +4809,7 @@ static void tlvs_ipv4_addresses_to_adj(struct isis_tlvs *tlvs,
if (adj->ipv4_address_count == 0 && tlvs->ipv4_address.count > 0)
ipv4_enabled = true;
else if (adj->ipv4_address_count > 0 && tlvs->ipv4_address.count == 0)
hook_call(isis_adj_ip_disabled_hook, adj, AF_INET);
hook_call(isis_adj_ip_disabled_hook, adj, AF_INET, false);
if (adj->ipv4_address_count != tlvs->ipv4_address.count) {
uint32_t oc = adj->ipv4_address_count;
@ -4654,7 +4843,7 @@ static void tlvs_ipv4_addresses_to_adj(struct isis_tlvs *tlvs,
}
if (ipv4_enabled)
hook_call(isis_adj_ip_enabled_hook, adj, AF_INET);
hook_call(isis_adj_ip_enabled_hook, adj, AF_INET, false);
}
static void tlvs_ipv6_addresses_to_adj(struct isis_tlvs *tlvs,
@ -4663,23 +4852,23 @@ static void tlvs_ipv6_addresses_to_adj(struct isis_tlvs *tlvs,
{
bool ipv6_enabled = false;
if (adj->ipv6_address_count == 0 && tlvs->ipv6_address.count > 0)
if (adj->ll_ipv6_count == 0 && tlvs->ipv6_address.count > 0)
ipv6_enabled = true;
else if (adj->ipv6_address_count > 0 && tlvs->ipv6_address.count == 0)
hook_call(isis_adj_ip_disabled_hook, adj, AF_INET6);
else if (adj->ll_ipv6_count > 0 && tlvs->ipv6_address.count == 0)
hook_call(isis_adj_ip_disabled_hook, adj, AF_INET6, false);
if (adj->ipv6_address_count != tlvs->ipv6_address.count) {
uint32_t oc = adj->ipv6_address_count;
if (adj->ll_ipv6_count != tlvs->ipv6_address.count) {
uint32_t oc = adj->ll_ipv6_count;
*changed = true;
adj->ipv6_address_count = tlvs->ipv6_address.count;
adj->ipv6_addresses = XREALLOC(
MTYPE_ISIS_ADJACENCY_INFO, adj->ipv6_addresses,
adj->ipv6_address_count * sizeof(*adj->ipv6_addresses));
adj->ll_ipv6_count = tlvs->ipv6_address.count;
adj->ll_ipv6_addrs = XREALLOC(
MTYPE_ISIS_ADJACENCY_INFO, adj->ll_ipv6_addrs,
adj->ll_ipv6_count * sizeof(*adj->ll_ipv6_addrs));
for (; oc < adj->ipv6_address_count; oc++) {
memset(&adj->ipv6_addresses[oc], 0,
sizeof(adj->ipv6_addresses[oc]));
for (; oc < adj->ll_ipv6_count; oc++) {
memset(&adj->ll_ipv6_addrs[oc], 0,
sizeof(adj->ll_ipv6_addrs[oc]));
}
}
@ -4691,16 +4880,65 @@ static void tlvs_ipv6_addresses_to_adj(struct isis_tlvs *tlvs,
else
addr = addr->next;
if (!memcmp(&adj->ipv6_addresses[i], &addr->addr,
if (!memcmp(&adj->ll_ipv6_addrs[i], &addr->addr,
sizeof(addr->addr)))
continue;
*changed = true;
adj->ipv6_addresses[i] = addr->addr;
adj->ll_ipv6_addrs[i] = addr->addr;
}
if (ipv6_enabled)
hook_call(isis_adj_ip_enabled_hook, adj, AF_INET6);
hook_call(isis_adj_ip_enabled_hook, adj, AF_INET6, false);
}
static void tlvs_global_ipv6_addresses_to_adj(struct isis_tlvs *tlvs,
struct isis_adjacency *adj,
bool *changed)
{
bool global_ipv6_enabled = false;
if (adj->global_ipv6_count == 0 && tlvs->global_ipv6_address.count > 0)
global_ipv6_enabled = true;
else if (adj->global_ipv6_count > 0
&& tlvs->global_ipv6_address.count == 0)
hook_call(isis_adj_ip_disabled_hook, adj, AF_INET6, true);
if (adj->global_ipv6_count != tlvs->global_ipv6_address.count) {
uint32_t oc = adj->global_ipv6_count;
*changed = true;
adj->global_ipv6_count = tlvs->global_ipv6_address.count;
adj->global_ipv6_addrs = XREALLOC(
MTYPE_ISIS_ADJACENCY_INFO, adj->global_ipv6_addrs,
adj->global_ipv6_count
* sizeof(*adj->global_ipv6_addrs));
for (; oc < adj->global_ipv6_count; oc++) {
memset(&adj->global_ipv6_addrs[oc], 0,
sizeof(adj->global_ipv6_addrs[oc]));
}
}
struct isis_ipv6_address *addr = NULL;
for (unsigned int i = 0; i < tlvs->global_ipv6_address.count; i++) {
if (!addr)
addr = (struct isis_ipv6_address *)
tlvs->global_ipv6_address.head;
else
addr = addr->next;
if (!memcmp(&adj->global_ipv6_addrs[i], &addr->addr,
sizeof(addr->addr)))
continue;
*changed = true;
adj->global_ipv6_addrs[i] = addr->addr;
}
if (global_ipv6_enabled)
hook_call(isis_adj_ip_enabled_hook, adj, AF_INET6, true);
}
void isis_tlvs_to_adj(struct isis_tlvs *tlvs, struct isis_adjacency *adj,
@ -4712,6 +4950,7 @@ void isis_tlvs_to_adj(struct isis_tlvs *tlvs, struct isis_adjacency *adj,
tlvs_protocols_supported_to_adj(tlvs, adj, changed);
tlvs_ipv4_addresses_to_adj(tlvs, adj, changed);
tlvs_ipv6_addresses_to_adj(tlvs, adj, changed);
tlvs_global_ipv6_addresses_to_adj(tlvs, adj, changed);
}
bool isis_tlvs_own_snpa_found(struct isis_tlvs *tlvs, uint8_t *snpa)
@ -4793,6 +5032,16 @@ void isis_tlvs_set_te_router_id(struct isis_tlvs *tlvs,
memcpy(tlvs->te_router_id, id, sizeof(*id));
}
void isis_tlvs_set_te_router_id_ipv6(struct isis_tlvs *tlvs,
const struct in6_addr *id)
{
XFREE(MTYPE_ISIS_TLV, tlvs->te_router_id_ipv6);
if (!id)
return;
tlvs->te_router_id_ipv6 = XCALLOC(MTYPE_ISIS_TLV, sizeof(*id));
memcpy(tlvs->te_router_id_ipv6, id, sizeof(*id));
}
void isis_tlvs_add_oldstyle_ip_reach(struct isis_tlvs *tlvs,
struct prefix_ipv4 *dest, uint8_t metric)
{
@ -4922,7 +5171,7 @@ void isis_tlvs_add_extended_reach(struct isis_tlvs *tlvs, uint16_t mtid,
r->subtlvs = copy_item_ext_subtlvs(exts, mtid);
struct isis_item_list *l;
if (mtid == ISIS_MT_IPV4_UNICAST)
if ((mtid == ISIS_MT_IPV4_UNICAST) || (mtid == ISIS_MT_DISABLE))
l = &tlvs->extended_reach;
else
l = isis_get_mt_items(&tlvs->mt_reach, mtid);

View File

@ -324,9 +324,11 @@ struct isis_tlvs {
struct isis_item_list oldstyle_ip_reach_ext;
struct isis_item_list ipv4_address;
struct isis_item_list ipv6_address;
struct isis_item_list global_ipv6_address;
struct isis_item_list mt_router_info;
bool mt_router_info_empty;
struct in_addr *te_router_id;
struct in6_addr *te_router_id_ipv6;
struct isis_item_list extended_ip_reach;
struct isis_mt_item_list mt_ip_reach;
char *hostname;
@ -372,10 +374,12 @@ enum isis_tlv_type {
ISIS_TLV_TE_ROUTER_ID = 134,
ISIS_TLV_EXTENDED_IP_REACH = 135,
ISIS_TLV_DYNAMIC_HOSTNAME = 137,
ISIS_TLV_TE_ROUTER_ID_IPV6 = 140,
ISIS_TLV_SPINE_LEAF_EXT = 150,
ISIS_TLV_MT_REACH = 222,
ISIS_TLV_MT_ROUTER_INFO = 229,
ISIS_TLV_IPV6_ADDRESS = 232,
ISIS_TLV_GLOBAL_IPV6_ADDRESS = 233,
ISIS_TLV_MT_IP_REACH = 235,
ISIS_TLV_IPV6_REACH = 236,
ISIS_TLV_MT_IPV6_REACH = 237,
@ -575,6 +579,8 @@ void isis_tlvs_add_ipv4_addresses(struct isis_tlvs *tlvs,
struct list *addresses);
void isis_tlvs_add_ipv6_addresses(struct isis_tlvs *tlvs,
struct list *addresses);
void isis_tlvs_add_global_ipv6_addresses(struct isis_tlvs *tlvs,
struct list *addresses);
int isis_tlvs_auth_is_valid(struct isis_tlvs *tlvs, struct isis_passwd *passwd,
struct stream *stream, bool is_lsp);
bool isis_tlvs_area_addresses_match(struct isis_tlvs *tlvs,
@ -594,6 +600,8 @@ void isis_tlvs_set_router_capability(struct isis_tlvs *tlvs,
const struct isis_router_cap *cap);
void isis_tlvs_set_te_router_id(struct isis_tlvs *tlvs,
const struct in_addr *id);
void isis_tlvs_set_te_router_id_ipv6(struct isis_tlvs *tlvs,
const struct in6_addr *id);
void isis_tlvs_add_oldstyle_ip_reach(struct isis_tlvs *tlvs,
struct prefix_ipv4 *dest, uint8_t metric);
void isis_tlvs_add_extended_ip_reach(struct isis_tlvs *tlvs,

View File

@ -38,6 +38,7 @@
#include "vrf.h"
#include "libfrr.h"
#include "bfd.h"
#include "link_state.h"
#include "isisd/isis_constants.h"
#include "isisd/isis_common.h"
@ -747,6 +748,25 @@ static void isis_zebra_connected(struct zclient *zclient)
bfd_client_sendmsg(zclient, ZEBRA_BFD_CLIENT_REGISTER, VRF_DEFAULT);
}
/**
* Register / unregister Link State ZAPI Opaque Message
*
* @param up True to register, false to unregister
*
* @return 0 if success, -1 otherwise
*/
int isis_zebra_ls_register(bool up)
{
int rc;
if (up)
rc = ls_register(zclient, true);
else
rc = ls_unregister(zclient, true);
return rc;
}
/*
* opaque messages between processes
*/
@ -754,6 +774,7 @@ static int isis_opaque_msg_handler(ZAPI_CALLBACK_ARGS)
{
struct stream *s;
struct zapi_opaque_msg info;
struct zapi_opaque_reg_info dst;
struct ldp_igp_sync_if_state state;
struct ldp_igp_sync_announce announce;
struct zapi_rlfa_response rlfa;
@ -764,6 +785,13 @@ static int isis_opaque_msg_handler(ZAPI_CALLBACK_ARGS)
return -1;
switch (info.type) {
case LINK_STATE_SYNC:
STREAM_GETC(s, dst.proto);
STREAM_GETW(s, dst.instance);
STREAM_GETL(s, dst.session_id);
dst.type = LINK_STATE_SYNC;
ret = isis_te_sync_ted(dst);
break;
case LDP_IGP_SYNC_IF_STATE_UPDATE:
STREAM_GET(&state, s, sizeof(state));
ret = isis_ldp_sync_state_update(state);

View File

@ -67,5 +67,6 @@ int isis_zebra_request_label_range(uint32_t base, uint32_t chunk_size);
int isis_zebra_release_label_range(uint32_t start, uint32_t end);
void isis_zebra_vrf_register(struct isis *isis);
void isis_zebra_vrf_deregister(struct isis *isis);
int isis_zebra_ls_register(bool up);
#endif /* _ZEBRA_ISIS_ZEBRA_H */

View File

@ -81,6 +81,7 @@ unsigned long debug_tx_queue;
unsigned long debug_sr;
unsigned long debug_ldp_sync;
unsigned long debug_lfa;
unsigned long debug_te;
DEFINE_MGROUP(ISISD, "isisd");
@ -1374,6 +1375,10 @@ void print_debug(struct vty *vty, int flags, int onoff)
if (flags & DEBUG_SR)
vty_out(vty, "IS-IS Segment Routing events debugging is %s\n",
onoffs);
if (flags & DEBUG_TE)
vty_out(vty,
"IS-IS Traffic Engineering events debugging is %s\n",
onoffs);
if (flags & DEBUG_LFA)
vty_out(vty, "IS-IS LFA events debugging is %s\n", onoffs);
if (flags & DEBUG_UPDATE_PACKETS)
@ -1416,6 +1421,8 @@ DEFUN_NOSH (show_debugging,
print_debug(vty, DEBUG_SPF_EVENTS, 1);
if (IS_DEBUG_SR)
print_debug(vty, DEBUG_SR, 1);
if (IS_DEBUG_TE)
print_debug(vty, DEBUG_TE, 1);
if (IS_DEBUG_UPDATE_PACKETS)
print_debug(vty, DEBUG_UPDATE_PACKETS, 1);
if (IS_DEBUG_RTE_EVENTS)
@ -1473,6 +1480,10 @@ static int config_write_debug(struct vty *vty)
vty_out(vty, "debug " PROTO_NAME " sr-events\n");
write++;
}
if (IS_DEBUG_TE) {
vty_out(vty, "debug " PROTO_NAME " te-events\n");
write++;
}
if (IS_DEBUG_LFA) {
vty_out(vty, "debug " PROTO_NAME " lfa\n");
write++;
@ -1707,6 +1718,33 @@ DEFUN (no_debug_isis_srevents,
return CMD_SUCCESS;
}
DEFUN (debug_isis_teevents,
debug_isis_teevents_cmd,
"debug " PROTO_NAME " te-events",
DEBUG_STR
PROTO_HELP
"IS-IS Traffic Engineering Events\n")
{
debug_te |= DEBUG_TE;
print_debug(vty, DEBUG_TE, 1);
return CMD_SUCCESS;
}
DEFUN (no_debug_isis_teevents,
no_debug_isis_teevents_cmd,
"no debug " PROTO_NAME " te-events",
NO_STR
UNDEBUG_STR
PROTO_HELP
"IS-IS Traffic Engineering Events\n")
{
debug_te &= ~DEBUG_TE;
print_debug(vty, DEBUG_TE, 0);
return CMD_SUCCESS;
}
DEFUN (debug_isis_lfa,
debug_isis_lfa_cmd,
"debug " PROTO_NAME " lfa",
@ -3095,6 +3133,8 @@ void isis_init(void)
install_element(ENABLE_NODE, &no_debug_isis_spfevents_cmd);
install_element(ENABLE_NODE, &debug_isis_srevents_cmd);
install_element(ENABLE_NODE, &no_debug_isis_srevents_cmd);
install_element(ENABLE_NODE, &debug_isis_teevents_cmd);
install_element(ENABLE_NODE, &no_debug_isis_teevents_cmd);
install_element(ENABLE_NODE, &debug_isis_lfa_cmd);
install_element(ENABLE_NODE, &no_debug_isis_lfa_cmd);
install_element(ENABLE_NODE, &debug_isis_rtevents_cmd);
@ -3126,6 +3166,8 @@ void isis_init(void)
install_element(CONFIG_NODE, &no_debug_isis_spfevents_cmd);
install_element(CONFIG_NODE, &debug_isis_srevents_cmd);
install_element(CONFIG_NODE, &no_debug_isis_srevents_cmd);
install_element(CONFIG_NODE, &debug_isis_teevents_cmd);
install_element(CONFIG_NODE, &no_debug_isis_teevents_cmd);
install_element(CONFIG_NODE, &debug_isis_lfa_cmd);
install_element(CONFIG_NODE, &no_debug_isis_lfa_cmd);
install_element(CONFIG_NODE, &debug_isis_rtevents_cmd);

View File

@ -331,6 +331,7 @@ extern unsigned long debug_tx_queue;
extern unsigned long debug_sr;
extern unsigned long debug_ldp_sync;
extern unsigned long debug_lfa;
extern unsigned long debug_te;
#define DEBUG_ADJ_PACKETS (1<<0)
#define DEBUG_SNP_PACKETS (1<<1)
@ -347,6 +348,7 @@ extern unsigned long debug_lfa;
#define DEBUG_SR (1<<12)
#define DEBUG_LDP_SYNC (1<<13)
#define DEBUG_LFA (1<<14)
#define DEBUG_TE (1<<15)
/* Debug related macro. */
#define IS_DEBUG_ADJ_PACKETS (debug_adj_pkt & DEBUG_ADJ_PACKETS)
@ -364,6 +366,7 @@ extern unsigned long debug_lfa;
#define IS_DEBUG_SR (debug_sr & DEBUG_SR)
#define IS_DEBUG_LDP_SYNC (debug_ldp_sync & DEBUG_LDP_SYNC)
#define IS_DEBUG_LFA (debug_lfa & DEBUG_LFA)
#define IS_DEBUG_TE (debug_te & DEBUG_TE)
#define lsp_debug(...) \
do { \
@ -383,6 +386,10 @@ extern unsigned long debug_lfa;
zlog_debug(__VA_ARGS__); \
} while (0)
#define DEBUG_TE DEBUG_LSP_GEN
#define te_debug(...) \
do { \
if (IS_DEBUG_TE) \
zlog_debug(__VA_ARGS__); \
} while (0)
#endif /* ISISD_H */

View File

@ -89,7 +89,7 @@ struct ls_node *ls_node_new(struct ls_node_id adv, struct in_addr rid,
}
}
if (!IN6_IS_ADDR_UNSPECIFIED(&rid6)) {
new->router6_id = rid6;
new->router_id6 = rid6;
SET_FLAG(new->flags, LS_NODE_ROUTER_ID6);
}
return new;
@ -127,7 +127,7 @@ int ls_node_same(struct ls_node *n1, struct ls_node *n2)
&& !IPV4_ADDR_SAME(&n1->router_id, &n2->router_id))
return 0;
if (CHECK_FLAG(n1->flags, LS_NODE_ROUTER_ID6)
&& !IPV6_ADDR_SAME(&n1->router6_id, &n2->router6_id))
&& !IPV6_ADDR_SAME(&n1->router_id6, &n2->router_id6))
return 0;
if (CHECK_FLAG(n1->flags, LS_NODE_FLAG)
&& (n1->node_flag != n2->node_flag))
@ -306,36 +306,23 @@ int ls_attributes_same(struct ls_attributes *l1, struct ls_attributes *l2)
if (CHECK_FLAG(l1->flags, LS_ATTR_USE_BW)
&& (l1->extended.used_bw != l2->extended.used_bw))
return 0;
if (CHECK_FLAG(l1->flags, LS_ATTR_ADJ_SID)) {
if ((l1->adj_sid[0].sid != l2->adj_sid[0].sid)
|| (l1->adj_sid[0].flags != l2->adj_sid[0].flags)
|| (l1->adj_sid[0].weight != l2->adj_sid[0].weight))
for (int i = 0; i < LS_ADJ_MAX; i++) {
if (!CHECK_FLAG(l1->flags, (LS_ATTR_ADJ_SID << i)))
continue;
if ((l1->adj_sid[i].sid != l2->adj_sid[i].sid)
|| (l1->adj_sid[i].flags != l2->adj_sid[i].flags)
|| (l1->adj_sid[i].weight != l2->adj_sid[i].weight))
return 0;
if (((l1->adv.origin == ISIS_L1) || (l1->adv.origin == ISIS_L2))
&& (memcmp(&l1->adj_sid[0].neighbor.sysid,
&l2->adj_sid[0].neighbor.sysid, ISO_SYS_ID_LEN)
&& (memcmp(&l1->adj_sid[i].neighbor.sysid,
&l2->adj_sid[i].neighbor.sysid, ISO_SYS_ID_LEN)
!= 0))
return 0;
if (((l1->adv.origin == OSPFv2) || (l1->adv.origin == STATIC)
|| (l1->adv.origin == DIRECT))
&& (!IPV4_ADDR_SAME(&l1->adj_sid[0].neighbor.addr,
&l2->adj_sid[0].neighbor.addr)))
return 0;
}
if (CHECK_FLAG(l1->flags, LS_ATTR_BCK_ADJ_SID)) {
if ((l1->adj_sid[1].sid != l2->adj_sid[1].sid)
|| (l1->adj_sid[1].flags != l2->adj_sid[1].flags)
|| (l1->adj_sid[1].weight != l2->adj_sid[1].weight))
return 0;
if (((l1->adv.origin == ISIS_L1) || (l1->adv.origin == ISIS_L2))
&& (memcmp(&l1->adj_sid[1].neighbor.sysid,
&l2->adj_sid[1].neighbor.sysid, ISO_SYS_ID_LEN)
!= 0))
return 0;
if (((l1->adv.origin == OSPFv2) || (l1->adv.origin == STATIC)
|| (l1->adv.origin == DIRECT))
&& (!IPV4_ADDR_SAME(&l1->adj_sid[1].neighbor.addr,
&l2->adj_sid[1].neighbor.addr)))
&& (i < ADJ_PRI_IPV6)
&& (!IPV4_ADDR_SAME(&l1->adj_sid[i].neighbor.addr,
&l2->adj_sid[i].neighbor.addr)))
return 0;
}
if (CHECK_FLAG(l1->flags, LS_ATTR_SRLG)
@ -417,6 +404,25 @@ int ls_prefix_same(struct ls_prefix *p1, struct ls_prefix *p2)
/**
* Link State Vertices management functions
*/
uint64_t sysid_to_key(const uint8_t sysid[ISO_SYS_ID_LEN])
{
uint64_t key = 0;
#if BYTE_ORDER == LITTLE_ENDIAN
uint8_t *byte = (uint8_t *)&key;
for (int i = 0; i < ISO_SYS_ID_LEN; i++)
byte[i] = sysid[ISO_SYS_ID_LEN - i - 1];
byte[6] = 0;
byte[7] = 0;
#else
memcpy(&key, sysid, ISO_SYS_ID_LEN);
#endif
return key;
}
struct ls_vertex *ls_vertex_add(struct ls_ted *ted, struct ls_node *node)
{
struct ls_vertex *new;
@ -435,7 +441,7 @@ struct ls_vertex *ls_vertex_add(struct ls_ted *ted, struct ls_node *node)
break;
case ISIS_L1:
case ISIS_L2:
memcpy(&key, &node->adv.id.iso.sys_id, ISO_SYS_ID_LEN);
key = sysid_to_key(node->adv.id.iso.sys_id);
break;
default:
key = 0;
@ -557,7 +563,7 @@ struct ls_vertex *ls_find_vertex_by_id(struct ls_ted *ted,
break;
case ISIS_L1:
case ISIS_L2:
memcpy(&vertex.key, &nid.id.iso.sys_id, ISO_SYS_ID_LEN);
vertex.key = sysid_to_key(nid.id.iso.sys_id);
break;
default:
return NULL;
@ -673,6 +679,46 @@ static void ls_edge_connect_to(struct ls_ted *ted, struct ls_edge *edge)
}
}
static uint64_t get_edge_key(struct ls_attributes *attr, bool dst)
{
uint64_t key = 0;
struct ls_standard *std;
if (!attr)
return key;
std = &attr->standard;
if (dst) {
/* Key is the IPv4 remote address */
if (CHECK_FLAG(attr->flags, LS_ATTR_NEIGH_ADDR))
key = ((uint64_t)ntohl(std->remote.s_addr))
& 0xffffffff;
/* or the 64 bits LSB of IPv6 remote address */
else if (CHECK_FLAG(attr->flags, LS_ATTR_NEIGH_ADDR6))
key = ((uint64_t)ntohl(std->remote6.s6_addr32[2]) << 32
| (uint64_t)ntohl(std->remote6.s6_addr32[3]));
/* of remote identifier if no IP addresses are defined */
else if (CHECK_FLAG(attr->flags, LS_ATTR_NEIGH_ID))
key = (((uint64_t)std->remote_id) & 0xffffffff)
| ((uint64_t)std->local_id << 32);
} else {
/* Key is the IPv4 local address */
if (CHECK_FLAG(attr->flags, LS_ATTR_LOCAL_ADDR))
key = ((uint64_t)ntohl(std->local.s_addr)) & 0xffffffff;
/* or the 64 bits LSB of IPv6 local address */
else if (CHECK_FLAG(attr->flags, LS_ATTR_LOCAL_ADDR6))
key = ((uint64_t)ntohl(std->local6.s6_addr32[2]) << 32
| (uint64_t)ntohl(std->local6.s6_addr32[3]));
/* of local identifier if no IP addresses are defined */
else if (CHECK_FLAG(attr->flags, LS_ATTR_LOCAL_ID))
key = (((uint64_t)std->local_id) & 0xffffffff)
| ((uint64_t)std->remote_id << 32);
}
return key;
}
struct ls_edge *ls_edge_add(struct ls_ted *ted,
struct ls_attributes *attributes)
{
@ -682,23 +728,7 @@ struct ls_edge *ls_edge_add(struct ls_ted *ted,
if (attributes == NULL)
return NULL;
/* Key is the IPv4 local address */
if (!IPV4_NET0(attributes->standard.local.s_addr))
key = ((uint64_t)ntohl(attributes->standard.local.s_addr))
& 0xffffffff;
/* or the IPv6 local address if IPv4 is not defined */
else if (!IN6_IS_ADDR_UNSPECIFIED(&attributes->standard.local6))
key = (uint64_t)(attributes->standard.local6.s6_addr32[0]
& 0xffffffff)
| ((uint64_t)attributes->standard.local6.s6_addr32[1]
<< 32);
/* of local identifier if no IP addresses are defined */
else if (attributes->standard.local_id != 0)
key = (uint64_t)(
(attributes->standard.local_id & 0xffffffff)
| ((uint64_t)attributes->standard.remote_id << 32));
/* Check that key is valid */
key = get_edge_key(attributes, false);
if (key == 0)
return NULL;
@ -736,23 +766,7 @@ struct ls_edge *ls_find_edge_by_source(struct ls_ted *ted,
if (attributes == NULL)
return NULL;
edge.key = 0;
/* Key is the IPv4 local address */
if (!IPV4_NET0(attributes->standard.local.s_addr))
edge.key = ((uint64_t)ntohl(attributes->standard.local.s_addr))
& 0xffffffff;
/* or the IPv6 local address if IPv4 is not defined */
else if (!IN6_IS_ADDR_UNSPECIFIED(&attributes->standard.local6))
edge.key = (uint64_t)(attributes->standard.local6.s6_addr32[0]
& 0xffffffff)
| ((uint64_t)attributes->standard.local6.s6_addr32[1]
<< 32);
/* of local identifier if no IP addresses are defined */
else if (attributes->standard.local_id != 0)
edge.key = (uint64_t)(
(attributes->standard.local_id & 0xffffffff)
| ((uint64_t)attributes->standard.remote_id << 32));
edge.key = get_edge_key(attributes, false);
if (edge.key == 0)
return NULL;
@ -767,24 +781,7 @@ struct ls_edge *ls_find_edge_by_destination(struct ls_ted *ted,
if (attributes == NULL)
return NULL;
edge.key = 0;
/* Key is the IPv4 remote address */
if (!IPV4_NET0(attributes->standard.remote.s_addr))
edge.key = ((uint64_t)ntohl(attributes->standard.remote.s_addr))
& 0xffffffff;
/* or the IPv6 remote address if IPv4 is not defined */
else if (!IN6_IS_ADDR_UNSPECIFIED(&attributes->standard.remote6))
edge.key =
(uint64_t)(attributes->standard.remote6.s6_addr32[0]
& 0xffffffff)
| ((uint64_t)attributes->standard.remote6.s6_addr32[1]
<< 32);
/* of remote identifier if no IP addresses are defined */
else if (attributes->standard.remote_id != 0)
edge.key = (uint64_t)(
(attributes->standard.remote_id & 0xffffffff)
| ((uint64_t)attributes->standard.local_id << 32));
edge.key = get_edge_key(attributes, true);
if (edge.key == 0)
return NULL;
@ -1177,7 +1174,7 @@ static struct ls_node *ls_parse_node(struct stream *s)
if (CHECK_FLAG(node->flags, LS_NODE_ROUTER_ID))
node->router_id.s_addr = stream_get_ipv4(s);
if (CHECK_FLAG(node->flags, LS_NODE_ROUTER_ID6))
STREAM_GET(&node->router6_id, s, IPV6_MAX_BYTELEN);
STREAM_GET(&node->router_id6, s, IPV6_MAX_BYTELEN);
if (CHECK_FLAG(node->flags, LS_NODE_FLAG))
STREAM_GETC(s, node->node_flag);
if (CHECK_FLAG(node->flags, LS_NODE_TYPE))
@ -1267,26 +1264,32 @@ static struct ls_attributes *ls_parse_attributes(struct stream *s)
if (CHECK_FLAG(attr->flags, LS_ATTR_USE_BW))
STREAM_GETF(s, attr->extended.used_bw);
if (CHECK_FLAG(attr->flags, LS_ATTR_ADJ_SID)) {
STREAM_GETL(s, attr->adj_sid[0].sid);
STREAM_GETC(s, attr->adj_sid[0].flags);
STREAM_GETC(s, attr->adj_sid[0].weight);
if (attr->adv.origin == ISIS_L1 || attr->adv.origin == ISIS_L2)
STREAM_GET(attr->adj_sid[0].neighbor.sysid, s,
ISO_SYS_ID_LEN);
else if (attr->adv.origin == OSPFv2)
attr->adj_sid[0].neighbor.addr.s_addr =
stream_get_ipv4(s);
STREAM_GETL(s, attr->adj_sid[ADJ_PRI_IPV4].sid);
STREAM_GETC(s, attr->adj_sid[ADJ_PRI_IPV4].flags);
STREAM_GETC(s, attr->adj_sid[ADJ_PRI_IPV4].weight);
attr->adj_sid[ADJ_PRI_IPV4].neighbor.addr.s_addr =
stream_get_ipv4(s);
}
if (CHECK_FLAG(attr->flags, LS_ATTR_BCK_ADJ_SID)) {
STREAM_GETL(s, attr->adj_sid[1].sid);
STREAM_GETC(s, attr->adj_sid[1].flags);
STREAM_GETC(s, attr->adj_sid[1].weight);
if (attr->adv.origin == ISIS_L1 || attr->adv.origin == ISIS_L2)
STREAM_GET(attr->adj_sid[1].neighbor.sysid, s,
ISO_SYS_ID_LEN);
else if (attr->adv.origin == OSPFv2)
attr->adj_sid[1].neighbor.addr.s_addr =
stream_get_ipv4(s);
STREAM_GETL(s, attr->adj_sid[ADJ_BCK_IPV4].sid);
STREAM_GETC(s, attr->adj_sid[ADJ_BCK_IPV4].flags);
STREAM_GETC(s, attr->adj_sid[ADJ_BCK_IPV4].weight);
attr->adj_sid[ADJ_BCK_IPV4].neighbor.addr.s_addr =
stream_get_ipv4(s);
}
if (CHECK_FLAG(attr->flags, LS_ATTR_ADJ_SID6)) {
STREAM_GETL(s, attr->adj_sid[ADJ_PRI_IPV6].sid);
STREAM_GETC(s, attr->adj_sid[ADJ_PRI_IPV6].flags);
STREAM_GETC(s, attr->adj_sid[ADJ_PRI_IPV6].weight);
STREAM_GET(attr->adj_sid[ADJ_PRI_IPV6].neighbor.sysid, s,
ISO_SYS_ID_LEN);
}
if (CHECK_FLAG(attr->flags, LS_ATTR_BCK_ADJ_SID6)) {
STREAM_GETL(s, attr->adj_sid[ADJ_BCK_IPV6].sid);
STREAM_GETC(s, attr->adj_sid[ADJ_BCK_IPV6].flags);
STREAM_GETC(s, attr->adj_sid[ADJ_BCK_IPV6].weight);
STREAM_GET(attr->adj_sid[ADJ_BCK_IPV6].neighbor.sysid, s,
ISO_SYS_ID_LEN);
}
if (CHECK_FLAG(attr->flags, LS_ATTR_SRLG)) {
STREAM_GETC(s, len);
@ -1401,7 +1404,7 @@ static int ls_format_node(struct stream *s, struct ls_node *node)
if (CHECK_FLAG(node->flags, LS_NODE_ROUTER_ID))
stream_put_ipv4(s, node->router_id.s_addr);
if (CHECK_FLAG(node->flags, LS_NODE_ROUTER_ID6))
stream_put(s, &node->router6_id, IPV6_MAX_BYTELEN);
stream_put(s, &node->router_id6, IPV6_MAX_BYTELEN);
if (CHECK_FLAG(node->flags, LS_NODE_FLAG))
stream_putc(s, node->node_flag);
if (CHECK_FLAG(node->flags, LS_NODE_TYPE))
@ -1487,26 +1490,32 @@ static int ls_format_attributes(struct stream *s, struct ls_attributes *attr)
if (CHECK_FLAG(attr->flags, LS_ATTR_USE_BW))
stream_putf(s, attr->extended.used_bw);
if (CHECK_FLAG(attr->flags, LS_ATTR_ADJ_SID)) {
stream_putl(s, attr->adj_sid[0].sid);
stream_putc(s, attr->adj_sid[0].flags);
stream_putc(s, attr->adj_sid[0].weight);
if (attr->adv.origin == ISIS_L1 || attr->adv.origin == ISIS_L2)
stream_put(s, attr->adj_sid[0].neighbor.sysid,
ISO_SYS_ID_LEN);
else if (attr->adv.origin == OSPFv2)
stream_put_ipv4(s,
attr->adj_sid[0].neighbor.addr.s_addr);
stream_putl(s, attr->adj_sid[ADJ_PRI_IPV4].sid);
stream_putc(s, attr->adj_sid[ADJ_PRI_IPV4].flags);
stream_putc(s, attr->adj_sid[ADJ_PRI_IPV4].weight);
stream_put_ipv4(
s, attr->adj_sid[ADJ_PRI_IPV4].neighbor.addr.s_addr);
}
if (CHECK_FLAG(attr->flags, LS_ATTR_BCK_ADJ_SID)) {
stream_putl(s, attr->adj_sid[1].sid);
stream_putc(s, attr->adj_sid[1].flags);
stream_putc(s, attr->adj_sid[1].weight);
if (attr->adv.origin == ISIS_L1 || attr->adv.origin == ISIS_L2)
stream_put(s, attr->adj_sid[1].neighbor.sysid,
ISO_SYS_ID_LEN);
else if (attr->adv.origin == OSPFv2)
stream_put_ipv4(s,
attr->adj_sid[1].neighbor.addr.s_addr);
stream_putl(s, attr->adj_sid[ADJ_BCK_IPV4].sid);
stream_putc(s, attr->adj_sid[ADJ_BCK_IPV4].flags);
stream_putc(s, attr->adj_sid[ADJ_BCK_IPV4].weight);
stream_put_ipv4(
s, attr->adj_sid[ADJ_BCK_IPV4].neighbor.addr.s_addr);
}
if (CHECK_FLAG(attr->flags, LS_ATTR_ADJ_SID6)) {
stream_putl(s, attr->adj_sid[ADJ_PRI_IPV6].sid);
stream_putc(s, attr->adj_sid[ADJ_PRI_IPV6].flags);
stream_putc(s, attr->adj_sid[ADJ_PRI_IPV6].weight);
stream_put(s, attr->adj_sid[ADJ_PRI_IPV6].neighbor.sysid,
ISO_SYS_ID_LEN);
}
if (CHECK_FLAG(attr->flags, LS_ATTR_BCK_ADJ_SID6)) {
stream_putl(s, attr->adj_sid[ADJ_BCK_IPV6].sid);
stream_putc(s, attr->adj_sid[ADJ_BCK_IPV6].flags);
stream_putc(s, attr->adj_sid[ADJ_BCK_IPV6].weight);
stream_put(s, attr->adj_sid[ADJ_BCK_IPV6].neighbor.sysid,
ISO_SYS_ID_LEN);
}
if (CHECK_FLAG(attr->flags, LS_ATTR_SRLG)) {
stream_putc(s, attr->srlg_len);
@ -1955,6 +1964,7 @@ static void ls_show_vertex_vty(struct ls_vertex *vertex, struct vty *vty,
struct listnode *node;
struct ls_node *lsn;
struct ls_edge *edge;
struct ls_attributes *attr;
struct ls_subnet *subnet;
struct sbuf sbuf;
uint32_t upper;
@ -2019,9 +2029,15 @@ static void ls_show_vertex_vty(struct ls_vertex *vertex, struct vty *vty,
} else {
sbuf_push(&sbuf, 6, "To:\t- (0.0.0.0)");
}
sbuf_push(&sbuf, 0, "\tLocal: %pI4\tRemote: %pI4\n",
&edge->attributes->standard.local,
&edge->attributes->standard.remote);
attr = edge->attributes;
if ((CHECK_FLAG(attr->flags, LS_ATTR_LOCAL_ADDR)))
sbuf_push(&sbuf, 0, "\tLocal: %pI4\tRemote: %pI4\n",
&attr->standard.local,
&attr->standard.remote);
else if ((CHECK_FLAG(attr->flags, LS_ATTR_LOCAL_ADDR6)))
sbuf_push(&sbuf, 0, "\tLocal: %pI6\tRemote: %pI6\n",
&attr->standard.local6,
&attr->standard.remote6);
}
sbuf_push(&sbuf, 4, "Incoming Edges: %d\n",
@ -2034,9 +2050,15 @@ static void ls_show_vertex_vty(struct ls_vertex *vertex, struct vty *vty,
} else {
sbuf_push(&sbuf, 6, "From:\t- (0.0.0.0)");
}
sbuf_push(&sbuf, 0, "\tRemote: %pI4\tLocal: %pI4\n",
&edge->attributes->standard.local,
&edge->attributes->standard.remote);
attr = edge->attributes;
if ((CHECK_FLAG(attr->flags, LS_ATTR_LOCAL_ADDR)))
sbuf_push(&sbuf, 0, "\tLocal: %pI4\tRemote: %pI4\n",
&attr->standard.local,
&attr->standard.remote);
else if ((CHECK_FLAG(attr->flags, LS_ATTR_LOCAL_ADDR6)))
sbuf_push(&sbuf, 0, "\tLocal: %pI6\tRemote: %pI6\n",
&attr->standard.local6,
&attr->standard.remote6);
}
sbuf_push(&sbuf, 4, "Subnets: %d\n", listcount(vertex->prefixes));
@ -2071,7 +2093,7 @@ static void ls_show_vertex_json(struct ls_vertex *vertex,
json_object_string_add(json, "router-id", buf);
}
if (CHECK_FLAG(lsn->flags, LS_NODE_ROUTER_ID6)) {
snprintfrr(buf, INET6_BUFSIZ, "%pI6", &lsn->router6_id);
snprintfrr(buf, INET6_BUFSIZ, "%pI6", &lsn->router_id6);
json_object_string_add(json, "router-id-v6", buf);
}
if (CHECK_FLAG(lsn->flags, LS_NODE_TYPE))
@ -2235,15 +2257,32 @@ static void ls_show_edge_vty(struct ls_edge *edge, struct vty *vty,
sbuf_push(&sbuf, 4, "Utilized Bandwidth: %g (Bytes/s)\n",
attr->extended.used_bw);
if (CHECK_FLAG(attr->flags, LS_ATTR_ADJ_SID)) {
sbuf_push(&sbuf, 4, "Adjacency-SID: %u", attr->adj_sid[0].sid);
sbuf_push(&sbuf, 4, "IPv4 Adjacency-SID: %u",
attr->adj_sid[ADJ_PRI_IPV4].sid);
sbuf_push(&sbuf, 0, "\tFlags: 0x%x\tWeight: 0x%x\n",
attr->adj_sid[0].flags, attr->adj_sid[0].weight);
attr->adj_sid[ADJ_PRI_IPV4].flags,
attr->adj_sid[ADJ_PRI_IPV4].weight);
}
if (CHECK_FLAG(attr->flags, LS_ATTR_BCK_ADJ_SID)) {
sbuf_push(&sbuf, 4, "Bck. Adjacency-SID: %u",
attr->adj_sid[1].sid);
sbuf_push(&sbuf, 4, "IPv4 Bck. Adjacency-SID: %u",
attr->adj_sid[ADJ_BCK_IPV4].sid);
sbuf_push(&sbuf, 0, "\tFlags: 0x%x\tWeight: 0x%x\n",
attr->adj_sid[1].flags, attr->adj_sid[1].weight);
attr->adj_sid[ADJ_BCK_IPV4].flags,
attr->adj_sid[ADJ_BCK_IPV4].weight);
}
if (CHECK_FLAG(attr->flags, LS_ATTR_ADJ_SID6)) {
sbuf_push(&sbuf, 4, "IPv6 Adjacency-SID: %u",
attr->adj_sid[ADJ_PRI_IPV6].sid);
sbuf_push(&sbuf, 0, "\tFlags: 0x%x\tWeight: 0x%x\n",
attr->adj_sid[ADJ_PRI_IPV6].flags,
attr->adj_sid[ADJ_PRI_IPV6].weight);
}
if (CHECK_FLAG(attr->flags, LS_ATTR_BCK_ADJ_SID6)) {
sbuf_push(&sbuf, 4, "IPv6 Bck. Adjacency-SID: %u",
attr->adj_sid[ADJ_BCK_IPV6].sid);
sbuf_push(&sbuf, 0, "\tFlags: 0x%x\tWeight: 0x%x\n",
attr->adj_sid[ADJ_BCK_IPV6].flags,
attr->adj_sid[ADJ_BCK_IPV6].weight);
}
if (CHECK_FLAG(attr->flags, LS_ATTR_SRLG)) {
sbuf_push(&sbuf, 4, "SRLGs: %d", attr->srlg_len);
@ -2374,10 +2413,12 @@ static void ls_show_edge_json(struct ls_edge *edge, struct json_object *json)
jsr = json_object_new_array();
json_object_object_add(json, "segment-routing", jsr);
jobj = json_object_new_object();
json_object_int_add(jobj, "adj-sid", attr->adj_sid[0].sid);
snprintfrr(buf, 6, "0x%x", attr->adj_sid[0].flags);
json_object_int_add(jobj, "adj-sid",
attr->adj_sid[ADJ_PRI_IPV4].sid);
snprintfrr(buf, 6, "0x%x", attr->adj_sid[ADJ_PRI_IPV4].flags);
json_object_string_add(jobj, "flags", buf);
json_object_int_add(jobj, "weight", attr->adj_sid[0].weight);
json_object_int_add(jobj, "weight",
attr->adj_sid[ADJ_PRI_IPV4].weight);
json_object_array_add(jsr, jobj);
}
if (CHECK_FLAG(attr->flags, LS_ATTR_BCK_ADJ_SID)) {
@ -2386,10 +2427,38 @@ static void ls_show_edge_json(struct ls_edge *edge, struct json_object *json)
json_object_object_add(json, "segment-routing", jsr);
}
jobj = json_object_new_object();
json_object_int_add(jobj, "adj-sid", attr->adj_sid[1].sid);
snprintfrr(buf, 6, "0x%x", attr->adj_sid[1].flags);
json_object_int_add(jobj, "adj-sid",
attr->adj_sid[ADJ_BCK_IPV4].sid);
snprintfrr(buf, 6, "0x%x", attr->adj_sid[ADJ_BCK_IPV4].flags);
json_object_string_add(jobj, "flags", buf);
json_object_int_add(jobj, "weight", attr->adj_sid[1].weight);
json_object_int_add(jobj, "weight",
attr->adj_sid[ADJ_BCK_IPV4].weight);
json_object_array_add(jsr, jobj);
}
if (CHECK_FLAG(attr->flags, LS_ATTR_ADJ_SID6)) {
jsr = json_object_new_array();
json_object_object_add(json, "segment-routing", jsr);
jobj = json_object_new_object();
json_object_int_add(jobj, "adj-sid",
attr->adj_sid[ADJ_PRI_IPV6].sid);
snprintfrr(buf, 6, "0x%x", attr->adj_sid[ADJ_PRI_IPV6].flags);
json_object_string_add(jobj, "flags", buf);
json_object_int_add(jobj, "weight",
attr->adj_sid[ADJ_PRI_IPV6].weight);
json_object_array_add(jsr, jobj);
}
if (CHECK_FLAG(attr->flags, LS_ATTR_BCK_ADJ_SID6)) {
if (!jsr) {
jsr = json_object_new_array();
json_object_object_add(json, "segment-routing", jsr);
}
jobj = json_object_new_object();
json_object_int_add(jobj, "adj-sid",
attr->adj_sid[ADJ_BCK_IPV6].sid);
snprintfrr(buf, 6, "0x%x", attr->adj_sid[ADJ_BCK_IPV6].flags);
json_object_string_add(jobj, "flags", buf);
json_object_int_add(jobj, "weight",
attr->adj_sid[ADJ_BCK_IPV6].weight);
json_object_array_add(jsr, jobj);
}
}

View File

@ -122,7 +122,7 @@ struct ls_node {
struct ls_node_id adv; /* Adv. Router of this Link State */
char name[MAX_NAME_LENGTH]; /* Name of the Node (IS-IS only) */
struct in_addr router_id; /* IPv4 Router ID */
struct in6_addr router6_id; /* IPv6 Router ID */
struct in6_addr router_id6; /* IPv6 Router ID */
uint8_t node_flag; /* IS-IS or OSPF Node flag */
enum ls_node_type type; /* Type of Node */
uint32_t as_number; /* Local or neighbor AS number */
@ -166,6 +166,8 @@ struct ls_node {
#define LS_ATTR_USE_BW 0x00400000
#define LS_ATTR_ADJ_SID 0x01000000
#define LS_ATTR_BCK_ADJ_SID 0x02000000
#define LS_ATTR_ADJ_SID6 0x04000000
#define LS_ATTR_BCK_ADJ_SID6 0x08000000
#define LS_ATTR_SRLG 0x10000000
/* Link State Attributes */
@ -200,6 +202,11 @@ struct ls_attributes {
float rsv_bw; /* Reserved Bandwidth */
float used_bw; /* Utilized Bandwidth */
} extended;
#define ADJ_PRI_IPV4 0
#define ADJ_BCK_IPV4 1
#define ADJ_PRI_IPV6 2
#define ADJ_BCK_IPV6 3
#define LS_ADJ_MAX 4
struct ls_adjacency { /* (LAN)-Adjacency SID for OSPF */
uint32_t sid; /* SID as MPLS label or index */
uint8_t flags; /* Flags */
@ -208,7 +215,7 @@ struct ls_attributes {
struct in_addr addr; /* Neighbor @IP for OSPF */
uint8_t sysid[ISO_SYS_ID_LEN]; /* or Sys-ID for ISIS */
} neighbor;
} adj_sid[2]; /* Primary & Backup (LAN)-Adj. SID */
} adj_sid[4]; /* IPv4/IPv6 & Primary/Backup (LAN)-Adj. SID */
uint32_t *srlgs; /* List of Shared Risk Link Group */
uint8_t srlg_len; /* number of SRLG in the list */
};
@ -412,21 +419,34 @@ struct ls_subnet {
macro_inline int vertex_cmp(const struct ls_vertex *node1,
const struct ls_vertex *node2)
{
return (node1->key - node2->key);
return numcmp(node1->key, node2->key);
}
DECLARE_RBTREE_UNIQ(vertices, struct ls_vertex, entry, vertex_cmp);
macro_inline int edge_cmp(const struct ls_edge *edge1,
const struct ls_edge *edge2)
{
return (edge1->key - edge2->key);
return numcmp(edge1->key, edge2->key);
}
DECLARE_RBTREE_UNIQ(edges, struct ls_edge, entry, edge_cmp);
/*
* Prefix comparison are done to the host part so, 10.0.0.1/24
* and 10.0.0.2/24 are considered come different
*/
macro_inline int subnet_cmp(const struct ls_subnet *a,
const struct ls_subnet *b)
const struct ls_subnet *b)
{
return prefix_cmp(&a->key, &b->key);
if (a->key.family != b->key.family)
return numcmp(a->key.family, b->key.family);
if (a->key.prefixlen != b->key.prefixlen)
return numcmp(a->key.prefixlen, b->key.prefixlen);
if (a->key.family == AF_INET)
return memcmp(&a->key.u.val, &b->key.u.val, 4);
return memcmp(&a->key.u.val, &b->key.u.val, 16);
}
DECLARE_RBTREE_UNIQ(subnets, struct ls_subnet, entry, subnet_cmp);
@ -503,6 +523,16 @@ extern struct ls_vertex *ls_vertex_update(struct ls_ted *ted,
*/
extern void ls_vertex_clean(struct ls_ted *ted, struct ls_vertex *vertex,
struct zclient *zclient);
/**
* This function convert the ISIS ISO system ID into a 64 bits unsigned integer
* following the architecture dependent byte order.
*
* @param sysid The ISO system ID
* @return Key as 64 bits unsigned integer
*/
extern uint64_t sysid_to_key(const uint8_t sysid[ISO_SYS_ID_LEN]);
/**
* Find Vertex in the Link State DB by its unique key.
*

View File

View File

@ -0,0 +1,31 @@
!
hostname r1
!
interface lo
ip router isis TE
ipv6 router isis TE
isis circuit-type level-2-only
isis passive
!
interface r1-eth0
ip router isis TE
isis circuit-type level-2-only
isis network point-to-point
isis hello-multiplier 3
!
interface r1-eth1
ip router isis TE
ipv6 router isis TE
isis circuit-type level-2-only
isis network point-to-point
isis hello-multiplier 3
!
router isis TE
net 49.0000.0000.0000.0001.00
is-type level-2-only
topology ipv6-unicast
lsp-timers gen-interval 2 refresh-interval 10 max-lifetime 350
mpls-te on
mpls-te router-address 10.0.255.1
!

View File

@ -0,0 +1,25 @@
!
hostname r1
!
interface lo
ip address 10.0.255.1/32
ipv6 address 2001:db8:ffff::1/128
!
interface r1-eth0
ip address 10.0.0.1/24
link-params
metric 20
delay 10000
ava-bw 1.25e+08
enable
exit-link-params
!
interface r1-eth1
ip address 10.0.1.1/24
ipv6 address 2001:db8:1::1:1/64
link-params
enable
exit-link-params
!
ip forwarding
!

View File

@ -0,0 +1,45 @@
!
hostname r2
!
! debug isis te-events
!
interface lo
ip router isis TE
ipv6 router isis TE
isis circuit-type level-2-only
isis passive
!
interface r2-eth0
ip router isis TE
isis circuit-type level-2-only
isis network point-to-point
isis hello-multiplier 3
!
interface r2-eth1
ip router isis TE
ipv6 router isis TE
isis circuit-type level-2-only
isis network point-to-point
isis hello-multiplier 3
!
interface r2-eth2
ip router isis TE
ipv6 router isis TE
isis circuit-type level-2-only
isis network point-to-point
isis hello-multiplier 3
!
interface r2-eth3
ip router isis TE
isis circuit-type level-2-only
isis network point-to-point
isis hello-multiplier 3
!
router isis TE
net 49.0000.0000.0000.0002.00
is-type level-2-only
topology ipv6-unicast
lsp-timers gen-interval 2 refresh-interval 10 max-lifetime 350
mpls-te on
mpls-te router-address 10.0.255.2
!

View File

@ -0,0 +1,39 @@
!
hostname r2
!
interface lo
ip address 10.0.255.2/32
ipv6 address 2001:db8:ffff::2/128
!
interface r2-eth0
ip address 10.0.0.2/24
link-params
enable
exit-link-params
!
interface r2-eth1
ip address 10.0.1.2/24
ipv6 address 2001:db8:1::1:2/64
link-params
enable
exit-link-params
!
interface r2-eth2
ip address 10.0.3.2/24
ipv6 address 2001:db8:3::3:2/64
link-params
enable
exit-link-params
!
interface r2-eth3
ip address 10.0.4.2/24
ipv6 address 2001:db8:4::4:2/64
link-params
metric 30
delay 25000
use-bw 1.25e+8
enable
exit-link-params
!
ip forwarding
!

View File

@ -0,0 +1,34 @@
!
hostname r3
!
! debug isis te-events
!
interface lo
ip router isis TE
ipv6 router isis TE
isis circuit-type level-2-only
isis passive
!
interface r3-eth0
ip router isis TE
ipv6 router isis TE
isis circuit-type level-2-only
isis network point-to-point
isis hello-multiplier 3
!
interface r3-eth1
ipv6 router isis TE
isis circuit-type level-2-only
isis network point-to-point
isis hello-multiplier 3
!
!
router isis TE
net 49.0000.0000.0000.0003.00
is-type level-2-only
topology ipv6-unicast
lsp-timers gen-interval 2 refresh-interval 10 max-lifetime 350
mpls-te on
mpls-te router-address 10.0.255.3
mpls-te router-address ipv6 2001:db8:1000::3
!

View File

@ -0,0 +1,25 @@
!
hostname r3
!
interface lo
ip address 10.0.255.3/32
ipv6 address 2001:db8:ffff::3/128
!
interface r3-eth0
ip address 10.0.3.3/24
ipv6 address 2001:db8:3::3:3/64
link-params
enable
admin-grp 0x20
exit-link-params
!
interface r3-eth1
ipv6 address 2001:db8:5::4:3/64
link-params
enable
metric 10
delay 50000
exit-link-params
!
ip forwarding
!

View File

@ -0,0 +1,39 @@
!
hostname r4
!
! debug isis te-events
! debug isis sr-events
! debug isis lsp-gen
!
interface lo
ip router isis TE
ipv6 router isis TE
isis circuit-type level-2-only
isis passive
!
interface r4-eth0
ip router isis TE
isis circuit-type level-2-only
isis network point-to-point
isis hello-multiplier 3
!
interface r4-eth1
ipv6 router isis TE
isis circuit-type level-2-only
isis network point-to-point
isis hello-multiplier 3
!
!
router isis TE
net 49.0000.0000.0000.0004.00
is-type level-2-only
topology ipv6-unicast
lsp-timers gen-interval 2 refresh-interval 10 max-lifetime 350
mpls-te on
mpls-te router-address 10.0.255.4
segment-routing on
segment-routing global-block 10000 19999 local-block 5000 5999
segment-routing node-msd 12
segment-routing prefix 10.0.255.4/32 index 400 no-php-flag
segment-routing prefix 2001:db8:ffff::4/128 index 1400 no-php-flag
!

View File

@ -0,0 +1,22 @@
!
hostname r4
!
interface lo
ip address 10.0.255.4/32
ipv6 address 2001:db8:ffff::4/128
!
interface r4-eth0
ip address 10.0.4.4/24
ipv6 address 2001:db8:4::2:4/64
link-params
enable
exit-link-params
!
interface r4-eth1
ipv6 address 2001:db8:5::3:4/64
link-params
enable
exit-link-params
!
ip forwarding
!

View File

@ -0,0 +1,851 @@
{
"ted":{
"name":"ISIS",
"key":1,
"verticesCount":4,
"edgesCount":14,
"subnetsCount":22,
"vertices":[
{
"vertex-id":1,
"status":"Sync",
"origin":"ISIS_L2",
"name":"r1",
"router-id":"10.0.255.1"
},
{
"vertex-id":2,
"status":"Sync",
"origin":"ISIS_L2",
"name":"r2",
"router-id":"10.0.255.2"
},
{
"vertex-id":3,
"status":"Sync",
"origin":"ISIS_L2",
"name":"r3",
"router-id":"10.0.255.3",
"router-id-v6":"2001:db8:1000::3"
},
{
"vertex-id":4,
"status":"Sync",
"origin":"ISIS_L2",
"name":"r4",
"router-id":"10.0.255.4",
"segment-routing":{
"srgb-size":10000,
"srgb-lower":10000,
"algorithms":[
{
"0":"SPF"
}
],
"srlb-size":1000,
"srlb-lower":5000,
"msd":12
}
}
],
"edges":[
{
"edge-id":65537,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"local-vertex-id":1,
"remote-vertex-id":2,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address-v6":"2001:db8:1::1:1",
"remote-address-v6":"2001:db8:1::1:2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":65538,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"local-vertex-id":2,
"remote-vertex-id":1,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address-v6":"2001:db8:1::1:2",
"remote-address-v6":"2001:db8:1::1:1",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":196610,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"local-vertex-id":2,
"remote-vertex-id":3,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address-v6":"2001:db8:3::3:2",
"remote-address-v6":"2001:db8:3::3:3",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":196611,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"local-vertex-id":3,
"remote-vertex-id":2,
"metric":10,
"edge-attributes":{
"te-metric":0,
"admin-group":32,
"local-address-v6":"2001:db8:3::3:3",
"remote-address-v6":"2001:db8:3::3:2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":196612,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0004",
"local-vertex-id":4,
"remote-vertex-id":3,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address-v6":"2001:db8:5::3:4",
"remote-address-v6":"2001:db8:5::4:3",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
},
"segment-routing":[
{
"adj-sid":5001,
"flags":"0xb0",
"weight":0
}
]
},
{
"edge-id":262147,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"local-vertex-id":3,
"remote-vertex-id":4,
"metric":10,
"edge-attributes":{
"te-metric":10,
"local-address-v6":"2001:db8:5::4:3",
"remote-address-v6":"2001:db8:5::3:4",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
],
"delay":50000
}
},
{
"edge-id":167772161,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"local-vertex-id":1,
"remote-vertex-id":2,
"metric":10,
"edge-attributes":{
"te-metric":20,
"local-address":"10.0.0.1",
"remote-address":"10.0.0.2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
],
"delay":10000,
"available-bandwidth":125000000.0
}
},
{
"edge-id":167772162,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"local-vertex-id":2,
"remote-vertex-id":1,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address":"10.0.0.2",
"remote-address":"10.0.0.1",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":167772417,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"local-vertex-id":1,
"remote-vertex-id":2,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address":"10.0.1.1",
"remote-address":"10.0.1.2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":167772418,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"local-vertex-id":2,
"remote-vertex-id":1,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address":"10.0.1.2",
"remote-address":"10.0.1.1",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":167772930,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"local-vertex-id":2,
"remote-vertex-id":3,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address":"10.0.3.2",
"remote-address":"10.0.3.3",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":167772931,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"local-vertex-id":3,
"remote-vertex-id":2,
"metric":10,
"edge-attributes":{
"te-metric":0,
"admin-group":32,
"local-address":"10.0.3.3",
"remote-address":"10.0.3.2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":167773186,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"local-vertex-id":2,
"remote-vertex-id":4,
"metric":10,
"edge-attributes":{
"te-metric":30,
"local-address":"10.0.4.2",
"remote-address":"10.0.4.4",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
],
"delay":25000,
"utilized-bandwidth":125000000.0
}
},
{
"edge-id":167773188,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0004",
"local-vertex-id":4,
"remote-vertex-id":2,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address":"10.0.4.4",
"remote-address":"10.0.4.2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
},
"segment-routing":[
{
"adj-sid":5000,
"flags":"0x30",
"weight":0
}
]
}
],
"subnets":[
{
"subnet-id":"10.0.0.1\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"vertex-id":1,
"metric":10
},
{
"subnet-id":"10.0.0.2\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"10.0.1.1\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"vertex-id":1,
"metric":10
},
{
"subnet-id":"10.0.1.2\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"10.0.3.2\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"10.0.3.3\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"vertex-id":3,
"metric":10
},
{
"subnet-id":"10.0.4.2\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"10.0.4.4\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0004",
"vertex-id":4,
"metric":10
},
{
"subnet-id":"10.0.255.1\/32",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"vertex-id":1,
"metric":10
},
{
"subnet-id":"10.0.255.2\/32",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"10.0.255.3\/32",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"vertex-id":3,
"metric":10
},
{
"subnet-id":"10.0.255.4\/32",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0004",
"vertex-id":4,
"metric":10,
"segment-routing":{
"pref-sid":400,
"algo":0,
"flags":"0x60"
}
},
{
"subnet-id":"2001:db8:1::1:1\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"vertex-id":1,
"metric":10
},
{
"subnet-id":"2001:db8:1::1:2\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"2001:db8:3::3:2\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"2001:db8:3::3:3\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"vertex-id":3,
"metric":10
},
{
"subnet-id":"2001:db8:5::3:4\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0004",
"vertex-id":4,
"metric":10
},
{
"subnet-id":"2001:db8:5::4:3\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"vertex-id":3,
"metric":10
},
{
"subnet-id":"2001:db8:ffff::1\/128",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"vertex-id":1,
"metric":10
},
{
"subnet-id":"2001:db8:ffff::2\/128",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"2001:db8:ffff::3\/128",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"vertex-id":3,
"metric":10
},
{
"subnet-id":"2001:db8:ffff::4\/128",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0004",
"vertex-id":4,
"metric":10,
"segment-routing":{
"pref-sid":1400,
"algo":0,
"flags":"0x60"
}
}
]
}
}

View File

@ -0,0 +1,651 @@
{
"ted":{
"name":"ISIS",
"key":1,
"verticesCount":4,
"edgesCount":10,
"subnetsCount":18,
"vertices":[
{
"vertex-id":1,
"status":"Sync",
"origin":"ISIS_L2",
"name":"r1",
"router-id":"10.0.255.1"
},
{
"vertex-id":2,
"status":"Sync",
"origin":"ISIS_L2",
"name":"r2",
"router-id":"10.0.255.2"
},
{
"vertex-id":3,
"status":"Sync",
"origin":"ISIS_L2",
"name":"r3",
"router-id":"10.0.255.3",
"router-id-v6":"2001:db8:1000::3"
},
{
"vertex-id":4,
"status":"Sync",
"origin":"ISIS_L2",
"name":"r4",
"router-id":"10.0.255.4",
"segment-routing":{
"srgb-size":10000,
"srgb-lower":10000,
"algorithms":[
{
"0":"SPF"
}
],
"srlb-size":1000,
"srlb-lower":5000,
"msd":12
}
}
],
"edges":[
{
"edge-id":196610,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"local-vertex-id":2,
"remote-vertex-id":3,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address-v6":"2001:db8:3::3:2",
"remote-address-v6":"2001:db8:3::3:3",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":196611,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"local-vertex-id":3,
"remote-vertex-id":2,
"metric":10,
"edge-attributes":{
"te-metric":0,
"admin-group":32,
"local-address-v6":"2001:db8:3::3:3",
"remote-address-v6":"2001:db8:3::3:2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":196612,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0004",
"local-vertex-id":4,
"remote-vertex-id":3,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address-v6":"2001:db8:5::3:4",
"remote-address-v6":"2001:db8:5::4:3",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
},
"segment-routing":[
{
"adj-sid":5001,
"flags":"0xb0",
"weight":0
}
]
},
{
"edge-id":262147,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"local-vertex-id":3,
"remote-vertex-id":4,
"metric":10,
"edge-attributes":{
"te-metric":10,
"local-address-v6":"2001:db8:5::4:3",
"remote-address-v6":"2001:db8:5::3:4",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
],
"delay":50000
}
},
{
"edge-id":167772161,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"local-vertex-id":1,
"remote-vertex-id":2,
"metric":10,
"edge-attributes":{
"te-metric":20,
"local-address":"10.0.0.1",
"remote-address":"10.0.0.2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
],
"delay":10000,
"available-bandwidth":125000000.0
}
},
{
"edge-id":167772162,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"local-vertex-id":2,
"remote-vertex-id":1,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address":"10.0.0.2",
"remote-address":"10.0.0.1",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":167772930,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"local-vertex-id":2,
"remote-vertex-id":3,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address":"10.0.3.2",
"remote-address":"10.0.3.3",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":167772931,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"local-vertex-id":3,
"remote-vertex-id":2,
"metric":10,
"edge-attributes":{
"te-metric":0,
"admin-group":32,
"local-address":"10.0.3.3",
"remote-address":"10.0.3.2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":167773186,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"local-vertex-id":2,
"remote-vertex-id":4,
"metric":10,
"edge-attributes":{
"te-metric":30,
"local-address":"10.0.4.2",
"remote-address":"10.0.4.4",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
],
"delay":25000,
"utilized-bandwidth":125000000.0
}
},
{
"edge-id":167773188,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0004",
"local-vertex-id":4,
"remote-vertex-id":2,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address":"10.0.4.4",
"remote-address":"10.0.4.2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
},
"segment-routing":[
{
"adj-sid":5000,
"flags":"0x30",
"weight":0
}
]
}
],
"subnets":[
{
"subnet-id":"10.0.0.1\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"vertex-id":1,
"metric":10
},
{
"subnet-id":"10.0.0.2\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"10.0.3.2\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"10.0.3.3\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"vertex-id":3,
"metric":10
},
{
"subnet-id":"10.0.4.2\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"10.0.4.4\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0004",
"vertex-id":4,
"metric":10
},
{
"subnet-id":"10.0.255.1\/32",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"vertex-id":1,
"metric":10
},
{
"subnet-id":"10.0.255.2\/32",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"10.0.255.3\/32",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"vertex-id":3,
"metric":10
},
{
"subnet-id":"10.0.255.4\/32",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0004",
"vertex-id":4,
"metric":10,
"segment-routing":{
"pref-sid":400,
"algo":0,
"flags":"0x60"
}
},
{
"subnet-id":"2001:db8:3::3:2\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"2001:db8:3::3:3\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"vertex-id":3,
"metric":10
},
{
"subnet-id":"2001:db8:5::3:4\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0004",
"vertex-id":4,
"metric":10
},
{
"subnet-id":"2001:db8:5::4:3\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"vertex-id":3,
"metric":10
},
{
"subnet-id":"2001:db8:ffff::1\/128",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"vertex-id":1,
"metric":10
},
{
"subnet-id":"2001:db8:ffff::2\/128",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"2001:db8:ffff::3\/128",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"vertex-id":3,
"metric":10
},
{
"subnet-id":"2001:db8:ffff::4\/128",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0004",
"vertex-id":4,
"metric":10,
"segment-routing":{
"pref-sid":1400,
"algo":0,
"flags":"0x60"
}
}
]
}
}

View File

@ -0,0 +1,752 @@
{
"ted":{
"name":"ISIS",
"key":1,
"verticesCount":4,
"edgesCount":12,
"subnetsCount":20,
"vertices":[
{
"vertex-id":1,
"status":"Sync",
"origin":"ISIS_L2",
"name":"r1",
"router-id":"10.0.255.1"
},
{
"vertex-id":2,
"status":"Sync",
"origin":"ISIS_L2",
"name":"r2",
"router-id":"10.0.255.2"
},
{
"vertex-id":3,
"status":"Sync",
"origin":"ISIS_L2",
"name":"r3",
"router-id":"10.0.255.3",
"router-id-v6":"2001:db8:1000::3"
},
{
"vertex-id":4,
"status":"Sync",
"origin":"ISIS_L2",
"name":"r4",
"router-id":"10.0.255.4",
"segment-routing":{
"srgb-size":10000,
"srgb-lower":10000,
"algorithms":[
{
"0":"SPF"
}
],
"srlb-size":1000,
"srlb-lower":5000,
"msd":12
}
}
],
"edges":[
{
"edge-id":1,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"local-vertex-id":1,
"remote-vertex-id":2,
"metric":10,
"edge-attributes":{
"te-metric":20,
"local-address-v6":"2001:db8::1",
"remote-address-v6":"2001:db8::2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
],
"delay":10000,
"available-bandwidth":125000000.0
}
},
{
"edge-id":2,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"local-vertex-id":2,
"remote-vertex-id":1,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address-v6":"2001:db8::2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":196610,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"local-vertex-id":2,
"remote-vertex-id":3,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address-v6":"2001:db8:3::3:2",
"remote-address-v6":"2001:db8:3::3:3",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":196611,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"local-vertex-id":3,
"remote-vertex-id":2,
"metric":10,
"edge-attributes":{
"te-metric":0,
"admin-group":32,
"local-address-v6":"2001:db8:3::3:3",
"remote-address-v6":"2001:db8:3::3:2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":196612,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0004",
"local-vertex-id":4,
"remote-vertex-id":3,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address-v6":"2001:db8:5::3:4",
"remote-address-v6":"2001:db8:5::4:3",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
},
"segment-routing":[
{
"adj-sid":5001,
"flags":"0xb0",
"weight":0
}
]
},
{
"edge-id":262147,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"local-vertex-id":3,
"remote-vertex-id":4,
"metric":10,
"edge-attributes":{
"te-metric":10,
"local-address-v6":"2001:db8:5::4:3",
"remote-address-v6":"2001:db8:5::3:4",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
],
"delay":50000
}
},
{
"edge-id":167772161,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"local-vertex-id":1,
"remote-vertex-id":2,
"metric":10,
"edge-attributes":{
"te-metric":20,
"local-address":"10.0.0.1",
"remote-address":"10.0.0.2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
],
"delay":10000,
"available-bandwidth":125000000.0
}
},
{
"edge-id":167772162,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"local-vertex-id":2,
"remote-vertex-id":1,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address":"10.0.0.2",
"remote-address":"10.0.0.1",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":167772930,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"local-vertex-id":2,
"remote-vertex-id":3,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address":"10.0.3.2",
"remote-address":"10.0.3.3",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":167772931,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"local-vertex-id":3,
"remote-vertex-id":2,
"metric":10,
"edge-attributes":{
"te-metric":0,
"admin-group":32,
"local-address":"10.0.3.3",
"remote-address":"10.0.3.2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":167773186,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"local-vertex-id":2,
"remote-vertex-id":4,
"metric":10,
"edge-attributes":{
"te-metric":30,
"local-address":"10.0.4.2",
"remote-address":"10.0.4.4",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
],
"delay":25000,
"utilized-bandwidth":125000000.0
}
},
{
"edge-id":167773188,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0004",
"local-vertex-id":4,
"remote-vertex-id":2,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address":"10.0.4.4",
"remote-address":"10.0.4.2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
},
"segment-routing":[
{
"adj-sid":5000,
"flags":"0x30",
"weight":0
}
]
}
],
"subnets":[
{
"subnet-id":"10.0.0.1\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"vertex-id":1,
"metric":10
},
{
"subnet-id":"10.0.0.2\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"10.0.3.2\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"10.0.3.3\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"vertex-id":3,
"metric":10
},
{
"subnet-id":"10.0.4.2\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"10.0.4.4\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0004",
"vertex-id":4,
"metric":10
},
{
"subnet-id":"10.0.255.1\/32",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"vertex-id":1,
"metric":10
},
{
"subnet-id":"10.0.255.2\/32",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"10.0.255.3\/32",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"vertex-id":3,
"metric":10
},
{
"subnet-id":"10.0.255.4\/32",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0004",
"vertex-id":4,
"metric":10,
"segment-routing":{
"pref-sid":400,
"algo":0,
"flags":"0x60"
}
},
{
"subnet-id":"2001:db8::1\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"vertex-id":1,
"metric":10
},
{
"subnet-id":"2001:db8::2\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"2001:db8:3::3:2\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"2001:db8:3::3:3\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"vertex-id":3,
"metric":10
},
{
"subnet-id":"2001:db8:5::3:4\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0004",
"vertex-id":4,
"metric":10
},
{
"subnet-id":"2001:db8:5::4:3\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"vertex-id":3,
"metric":10
},
{
"subnet-id":"2001:db8:ffff::1\/128",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"vertex-id":1,
"metric":10
},
{
"subnet-id":"2001:db8:ffff::2\/128",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"2001:db8:ffff::3\/128",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"vertex-id":3,
"metric":10
},
{
"subnet-id":"2001:db8:ffff::4\/128",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0004",
"vertex-id":4,
"metric":10,
"segment-routing":{
"pref-sid":1400,
"algo":0,
"flags":"0x60"
}
}
]
}
}

View File

@ -0,0 +1,752 @@
{
"ted":{
"name":"ISIS",
"key":1,
"verticesCount":4,
"edgesCount":12,
"subnetsCount":20,
"vertices":[
{
"vertex-id":1,
"status":"Sync",
"origin":"ISIS_L2",
"name":"r1",
"router-id":"10.0.255.1"
},
{
"vertex-id":2,
"status":"Sync",
"origin":"ISIS_L2",
"name":"r2",
"router-id":"10.0.255.2"
},
{
"vertex-id":3,
"status":"Sync",
"origin":"ISIS_L2",
"name":"r3",
"router-id":"10.0.255.3",
"router-id-v6":"2001:db8:1000::3"
},
{
"vertex-id":4,
"status":"Sync",
"origin":"ISIS_L2",
"name":"r4",
"router-id":"10.0.255.4",
"segment-routing":{
"srgb-size":10000,
"srgb-lower":10000,
"algorithms":[
{
"0":"SPF"
}
],
"srlb-size":1000,
"srlb-lower":5000,
"msd":12
}
}
],
"edges":[
{
"edge-id":1,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"local-vertex-id":1,
"remote-vertex-id":2,
"metric":10,
"edge-attributes":{
"te-metric":20,
"local-address-v6":"2001:db8::1",
"remote-address-v6":"2001:db8::2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
],
"delay":10000,
"available-bandwidth":125000000.0
}
},
{
"edge-id":2,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"local-vertex-id":2,
"remote-vertex-id":1,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address-v6":"2001:db8::2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":196610,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"local-vertex-id":2,
"remote-vertex-id":3,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address-v6":"2001:db8:3::3:2",
"remote-address-v6":"2001:db8:3::3:3",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":196611,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"local-vertex-id":3,
"remote-vertex-id":2,
"metric":10,
"edge-attributes":{
"te-metric":0,
"admin-group":32,
"local-address-v6":"2001:db8:3::3:3",
"remote-address-v6":"2001:db8:3::3:2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":196612,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0004",
"local-vertex-id":4,
"remote-vertex-id":3,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address-v6":"2001:db8:5::3:4",
"remote-address-v6":"2001:db8:5::4:3",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
},
"segment-routing":[
{
"adj-sid":5001,
"flags":"0xb0",
"weight":0
}
]
},
{
"edge-id":262147,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"local-vertex-id":3,
"remote-vertex-id":4,
"metric":10,
"edge-attributes":{
"te-metric":10,
"local-address-v6":"2001:db8:5::4:3",
"remote-address-v6":"2001:db8:5::3:4",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
],
"delay":50000
}
},
{
"edge-id":167772161,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"local-vertex-id":1,
"remote-vertex-id":2,
"metric":10,
"edge-attributes":{
"te-metric":20,
"local-address":"10.0.0.1",
"remote-address":"10.0.0.2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
],
"delay":10000,
"available-bandwidth":125000000.0
}
},
{
"edge-id":167772162,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"local-vertex-id":2,
"remote-vertex-id":1,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address":"10.0.0.2",
"remote-address":"10.0.0.1",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":167772930,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"local-vertex-id":2,
"remote-vertex-id":3,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address":"10.0.3.2",
"remote-address":"10.0.3.3",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":167772931,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"local-vertex-id":3,
"remote-vertex-id":2,
"metric":10,
"edge-attributes":{
"te-metric":0,
"admin-group":32,
"local-address":"10.0.3.3",
"remote-address":"10.0.3.2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":167773186,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"local-vertex-id":2,
"remote-vertex-id":4,
"metric":10,
"edge-attributes":{
"te-metric":30,
"local-address":"10.0.4.2",
"remote-address":"10.0.4.4",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
],
"delay":25000,
"utilized-bandwidth":125000000.0
}
},
{
"edge-id":167773188,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0004",
"local-vertex-id":4,
"remote-vertex-id":2,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address":"10.0.4.4",
"remote-address":"10.0.4.2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
},
"segment-routing":[
{
"adj-sid":5000,
"flags":"0x30",
"weight":0
}
]
}
],
"subnets":[
{
"subnet-id":"10.0.0.1\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"vertex-id":1,
"metric":10
},
{
"subnet-id":"10.0.0.2\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"10.0.3.2\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"10.0.3.3\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"vertex-id":3,
"metric":10
},
{
"subnet-id":"10.0.4.2\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"10.0.4.4\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0004",
"vertex-id":4,
"metric":10
},
{
"subnet-id":"10.0.255.1\/32",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"vertex-id":1,
"metric":10
},
{
"subnet-id":"10.0.255.2\/32",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"10.0.255.3\/32",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"vertex-id":3,
"metric":10
},
{
"subnet-id":"10.0.255.4\/32",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0004",
"vertex-id":4,
"metric":10,
"segment-routing":{
"pref-sid":400,
"algo":0,
"flags":"0x60"
}
},
{
"subnet-id":"2001:db8::1\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"vertex-id":1,
"metric":10
},
{
"subnet-id":"2001:db8::2\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"2001:db8:3::3:2\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"2001:db8:3::3:3\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"vertex-id":3,
"metric":10
},
{
"subnet-id":"2001:db8:5::3:4\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0004",
"vertex-id":4,
"metric":10
},
{
"subnet-id":"2001:db8:5::4:3\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"vertex-id":3,
"metric":10
},
{
"subnet-id":"2001:db8:ffff::1\/128",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"vertex-id":1,
"metric":10
},
{
"subnet-id":"2001:db8:ffff::2\/128",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"2001:db8:ffff::3\/128",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"vertex-id":3,
"metric":10
},
{
"subnet-id":"2001:db8:ffff::4\/128",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0004",
"vertex-id":4,
"metric":10,
"segment-routing":{
"pref-sid":1400,
"algo":0,
"flags":"0x60"
}
}
]
}
}

View File

@ -0,0 +1,952 @@
{
"ted":{
"name":"ISIS",
"key":1,
"verticesCount":4,
"edgesCount":16,
"subnetsCount":24,
"vertices":[
{
"vertex-id":1,
"status":"Sync",
"origin":"ISIS_L2",
"name":"r1",
"router-id":"10.0.255.1"
},
{
"vertex-id":2,
"status":"Sync",
"origin":"ISIS_L2",
"name":"r2",
"router-id":"10.0.255.2"
},
{
"vertex-id":3,
"status":"Sync",
"origin":"ISIS_L2",
"name":"r3",
"router-id":"10.0.255.3",
"router-id-v6":"2001:db8:1000::3"
},
{
"vertex-id":4,
"status":"Sync",
"origin":"ISIS_L2",
"name":"r4",
"router-id":"10.0.255.4",
"segment-routing":{
"srgb-size":10000,
"srgb-lower":10000,
"algorithms":[
{
"0":"SPF"
}
],
"srlb-size":1000,
"srlb-lower":5000,
"msd":12
}
}
],
"edges":[
{
"edge-id":1,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"local-vertex-id":1,
"remote-vertex-id":2,
"metric":10,
"edge-attributes":{
"te-metric":20,
"local-address-v6":"2001:db8::1",
"remote-address-v6":"2001:db8::2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
],
"delay":10000,
"available-bandwidth":125000000.0
}
},
{
"edge-id":2,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"local-vertex-id":2,
"remote-vertex-id":1,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address-v6":"2001:db8::2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":65537,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"local-vertex-id":1,
"remote-vertex-id":2,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address-v6":"2001:db8:1::1:1",
"remote-address-v6":"2001:db8:1::1:2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":65538,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"local-vertex-id":2,
"remote-vertex-id":1,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address-v6":"2001:db8:1::1:2",
"remote-address-v6":"2001:db8:1::1:1",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":196610,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"local-vertex-id":2,
"remote-vertex-id":3,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address-v6":"2001:db8:3::3:2",
"remote-address-v6":"2001:db8:3::3:3",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":196611,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"local-vertex-id":3,
"remote-vertex-id":2,
"metric":10,
"edge-attributes":{
"te-metric":0,
"admin-group":32,
"local-address-v6":"2001:db8:3::3:3",
"remote-address-v6":"2001:db8:3::3:2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":196612,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0004",
"local-vertex-id":4,
"remote-vertex-id":3,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address-v6":"2001:db8:5::3:4",
"remote-address-v6":"2001:db8:5::4:3",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
},
"segment-routing":[
{
"adj-sid":5001,
"flags":"0xb0",
"weight":0
}
]
},
{
"edge-id":262147,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"local-vertex-id":3,
"remote-vertex-id":4,
"metric":10,
"edge-attributes":{
"te-metric":10,
"local-address-v6":"2001:db8:5::4:3",
"remote-address-v6":"2001:db8:5::3:4",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
],
"delay":50000
}
},
{
"edge-id":167772161,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"local-vertex-id":1,
"remote-vertex-id":2,
"metric":10,
"edge-attributes":{
"te-metric":20,
"local-address":"10.0.0.1",
"remote-address":"10.0.0.2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
],
"delay":10000,
"available-bandwidth":125000000.0
}
},
{
"edge-id":167772162,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"local-vertex-id":2,
"remote-vertex-id":1,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address":"10.0.0.2",
"remote-address":"10.0.0.1",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":167772417,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"local-vertex-id":1,
"remote-vertex-id":2,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address":"10.0.1.1",
"remote-address":"10.0.1.2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":167772418,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"local-vertex-id":2,
"remote-vertex-id":1,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address":"10.0.1.2",
"remote-address":"10.0.1.1",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":167772930,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"local-vertex-id":2,
"remote-vertex-id":3,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address":"10.0.3.2",
"remote-address":"10.0.3.3",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":167772931,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"local-vertex-id":3,
"remote-vertex-id":2,
"metric":10,
"edge-attributes":{
"te-metric":0,
"admin-group":32,
"local-address":"10.0.3.3",
"remote-address":"10.0.3.2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":167773186,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"local-vertex-id":2,
"remote-vertex-id":4,
"metric":10,
"edge-attributes":{
"te-metric":30,
"local-address":"10.0.4.2",
"remote-address":"10.0.4.4",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
],
"delay":25000,
"utilized-bandwidth":125000000.0
}
},
{
"edge-id":167773188,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0004",
"local-vertex-id":4,
"remote-vertex-id":2,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address":"10.0.4.4",
"remote-address":"10.0.4.2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
},
"segment-routing":[
{
"adj-sid":5000,
"flags":"0x30",
"weight":0
}
]
}
],
"subnets":[
{
"subnet-id":"10.0.0.1\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"vertex-id":1,
"metric":10
},
{
"subnet-id":"10.0.0.2\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"10.0.1.1\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"vertex-id":1,
"metric":10
},
{
"subnet-id":"10.0.1.2\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"10.0.3.2\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"10.0.3.3\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"vertex-id":3,
"metric":10
},
{
"subnet-id":"10.0.4.2\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"10.0.4.4\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0004",
"vertex-id":4,
"metric":10
},
{
"subnet-id":"10.0.255.1\/32",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"vertex-id":1,
"metric":10
},
{
"subnet-id":"10.0.255.2\/32",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"10.0.255.3\/32",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"vertex-id":3,
"metric":10
},
{
"subnet-id":"10.0.255.4\/32",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0004",
"vertex-id":4,
"metric":10,
"segment-routing":{
"pref-sid":400,
"algo":0,
"flags":"0x60"
}
},
{
"subnet-id":"2001:db8::1\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"vertex-id":1,
"metric":10
},
{
"subnet-id":"2001:db8::2\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"2001:db8:1::1:1\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"vertex-id":1,
"metric":10
},
{
"subnet-id":"2001:db8:1::1:2\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"2001:db8:3::3:2\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"2001:db8:3::3:3\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"vertex-id":3,
"metric":10
},
{
"subnet-id":"2001:db8:5::3:4\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0004",
"vertex-id":4,
"metric":10
},
{
"subnet-id":"2001:db8:5::4:3\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"vertex-id":3,
"metric":10
},
{
"subnet-id":"2001:db8:ffff::1\/128",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"vertex-id":1,
"metric":10
},
{
"subnet-id":"2001:db8:ffff::2\/128",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"2001:db8:ffff::3\/128",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"vertex-id":3,
"metric":10
},
{
"subnet-id":"2001:db8:ffff::4\/128",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0004",
"vertex-id":4,
"metric":10,
"segment-routing":{
"pref-sid":1400,
"algo":0,
"flags":"0x60"
}
}
]
}
}

View File

@ -0,0 +1,953 @@
{
"ted":{
"name":"ISIS",
"key":1,
"verticesCount":4,
"edgesCount":16,
"subnetsCount":24,
"vertices":[
{
"vertex-id":1,
"status":"Sync",
"origin":"ISIS_L2",
"name":"r1",
"router-id":"10.0.255.1"
},
{
"vertex-id":2,
"status":"Sync",
"origin":"ISIS_L2",
"name":"r2",
"router-id":"10.0.255.2"
},
{
"vertex-id":3,
"status":"Sync",
"origin":"ISIS_L2",
"name":"r3",
"router-id":"10.0.255.3",
"router-id-v6":"2001:db8:1000::3"
},
{
"vertex-id":4,
"status":"Sync",
"origin":"ISIS_L2",
"name":"r4",
"router-id":"10.0.255.4",
"segment-routing":{
"srgb-size":10000,
"srgb-lower":10000,
"algorithms":[
{
"0":"SPF"
}
],
"srlb-size":1000,
"srlb-lower":5000,
"msd":12
}
}
],
"edges":[
{
"edge-id":1,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"local-vertex-id":1,
"remote-vertex-id":2,
"metric":10,
"edge-attributes":{
"te-metric":20,
"local-address-v6":"2001:db8::1",
"remote-address-v6":"2001:db8::2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
],
"delay":10000,
"available-bandwidth":125000000.0
}
},
{
"edge-id":2,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"local-vertex-id":2,
"remote-vertex-id":1,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address-v6":"2001:db8::2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":65537,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"local-vertex-id":1,
"remote-vertex-id":2,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address-v6":"2001:db8:1::1:1",
"remote-address-v6":"2001:db8:1::1:2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":65538,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"local-vertex-id":2,
"remote-vertex-id":1,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address-v6":"2001:db8:1::1:2",
"remote-address-v6":"2001:db8:1::1:1",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":196610,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"local-vertex-id":2,
"remote-vertex-id":3,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address-v6":"2001:db8:3::3:2",
"remote-address-v6":"2001:db8:3::3:3",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":196611,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"local-vertex-id":3,
"remote-vertex-id":2,
"metric":10,
"edge-attributes":{
"te-metric":0,
"admin-group":32,
"local-address-v6":"2001:db8:3::3:3",
"remote-address-v6":"2001:db8:3::3:2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":196612,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0004",
"local-vertex-id":4,
"remote-vertex-id":3,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address-v6":"2001:db8:5::3:4",
"remote-address-v6":"2001:db8:5::4:3",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
},
"segment-routing":[
{
"adj-sid":5001,
"flags":"0xb0",
"weight":0
}
]
},
{
"edge-id":262147,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"local-vertex-id":3,
"remote-vertex-id":4,
"metric":10,
"edge-attributes":{
"te-metric":10,
"local-address-v6":"2001:db8:5::4:3",
"remote-address-v6":"2001:db8:5::3:4",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
],
"delay":50000
}
},
{
"edge-id":167772161,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"local-vertex-id":1,
"remote-vertex-id":2,
"metric":10,
"edge-attributes":{
"te-metric":20,
"local-address":"10.0.0.1",
"remote-address":"10.0.0.2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
],
"delay":10000,
"available-bandwidth":125000000.0
}
},
{
"edge-id":167772162,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"local-vertex-id":2,
"remote-vertex-id":1,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address":"10.0.0.2",
"remote-address":"10.0.0.1",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":167772417,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"local-vertex-id":1,
"remote-vertex-id":2,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address":"10.0.1.1",
"remote-address":"10.0.1.2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":167772418,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"local-vertex-id":2,
"remote-vertex-id":1,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address":"10.0.1.2",
"remote-address":"10.0.1.1",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":167772930,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"local-vertex-id":2,
"remote-vertex-id":3,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address":"10.0.3.2",
"remote-address":"10.0.3.3",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":167772931,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"local-vertex-id":3,
"remote-vertex-id":2,
"metric":10,
"edge-attributes":{
"te-metric":0,
"admin-group":32,
"local-address":"10.0.3.3",
"remote-address":"10.0.3.2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
]
}
},
{
"edge-id":167773186,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"local-vertex-id":2,
"remote-vertex-id":4,
"metric":10,
"edge-attributes":{
"te-metric":30,
"local-address":"10.0.4.2",
"remote-address":"10.0.4.4",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
],
"delay":25000
}
},
{
"edge-id":167773188,
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0004",
"local-vertex-id":4,
"remote-vertex-id":2,
"metric":10,
"edge-attributes":{
"te-metric":0,
"local-address":"10.0.4.4",
"remote-address":"10.0.4.2",
"max-link-bandwidth":176258176.0,
"max-resv-link-bandwidth":176258176.0,
"unreserved-bandwidth":[
{
"class-type-0":176258176.0
},
{
"class-type-1":176258176.0
},
{
"class-type-2":176258176.0
},
{
"class-type-3":176258176.0
},
{
"class-type-4":176258176.0
},
{
"class-type-5":176258176.0
},
{
"class-type-6":176258176.0
},
{
"class-type-7":176258176.0
}
],
"delay":20000,
"jitter":10000
},
"segment-routing":[
{
"adj-sid":5000,
"flags":"0x30",
"weight":0
}
]
}
],
"subnets":[
{
"subnet-id":"10.0.0.1\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"vertex-id":1,
"metric":10
},
{
"subnet-id":"10.0.0.2\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"10.0.1.1\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"vertex-id":1,
"metric":10
},
{
"subnet-id":"10.0.1.2\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"10.0.3.2\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"10.0.3.3\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"vertex-id":3,
"metric":10
},
{
"subnet-id":"10.0.4.2\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"10.0.4.4\/24",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0004",
"vertex-id":4,
"metric":10
},
{
"subnet-id":"10.0.255.1\/32",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"vertex-id":1,
"metric":10
},
{
"subnet-id":"10.0.255.2\/32",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"10.0.255.3\/32",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"vertex-id":3,
"metric":10
},
{
"subnet-id":"10.0.255.4\/32",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0004",
"vertex-id":4,
"metric":10,
"segment-routing":{
"pref-sid":400,
"algo":0,
"flags":"0x60"
}
},
{
"subnet-id":"2001:db8::1\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"vertex-id":1,
"metric":10
},
{
"subnet-id":"2001:db8::2\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"2001:db8:1::1:1\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"vertex-id":1,
"metric":10
},
{
"subnet-id":"2001:db8:1::1:2\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"2001:db8:3::3:2\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"2001:db8:3::3:3\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"vertex-id":3,
"metric":10
},
{
"subnet-id":"2001:db8:5::3:4\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0004",
"vertex-id":4,
"metric":10
},
{
"subnet-id":"2001:db8:5::4:3\/64",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"vertex-id":3,
"metric":10
},
{
"subnet-id":"2001:db8:ffff::1\/128",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0001",
"vertex-id":1,
"metric":10
},
{
"subnet-id":"2001:db8:ffff::2\/128",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0002",
"vertex-id":2,
"metric":10
},
{
"subnet-id":"2001:db8:ffff::3\/128",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0003",
"vertex-id":3,
"metric":10
},
{
"subnet-id":"2001:db8:ffff::4\/128",
"status":"Sync",
"origin":"ISIS_L2",
"advertised-router":"0000.0000.0004",
"vertex-id":4,
"metric":10,
"segment-routing":{
"pref-sid":1400,
"algo":0,
"flags":"0x60"
}
}
]
}
}

View File

@ -0,0 +1,265 @@
#!/usr/bin/env python
#
# test_isis_te_topo1.py
# Part of NetDEF Topology Tests
#
# Copyright (c) 2021 by Orange
# Author: Olivier Dugeon <olivier.dugeon@orange.com>
#
# Permission to use, copy, modify, and/or distribute this software
# for any purpose with or without fee is hereby granted, provided
# that the above copyright notice and this permission notice appear
# in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND NETDEF DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
#
"""
test_isis_te_topo1.py: Test the FRR IS-IS with Traffic Engineering.
+------------+
| |
| R1 |
| 10.0.225.1 |
| |
+------------+
r1-eth0| |r1-eth1
| |
10.0.0.0/24| |10.0.1.0/24
| |2001:db8:1:/64
| |
r2-eth0| |r2-eth1
+------------+ +------------+
| | | |
| R2 |r2-eth2 r3-eth0| R3 |
| 10.0.255.2 +------------------+ 10.0.255.3 |
| | 10.0.3.0/24 | |
+------------+ 2001:db8:3:/64 +------+-----+
r2-eth3| r3-eth1|
| |
10.0.4.0/24| |
| |
| |
r4-eth0| 2001:db8:5:/64|
+------------+ |
| | |
| R4 |r4-eth1 |
| 10.0.255.4 +-------------------------+
| |
+------------+
"""
import os
import sys
import json
from functools import partial
# Save the Current Working Directory to find configuration files.
CWD = os.path.dirname(os.path.realpath(__file__))
sys.path.append(os.path.join(CWD, "../"))
# pylint: disable=C0413
# Import topogen and topotest helpers
from lib import topotest
from lib.topogen import Topogen, TopoRouter, get_topogen
from lib.topolog import logger
# and Finally pytest
import pytest
pytestmark = [pytest.mark.isisd]
def build_topo(tgen):
"Build function"
# Create 4 routers
for routern in range(1, 5):
tgen.add_router("r{}".format(routern))
# Interconect router 1 and 2 with 2 links
switch = tgen.add_switch("s1")
switch.add_link(tgen.gears["r1"])
switch.add_link(tgen.gears["r2"])
switch = tgen.add_switch("s2")
switch.add_link(tgen.gears["r1"])
switch.add_link(tgen.gears["r2"])
# Interconect router 3 and 2
switch = tgen.add_switch("s3")
switch.add_link(tgen.gears["r3"])
switch.add_link(tgen.gears["r2"])
# Interconect router 4 and 2
switch = tgen.add_switch("s4")
switch.add_link(tgen.gears["r4"])
switch.add_link(tgen.gears["r2"])
# Interconnect router 3 and 4
switch = tgen.add_switch("s5")
switch.add_link(tgen.gears["r3"])
switch.add_link(tgen.gears["r4"])
def setup_module(mod):
"Sets up the pytest environment"
logger.info("\n\n---- Starting IS-IS TE tests ----\n")
tgen = Topogen(build_topo, mod.__name__)
tgen.start_topology()
router_list = tgen.routers()
for rname, router in router_list.items():
router.load_config(
TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
)
router.load_config(
TopoRouter.RD_ISIS, os.path.join(CWD, "{}/isisd.conf".format(rname))
)
# Initialize all routers.
tgen.start_router()
def teardown_module():
"Teardown the pytest environment"
tgen = get_topogen()
tgen.stop_topology()
logger.info("\n\n---- IS-IS TE tests End ----\n")
def compare_ted_json_output(tgen, rname, fileref):
"Compare TED JSON output"
logger.info('Comparing router "%s" TED output', rname)
filename = "{}/reference/{}".format(CWD, fileref)
expected = json.loads(open(filename).read())
command = "show isis mpls-te database json"
# Run test function until we get an result. Wait at most 60 seconds.
test_func = partial(topotest.router_json_cmp, tgen.gears[rname], command, expected)
_, diff = topotest.run_and_expect(test_func, None, count=60, wait=2)
assertmsg = '"{}" TED JSON output mismatches the expected result'.format(rname)
assert diff is None, assertmsg
def setup_testcase(msg):
"Setup test case"
logger.info(msg)
tgen = get_topogen()
# Skip if previous fatal error condition is raised
if tgen.routers_have_failure():
pytest.skip(tgen.errors)
return tgen
# Note that all routers must discover the same Network Topology, so the same TED.
def test_step1():
"Step1: Check initial topology"
tgen = setup_testcase("Step1: test initial IS-IS TE Data Base")
for rname in ["r1", "r2", "r3", "r4"]:
compare_ted_json_output(tgen, rname, "ted_step1.json")
def test_step2():
"Step2: Shutdown interface between r1 and r2 and verify that \
corresponding Edges are removed from the TED on all routers "
tgen = setup_testcase("Step2: Shutdown interface between r1 & r2")
tgen.net["r1"].cmd('vtysh -c "conf t" -c "interface r1-eth1" -c "shutdown"')
tgen.net["r2"].cmd('vtysh -c "conf t" -c "interface r2-eth1" -c "shutdown"')
for rname in ["r1", "r2", "r3", "r4"]:
compare_ted_json_output(tgen, rname, "ted_step2.json")
def test_step3():
"Step3: Enable IPv6 address between r1 and r2 and verify that \
corresponding Edges are added in the TED on all routers"
tgen = setup_testcase("Step3: Add IPv6 on r1 and r2 interfaces")
tgen.net["r1"].cmd('vtysh -c "conf t" -c "interface r1-eth0" -c "ipv6 address 2001:db8:0::1/64"')
tgen.net["r1"].cmd('vtysh -c "conf t" -c "interface r1-eth0" -c "ipv6 router isis TE"')
tgen.net["r2"].cmd('vtysh -c "conf t" -c "interface r2-eth0" -c "ipv6 address 2001:db8:0::2/64"')
tgen.net["r2"].cmd('vtysh -c "conf t" -c "interface r2-eth0" -c "ipv6 router isis TE"')
for rname in ["r1", "r2", "r3", "r4"]:
compare_ted_json_output(tgen, rname, "ted_step3.json")
def test_step4():
"Step4: Modify Segment Routing Prefix SID advertisement on Router r4"
tgen = setup_testcase("Step4: Modify Prefix SID on router r4")
tgen.net["r4"].cmd('vtysh -c "conf t" -c "router isis TE" -c "segment-routing prefix 10.0.255.4/32 index 40"')
tgen.net["r4"].cmd('vtysh -c "conf t" -c "router isis TE" -c "segment-routing prefix 2001:db8:ffff::4/128 index 1040"')
for rname in ["r1", "r2", "r3", "r4"]:
compare_ted_json_output(tgen, rname, "ted_step4.json")
def test_step5():
"Step5: Re-enable interface between r1 & r2 and verify that corresponding \
Edges are added in the TED on all routers"
tgen = setup_testcase("Step5: Re-enable interface between r1 & r2")
tgen.net["r1"].cmd('vtysh -c "conf t" -c "interface r1-eth1" -c "no shutdown"')
tgen.net["r2"].cmd('vtysh -c "conf t" -c "interface r2-eth1" -c "no shutdown"')
for rname in ["r1", "r2", "r3", "r4"]:
compare_ted_json_output(tgen, rname, "ted_step5.json")
def test_step6():
"Step6: Set delay and jitter for interface r4-eth0 on r4, remove use-bw \
for interface r2-eth3 on r2 and verify that corresponding Edges are \
updated in the TED on all routers"
tgen = setup_testcase("Step6: Modify link parameters on r2 & r4")
tgen.net["r2"].cmd('vtysh -c "conf t" -c "interface r2-eth3" -c "link-params" -c "no use-bw"')
tgen.net["r4"].cmd('vtysh -c "conf t" -c "interface r4-eth0" -c "link-params" -c "delay 20000"')
tgen.net["r4"].cmd('vtysh -c "conf t" -c "interface r4-eth0" -c "link-params" -c "delay-variation 10000"')
for rname in ["r1", "r2", "r3", "r4"]:
compare_ted_json_output(tgen, rname, "ted_step6.json")
def test_memory_leak():
"Run the memory leak test and report results."
tgen = get_topogen()
if not tgen.is_memleak_enabled():
pytest.skip("Memory leak test/report is disabled")
tgen.report_memory_leaks()
if __name__ == "__main__":
args = ["-s"] + sys.argv[1:]
sys.exit(pytest.main(args))

View File

@ -1481,6 +1481,17 @@ module frr-isisd {
description
"Stable IP address of the advertising router.";
}
leaf router-address-v6 {
type inet:ipv6-address;
description
"Stable IPv6 address of the advertising router.";
}
leaf export {
type boolean;
default "false";
description
"Export Link State informatin.";
}
}
container segment-routing {