...
 
Commits (10)
# Getting started
# About This Profile
Be sure to setup your SSH keys as outlined in the manual; it's better
to log in via a real SSH client to the nodes in your experiment.
......@@ -9,10 +9,36 @@ and epc nodes. It is mounted as a clone of a remote blockstore
here, but be aware that your changes will not persist when your
experiment terminates.
To access the UE via ADB, first log in to the `adb-tgt` node, then run
`pnadb -a` to connect to the UE. Use ADB commands as per normal
afterward. If/when you reboot the UE, be aware that you will need to
again run `pnadb -a` to reestablish the ADB connection; wait a minute
This experiment can work in two modes:
1. UE and eNodeB SDR
2. Simulated UE+eNodeB (OAISIM).
To enable OAISIM, select OAI_SIM in the drop down menu "Experiment Type"
while instantiating the experiment. When the experiment starts, two nodes
will be created: sim_enb and epc.
To get the SDR based eNodeB and off-the-shelf UE, select one of the other
two options in the "Experiment Type" based upon the requirements.
# Getting Started
After booting is complete, log onto either the `enb1` or `epc`
nodes. From there, you will be able to start all OAI services across
the network by running:
sudo /local/repository/bin/start_oai.pl
This will stop any currently running OAI services, start all services
(both epc and enodeb) again, and then interactively show a tail of the
logs of the mme and enodeb services. Once you see the logs, you can
exit at any time with Ctrl-C, but the services stay running in the
background and save logs to `/var/log/oai/*` on the `enb1` and `epc`
nodes.
When using real UE, to access the UE via ADB, first log in to the `adb-tgt`
node, then run `pnadb -a` to connect to the UE. Use ADB commands as per
normal afterward. If/when you reboot the UE, be aware that you will need
to again run `pnadb -a` to reestablish the ADB connection; wait a minute
or so for the UE to become available again before doing this.
The OAI mobile networking functions should automatically start up when
......@@ -29,8 +55,7 @@ restarting the services by hand from the command line.
For more detailed information:
* [Controlling OAI](https://gitlab.flux.utah.edu/duerig/oai-enb/blob/master/control.md)
* [Inspecting OAI](https://gitlab.flux.utah.edu/duerig/oai-enb/blob/master/inspect.md)
* [Modifying OAI](https://gitlab.flux.utah.edu/duerig/oai-enb/blob/master/modify.md)
* [Controlling OAI](https://gitlab.flux.utah.edu/powder-profiles/OAI-Real-Hardware/blob/master/control.md)
* [Inspecting OAI](https://gitlab.flux.utah.edu/powder-profiles/OAI-Real-Hardware/blob/master/inspect.md)
* [Modifying OAI](https://gitlab.flux.utah.edu/powder-profiles/OAI-Real-Hardware/blob/master/modify.md)
* [Modifying This Profile](https://gitlab.flux.utah.edu/powder-profiles/OAI-Real-Hardware/blob/master/modify-profile.md)
......@@ -201,7 +201,7 @@ TOPSW: for ($role) {
# Default
logdie("Unknown role: $role\n");
}
runOAI();
#runOAI();
#
# Helper to lookup a list of hosts, searching for an IP.
......
[1]
host=128.110.153.209
username=sonika05
num=1
[2]
host=155.98.36.59
username=sonika05
num=1
#!/bin/bash
while read line; do
if [[ $line =~ ^"["(.+)"]"$ ]]; then
obj_num=${BASH_REMATCH[1]}
interface="/tmp/remote$obj_num"
intf="$intf -i $interface"
while read line; do
if [[ $line =~ "host="(.+) ]]; then
host=${BASH_REMATCH[1]}
echo $host
elif [[ $line =~ "username="(.*) ]]; then
username=${BASH_REMATCH[1]}
echo $username
elif [[ $line =~ ^"num="(.*) ]]; then
num=${BASH_REMATCH[1]}
echo $num
else
break
fi
done
echo "ssh $username@$host \"sudo cat /tmp/local\" > $interface"
ssh $username@$host "sudo cat /tmp/local" > $interface &
fi
done < $1
sudo wireshark -k $intf
#!/bin/bash
usage() {
cat <<EOM
Usage:
$(basename $0) <interface>
Provide the interface to start the capture on
EOM
exit 0
}
[ -z $1 ] && { usage; }
pipe=/tmp/local
if [[ -p $pipe ]]; then
rm -f /tmp/local
fi
mkfifo /tmp/local
exec 3<>/tmp/local
tcpdump -s 0 -U -n -w - -i $1 not port 22 > /tmp/local
if [ $? -ne 0 ]; then
usage
fi
#!/usr/bin/perl -w
use strict;
use English;
use Getopt::Std;
use XML::LibXML;
use Socket;
# Enable file output autoflush
$| = 1;
BEGIN {
require "/etc/emulab/paths.pm";
import emulabpaths;
require "/local/repository/lib/paths.pm";
import oaipaths;
}
# PhantomNet library
use epclib;
my $CAT = "/bin/cat";
#
# Enforce running script as root.
#
($UID == 0)
or die "You must run this script as root (e.g., via sudo)!\n";
#
# Ensure multitail is installed
#
system("apt-get install multitail");
#
# Setup ssh commands
#
my $enbStart = "/usr/bin/ssh -p 22 -o ServerAliveInterval=300 -o ServerAliveCountMax=3 -o BatchMode=yes -o StrictHostKeyChecking=no enb1 ";
my $epcStart = "/usr/bin/ssh -p 22 -o ServerAliveInterval=300 -o ServerAliveCountMax=3 -o StrictHostKeyChecking=no epc ";
my $nickname = `$CAT $BOOTDIR/nickname`;
chomp($nickname);
if ($nickname =~ /^epc/)
{
$epcStart = "";
}
if ($nickname =~ /^enb/)
{
$enbStart = "";
}
#
# Begin Services
#
print "Killing off any old services...\n";
system($epcStart . "/local/repository/bin/hss.start.sh");
system($epcStart . "/local/repository/bin/mme.start.sh");
system($epcStart . "/local/repository/bin/spgw.start.sh");
system($enbStart . "/local/repository/bin/enb.start.sh");
print "Starting HSS...\n";
system($epcStart . "/local/repository/bin/hss.start.sh");
sleep(5);
print "Starting MME...\n";
system($epcStart . "/local/repository/bin/mme.start.sh");
sleep(5);
print "Starting SPGW...\n";
system($epcStart . "/local/repository/bin/spgw.start.sh");
sleep(30);
print "Starting ENB...\n";
system($enbStart . "/local/repository/bin/enb.start.sh");
#
# Display Output of services
#
system("multitail ".
# "-l \"$epcStart tail -f /var/log/oai/hss.log\" ".
"-l \"$epcStart tail -f /var/log/oai/mme.log\" ".
# "-l \"$epcStart tail -f /var/log/oai/spgw.log\" ".
"-l \"$enbStart tail -f /var/log/oai/enb.log\"");
......@@ -7,6 +7,13 @@ fresh disk image wiping out any changes) from the portal
interface. After any reboot, all services will automatically start and
the UE should attach and connect to provide end-to-end connectivity.
## Restarting without rebooting
If you want to restart all the services but don't want to reboot the
nodes themselves, you can run this script on either the `enb1` or `epc` nodes:
sudo /local/repository/bin/start_oai.pl
## UE Control
Log into the `adb-tgt` node on your experiment. This node links to the
......@@ -47,12 +54,43 @@ Or you can kill a running enb service with:
The enb service should be started last because if it doesn't detect an
mme when it starts, it will never connect.
## Simulated UE+eNB control
When the experiment starts, necessary scripts are started with the required
configurations. You can monitor the logs by attaching to the screen:
sudo screen -r sim_enb
To confirm if UE is connected, ping using the oip1 interface:
ping -I oip1 8.8.8.8
To restart oaisim, use:
sudo /local/repository/bin/config_oai.pl -r SIM_ENB
The code for oaisim can be found in `/opt/oai/openairinterface5g`.
You can build the latest version of the code by using following steps:
cd ~
git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git
cd openairinterface5g
source oaienv
cd cmake_targets
./build_oai -I --oaisim -x --install-system-files
./build_oai --oaisim -c
cd tools
sudo ./run_enb_ue_virt_s1 -c <conf_file>
You can use the config file `/usr/local/etc/oai/enb.conf` and update any
necessary parameters like interfaces, MCC, MNC etc.
Please note that current profile has been tested with the default binaries
and not with other versions of OAI.
## EPC Control
The startup script on the `epc` boots up the hss, mme, and spgw
services. After all three of these are started, it syncronises with
the startup script on the `enb1`. To manually start any of these
services, run one of these scripts on the `epc` node:
To manually start any of the EPC services, run one of these scripts on
the `epc` node:
sudo /local/repository/bin/hss.start.sh
sudo /local/repository/bin/mme.start.sh
......@@ -66,18 +104,6 @@ To kill these scripts, just run one of these on the `epc` node:
sudo /local/repository/bin/mme.kill.sh
sudo /local/repository/bin/spgw.kill.sh
## Restarting without rebooting
If you want to restart all the services but don't want to reboot the
nodes themselves, you can first kill all services, then on the `enb1`
node, run:
sudo /local/repository/bin/config_oai.pl -r ENB
And on the `epc` node, run:
sudo /local/repository/bin/config_oai.pl -r EPC
## Tweaking Configuration
The source templates for the configuration files are at
......
# Modifying This Profile
This profile is itself in a git repository. Whenever an experiment is
instantiated, that repository is cloned to `/local/repository`. You
can make your own clone of the repository, modify either the resource
allocation geni-lib script or any of the startup or utility scripts,
and create a new profile based on your cloned repository.
### Resource Allocation
The resource allocation script is in `/local/repository/profile.py`
and this Python script is run before the experiment begins to specify the
resources that will be used for the experiment. You could modify it to
add other compute nodes, other radios, or change what scripts are run
at startup.
The geni-lib libraries that are used to build up this resource
specification are described in our
[documentation](http://docs.powderwireless.net/geni-lib.html). Modifying
`profile.py` after an experiment begins won't change the allocated
resources of that experiment.
### Startup Scripts
In `profile.py`, a startup script is specified for the `enb1` and
`epc` nodes. That script is located in
`/local/repository/bin/config_oai.pl`. This script is executed (with
`/the parameters specified in `profile.py`) at experiment startup and
`/every time the experiment boots.
The first time `config_oai.pl` runs, it uses the configuration
templates in `/local/repository/etc/*` to generate configuration files
for all of the OAI services. Then it touches
`/var/emulab/boot/OAI_CONFIG_DONE` so that it won't regenerate those
files on future run-throughs. If you want to regenerate the
configuration files on `enb1` or `epc`, remove
`/var/emulab/boot/OAI_CONFIG_DONE` and rerun `config_oai.pl`.
After generating the configuration files, `config_oai.pl` starts up
all the services in a synchronized way. The instance running on the
`epc` node starts up the MME, HSS, and SPGW and then waits. And the
instance running on the `enb1` node waits until all the other services
are started before beginning the eNodeB. If one is run without the
other, it will wait forever. The `config_oai.pl` script logs its
output to `/var/log/oai/startup.log` in addition to printing it to
standard out.
### Service Scripts
The other scripts in `/local/repository/bin` provide a way to manage
each individual service by hand. They can start or stop any of the OAI
services. There is no synchronization here. Each one of them sets up a
screen session, and also clones their output to log files into a file
in `/var/log/oai`.
### Creating a Profile
While any of these scripts can be modified, the changes won't persist
unless you create your own profile. Go to the portal, select this
profile, and click 'copy'.
A pop-up box will tell you the URL of this repository and you will
need to use that URL to fork this repository using gitlab or github or
some other git hosting service.
Once you have forked the repository, you can paste the URL for the new
repository and then your new profile will point at your new
repository. In order to have the new profile automatically track
changes to the forked repository, you will need to set up a push hook
on the fork.
[Full Documentation on Repository-Based Profiles](http://docs.powderwireless.net/creating-profiles.html#%28part._repo-based-profiles%29)
# Modifying Your Experiment
# Modifying Your OAI Build
This profile is meant to be a jumping-off point for creating your own
experiments. As such, you have access to the source code for OAI
......@@ -86,17 +86,13 @@ To build the SPGW from source:
### Restarting After Rebuilding
You can re-run the startup script on both `enb1` and `epc` nodes. This
You can re-run the startup script on either `enb1` or `epc` nodes. This
will start all services again and syncronize their startups to ensure
the start in the proper order.
On the `epc` node:
sudo /local/repository/bin/config_oai.pl -r EPC
On the `enb` node:
sudo /local/repository/bin/config_oai.pl -r ENB
sudo /local/repository/bin/start_oai.pl
### Saving Source Code Changes Permanently
......@@ -110,77 +106,3 @@ repository. Then add it as a remote in `/opt/oai/openair-cn` or
Then on later experiments you can add your experiment as a remote,
pull, and rebuild.
## Modifying This Profile
This profile is itself in a git repository. Whenever an experiment is
instantiated, that repository is cloned to `/local/repository`. You
can make your own clone of the repository, modify either the resource
allocation geni-lib script or any of the startup or utility scripts,
and create a new profile based on your cloned repository.
### Resource Allocation
The resource allocation script is in `/local/repository/profile.py`
and this Python script is run before the experiment begins to specify the
resources that will be used for the experiment. You could modify it to
add other compute nodes, other radios, or change what scripts are run
at startup.
The geni-lib libraries that are used to build up this resource
specification are described in our
[documentation](http://docs.powderwireless.net/geni-lib.html). Modifying
`profile.py` after an experiment begins won't change the allocated
resources of that experiment.
### Startup Scripts
In `profile.py`, a startup script is specified for the `enb1` and
`epc` nodes. That script is located in
`/local/repository/bin/config_oai.pl`. This script is executed (with
`/the parameters specified in `profile.py`) at experiment startup and
`/every time the experiment boots.
The first time `config_oai.pl` runs, it uses the configuration
templates in `/local/repository/etc/*` to generate configuration files
for all of the OAI services. Then it touches
`/var/emulab/boot/OAI_CONFIG_DONE` so that it won't regenerate those
files on future run-throughs. If you want to regenerate the
configuration files on `enb1` or `epc`, remove
`/var/emulab/boot/OAI_CONFIG_DONE` and rerun `config_oai.pl`.
After generating the configuration files, `config_oai.pl` starts up
all the services in a synchronized way. The instance running on the
`epc` node starts up the MME, HSS, and SPGW and then waits. And the
instance running on the `enb1` node waits until all the other services
are started before beginning the eNodeB. If one is run without the
other, it will wait forever. The `config_oai.pl` script logs its
output to `/var/log/oai/startup.log` in addition to printing it to
standard out.
### Service Scripts
The other scripts in `/local/repository/bin` provide a way to manage
each individual service by hand. They can start or stop any of the OAI
services. There is no synchronization here. Each one of them sets up a
screen session, and also clones their output to log files into a file
in `/var/log/oai`.
### Creating a Profile
While any of these scripts can be modified, the changes won't persist
unless you create your own profile. Go to the portal, select this
profile, and click 'copy'.
A pop-up box will tell you the URL of this repository and you will
need to use that URL to fork this repository using gitlab or github or
some other git hosting service.
Once you have forked the repository, you can paste the URL for the new
repository and then your new profile will point at your new
repository. In order to have the new profile automatically track
changes to the forked repository, you will need to set up a push hook
on the fork.
[Full Documentation on Repository-Based Profiles](http://docs.powderwireless.net/creating-profiles.html#%28part._repo-based-profiles%29)
#!/usr/bin/env python
"""
NOTE: This profile tracks more recent versions of OAI (develop branch),
and is likely to change more frequently.
#
# Standard geni-lib/portal libraries
#
import geni.portal as portal
import geni.rspec.pg as rspec
import geni.rspec.emulab as elab
import geni.rspec.igext as IG
import geni.urn as URN
tourDescription = """
Use this profile to instantiate an experiment using Open Air Interface
to realize an end-to-end SDR-based mobile network. This profile includes
the following resources:
......@@ -18,21 +25,25 @@ specific allocated resources.
For more detailed information:
* [Getting Started](https://gitlab.flux.utah.edu/duerig/oai-enb/blob/master/README.md)
* [Controlling OAI](https://gitlab.flux.utah.edu/duerig/oai-enb/blob/master/control.md)
* [Inspecting OAI](https://gitlab.flux.utah.edu/duerig/oai-enb/blob/master/inspect.md)
* [Modifying OAI](https://gitlab.flux.utah.edu/duerig/oai-enb/blob/master/modify.md)
* [Getting Started](https://gitlab.flux.utah.edu/powder-profiles/OAI-Real-Hardware/blob/master/README.md)
"""
""";
tourInstructions = """
After booting is complete, log onto either the `enb1` or `epc` nodes. From there, you will be able to start all OAI services across the network by running:
sudo /local/repository/bin/start_oai.pl
This will stop any currently running OAI services, start all services (both epc and enodeb) again, and then interactively show a tail of the logs of the mme and enodeb services. Once you see the logs, you can exit at any time with Ctrl-C, but the services stay running in the background and save logs to `/var/log/oai/*` on the `enb1` and `epc` nodes.
Once all the services are running, the UE device will typically connect on its own, but if it doesn't you can reboot the phone. You can manage the UE by logging into the `adb-tgt` node, running `pnadb -a` to connect, and then managing it via any `adb` command such as `adb shell` or `adb reboot`.
While OAI is still a system in development and may be unstable, you can usually recover from any issue by running `start_oai.pl` to restart all the services.
* [Full Documentation](https://gitlab.flux.utah.edu/powder-profiles/OAI-Real-Hardware/blob/master/README.md)
""";
#
# Standard geni-lib/portal libraries
#
import geni.portal as portal
import geni.rspec.pg as rspec
import geni.rspec.emulab as elab
import geni.rspec.igext
import geni.urn as URN
#
# PhantomNet extensions.
......@@ -81,15 +92,19 @@ pc = portal.Context()
# Profile parameters.
#
pc.defineParameter("FIXED_UE", "Bind to a specific UE",
portal.ParameterType.STRING, "",
longDescription="Input the name of a PhantomNet UE node to allocate (e.g., \'ue1\'). Leave blank to let the mapping algorithm choose.")
portal.ParameterType.STRING, "", advanced=True,
longDescription="Input the name of a PhantomNet UE node to allocate (e.g., 'ue1'). Leave blank to let the mapping algorithm choose.")
pc.defineParameter("FIXED_ENB", "Bind to a specific eNodeB",
portal.ParameterType.STRING, "",
longDescription="Input the name of a PhantomNet eNodeB device to allocate (e.g., \'nuc1\'). Leave blank to let the mapping algorithm choose. If you bind both UE and eNodeB devices, mapping will fail unless there is path between them via the attenuator matrix.")
portal.ParameterType.STRING, "", advanced=True,
longDescription="Input the name of a PhantomNet eNodeB device to allocate (e.g., 'nuc1'). Leave blank to let the mapping algorithm choose. If you bind both UE and eNodeB devices, mapping will fail unless there is path between them via the attenuator matrix.")
pc.defineParameter("TYPE", "Experiment type",
portal.ParameterType.STRING,"atten",[("atten","RF devices with attenuator"),("ota","Over the air"),("sim","OAI SIM")],
longDescription="When enabled, RF devices with real antennas and transmissions propagated through free space will be selected. Leave disabled (default) to assign RF devices connected via transmission lines with variable attenuator control.")
portal.ParameterType.STRING,"ota",[("sim","Simulated UE"),("atten","Real UE with attenuator"),("ota","Over the air")],
longDescription="*Simulated UE*: OAI simulated UE connects to an OAI eNodeB and EPC. *Real UE with attenuator*: Real RF devices will be connected via transmission lines with variable attenuator control. *Over the air*: Real RF devices with real antennas and transmissions propagated through free space will be selected.")
#pc.defineParameter("RADIATEDRF", "Radiated (over-the-air) RF transmissions",
# portal.ParameterType.BOOLEAN, False,
# longDescription="When enabled, RF devices with real antennas and transmissions propagated through free space will be selected. Leave disabled (default) to assign RF devices connected via transmission lines with variable attenuator control.")
#pc.defineParameter("RADIATEDRF", "Radiated (over-the-air) RF transmissions",
# portal.ParameterType.BOOLEAN, False,
......@@ -164,6 +179,11 @@ epclink.link_multiplexing = True
epclink.vlan_tagging = True
epclink.best_effort = True
tour = IG.Tour()
tour.Description(IG.Tour.MARKDOWN, tourDescription)
tour.Instructions(IG.Tour.MARKDOWN, tourInstructions)
request.addTour(tour)
#
# Print and go!
#
......