diff --git a/examples/trex/external_encap_node/map.yaml b/examples/trex/external_encap_node/map.yaml index 0e5bf8a..54ded20 100644 --- a/examples/trex/external_encap_node/map.yaml +++ b/examples/trex/external_encap_node/map.yaml @@ -65,13 +65,23 @@ items: - mapfile: /sys/fs/bpf/xdp/globals/n1_overlay_fib4 overlay_fib4: items: - - key: - vrf_id: 1 - addr: "10.0.1.11" - val: - flags: 0 - segs: - - "fc00:1101::" + - {key: {vrf_id: 1, addr: "20.0.0.0"}, val: {flags: 0, segs: ["fc00:1101::"]}} + - {key: {vrf_id: 1, addr: "20.0.0.1"}, val: {flags: 0, segs: ["fc00:1101::"]}} + - {key: {vrf_id: 1, addr: "20.0.0.2"}, val: {flags: 0, segs: ["fc00:1101::"]}} + - {key: {vrf_id: 1, addr: "20.0.0.3"}, val: {flags: 0, segs: ["fc00:1101::"]}} + - {key: {vrf_id: 1, addr: "20.0.0.4"}, val: {flags: 0, segs: ["fc00:1101::"]}} + - {key: {vrf_id: 1, addr: "20.0.0.5"}, val: {flags: 0, segs: ["fc00:1101::"]}} + - {key: {vrf_id: 1, addr: "20.0.0.6"}, val: {flags: 0, segs: ["fc00:1101::"]}} + - {key: {vrf_id: 1, addr: "20.0.0.7"}, val: {flags: 0, segs: ["fc00:1101::"]}} + - {key: {vrf_id: 1, addr: "20.0.0.8"}, val: {flags: 0, segs: ["fc00:1101::"]}} + - {key: {vrf_id: 1, addr: "20.0.0.9"}, val: {flags: 0, segs: ["fc00:1101::"]}} + - {key: {vrf_id: 1, addr: "20.0.0.10"}, val: {flags: 0, segs: ["fc00:1101::"]}} + - {key: {vrf_id: 1, addr: "20.0.0.11"}, val: {flags: 0, segs: ["fc00:1101::"]}} + - {key: {vrf_id: 1, addr: "20.0.0.12"}, val: {flags: 0, segs: ["fc00:1101::"]}} + - {key: {vrf_id: 1, addr: "20.0.0.13"}, val: {flags: 0, segs: ["fc00:1101::"]}} + - {key: {vrf_id: 1, addr: "20.0.0.14"}, val: {flags: 0, segs: ["fc00:1101::"]}} + - {key: {vrf_id: 1, addr: "20.0.0.15"}, val: {flags: 0, segs: ["fc00:1101::"]}} + - {key: {vrf_id: 1, addr: "20.0.0.16"}, val: {flags: 0, segs: ["fc00:1101::"]}} - mapfile: /sys/fs/bpf/xdp/globals/n1_fib6 fib6: items: diff --git a/examples/trex/external_encap_node/new_connection_test.py b/examples/trex/external_encap_node/new_connection_test.py index 6078dfb..24ae3bf 100644 --- a/examples/trex/external_encap_node/new_connection_test.py +++ b/examples/trex/external_encap_node/new_connection_test.py @@ -18,7 +18,7 @@ def create_profile(self, cps): prog_s.wait_for_peer_close() # ip generator - ip_gen_c = ASTFIPGenDist(ip_range=["20.0.0.0", "20.0.255.255"], distribution="seq") + ip_gen_c = ASTFIPGenDist(ip_range=["20.0.0.0", "20.0.0.16"], distribution="seq") ip_gen_s = ASTFIPGenDist(ip_range=["30.0.0.0", "30.0.255.255"], distribution="seq") ip_gen = ASTFIPGen(glob=ASTFIPGenGlobal(ip_offset="1.0.0.0"), dist_client=ip_gen_c, @@ -38,6 +38,7 @@ def create_profile(self, cps): parser = argparse.ArgumentParser() parser.add_argument('--mult', "-m", default=1, type=int) +parser.add_argument('--duration', "-d", default=3600, type=int) args = parser.parse_args() c = ASTFClient() @@ -47,7 +48,7 @@ def create_profile(self, cps): c.load_profile(Prof1().create_profile(1)) c.clear_stats() -c.start(mult=args.mult, duration=3600) +c.start(mult=args.mult, duration=args.duration) print("started") def dig(d, keys): diff --git a/examples/trex/external_encap_node/spec.yaml b/examples/trex/external_encap_node/spec.yaml index ad23e6a..02b07d9 100644 --- a/examples/trex/external_encap_node/spec.yaml +++ b/examples/trex/external_encap_node/spec.yaml @@ -54,6 +54,12 @@ nodes: node_configs: - name: T1 cmds: + - cmd: ip link set net0 down + - cmd: ip link set net0 address 52:54:00:01:00:01 + - cmd: ip link set net0 up + - cmd: ip link set net1 down + - cmd: ip link set net1 address 52:54:00:02:00:01 + - cmd: ip link set net1 up - cmd: nohup ./_t-rex-64 -i --astf --cfg ./cfg.yaml & - name: BR cmds: @@ -96,15 +102,23 @@ postinit: ip table add 10 set int ip table host-net1 10 + set interface mac address host-net0 52:54:00:ff:00:01 set interface mac address host-net1 52:54:00:01:00:02 set interface mac address host-net2 52:54:00:02:00:02 set int ip addr host-net0 2001::1/64 - set int ip addr host-net1 20.0.0.1/8 - set int ip addr host-net2 30.0.0.1/8 + set int ip addr host-net1 50.0.0.1/8 + set int ip addr host-net2 40.0.0.1/8 + ip route add table 10 20.0.0.0/8 via 50.0.0.2 host-net1 + ip route add 30.0.0.0/8 via 40.0.0.2 host-net2 + ip route add 142.0.0.0/8 via fe80::5054:ff:feff:2 host-net0 ip route add fc00:ff00::/24 via fe80::5054:ff:feff:2 host-net0 ip route add fc00:3100::/24 via fe80::5054:ff:feff:3 host-net0 + set ip arp host-net2 40.0.0.2 52:54:00:02:00:01 + set ip arp host-net1 50.0.0.2 52:54:00:01:00:01 + set int feature host-net0 ip4-not-enabled arc ip4-unicast disable + sr localsid address fc00:1100:: behavior end sr localsid address fc00:1101:: behavior end.dt4 10 set sr encaps source addr fc00:1100::