Skip to content

Commit

Permalink
2023.12.17-11:09
Browse files Browse the repository at this point in the history
  • Loading branch information
slankdev committed Dec 17, 2023
1 parent e72ba24 commit cd8d7af
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 11 deletions.
24 changes: 17 additions & 7 deletions examples/trex/external_encap_node/map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 3 additions & 2 deletions examples/trex/external_encap_node/new_connection_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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()
Expand All @@ -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):
Expand Down
18 changes: 16 additions & 2 deletions examples/trex/external_encap_node/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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::
Expand Down

0 comments on commit cd8d7af

Please sign in to comment.