Dissecting RAN Messages using FAPI
Introduction
Our off-the-shelf eNodeB vendor, ip.access, provides a tool called FAPI that can be used to analyze RAN messages exchanged between the UE and the ip.access eNodeB in detail. The logs can be accessed as a tcpdump (pcap) trace and be analyzed by a custom Wireshark installation integrated with a FAPI plugin.
The verbosity level of the capture can be set according to the user preference. The default configuration allows a extremely verbose capture of all the RAN messages - e.g., RACH indications, UL/DL configuration requests, UL/DL scheduling information etc. An example capture is shown here. Such a verbose capture is very useful in understanding the overall message flow associated with different phases of device-network interaction including connection setup, data exchange, and connection teardown.
However, in certain scenarios a user may be interested in specific types of message exchanges - for example an user may want to focus only on RAN messages related to scheduling. ip.access provides filters that allow users to configure the FAPI logging to capture only the messages of interest and discard the others. The following table shows the set of options available to the user - one or more such options can be enabled in the eNodeB as per a user's configuration.
enableFAPIPhyErrorIndLogging | Log only Error Messages |
enableFAPIPhyDlCfgReqLogging | Log Downlink Configuration Request Messages |
enableFAPIPhyUlCfgReqLogging | Log Uplink Configuartion Messages |
enableFAPIPhyUlSfIndLogging | Log Uplink Subframe Indication Messages |
enableFAPIPhyDlHiDci0ReqLogging | Log DCI-0 (Uplink Scheduling Assignment) Messgaes |
enableFAPIPhyDlTxReqLogging | Log Downlink Data Transmission Request Messages |
enableFAPIPhyUlHarqIndLogging | Log Uplink HARQ Indiaction Messages |
enableFAPIPhyUlCrcIndLogging, | Log Uplink CRC Indication Messages |
enableFAPIPhyUlRxUlschIndLogging | Log Uplink Scheduling Indication Messages |
enableFAPIPhyUlRachIndLogging | Log RACH Indication Messages |
enableFAPIPhyUlSRSIndLogging | Log SRS Indication Messages |
enableFAPIPhyUlRxSrIndLogging | Log Scheduling Request Indicator Messages |
enableFAPIPhyUlRxCqiIndLogging | Log Receiver Channel Quality Indication Messages |
enableFAPIRFTickLogging | Log Clock Ticks |
For example, n user who wants to debug UL subframe indication messages can enable the "enableFAPIPhyUlSfIndLogging" option to get a trace like this. Similarly by enabling "enableFAPIPhyUlRxCqiIndLogging" the user can get detailed information about Channel Quality Indication report as can be seen in this trace.
In summary, FAPI is a great and powerful tool that enables an user to dive deep into the messages exchanged at the RAN. The flexible logging functionality is useful for both debugging specific types of messages and understanding the message flows and message contents in the RAN in general.
Accessing Pre-Captured Logs:
For the user's convenience we have captured FAPI logs, related to each of the aforesaid options, which can be accessed through a PhantomNet experiment. Once you have created a PhantomNet experiment, you can ssh into any of the experimental node to access the captured logs. The logs are located in /share/phantomnet/FAPI_caps/ directory. Each pcap file in this directory corresponds to a specific filtering option as described in the earlier section. We also have a fapi_all.pcap file that corresponds to the case when all the filtering options are enabled. Each capture corresponds to the following events: a) Device Attachment, b) Accessing a Internet-based webpage from the device, and c) Device Detachment.
Following is a step-by-step instructions as how you can access the pre-captured logs:
1. ssh -X sgw.[your experiment name].[your project name].emulab.net (You can get your SGW's canonical hostname from the node list tab in your experiment as well.)
2. cd /share/phantomnet/FAPI_caps/
3. ls <To list all the pre-captured files>
4. wireshark enableFAPIPhyDlCfgReqLogging.pcap <Open an example pcap to see its contents>
Generating Your Own Captures
Now we describe how you can capture your own FAPI logs using the configuartion options described in the Using commercial eNodeBs in PhantomNet guide. You can capture the logs using any physical node connected to the physical eNodeB in your setup. We recommend using the emulated eNodeB node [Ip address: 192.168.4.90] for this purpose. Following is an example guide that can be used to set the enableFAPIPhyDlCfgReqLogging at the eNodeB and capture the corresponding FAPI logs.
Step 1: Setup the eNodeB [Please refer to Using commercial eNodeBs in PhantomNet guide for details]
i) ssh into the SGW
ssh sgw.[your experiment name].[your project name].emulab.net
ii) create a config file test.cfg with the following options:
# Example Configuration File
# Specify capture node IP - we'll use the IP of the SGW node here.
FAPI_IP=192.168.4.80
# Specify capture port (we'll point tcpdump at this port)
FAPI_port=8888
# Specify FAPI option to enable.
FAPI_PhyDlCfgReq=1
iii) Configure the Physical eNodeB
e40-config.sh enodebXX test.cfg
In the above command, XX is a placeholder for the actual number portion in the name of the eNodeB in your experiment (e.g., enodeb03). You should be able to find this canonical name by looking for the eNodeB in the List View tab for your experiment on the PhantomNet web portal. This configuration command will reboot the eNodeB and set it up with the required logging capabilities.
Step 2: Capturing the FAPI logs
i) Figure out which interface to capture from. The eNodeB nodes all connect via the net_d subnet (192.168.4.0/24). The following command will show you the net_d interface of the SGW node:
ip address show to 192.168.4.80
ii) Execute tcpdump to capture FAPI logs on your SGW node (save to local disk by changing to /var/tmp):
cd /var/tmp
sudo tcpdump -i [interface found in prior command] -s0 -w my-FAPI.pcap port 8888
Here 8888 is the port we set for the eNodeB to log to in the configuration file we created above.
Once this capture is enabled, you can use your UE device to connect to the eNodeB and access the Internet. Once you are done with the experiment, you can use [Ctrl C] to stop the tcpdump capture and use wireshark to access the captured log.