git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5433 818b1a75-f10b-46b9-bf7c-635c3b92a50f

This commit is contained in:
Lionel Gauthier
2014-06-25 15:34:20 +00:00
parent 943eb8c0a9
commit cbea00b9c2
4 changed files with 174 additions and 95 deletions
@@ -290,11 +290,10 @@ create_sgi_vlans() {
create_vlan_interface $PGW_INTERFACE_NAME_FOR_SGI.$i
sync
# configure vlan interface
#CIDR=$NETWORK'.'$i'/24'
base=200
NET=$(( $i + $base ))
CIDR='10.0.'$NET'.2/24'
bash_exec "ip -4 addr add $CIDR dev $PGW_INTERFACE_NAME_FOR_SGI.$i"
set_interface_up $PGW_INTERFACE_NAME_FOR_SGI.$i "10.0."$NET".2" 24
done
@@ -241,12 +241,12 @@ rotate_log_file tshark_enb_ue.$HOSTNAME.pcap
cd $THIS_SCRIPT_PATH
nohup tshark -i $ENB_INTERFACE_NAME_FOR_S1_MME -i $ENB_INTERFACE_NAME_FOR_S1U -w OUTPUT/$HOSTNAME/tshark_enb_ue.$HOSTNAME.pcap &
#nohup tshark -i $ENB_INTERFACE_NAME_FOR_S1_MME -i $ENB_INTERFACE_NAME_FOR_S1U -w OUTPUT/$HOSTNAME/tshark_enb_ue.$HOSTNAME.pcap &
#nohup xterm -e $OPENAIRCN_DIR/NAS/EURECOM-NAS/bin/UserProcess &
gdb --args $OPENAIR_TARGETS/SIMU/USER/oaisim -a -u1 -l9 -K OUTPUT/$HOSTNAME/$ITTI_LOG_FILE --enb-conf $CONFIG_FILE_ENB 2>&1 | tee OUTPUT/$HOSTNAME/$STDOUT_LOG_FILE
pkill tshark
#pkill tshark
cat OUTPUT/$HOSTNAME/$STDOUT_LOG_FILE | |grep 'RRC\|S1AP\|SCTP\|PDCP' > OUTPUT/$HOSTNAME/$STDOUT_LOG_FILE.filtered
cat OUTPUT/$HOSTNAME/$STDOUT_LOG_FILE |grep 'RRC\|S1AP\|SCTP\|PDCP' > OUTPUT/$HOSTNAME/$STDOUT_LOG_FILE.filtered
+41 -18
View File
@@ -140,6 +140,21 @@ THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
. $THIS_SCRIPT_PATH/networks.bash
###########################################################
control_c()
# run if user hits control-c
{
pkill -9 tshark
pkill -9 oai_epc
rotate_log_file $THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME/$ITTI_LOG_FILE
rotate_log_file $THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME/$STDOUT_LOG_FILE
rotate_log_file $THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME/$PCAP_S1C_LOG_FILE
rotate_log_file $THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME/$PCAP_S6A_LOG_FILE echo -en "\n*** Exiting ***\n"
exit $?
}
if [ $# -eq 1 ]; then
declare -x CONFIG_FILE_DIR=$1
if [ ! -d $CONFIG_FILE_DIR ]; then
@@ -276,18 +291,19 @@ SGW_IPV4_ADDRESS_FOR_S5_S8_UP=$( echo $SGW_IPV4_ADDRESS_FOR_S5_S8_UP
PGW_IPV4_ADDRESS_FOR_S5_S8=$( echo $PGW_IPV4_ADDRESS_FOR_S5_S8 | cut -f1 -d '/')
PGW_IPV4_ADDR_FOR_SGI=$( echo $PGW_IPV4_ADDR_FOR_SGI | cut -f1 -d '/')
is_vlan_interface $MME_INTERFACE_NAME_FOR_S1_MME \
$SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP
#is_vlan_interface $MME_INTERFACE_NAME_FOR_S1_MME \
# $SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP
if [ $? -eq 1 ]; then
echo_success "Found open VLAN network configuration"
clean_epc_vlan_network
build_mme_spgw_vlan_network
else
clean_epc_vlan_network
create_sgi_vlans
fi
#if [ $? -eq 1 ]; then
# echo_success "Found open VLAN network configuration"
# clean_epc_vlan_network
# build_mme_spgw_vlan_network
#else
# clean_epc_vlan_network
# create_sgi_vlans
#fi
get_mac_router
##################################################
# LAUNCH MME + S+P-GW executable
@@ -301,18 +317,25 @@ then
fi
ITTI_LOG_FILE=./itti_mme.$HOSTNAME.log
rotate_log_file $ITTI_LOG_FILE
ITTI_LOG_FILE=itti_mme.$HOSTNAME.log
rotate_log_file $THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME/$ITTI_LOG_FILE
STDOUT_LOG_FILE=./stdout_mme.$HOSTNAME.log
rotate_log_file $STDOUT_LOG_FILE
STDOUT_LOG_FILE=stdout_mme.$HOSTNAME.log
rotate_log_file $THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME/$STDOUT_LOG_FILE
PCAP_LOG_FILE=./tshark_mme.$HOSTNAME.pcap
rotate_log_file $PCAP_LOG_FILE
PCAP_S1C_LOG_FILE=tshark_mme_s1c.$HOSTNAME.pcap
rotate_log_file $THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME/$PCAP_S1C_LOG_FILE
PCAP_S6A_LOG_FILE=tshark_mme_s6a.$HOSTNAME.pcap
rotate_log_file $THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME/$PCAP_S6A_LOG_FILE
cd $OPENAIRCN_DIR/$OBJ_DIR
nohup tshark -i MME_INTERFACE_NAME_FOR_S1_MME -w $THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME/$PCAP_LOG_FILE &
trap control_c SIGINT
#nohup tshark -i $MME_INTERFACE_NAME_FOR_S1_MME -w $THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME/$PCAP_S1C_LOG_FILE &
#nohup tshark -i $MME_INTERFACE_NAME_FOR_S6A -w $THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME/$PCAP_S6A_LOG_FILE &
gdb --args $OPENAIRCN_DIR/$OBJ_DIR/OAI_EPC/oai_epc -K $THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME/$ITTI_LOG_FILE -c $THIS_SCRIPT_PATH/$CONFIG_FILE_EPC 2>&1 | tee $THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME/$STDOUT_LOG_FILE
$OPENAIRCN_DIR/$OBJ_DIR/OAI_EPC/oai_epc -K $THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME/$ITTI_LOG_FILE -c $THIS_SCRIPT_PATH/$CONFIG_FILE_EPC 2>&1 | tee $THIS_SCRIPT_PATH/OUTPUT/$HOSTNAME/$STDOUT_LOG_FILE
+128 -71
View File
@@ -1,6 +1,5 @@
#!/bin/bash
export ENB_VM_NAME='enb-vm-ubuntu-12.04.4-server-amd64'
export HSS_VM_NAME='hss-vm-ubuntu-12.04.4-server-amd64'
export MME_VM_NAME='mme-vm-ubuntu-12.04.4-server-amd64'
export OS_INSTALL_IMAGE="/root/ubuntu-12.04.4-server-amd64.iso"
@@ -49,35 +48,35 @@ THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
# | | | +------+ HSS | |
# | | +----------+ eth0 | (VM) | |
# | | +------+ | |
# | | 192.168.13.177 | | |
# | bridged network | 192.168.13.177 | | |
# | | +-+------+--+ |
# | | |eth1 |192.168.57.101|
# | | +--+---+ |
# | +------------------+ | |
# | | bridged network | intnet |
# | | | network intnets6a|
# | | | 192.168.57.0/24 |
# | |192.168.13.176 |192.168.57.1 |
# | +--+---+ +--+--+ |
# | |eth0 | |eth1 | |
# | +-+------+--+192.168.56.101 192.168.56.1+-+-----+---+ |
# | | eNB 0 +------+ +--------+ MME | |
# | | (VM) |eth1 +----------------+ eth2 | S+P/GW | |
# | | +------+ intnet +--------+ (VM) | |
# | | | network ints1c | | |
# | | | 192.168.56.0/24 | | |
# | | LTE eNB 1 +------+ +--------+ | |
# | | LTE UEs |eth2 +----------------+ eth3 | | |
# | +-----------+------+ intnet +--------+-----------+ |
# | 192.168.58.101 network ints1u 192.168.58.1 |
# | 192.168.58.0/24 |
# | | | |
# | | 192.168.13.178 | host |
# | +------------------+ | network vboxnet1 |
# | | | 192.168.57.0/24 |
# | | | 192.168.57.100 |
# | +-+--++--+--+ |
# | |eth0||eth1 | |
# |+-----------+192.168.56.1 192.168.56.100+-+----+------+---+ |
# || LTE eNB 1 +--------+ +--------+ MME | |
# || (HOST) |vboxnet0+--------------+ eth2 | S+P/GW | |
# || +--------+ host +--------+ (VM) | |
# || | network vboxnet0 | | |
# || | 192.168.56.0/24 | | |
# || +--------+ +--------+ | |
# || LTE n UEs |vboxnet2+--------------+ eth3 | | |
# |+-----------+--------+ host +--------+-----------------+ |
# | 192.168.58.1 network vboxnet2 192.168.58.100 |
# | 192.168.58.0/24 |
# +---------------------------------------------------------------------------+
#
check_install_vbox_software
build_vbox_vm_enb() {
build_vbox_vm_mme() {
if [ $OS_TYPE ]; then
echo_success "OS_TYPE: $OS_TYPE"
@@ -85,10 +84,10 @@ build_vbox_vm_enb() {
echo_fatal "OS_TYPE bash variable must be set to any of the following values (The type of OS you want to install on your VM): `VBoxManage list ostypes | grep ID | cut -d: -f2 | tr -d ' ' | sed -n -e 'H;${x;s/\n/,/g;s/^,//;p;}'`"
fi
if [ $ENB_VM_NAME ]; then
echo_success "ENB_VM_NAME: $ENB_VM_NAME"
if [ $MME_VM_NAME ]; then
echo_success "MME_VM_NAME: $MME_VM_NAME"
else
echo_fatal "ENB_VM_NAME bash variable must be set"
echo_fatal "MME_VM_NAME bash variable must be set"
fi
if [ $OS_INSTALL_IMAGE ]; then
@@ -101,12 +100,12 @@ build_vbox_vm_enb() {
echo_fatal "OS_INSTALL_IMAGE bash variable must be set to a valid ISO OS installation file"
fi
bash_exec "VBoxManage unregistervm $ENB_VM_NAME --delete"
rm -Rf "$DEFAULT_VIRTUAL_BOX_VM_PATH"/"$ENB_VM_NAME"
bash_exec "VBoxManage unregistervm $MME_VM_NAME --delete"
rm -Rf "$DEFAULT_VIRTUAL_BOX_VM_PATH"/"$MME_VM_NAME"
bash_exec "VBoxManage createvm --name $ENB_VM_NAME --register"
bash_exec "VBoxManage createvm --name $MME_VM_NAME --register"
UUID=`VBoxManage showvminfo $ENB_VM_NAME | grep Hardware\ UUID | cut -d: -f2 | tr -d ' '`
UUID=`VBoxManage showvminfo $MME_VM_NAME | grep Hardware\ UUID | cut -d: -f2 | tr -d ' '`
echo ENB UUID=$UUID
@@ -114,42 +113,47 @@ build_vbox_vm_enb() {
--rtcuseutc on --cpuhotplug off --cpuexecutioncap 100 --pae on --hpet on \
--hwvirtex on --nestedpaging on \
--firmware bios --biosbootmenu messageandmenu --boot1 dvd --boot2 disk \
--nic1 bridged --nic2 intnet --nic3 intnet --nic4 hostonly \
--nic1 bridged --nic2 hostonly --nic3 hostonly --nic4 hostonly \
--nictype1 82545EM --nictype2 82545EM --nictype3 82545EM --nictype4 82545EM \
--cableconnected1 on --cableconnected2 on --cableconnected3 on --cableconnected4 off \
--macaddress1 c8d3a3020301 --macaddress2 c8d3a3020302 \
--macaddress3 c8d3a3020303 --macaddress4 c8d3a3020304 \
--cableconnected1 on --cableconnected2 on --cableconnected3 on --cableconnected4 on \
--macaddress1 c8d3a3020201 --macaddress2 c8d3a3020202 \
--macaddress3 c8d3a3020203 --macaddress4 c8d3a3020204 \
--bridgeadapter1 $HOST_BRIDGED_IF_NAME \
--intnet2 intnets1c \
--intnet3 intnets1u \
--audio none \
--hostonly2 vboxnet1 \
--hostonly3 vboxnet0 \
--hostonly4 vboxnet2 \
--nicpromisc1 allow-all \
--nicpromisc2 allow-all \
--nicpromisc3 allow-all \
--nicpromisc4 allow-all \
--audio none \
--usb off --usbehci off"
# BRIDGED_MAC_ADDRESS=`vboxmanage showvminfo $UUID | grep Bridged\ Interface | sed 's/^.*MAC:\ //' | cut --delimiter=',' -f 1`
mkdir -p -m 777 "$DEFAULT_VIRTUAL_BOX_VM_PATH"/"$ENB_VM_NAME"/MKISO
rm -Rf "$DEFAULT_VIRTUAL_BOX_VM_PATH"/"$ENB_VM_NAME"/MKISO/*
mkdir -p -m 777 "$DEFAULT_VIRTUAL_BOX_VM_PATH"/"$MME_VM_NAME"/MKISO
rm -Rf "$DEFAULT_VIRTUAL_BOX_VM_PATH"/"$MME_VM_NAME"/MKISO/*
chmod -Rf 777 "$DEFAULT_VIRTUAL_BOX_VM_PATH"/"$ENB_VM_NAME"/MKISO
# mkisofs -max-iso9660-filenames -untranslated-filenames -no-iso-translate -o "$DEFAULT_VIRTUAL_BOX_VM_PATH"/"$ENB_VM_NAME"/cd_guest_setup.iso "$DEFAULT_VIRTUAL_BOX_VM_PATH"/"$ENB_VM_NAME"/MKISO/
chmod -Rf 777 "$DEFAULT_VIRTUAL_BOX_VM_PATH"/"$MME_VM_NAME"/MKISO
# mkisofs -max-iso9660-filenames -untranslated-filenames -no-iso-translate -o "$DEFAULT_VIRTUAL_BOX_VM_PATH"/"$MME_VM_NAME"/cd_guest_setup.iso "$DEFAULT_VIRTUAL_BOX_VM_PATH"/"$MME_VM_NAME"/MKISO/
VBoxManage createhd --filename "$DEFAULT_VIRTUAL_BOX_VM_PATH"/"$ENB_VM_NAME"/"$ENB_VM_NAME".vdi --size 16384 --format VDI
VBoxManage createhd --filename "$DEFAULT_VIRTUAL_BOX_VM_PATH"/"$MME_VM_NAME"/"$MME_VM_NAME".vdi --size 16384 --format VDI
VBoxManage storagectl $UUID --name "IDE Controller" --add ide --controller PIIX4 --hostiocache on --bootable on
VBoxManage storageattach $UUID --storagectl "IDE Controller" --type dvddrive --passthrough off --port 1 --device 0 --medium $OS_INSTALL_IMAGE
# VBoxManage storageattach $UUID --storagectl "IDE Controller" --type dvddrive --passthrough off --port 1 --device 1 --medium "$DEFAULT_VIRTUAL_BOX_VM_PATH"/"$ENB_VM_NAME"/cd_guest_setup.iso
# VBoxManage storageattach $UUID --storagectl "IDE Controller" --type dvddrive --passthrough off --port 1 --device 1 --medium "$DEFAULT_VIRTUAL_BOX_VM_PATH"/"$MME_VM_NAME"/cd_guest_setup.iso
VBoxManage storagectl $UUID --name "SATA Controller" --add sata --controller IntelAhci --sataportcount 4 --hostiocache off --bootable on
VBoxManage storageattach $UUID --storagectl "SATA Controller" --type hdd --port 0 --device 0 --medium "$DEFAULT_VIRTUAL_BOX_VM_PATH"/"$ENB_VM_NAME"/"$ENB_VM_NAME".vdi
VBoxManage storageattach $UUID --storagectl "SATA Controller" --type hdd --port 0 --device 0 --medium "$DEFAULT_VIRTUAL_BOX_VM_PATH"/"$MME_VM_NAME"/"$MME_VM_NAME".vdi
bash_exec "VBoxManage sharedfolder add $ENB_VM_NAME --name $TRUNK_SHARED_FOLDER_NAME --hostpath $OPENAIR_HOME"
bash_exec "VBoxManage sharedfolder add $MME_VM_NAME --name $TRUNK_SHARED_FOLDER_NAME --hostpath $OPENAIR_HOME"
}
build_vbox_vm_hss() {
UUID=`VBoxManage clonevm $ENB_VM_NAME --mode all --name $HSS_VM_NAME --register`
UUID=`VBoxManage clonevm $MME_VM_NAME --mode all --name $HSS_VM_NAME --register`
HSS_UUID=`VBoxManage showvminfo $HSS_VM_NAME | grep Hardware\ UUID | cut -d: -f2 | tr -d ' '`
echo HSS_UUID=$HSS_UUID
@@ -157,45 +161,24 @@ build_vbox_vm_hss() {
--rtcuseutc on --cpuhotplug off --cpuexecutioncap 100 --pae on --hpet on \
--hwvirtex on --nestedpaging on \
--firmware bios --biosbootmenu messageandmenu --boot1 disk \
--nic1 bridged --nic2 intnet --nic3 none --nic4 none \
--nictype1 82545EM --nictype2 82545EM --nictype3 82545EM --nictype4 82545EM \
--nic1 bridged --nic2 hostonly --nic3 none --nic4 none \
--nictype1 82545EM --nictype2 82545EM --nictype3 82545EM --nictype4 82545EM \
--cableconnected1 on --cableconnected2 on --cableconnected3 off --cableconnected4 off \
--macaddress1 c8d3a3020101 --macaddress2 c8d3a3020102 \
--macaddress3 c8d3a3020103 --macaddress4 c8d3a3020104 \
--bridgeadapter1 $HOST_BRIDGED_IF_NAME \
--intnet2 intnets6a \
--hostonly2 vboxnet1 \
--nicpromisc1 allow-all \
--nicpromisc2 allow-all \
--audio none \
--usb off --usbehci off"
}
build_vbox_vm_mme() {
UUID=`VBoxManage clonevm $ENB_VM_NAME --mode all --name $MME_VM_NAME --register`
HSS_UUID=`VBoxManage showvminfo $MME_VM_NAME | grep Hardware\ UUID | cut -d: -f2 | tr -d ' '`
echo HSS_UUID=$HSS_UUID
bash_exec "VBoxManage modifyvm $MME_VM_NAME --ostype $OS_TYPE --memory 512 --vram 12 --cpus 1 \
--rtcuseutc on --cpuhotplug off --cpuexecutioncap 100 --pae on --hpet on \
--hwvirtex on --nestedpaging on \
--firmware bios --biosbootmenu messageandmenu --boot1 disk \
--nic1 bridged --nic2 intnet --nic3 none --nic4 none \
--nictype1 82545EM --nictype2 82545EM --nictype3 82545EM --nictype4 82545EM \
--cableconnected1 on --cableconnected2 on --cableconnected3 on --cableconnected4 on \
--macaddress1 c8d3a3020201 --macaddress2 c8d3a3020202 \
--macaddress3 c8d3a3020203 --macaddress4 c8d3a3020204 \
--bridgeadapter1 $HOST_BRIDGED_IF_NAME \
--intnet2 intnets1c \
--intnet3 intnets6a \
--intnet4 intnets1u \
--audio none \
--usb off --usbehci off"
}
build_vms() {
build_vbox_vm_enb
build_vbox_vm_hss
build_vbox_vm_mme
build_vbox_vm_hss
echo_warning "!!!!!!! once VM are created, you have to harmonize IP addresses and MAC addresses !!!!!!!"
echo_warning "!!!!!!! /etc/network/interfaces and /etc/udev/rules.d/70-persistent-net.rules !!!!!!!"
echo_warning "!!!!!!! !!!!!!!"
@@ -211,5 +194,79 @@ build_vms() {
}
##########################
# #
# A N N E X #
# #
##########################
################################################################################
## MME: FILE /etc/network/interfaces (Remove one '#' at each start of line)
################################################################################
## This file describes the network interfaces available on your system
## and how to activate them. For more information, see interfaces(5).
## The loopback network interface
#auto lo
#iface lo inet loopback
## The primary network interface
#auto eth0
#iface eth0 inet static
# address 192.168.13.178
# netmask 255.255.255.0
# network 192.168.13.0
# broadcast 192.168.13.255
# gateway 192.168.13.17
# # dns-* options are implemented by the resolvconf package, if installed
# dns-nameservers 192.168.12.100
#
#auto eth2
#iface eth2 inet static
# address 192.168.56.100
# netmask 255.255.255.0
# network 192.168.56.0
# broadcast 192.168.56.255
#
#auto eth1
#iface eth1 inet static
# address 192.168.57.100
# netmask 255.255.255.0
# network 192.168.57.0
# broadcast 192.168.57.255
#
#auto eth3
#iface eth3 inet static
# address 192.168.58.100
# netmask 255.255.255.0
# network 192.168.58.0
# broadcast 192.168.58.255
################################################################################
## HSS: FILE /etc/network/interfaces (Remove one '#' at each start of line)
################################################################################
## This file describes the network interfaces available on your system
## and how to activate them. For more information, see interfaces(5).
#
## The loopback network interface
#auto lo
#iface lo inet loopback
#
## The primary network interface
#auto eth0
#iface eth0 inet static
# address 192.168.13.177
# netmask 255.255.255.0
# network 192.168.13.0
# broadcast 192.168.13.255
# gateway 192.168.13.17
# # dns-* options are implemented by the resolvconf package, if installed
# dns-nameservers 192.168.12.100
#
#auto eth1
#iface eth1 inet static
# address 192.168.57.101
# netmask 255.255.255.0
# network 192.168.57.0
# broadcast 192.168.57.255