806
def r8V2(verbose, protocol):
808
Simple two router case the next two tests will add another link between
813
# RT2 is its direct neighbour
814
# A single route should be installed for 10.1.1.0/24 via 10.1.2.1
820
# 10.2.2.0/24| | | |10.1.1.0/24
821
# -----------| | | |------------
822
# | | 10.1.2.0/24 | |
823
# | |---------------------| |
824
# | |10.1.2.2 10.1.2.1| |
828
fp = start_routing_interactive(verbose, protocol)
830
RT1 = "RouterLsa E-bit lsid 127.1.0.2 adv 127.1.0.2 \
831
stub lsid 10.2.2.0 ldata 255.255.255.0 metric 1 \
832
transit lsid 10.1.2.2 ldata 10.1.2.2 metric 1 \
835
RT2 = "RouterLsa E-bit lsid 127.1.0.1 adv 127.1.0.1 \
836
stub lsid 10.1.1.0 ldata 255.255.255.0 metric 1 \
837
transit lsid 10.1.2.2 ldata 10.1.2.1 metric 1 \
840
RT1_NETWORK1 = "NetworkLsa E-bit lsid 10.1.2.2 adv 127.1.0.2 \
842
add-router 127.1.0.2 \
843
add-router 127.1.0.1 \
846
RT1_NETWORK2 = "NetworkLsa E-bit lsid 99.1.1.2 adv 127.1.0.2 \
848
add-router 127.1.0.2 \
849
add-router 127.1.0.1 \
853
set_router_id 127.1.0.2
854
create 0.0.0.0 normal
861
verify_routing_table_size 1
862
verify_routing_entry 10.1.1.0/24 10.1.2.1 2 false false
863
""" % (RT1, RT2, RT1_NETWORK1, RT1_NETWORK2)
872
def r9V2(verbose, protocol):
874
Test that when there are two paths between two routers the one
875
with the lowest metric is choosen. This test is the same as the
876
previous test apart from the addition of the more expensive path.
880
# RT2 is its direct neighbour via two interfaces.
881
# A single route should be installed for 10.1.1.0/24 via 10.1.2.1
884
# | RT1 | 99.1.2.0/24 | RT2 |
885
# | |---------------------| |
886
# | |99.1.2.2 99.1.2.1| |
887
# 10.2.2.0/24| | metric 10 | |10.1.1.0/24
888
# -----------| | | |------------
889
# | | 10.1.2.0/24 | |
890
# | |---------------------| |
891
# | |10.1.2.2 10.1.2.1| |
895
fp = start_routing_interactive(verbose, protocol)
897
RT1 = "RouterLsa E-bit lsid 127.1.0.2 adv 127.1.0.2 \
898
age 1074 seqno 0x8000001a cksum 0x9976 \
899
transit lsid 99.1.1.2 ldata 99.1.1.2 metric 10 \
900
stub lsid 10.2.2.0 ldata 255.255.255.0 metric 1 \
901
transit lsid 10.1.2.2 ldata 10.1.2.2 metric 1 \
904
RT2 = "RouterLsa E-bit lsid 127.1.0.1 adv 127.1.0.1 \
905
age 1076 seqno 0x8000001a cksum 0x4cc9 \
906
transit lsid 99.1.1.2 ldata 99.1.1.1 metric 10 \
907
stub lsid 10.1.1.0 ldata 255.255.255.0 metric 1 \
908
transit lsid 10.1.2.2 ldata 10.1.2.1 metric 1 \
911
RT1_NETWORK1 = "NetworkLsa E-bit lsid 10.1.2.2 adv 127.1.0.2 \
912
age 1075 seqno 0x80000019 cksum 0x3676 \
914
add-router 127.1.0.2 \
915
add-router 127.1.0.1 \
918
RT1_NETWORK2 = "NetworkLsa E-bit lsid 99.1.1.2 adv 127.1.0.2 \
919
age 1074 seqno 0x80000019 cksum 0xb79c \
921
add-router 127.1.0.2 \
922
add-router 127.1.0.1 \
926
set_router_id 127.1.0.2
927
create 0.0.0.0 normal
934
verify_routing_table_size 1
935
verify_routing_entry 10.1.1.0/24 10.1.2.1 2 false false
936
""" % (RT1, RT2, RT1_NETWORK1, RT1_NETWORK2)
945
def r10V2(verbose, protocol):
947
Test that when there are two paths between two routers the one
948
with the lowest metric is choosen. This test is identical to the
949
previous test apart from the order of the transit links in the
954
# RT2 is its direct neighbour via two interfaces.
955
# A single route should be installed for 10.1.1.0/24 via 10.1.2.1
958
# | RT1 | 99.1.2.0/24 | RT2 |
959
# | |---------------------| |
960
# | |99.1.2.2 99.1.2.1| |
961
# 10.2.2.0/24| | metric 10 | |10.1.1.0/24
962
# -----------| | | |------------
963
# | | 10.1.2.0/24 | |
964
# | |---------------------| |
965
# | |10.1.2.2 10.1.2.1| |
969
fp = start_routing_interactive(verbose, protocol)
971
RT1 = "RouterLsa E-bit lsid 127.1.0.2 adv 127.1.0.2 \
972
age 1074 seqno 0x8000001a cksum 0x9976 \
973
transit lsid 10.1.2.2 ldata 10.1.2.2 metric 1 \
974
stub lsid 10.2.2.0 ldata 255.255.255.0 metric 1 \
975
transit lsid 99.1.1.2 ldata 99.1.1.2 metric 10 \
978
RT2 = "RouterLsa E-bit lsid 127.1.0.1 adv 127.1.0.1 \
979
age 1076 seqno 0x8000001a cksum 0x4cc9 \
980
transit lsid 10.1.2.2 ldata 10.1.2.1 metric 1 \
981
stub lsid 10.1.1.0 ldata 255.255.255.0 metric 1 \
982
transit lsid 99.1.1.2 ldata 99.1.1.1 metric 10 \
985
RT1_NETWORK1 = "NetworkLsa E-bit lsid 10.1.2.2 adv 127.1.0.2 \
986
age 1075 seqno 0x80000019 cksum 0x3676 \
988
add-router 127.1.0.2 \
989
add-router 127.1.0.1 \
992
RT1_NETWORK2 = "NetworkLsa E-bit lsid 99.1.1.2 adv 127.1.0.2 \
993
age 1074 seqno 0x80000019 cksum 0xb79c \
995
add-router 127.1.0.2 \
996
add-router 127.1.0.1 \
1000
set_router_id 127.1.0.2
1001
create 0.0.0.0 normal
1008
verify_routing_table_size 1
1009
verify_routing_entry 10.1.1.0/24 10.1.2.1 2 false false
1010
""" % (RT1, RT2, RT1_NETWORK1, RT1_NETWORK2)
1021
Return the database for test r11V3
1024
# RT1 is this router.
1025
# RTC is an area border router that generates an Inter-Area-Prefix-LSA.
1026
# RT1 is connected to RTC via transit.
1030
# |RT1|---------|RTC|----| Other Area
1034
# Network IPv6 prefix
1035
# -----------------------------------
1036
# Other Area 3ffe:4725:c404::/64
1038
# Router Interface Interface ID link-local address
1039
# -------------------------------------------------------
1040
# RT1 to RTC 4 fe80::8:800:200c:4300
1041
# RTC to RT1 3 fe80::8:800:200c:4350
1043
RT1 = "RouterLsa V6-bit E-bit R-bit lsid 0.0.0.0 adv 10.80.52.103 \
1044
transit iid 4 nid 4 nrid 10.80.52.103 metric 1 \
1046
RT1_LINK = "LinkLsa lsid 0.0.0.4 adv 10.80.52.103 \
1047
link-local-address fe80::8:800:200c:4300"
1049
RT1_NETWORK = "NetworkLsa lsid 0.0.0.4 adv 10.80.52.103 \
1050
add-router 10.80.52.103 \
1051
add-router 10.80.52.107 \
1054
RTC = "RouterLsa bit-B V6-bit E-bit R-bit lsid 0.0.0.1 adv 10.80.52.107 \
1055
transit iid 3 nid 4 nrid 10.80.52.103 metric 1 \
1058
RTC_LINK = "LinkLsa lsid 0.0.0.3 adv 10.80.52.107 \
1059
link-local-address fe80::8:800:200c:4350"
1061
RTC_INTER = "SummaryNetworkLsa lsid 0.0.0.2 adv 10.80.52.107 \
1063
IPv6Prefix 3ffe:4725:c404::/64 \
1073
""" % (RT1,RT1_LINK,RT1_NETWORK,
1074
RTC,RTC_LINK,RTC_INTER)
1078
def r11V3(verbose, protocol):
1080
Verify the correct processing of Inter-Area-Prefix-LSAs, when this router
1081
is connected to the generating router by a Network-LSA.
1084
fp = start_routing_interactive(verbose, protocol)
1087
set_router_id 10.80.52.103
1088
create 0.0.0.0 normal
1092
verify_routing_table_size 1
1093
verify_routing_entry 3ffe:4725:c404::/64 fe80::8:800:200c:4350 2 false false
1105
Return the database for test r12V3
1108
# RT1 is this router.
1109
# RTB is an area border router that generates an Intra-Area-Prefix-LSA.
1110
# RT1 is connected to RTB via transit.
1114
# |RT1|---------|RTB|----| Other Area
1118
# Network IPv6 prefix
1119
# -----------------------------------
1120
# Other Area 3ffe:4725:c404::/64
1122
# Router Interface Interface ID link-local address
1123
# -------------------------------------------------------
1124
# RT1 to RTB 5 fe80::8:800:200c:4200
1125
# RTB to RT1 2 fe80::8:800:200c:4250
1127
RT1 = "RouterLsa V6-bit E-bit R-bit lsid 0.0.0.0 adv 10.80.52.103 \
1128
transit iid 5 nid 5 nrid 10.80.52.103 metric 1 \
1130
RT1_LINK = "LinkLsa lsid 0.0.0.5 adv 10.80.52.103 \
1131
link-local-address fe80::8:800:200c:4200"
1133
RT1_NETWORK = "NetworkLsa lsid 0.0.0.5 adv 10.80.52.103 \
1134
add-router 10.80.52.103 \
1135
add-router 10.80.52.106 \
1138
RTB = "RouterLsa bit-B V6-bit E-bit R-bit lsid 0.0.0.1 adv 10.80.52.106 \
1139
transit iid 2 nid 5 nrid 10.80.52.103 metric 1 \
1142
RTB_LINK = "LinkLsa lsid 0.0.0.2 adv 10.80.52.106 \
1143
link-local-address fe80::8:800:200c:4250"
1145
RTB_INTRA = "IntraAreaPrefixLsa lsid 0.0.0.2 adv 10.80.52.106 \
1146
rlstype 0x2001 rlsid 0.0.0.0 radv 10.80.52.106 \
1147
IPv6Prefix 3ffe:4725:c404::/64 metric 3 \
1157
""" % (RT1,RT1_LINK,RT1_NETWORK,
1158
RTB,RTB_LINK,RTB_INTRA)
1162
def r12V3(verbose, protocol):
1164
Verify the correct processing of Intra-Area-Prefix-LSAs.
1167
fp = start_routing_interactive(verbose, protocol)
1170
set_router_id 10.80.52.103
1171
create 36.0.0.0 normal
1175
verify_routing_table_size 1
1176
verify_routing_entry 3ffe:4725:c404::/64 fe80::8:800:200c:4250 4 false false
1186
def r13V3(verbose, protocol):
1188
Verify that Intra-Area-Prefix-LSAs always win over Inter-Area-Prefix-LSAs.
1189
The same route is introduced into thebackbone 0.0.0.0 and area 36.0.0.0,
1190
In the backbone 0.0.0.0 it is an Inter-Area-Prefix-LSA, in area 36.0.0.0
1191
it is an Intra-Area-Prefix-LSA.
1193
The two area databases are introduced in various orders and the
1194
computations run to make sure that however the LSAs are introduced
1195
the IntraAreaPrefixLsa always wins.
1199
set_router_id 10.80.52.103
1200
create 0.0.0.0 normal
1201
create 36.0.0.0 normal
1207
""" % (r11database())
1210
verify_routing_table_size 1
1211
verify_routing_entry 3ffe:4725:c404::/64 fe80::8:800:200c:4350 2 false false
1217
""" % (r12database())
1220
verify_routing_table_size 1
1221
verify_routing_entry 3ffe:4725:c404::/64 fe80::8:800:200c:4250 4 false false
1224
fp = start_routing_interactive(verbose, protocol)
1228
print >>fp, "compute 0.0.0.0"
1231
print >>fp, "compute 36.0.0.0"
1232
print >>fp, verify36
1237
fp = start_routing_interactive(verbose, protocol)
1241
print >>fp, "compute 36.0.0.0"
1242
print >>fp, verify36
1244
print >>fp, "compute 0.0.0.0"
1245
print >>fp, verify36
1250
fp = start_routing_interactive(verbose, protocol)
1255
print >>fp, "compute 0.0.0.0"