Skip to content

Commit

Permalink
Add measure for session establishment delay
Browse files Browse the repository at this point in the history
  • Loading branch information
louisroyer committed Oct 18, 2024
1 parent 0c97695 commit 85d6eb0
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
39 changes: 39 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
34 changes: 34 additions & 0 deletions scripts/cp_delay.py
Original file line number Diff line number Diff line change
@@ -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')

0 comments on commit 85d6eb0

Please sign in to comment.