diff --git a/Makefile b/Makefile index ba6c1ad..91c2883 100644 --- a/Makefile +++ b/Makefile @@ -211,3 +211,42 @@ graph/latency-switch: @docker exec ue1-debug bash -c "ping -D -w 60 10.4.0.1 -i 0.1 > /volume/ping.txt" @echo "[6/6] Stopping containers" @$(MAKE) down + +.PHONY: graph/cp-delay +graph/cp-delay: + @echo "Configuring testbed" + @$(MAKE) set/nb-ue/1 + @$(MAKE) set/nb-edges/2 + @echo "Setting dataplane to Free5GC" + @$(MAKE) set/dataplane/free5gc + @$(MAKE) build + @$(MAKE) graph/cp-delay/f5gc-1 + @$(MAKE) graph/cp-delay/f5gc-2 + @$(MAKE) graph/cp-delay/f5gc-3 + @$(MAKE) graph/cp-delay/f5gc-4 + @$(MAKE) graph/cp-delay/f5gc-5 + @$(MAKE) graph/cp-delay/f5gc-6 + @$(MAKE) graph/cp-delay/f5gc-7 + @$(MAKE) graph/cp-delay/f5gc-8 + @$(MAKE) graph/cp-delay/f5gc-9 + @$(MAKE) graph/cp-delay/f5gc-10 + @echo "Setting dataplane to NextMN-SRv6" + @$(MAKE) set/dataplane/nextmn-srv6 + @$(MAKE) build + @$(MAKE) graph/cp-delay/srv6-1 + @$(MAKE) graph/cp-delay/srv6-2 + @$(MAKE) graph/cp-delay/srv6-3 + @$(MAKE) graph/cp-delay/srv6-4 + @$(MAKE) graph/cp-delay/srv6-5 + @$(MAKE) graph/cp-delay/srv6-6 + @$(MAKE) graph/cp-delay/srv6-7 + @$(MAKE) graph/cp-delay/srv6-8 + @$(MAKE) graph/cp-delay/srv6-9 + @$(MAKE) graph/cp-delay/srv6-10 + +graph/cp-delay/%: + @mkdir build/results -p + timeout --preserve-status -s TERM 15 tshark -i any -f sctp -w build/results/cp-delay-$(@F).pcapng & + @$(MAKE) up + @sleep 5 + @$(MAKE) down diff --git a/scripts/cp_delay.py b/scripts/cp_delay.py new file mode 100755 index 0000000..38a5967 --- /dev/null +++ b/scripts/cp_delay.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python3 +'''check control plane establishment delay''' + +import subprocess + +for dataplane in ['f5gc', 'srv6']: + for i in range(1, 11): + with open(f'build/results/cp-delay-{dataplane}-{i}.txt', 'w', encoding='utf-8') as f: + subprocess.run(['tshark', '-r', + f'build/results/cp-delay-{dataplane}-{i}.pcapng', + '-Y', 'ngap' + ], + check=True, + stdout=f, + stderr=subprocess.DEVNULL + ) +mes_t1 = [] +mes_t2 = [] +for dataplane in ['f5gc', 'srv6']: + for i in range(1, 11): + with open(f'build/results/cp-delay-{dataplane}-{i}.txt', 'r', encoding='utf-8') as f: + for j, line in enumerate(f): + if 'InitialUEMessage' in line: + mes_t1.append(float(line.strip().split(' ')[1])) + elif 'PDUSessionResourceSetupResponse' in line: + mes_t2.append(float(line.strip().split(' ')[1])) +if len(mes_t1) != 20 or len(mes_t2) != 20: + print('Wrong number of timestamps!') + print('t1', len(mes_t1)) + print('t2', len(mes_t2)) +for i in range(10): + print(f'% f5gc - {i+1}: {(mes_t2[i] - mes_t1[i])*1000} ms') +for i in range(10): + print(f'% srv6 - {i+1}: {(mes_t2[10+i] - mes_t1[10+i])*1000} ms')