# Adaptive Modified RISE-based Quadrotor Trajectory Tracking with Actuator
Uncertainty Compensation

Krishna Bhavithavya Kidambi1, Madhur Tiwari2, Emmanuel Ogbanje Ijoga3 and
William MacKunis4 1Krishna Bhavithavya Kidambi is an Assistant Professor in
the Department of Mechanical and Aerospace Engineering, University of Dayton,
Dayton, OH 45469<EMAIL_ADDRESS>Tiwari is an Assistant
Professor in the Department of Aerospace, Physics and Space Sciences, Florida
Institute of Technology, Melbourne, FL 32901<EMAIL_ADDRESS>Ogbanje Ijoga, William MacKunis are with Physical Sciences Department, Embry-
Riddle Aeronautical University, Daytona Beach, FL 32114<EMAIL_ADDRESS><EMAIL_ADDRESS>
###### Abstract

This paper presents an adaptive robust nonlinear control method, which
achieves reliable trajectory tracking control for a quadrotor unmanned aerial
vehicle in the presence of gyroscopic effects, rotor dynamics, and external
disturbances. Through novel mathematical manipulation in the error system
development, the quadrotor dynamics are expressed in a control-oriented form,
which explicitly incorporates the uncertainty in the gyroscopic term and
control actuation term. An adaptive robust nonlinear control law is then
designed to stabilize both the position and attitude loops of the quadrotor
system. A rigorous Lyapunov-based analysis is utilized to prove asymptotic
trajectory tracking, where the region of convergence can be made arbitrarily
large through judicious control gain selection. Moreover, the stability
analysis formally addresses gyroscopic effects and actuator uncertainty. To
illustrate the performance of the control law, comparative numerical
simulation results are provided, which demonstrate the improved closed-loop
performance achieved under varying levels of parametric uncertainty and
disturbance magnitudes.

##  I INTRODUCTION

Unmanned aerial vehicles (UAVs) (or Quadrotors) have the potential to
transport people and things to locations not traditionally served by current
modes of air transportation. The UAV market can potentially proliferate, and
one can sense that the lack of regulation is currently preventing this.
Hundreds of exciting and promising applications in various domains such as air
delivery, surveying, agriculture, architecture, security, and video
entertainment are being developed [1, 2].

Developing reliable and safe control algorithms is still a challenging task in
a myraid of quadrotor control applications [3]. Over the last decade several
methods have been proposed to compensate for uncertain and time-varying
external operating conditions; however, there remain numerous open challenges
in the design of robust and adaptive nonlinear quadrotor UAV control systems,
which are rigorously proven to simultaneously compensate for external
disturbances (e.g., due wind gusts and aerodynamic anomalies) and internal
anomalies, disturbances, and unmodeled effects in the UAV actuation dynamics
(e.g., due to electromechanical propeller motor dynamics and/or actuator
faults).

Numerous recent approaches to quadrotor control are based on classical control
methods applied to linearized models of the UAV dynamics [4, 5, 6, 7]. Popular
linear control methods include proportional-integral-derivative (PID) control
[6] and linear quadratic regulators (LQR) [7]. While PID and LQR methods
benefit from simple implementation and intuitive control gain-tuning, they
have limited capability to compensate for the inherent nonlinearities in the
quadrotor dynamics; and they tend to have low robustness to external
disturbances.

In an effort to overcome the limitations of linear control methods, nonlinear
control techniques have been widely shown to achieve an increased level of
reliability in quadrotor flight under various uncertain and adversarial
operating conditions. Common nonlinear control design approaches include
feedback linearization [8, 9], backstepping [10, 11, 12], adaptive control
[13, 14] and robust control [15, 16, 17]. Advantages to feedback linearization
include mathematical simplicity and easy implementation; however, they often
incur reduced robustness to disturbances and sensitivity to model uncertainty.
To address this, feedback linearization-based linear control designs often
employ robust nonlinear compensators to achieve the desired disturbance-
rejection objectives [9]. The authors in [12] present an adaptive back-
stepping controller to track time-varying trajectories with parameter
uncertainties and under-actuation. The control algorithm is extended to
include velocity input and motor coefficients, and geometric parameters are
handled by the adaptive laws.

In [15], a robust control scheme based on nonlinear dynamic inversion (NDI)
for disturbance rejection is proposed. However, to achieve performance in
agile quadcopters, accounting for actuator uncertainty is vital. The authors
in [18] develop an agile control subjected to aerodynamic drag, the center of
gravity shift, and motor dynamics. It is shown that accounting for
uncertainties in the actuator dynamics is essential to achieve the desired
trajectory-tracking performance.

While standard sliding mode control approaches are widely known for their
disturbance-rejection capabilities, their implementation can be challenging
due to the use of high-bandwidth switching [19, 20]. Motivated by this, robust
integral of the sign of the error (RISE)-based control can be used to achieve
reliable disturbance rejection using continuous control [21]. RISE has been
widely shown to achieve superior rejection of norm-bounded disturbances in
various recent results [22, 23, 24]. In addition, our recent result in [25]
presents a modified RISE (MRISE)-based quadrotor control design, which is
proven to reject external disturbances of varying magnitudes and compensate
for varying levels of parametric uncertainty in the UAV dynamics. While the
MRISE result achieved significant performance improvement in trajectory
tracking compared to traditional RISE, the work does not formally incorporate
the effects of actuator uncertainty and gyroscopic effects in the quadrotor
dynamic model.

Motivated by this and future demands of building robust and agile quadrotors,
we propose an adaptive MRISE-based trajectory tracking control method for a
quadrotor system subjected to parametric uncertainty and unmodeled gyroscopic
effects and uncertainties in the actuator dynamics in addition to external
disturbances. The result is achieved through a non-trivial reworking of the
error system development and stability analysis in [25], which now formally
incorporates unmodeled effects in the actuation dynamic model. The primary
contributions of this result can be summarized as follows:

  1. 1.

An augmented adaptive MRISE control design for both the inner and outer loop
of the quadrotor tracking control system, which formally incorporates feedback
compensators for the actuator uncertainty, gyroscopic effects, model
uncertainties and external disturbances. The control algorithm accounts for
varying magnitudes of uncertainty ($\pm$ 15%) with little or no gain tuning.

  2. 2.

A rigorous closed-loop stability analysis using a Lyapunov-based approach,
which provides a detailed derivation of semi-global asymptotic tracking and
the specific control gain conditions under which convergence can be
guaranteed.

  3. 3.

A detailed comparative numerical simulation study to demonstrate the
performance of the proposed control design.

The rest of the paper is organized as follows: Section II describes the
nonlinear dynamic model of the quadrotor, especially Section II-C describes a
detailed model incorporating the gyroscopic effects and the actuator dynamics.
The open-loop and closed-loop error systems are described in Section III-A and
III-B, respectively. In Section IV, the closed-loop stability analysis is
presented. Finally, Section V presents the numerical simulations to
demonstrate the effectiveness of the proposed method, followed by conclusions
in Section VI.

##  II MATHEMATICAL MODEL

###  II-A Quad Dynamics

The mathematical model of quadrotor dynamics is well studied in the literature
[26, 27]. The explicit form of the dynamics by using the Newton–Euler method
with position and orientation can be written as [28]

$\displaystyle m\dot{V}$ $\displaystyle=$ $\displaystyle
F_{g}+F_{T}+F_{d}+d_{1}(t)$ (1a) $\displaystyle I\dot{\Omega}$
$\displaystyle=$
$\displaystyle-\Omega^{\times}I\Omega+\tau-\tau_{a}+\tau_{g}+d_{2}(t)$ (1b)

where $m\in\mathbb{R}^{+}$ is the mass of the quadrotor,
$V=[V_{x},V_{y},V_{z}]^{T}$ and $\Omega=[p,q,r]^{T}$ denote the translational
and angular velocity defined in the inertial frame and body frame,
respectively. $I=diag(I_{x},I_{y},I_{z})\in\mathbb{R}^{3\times 3}$ is a
positive definite diagonal moment of inertia matrix, and $d_{1}(t),d_{2}(t)$
are the external disturbances in the translation and rotational dynamics
respectively.

The remaining forces in the translational dynamics are given as
$F_{g}=[0,0,-mg]^{T}$, where g = 9.81 $\frac{m}{s^{2}}$ is the gravitational
acceleration. $F_{d}$ is the drag due to the translational motion and is given
by

$F_{d}=-diag(K_{d_{x}},K_{d_{y}},K_{d_{z}})V$ (2)

where $K_{d_{x}},K_{d_{y}},K_{d_{z}}$ are translational drag coefficients. The
control input $F_{T}\in\mathbb{R}$ is the total thrust generated by all four
motors and is given as

$F_{T}=R_{1}\sum_{i=1}^{4}F_{i}$ (3)

where $F_{i}=K_{T}u_{i}^{2}$, and $K_{T}$ is the thrust coefficient and
$u_{i}$ is the speed of $i^{th}$ motor. The term $R_{1}$ is given as

$R_{1}=\begin{bmatrix}\cos(\psi)\sin(\theta)\cos(\phi)+\sin(\psi)\sin(\phi)\\\
\sin(\phi)\sin(\theta)\sin(\psi)-\cos(\psi)\sin(\phi)\\\
\cos(\theta)\cos(\phi)\end{bmatrix}$ (4)

The gyroscopic torque $\tau_{g}$ is given as

$\tau_{g}=\sum_{i=1}^{4}\Omega^{\times}I_{r}\begin{bmatrix}0\\\ 0\\\
(-1)^{i-1}u_{i}\end{bmatrix}$ (5)

where $I_{r}$ is the rotor inertia. The aerodynamic frictional torque
$\tau_{a}$ is given as

$\tau_{a}=-diag(K_{a_{x}},K_{a_{y}},K_{a_{z}})\|\Omega^{2}\|$ (6)

where $K_{a_{x}},K_{a_{y}},K_{a_{z}}$ are the coefficients of aerodynamic
friction. The torque $\tau$ applied on the quadrotor is given by

$\displaystyle\tau=\begin{bmatrix}\tau_{\phi}\\\ \tau_{\theta}\\\
\tau_{\psi}\end{bmatrix}=\begin{bmatrix}0&-lK_{T}&0&lK_{T}\\\
lK_{T}&0&-lK_{T}&0\\\
K_{D}&-K_{D}&K_{D}&-K_{D}\end{bmatrix}\begin{bmatrix}u_{1}^{2}\\\ u_{2}^{2}\\\
u_{3}^{2}\\\ u_{4}^{2}\\\ \end{bmatrix}$ (7)

where $\tau_{\phi},\tau_{\theta},\tau_{\psi}$ denotes the torque along $x,y,z$
axis respectively, $l$ is the distance between each rotor to the quadrotor
center of mass, and $K_{D}$ is the drag coefficient.

###  II-B Actuator Dynamics

The control input commands to the quadrotor are applied through a DC motor and
when tracking aggressive trajectories, actuator dynamics cannot be ignored for
the sake of precise tracking performance. The dynamics of the $i^{th}$ motor
speed is given as [18]

$\dot{u}_{i}=\frac{k_{\tau}}{I_{r}}(u_{ci}-u_{i})$ (8)

where $k_{\tau}$ is the motor coefficient and $u_{ci}$ is the commanded speed
of the $i^{th}$ motor and $u_{i}$ is introduced in (3).

###  II-C Uncertain Quadrotor Model

The dynamic equations in (1) are recast by incorporating parametric and
actuator uncertainties and are simplified as

$\displaystyle\dot{P}$ $\displaystyle=$ $\displaystyle V$ (9a)
$\displaystyle\dot{V}$ $\displaystyle=$ $\displaystyle
f_{1}(V)+F_{V}+\Delta_{V}F_{V}+d_{V}(t)$ (9b) $\displaystyle\dot{\omega}$
$\displaystyle=$ $\displaystyle\Omega$ (9c) $\displaystyle\dot{\Omega}$
$\displaystyle=$ $\displaystyle
f_{2}(\Omega)+\tau_{\Omega}+\Delta_{\Omega}\tau_{\Omega}+d_{\Omega}(t)$ (9d)

where $P=[x,y,z]^{T}$, $V=[V_{x},V_{y},V_{z}]^{T}$,
$\omega=[\phi,\theta,\psi]^{T}$ and $\Omega=[p,q,r]^{T}$ are the position,
velocity, angular position and angular velocity in 3-D; and the following
definitions have been made:

$F_{V}=\frac{F_{T}}{m};\qquad\Delta_{V}F_{V}=\frac{R_{1}}{m}\sum_{i=1}^{4}\Delta
F_{i}$ $\displaystyle f_{1}(V)$ $\displaystyle=$
$\displaystyle\frac{\bar{F}_{g}}{m}+\frac{\bar{F}_{d}}{m}$ $\displaystyle
d_{V}(t)$ $\displaystyle=$ $\displaystyle-\frac{\Delta
m\dot{V}}{m}+\frac{\Delta F_{g}}{m}+\frac{\Delta F_{d}}{m}+\frac{d_{1}(t)}{m}$
$\displaystyle\tau_{\Omega}$ $\displaystyle=$ $\displaystyle
R_{2}\times[u_{1}^{2},u_{2}^{2},u_{3}^{2},u_{4}^{2}]^{T}$
$\displaystyle\Delta_{\Omega}\tau_{\Omega}$ $\displaystyle=$
$\displaystyle\Delta R_{2}\times[u_{1}^{2},u_{2}^{2},u_{3}^{2},u_{4}^{2}]^{T}$
$\displaystyle f_{2}(\Omega)$ $\displaystyle=$ $\displaystyle
I^{-1}\Big{[}-\overline{\Omega^{\times}I\Omega}-\bar{\tau}_{a}+\bar{\tau}_{g}\Big{]}$
$d_{\Omega}(t)=I^{-1}\Big{[}-\overline{\Omega^{\times}\Delta I\Omega}-\Delta
I\dot{\Omega}-\Delta\tau_{a}+\Delta\tau_{g}+d_{2}(t)\Big{]}$

##  III Control Model

The control objective is to design the control signal to regulate the
quadrotor states to a given desired time-varying reference trajectory that is
sufficiently smooth, despite the presence of uncertainties in the dynamic and
actuator model respectively. Thus, the control objective can be mathematically
stated as

$\|\xi(t)\|\rightarrow 0$ (10)

where $\xi$ in (10) is the difference between the current state and desired
state of the quadrotor and $\|.\|$ in (10) denotes standard Euclidean norm.

###### Assumption 1

The desired trajectory profile $P_{d}\left(t\right)$ and its first three-time
derivatives are bounded in the sense that
$P_{d}\left(t\right),\dot{P}_{d}\left(t\right),\ddot{P}_{d}\left(t\right),\dddot{P}_{d}\left(t\right)\in\mathcal{L}_{\infty}$
$\forall$ $t\geq 0$.

###### Assumption 2

The distrubances in the quadtrotor dynamics in (9b) and (9d) are smooth enough
such that

$\|\dot{d}_{V}\|\leq\epsilon_{1},\qquad\|\dot{d}_{\Omega}\|\leq\epsilon_{2}$
(11)

where $\epsilon_{1},\epsilon_{2}$ are some unknown positive constants.

###  III-A Open-loop Error System

####  III-A1 Position Loop

To assess the controller performance and to enable the subsequent stability
analysis, the tracking error $\xi_{1}(t)\in\mathbb{R}^{3}$ and auxiliary
tracking errors $\xi_{2}(t),\eta_{1}(t)\in\mathbb{R}^{3}$ for the position
loop are defined as

$\displaystyle\xi_{1}=P-P_{d},$ (12)
$\displaystyle\xi_{2}=\dot{\xi}_{1}+k_{1}\xi_{1}=V-V^{*}_{d}$ (13)
$\displaystyle V^{*}_{d}=V_{d}-k1\xi_{1}$ (14)
$\displaystyle\eta_{1}=\dot{\xi}_{2}+k_{2}\xi_{2}$ (15)

where $P_{d}=[x_{d},y_{d},z_{d}]^{T}\in\mathbb{R}^{3}$,
$V_{d}=[V_{d_{x}},V_{d_{y}},V_{d_{z}}]^{T}\in\mathbb{R}^{3}$ are the desired
position and velocity; and $k_{1},k_{2}\in\mathbb{R}$ denote positive control
gains. Taking the derivative of (15) and using the definition in (12) and (13)
the open loop error dynamics can be expressed as

$\displaystyle\dot{\eta}_{1}=\ddot{V}-\ddot{V}_{d}+k_{1}(\dot{\xi}_{2}-k_{1}\dot{\xi}_{1})+k_{2}\dot{\xi}_{2}$
(16)

By using the definition in (9b) the tracking error in (16) is expanded as

$\displaystyle\dot{\eta}_{1}$ $\displaystyle=$
$\displaystyle\dot{f}_{1}(V)+\dot{F}_{V}(t)+\dot{\Delta}_{V}F_{V}(t)+\dot{d}_{V}(t)-\ddot{V}_{d}$
(17) $\displaystyle+$ $\displaystyle
k_{1}(\dot{\xi}_{2}-k_{1}\dot{\xi}_{1})+k_{2}\dot{\xi}_{2}.$

The error dynamics in (17) can be expressed as

$\dot{\eta}_{1}=\tilde{\Gamma}_{1}+\Gamma_{1d}+\dot{F}_{V}(t)+\dot{\Delta}_{V}F_{V}(t)-\xi_{2}$
(18)

where the unknown auxiliary functions,
$\tilde{\Gamma}_{1}(t),\Gamma_{1d}(t)\in\mathbb{R}^{3}$ are defined as

$\displaystyle\tilde{\Gamma}_{1}(t)$ $\displaystyle=$
$\displaystyle\dot{f}_{1}(V)+k_{1}(\dot{\xi}_{2}-k_{1}\dot{\xi}_{1})+k_{2}\dot{\xi}_{2}+\xi_{2}$
(19) $\displaystyle\Gamma_{1d}$ $\displaystyle=$
$\displaystyle\dot{d}_{V}(t)-\ddot{V}_{d}.$ (20)

###### Assumption 3

Approximate model knowledge is available such that $\dot{\Delta}_{V}(t)$
satisfies

$\left\|\dot{\Delta}_{V}(t)\right\|_{i\infty}<\delta_{1}<1,$ (21)

where $\delta_{1}\in\mathbb{R}^{+}$ is a known bounding constant, and
$\left\|\cdot\right\|_{i\infty}$ denotes the induced infinity norm.

The motivation for the separation of terms in (19) and (20) is based on the
fact that the following inequalities can be developed

$\|\tilde{\Gamma}_{1}\|\leq\rho_{1}\left(\left\|\mu_{1}\right\|\right)\left\|\mu_{1}\right\|,\>\>\>\|\Gamma_{1d}\|\leq\kappa_{\Gamma_{1d}},\>\>\>\|\dot{\Gamma}_{1d}\|\leq\kappa_{\dot{\Gamma}_{1d}}$
(22)

where $\kappa_{\Gamma_{1d}}$, $\kappa_{\dot{\Gamma}_{1d}}\in\mathbb{R}^{+}$
are known bounding constants; $\rho\left(\cdot\right)$ is a positive, globally
invertible, non-decreasing function; and $\mu_{1}(t)\in\mathbb{R}^{9}$ is
defined as

$\mu_{1}\left(t\right)\triangleq\left[\begin{array}[]{ccc}\xi_{1}^{T}\left(t\right)&\xi_{2}^{T}\left(t\right)&\eta_{1}^{T}\left(t\right)\end{array}\right]^{T}.$
(23)

####  III-A2 Attitude Loop

The tracking error in the attitude loop $\xi_{3}(t)\in\mathbb{R}^{3}$ and
auxiliary tracking errors $\xi_{4}(t),\eta_{2}(t)\in\mathbb{R}^{3}$ are
defined as

$\displaystyle\xi_{3}=\omega-\omega_{d},$ (24)
$\displaystyle\xi_{4}=\dot{\xi}_{3}+k_{3}\xi_{3}=\Omega-\Omega^{*}_{d}$ (25)
$\displaystyle\Omega^{*}_{d}=\Omega_{d}-k_{3}\xi_{3}$ (26)
$\displaystyle\eta_{2}=\dot{\xi}_{4}+k_{4}\xi_{4}$ (27)

where $\omega_{d}=[\phi_{d},\theta_{d},\psi_{d}]^{T}\in\mathbb{R}^{3}$,
$\Omega_{d}=[p_{d},q_{d},r_{d}]^{T}\in\mathbb{R}^{3}$ are the desired angular
position and angular velocity, $k_{3},k_{4}\in\mathbb{R}$ denote positive
control gains.

Since the quadrotor is an underactuated system with 4 control inputs and 6
outputs and using the differential flatness property, the control input can be
obtained from four flat outputs $[x_{d},y_{d},z_{d},\psi_{d}]^{T}$ (user-
defined). In addition, the desired trajectories of roll ($\phi_{d}$) and pitch
($\theta_{d}$) depend on these flat outputs and are defined according to the
dynamics (9a) and (9b) as [12, 24]:

$\displaystyle\phi_{d}=\sin^{-1}\bigg{[}\frac{m}{U_{1}}(U_{1}\sin(\psi_{d})-U_{2}\cos(\psi_{d}))\bigg{]},$
(28)
$\displaystyle\theta_{d}=\tan^{-1}\bigg{[}\frac{1}{U_{3}}(U_{1}\cos(\psi_{d})+U_{2}\cos(\psi_{d}))\bigg{]},$
(29)

where $F_{V}$ is the thrust force, which is defined as

$F_{V}=m\sqrt{U_{1}^{2}+U_{2}^{2}+U_{3}^{2}}$ (30)

where $U_{i}=F_{V}\times R_{1}(i)$ for $i=1,2,3$ and $R_{1}(i)$ is the
$i^{th}$ row of matrix $R_{1}$ defined in (52).

By taking the derivative of (27) and using the definition in (24) and (25) the
open loop error dynamics in the attitude loop can be expressed as

$\displaystyle\dot{\eta}_{2}=\ddot{\Omega}-\ddot{\Omega}_{d}+k_{3}(\dot{\xi}_{4}-k_{3}\dot{\xi}_{3})+k_{4}\dot{\xi}_{4}$
(31)

By using the definition in (9d) the tracking error in (31) is expanded as

$\displaystyle\dot{\eta}_{2}$ $\displaystyle=$
$\displaystyle\dot{f}_{2}(\Omega)+\dot{\tau}_{\Omega}(t)+\dot{\Delta}_{\Omega}\tau_{\Omega}(t)+\dot{d}_{\Omega}(t)-\ddot{\Omega}_{d}$
(32) $\displaystyle+$ $\displaystyle
k_{3}(\dot{\xi}_{4}-k_{3}\dot{\xi}_{3})+k_{4}\dot{\xi}_{4}.$

The error dynamics in (32) can be expressed as

$\dot{\eta}_{2}=\tilde{\Gamma}_{2}+\Gamma_{2d}+\dot{\tau}_{\Omega}(t)+\dot{\Delta}_{\Omega}\tau_{\Omega}(t)-\xi_{4}$
(33)

where the unknown auxiliary functions,
$\tilde{\Gamma}_{2}(t),\Gamma_{2d}(t)\in\mathbb{R}^{3}$ are defined as

$\displaystyle\tilde{\Gamma}_{2}(t)$ $\displaystyle=$
$\displaystyle\dot{f}_{2}(\Omega)+k_{3}(\dot{\xi}_{4}-k_{3}\dot{\xi}_{3})+k_{4}\dot{\xi}_{4}+\xi_{4}$
(34) $\displaystyle\Gamma_{1d}$ $\displaystyle=$
$\displaystyle\dot{d}_{\Omega}(t)-\ddot{\Omega}_{d}.$ (35)

###### Assumption 4

Approximate model knowledge is available such that $\dot{\Delta}_{\Omega}(t)$
satisfies

$\left\|\dot{\Delta}_{\Omega}(t)\right\|_{i\infty}<\delta_{2}<1,$ (36)

where $\delta_{2}\in\mathbb{R}^{+}$ is a known bounding constant, and
$\left\|\cdot\right\|_{i\infty}$ denotes the induced infinity norm.

The motivation for the separation of terms in (34) and (35) are based on the
fact that the following inequalities can be developed

$\|\tilde{\Gamma}_{2}\|\leq\rho_{2}\left(\left\|\mu_{2}\right\|\right)\left\|\mu_{2}\right\|,\|\Gamma_{2d}\|\leq\kappa_{\Gamma_{2d}},\|\dot{\Gamma}_{2d}\|\leq\kappa_{\dot{\Gamma}_{2d}}$
(37)

where $\kappa_{\Gamma_{2d}}$, $\kappa_{\dot{\Gamma}_{2d}}\in\mathbb{R}^{+}$
are known bounding constants; $\rho\left(\cdot\right)$ is a positive, globally
invertible, non-decreasing function; and $\mu_{2}(t)\in\mathbb{R}^{9}$ is
defined as

$\mu_{2}\left(t\right)\triangleq\left[\begin{array}[]{ccc}\xi_{3}^{T}\left(t\right)&\xi_{4}^{T}\left(t\right)&\eta_{2}^{T}\left(t\right)\end{array}\right]^{T}.$
(38)

###  III-B Closed-loop Error System

####  III-B1 Position Loop

Based on the open-loop error system dynamics in (18), the control term
$F_{V}(t)$ is designed as:

$\displaystyle\dot{F}_{V}(t)=-\alpha_{F}\|F_{V}(t)\|sgn(\eta_{1})-(\alpha_{1}+1)\eta_{1}$
$\displaystyle-\hat{\lambda}_{1}sgn(\eta_{1}),$ (39)

where $\alpha_{F},\alpha_{1}\in\mathbb{R}$ are positive, control gains.
$\hat{\lambda}_{1}\in\mathbb{R}^{3}$ is a adaptive nonlinear feedback gain,
which is defined as

$\dot{\hat{\lambda}}_{1i}=\beta_{1}sgn(\eta_{1})\eta_{1}$ (40)

where $i=1,2,3$, $\beta_{1}$ is a positive adaptation gain.

###### Remark 1

Note that the theoretical design and stability analysis in this paper are
based on the discontinuous signum function, i.e.,

$\displaystyle sgn(\sigma)=\Bigg{\\{}\begin{array}[]{c}1\qquad\sigma>0\\\
0\qquad\sigma=0\\\
-1\qquad\sigma<0\end{array}\qquad\forall\sigma\in\mathbb{R}.$ (44)

After substituting (III-B1) into (18), the closed-loop error dynamics is
obtained as

$\displaystyle\dot{\eta}_{1}$ $\displaystyle=$
$\displaystyle\tilde{\Gamma}_{1}+\Gamma_{1d}-\alpha_{F}\|F_{V}(t)\|sgn(\eta_{1})-(\alpha_{1}+1)\eta_{1}$
(45) $\displaystyle-$
$\displaystyle\hat{\lambda}_{1}sgn(\eta_{1})+\dot{\Delta}_{V}F_{V}(t)-\xi_{2}$

####  III-B2 Attitude Loop

Based on the open-loop error system dynamics in (33), the control term
$\tau_{\Omega}(t)$ is designed as:

$\displaystyle\dot{\tau}_{\Omega}(t)=-\alpha_{\Omega}\|\tau_{\Omega}(t)\|sgn(\eta_{2})-(\alpha_{2}+1)\eta_{2}$
$\displaystyle-\hat{\lambda}_{2}sgn(\eta_{2}),$ (46)

where $\alpha_{\Omega},\alpha_{2}\in\mathbb{R}$ are positive, control gains.
$\hat{\lambda}_{2}\in\mathbb{R}^{3}$ is a adaptive nonlinear feedback gain,
which is defined as

$\dot{\hat{\lambda}}_{2i}=\beta_{2}sgn(\eta_{2})\eta_{2}$ (47)

where $i=1,2,3$; $\beta_{2}$ is a positive adaptation gain.

After substituting (III-B2) into (33), the closed-loop error dynamics is
obtained as

$\displaystyle\dot{\eta}_{2}$ $\displaystyle=$
$\displaystyle\tilde{\Gamma}_{2}+\Gamma_{2d}-\alpha_{\Omega}\|\tau_{\Omega}(t)\|sgn(\eta_{2})-(\alpha_{2}+1)\eta_{2}$
(48) $\displaystyle-$
$\displaystyle\hat{\lambda}_{2}sgn(\eta_{2})+\dot{\Delta}_{\Omega}\tau_{\Omega}(t)-\xi_{4}$

##  IV Stability Analysis

Before providing the stability analysis of the closed-loop quadrotor system,
the following conditions, definition and lemma will be utilized in the proof
of theorem1.

######  Condition 1 ($\lambda_{ji}$-Gain)

To facilitate the following stability proof, the adaptive gain $\lambda_{ji}$
for $j=1,2$ and $i=1,2,3$ must satisfy the following condition

$\displaystyle\lambda_{1i}=\Gamma_{1d}+\frac{1}{k_{2}}\dot{\Gamma}_{1d};\qquad\lambda_{2i}=\Gamma_{2d}+\frac{1}{k_{4}}\dot{\Gamma}_{2d}$
(49)

###### Definition 1

To facilitate the Lyapunov-based proof of theorem1, two functions
$Q_{1}(t)\in\mathbb{R}$ and $Q_{2}(t)\in\mathbb{R}$ are defined as

$\displaystyle
Q_{1}(t)\triangleq\lambda_{1}\left|\xi_{2}(0)\right|-\xi_{2}^{T}(0)\Gamma_{1d}(0)-\int_{0}^{t}R_{1}(\upsilon)d\upsilon$
(50) $\displaystyle
Q_{2}(t)\triangleq\lambda_{2}\left|\xi_{4}(0)\right|-\xi_{4}^{T}(0)\Gamma_{2d}(0)-\int_{0}^{t}R_{2}(\upsilon)d\upsilon$
(51)

where the auxiliary function $R_{1}(t)\in\mathbb{R}$ and
$R_{2}(t)\in\mathbb{R}$ are defined as

$\displaystyle
R_{1}(t)=\eta_{1}^{T}(t)\big{[}\Gamma_{1d}(t)-\lambda_{1}sgn(\eta_{1})\big{]}$
(52) $\displaystyle
R_{2}(t)=\eta_{2}^{T}(t)\big{[}\Gamma_{2d}(t)-\lambda_{2}sgn(\eta_{2})\big{]}$
(53)

###### Lemma 1

Provided the sufficient conditions in (49) are satisfied, the auxiliary
functions in the translational and rotational loop are defined as

$\displaystyle\int_{0}^{t}R_{1}(\upsilon)d\upsilon\leq\lambda_{1}\left|\xi_{2}(0)\right|-\xi_{2}^{T}(0)\Gamma_{1d}(0)$
(54)
$\displaystyle\int_{0}^{t}R_{2}(\upsilon)d\upsilon\leq\lambda_{2}\left|\xi_{4}(0)\right|-\xi_{4}^{T}(0)\Gamma_{2d}(0)$
(55)

Hence, (54) and (55) can be used to prove that $Q_{1}(t)\geq 0$ and
$Q_{1}(t)\geq 0$. Proof of Lemma 1 can be found in [21] and is omitted here
for brevity.

######  Condition 2 (Control Gain)

The control gains defined in (III-B1) and (III-B2) are selected according to
the condition

$\alpha_{1}>\frac{\rho^{2}(\|\mu_{1}\|)}{4min\\{(k_{1}-\frac{1}{2}),(k_{2}-\frac{1}{2}),1\\}}$
(56)
$\alpha_{2}>\frac{\rho^{2}(\|\mu_{2}\|)}{4min\\{(k_{3}-\frac{1}{2}),(k_{4}-\frac{1}{2}),1\\}}$
(57) $\alpha_{F}\geq\delta_{1},\qquad\alpha_{\tau}\geq\delta_{2}.$ (58)

###### Theorem 1

theorem1 For the quadrotor dynamics described in (9a)-(9d) and for a given
sufficiently smooth desired trajectory $[x_{d},y_{d},z_{d},\psi_{d}]^{T}$, the
robust nonlinear control law given in (III-B1) and (III-B2) along with the
adaptive parameters updated based on (40) and (47) ensure the tracking error
is asymptotically regulated and all the signals remain bounded throughout the
closed-loop operation in the sense that

$\|\xi(t)\|\rightarrow 0\qquad\mbox{for}\qquad t\geq t_{n}<\infty,$ (59)

where $t_{n}\in\mathcal{L}_{\infty}$.

###### Proof:

Let $\mathcal{D}\subset\mathbb{R}^{6n+6+2}$ be a domain containing
$w\left(t\right)=0$, where $w\left(t\right)\in\mathbb{R}^{6n+1}$ is defined as

$w\left(t\right)\triangleq\left[\begin{array}[]{ccccc}\mu^{T}\left(t\right)&\tilde{\lambda}_{1}^{T}&\tilde{\lambda}_{2}^{T}&\sqrt{Q_{1}(t)}&\sqrt{Q_{2}(t)}\end{array}\right]^{T}$
(60)

where $\tilde{\lambda}_{i}=\hat{\lambda}_{i}-\lambda_{i},(i=1,2)$ in (60)
represent the difference between the estimated parameter and its true value
defined in Condition 1 and $\mu(t)\in\mathbb{R}^{6n}$ is defined as

$\mu\left(t\right)\triangleq\left[\begin{array}[]{cc}\mu_{1}^{T}\left(t\right)&\mu_{2}^{T}\left(t\right)\end{array}\right]^{T},$
(61)

$Q_{1}(t)$ and $Q_{2}(t)$ are defined in Definition 1. Let
$V\left(w,t\right):\mathcal{D}\times[0,\infty)\rightarrow\mathbb{R}$ be a
radially unbounded, positive definite function defined as

$\displaystyle V$ $\displaystyle=$
$\displaystyle\frac{1}{2}\xi_{1}^{T}\xi_{1}+\frac{1}{2}\xi_{2}^{T}\xi_{2}+\frac{1}{2}\xi_{3}^{T}\xi_{3}+\frac{1}{2}\xi_{4}^{T}\xi_{4}+\frac{1}{2}\eta_{1}^{T}\eta_{1}$
(62) $\displaystyle+$
$\displaystyle\frac{1}{2}\eta_{2}^{T}\eta_{2}+Q_{1}+Q_{2}+\frac{1}{2\beta_{1}}\tilde{\lambda}_{1}^{T}\tilde{\lambda}_{1}+\frac{1}{2\beta_{2}}\tilde{\lambda}_{2}^{T}\tilde{\lambda}_{2}$

which satisfies the inequalities

$U_{1}\left(w\right)\leq V\left(w,t\right)\leq U_{2}\left(w\right),$ (63)

provided the gain Condition 1 are satisfied. In (63), the continuous positive
definite functions $U_{1}\left(w\right)$, $U_{2}\left(w\right)\in\mathbb{R}$
are defined as

$U_{1}\left(w\right)\triangleq\textstyle{\frac{1}{2}}\left\|w\right\|^{2},\qquad
U_{2}\left(w\right)\triangleq\left\|w\right\|^{2}.$ (64)

After taking the time derivative of (62) and using (12), (13), (24), (25),
(45), (48), $\dot{V}$ can be expressed as

$\displaystyle\dot{V}$ $\displaystyle=$
$\displaystyle\xi_{1}^{T}[\xi_{2}-k_{1}\xi_{1}]+\xi_{2}^{T}[\eta_{1}-k_{2}\xi_{2}]+\xi_{3}^{T}[\xi_{4}-k_{3}\xi_{3}]$
(65) $\displaystyle+$
$\displaystyle\xi_{4}^{T}[\eta_{2}-k_{4}\xi_{4}]+\eta_{1}^{T}[\tilde{\Gamma}_{1}+\Gamma_{1d}-\alpha_{F}\|F_{V}\|sgn(\eta_{1})$
$\displaystyle-$
$\displaystyle(\alpha_{1}+1)\eta_{1}-\hat{\lambda}_{1}sgn(\eta_{1})+\dot{\Delta}_{V}F_{V}(t)-\xi_{2}]$
$\displaystyle+$
$\displaystyle\eta_{2}^{T}[\tilde{\Gamma}_{2}+\Gamma_{2d}-\alpha_{\Omega}\|\tau_{\Omega}\|sgn(\eta_{2})-(\alpha_{2}+1)\eta_{2}$
$\displaystyle-$
$\displaystyle\hat{\lambda}_{2}sgn(\eta_{2})+\dot{\Delta}_{\Omega}\tau_{\Omega}(t)-\xi_{4}]+\dot{Q}_{1}+\dot{Q}_{2}$
$\displaystyle+$
$\displaystyle\frac{1}{\beta_{1}}\tilde{\lambda}_{1}^{T}\dot{\hat{\lambda}}_{1}+\frac{1}{\beta_{2}}\tilde{\lambda}_{2}^{T}\dot{\hat{\lambda}}_{2}.$

By using the bounding inequalities in (22), (37) and the defition of
$Q_{1},Q_{2}$ from (50), (51), and the definition of
$\dot{\hat{\lambda}}_{1}$, $\dot{\hat{\lambda}}_{2}$ from (40), (47), the
expression in (65) can be upper bounded as

$\displaystyle\dot{V}$ $\displaystyle\leq$
$\displaystyle\xi_{1}^{T}\xi_{2}+\xi_{3}^{T}\xi_{4}-k_{1}\|\xi_{1}\|^{2}-k_{2}\|\xi_{2}\|^{2}-k_{3}\|\xi_{3}\|^{2}$
(66) $\displaystyle-$ $\displaystyle
k_{4}\|\xi_{4}\|^{2}+\|\eta_{1}\|\rho(\|\mu_{1}\|)\|\mu_{1}\|+\|\eta_{1}\|\|\Gamma_{1d}\|$
$\displaystyle-$
$\displaystyle\|\eta_{1}\|(\alpha_{F})\|F_{V}\|-(\alpha_{1}+1)\|\eta_{1}\|^{2}-\|\eta_{1}\|\hat{\lambda}_{1}sgn(\eta_{1})$
$\displaystyle+$
$\displaystyle\delta_{1}\|\eta_{1}\|\|F_{V}\|+\|\eta_{2}\|\rho(\|\mu_{2}\|)\|\mu_{2}\|+\|\eta_{2}\|\|\Gamma_{2d}\|$
$\displaystyle-$
$\displaystyle\|\eta_{2}\|(\alpha_{\tau})\|\tau_{\Omega}\|-(\alpha_{2}+1)\|\eta_{2}\|^{2}-\|\eta_{2}\|\|\hat{\lambda}_{2}sgn(\eta_{2})$
$\displaystyle+$
$\displaystyle\delta_{2}\|\eta_{2}\|\|\tau_{\Omega}\|-\|\eta_{1}\|\|\Gamma_{1d}\|+\|\eta_{1}\|\lambda_{1}sgn(\eta_{1})$
$\displaystyle-$
$\displaystyle\|\eta_{2}\|\|\Gamma_{2d}\|+\|\eta_{2}\|\lambda_{2}sgn(\eta_{2})+\tilde{\lambda}_{1}^{T}sgn(\eta_{1})\eta_{1}$
$\displaystyle+$ $\displaystyle\tilde{\lambda}_{2}^{T}sgn(\eta_{2})\eta_{2}.$

But $\xi_{1}^{T}\xi_{2}$ and $\xi_{3}^{T}\xi_{4}$ can be upper bounded as

$\xi_{1}^{T}\xi_{2}\leq\frac{1}{2}\|\xi_{1}\|^{2}+\frac{1}{2}\|\xi_{2}\|^{2};\qquad\xi_{3}^{T}\xi_{4}\leq\frac{1}{2}\|\xi_{3}\|^{2}+\frac{1}{2}\|\xi_{4}\|^{2}.$
(67)

By using (67), and the gains $\alpha_{F},\alpha_{\tau},\alpha_{1}$ and
$\alpha_{2}$ satisfy the gain condition in Condition 2, the upper bound in
(66) can be further simplified as

$\displaystyle\dot{V}$ $\displaystyle\leq$
$\displaystyle-(k_{1}-\frac{1}{2})\|\xi_{1}\|^{2}-(k_{2}-\frac{1}{2})\|\xi_{2}\|^{2}-\|\eta_{1}\|^{2}$
$\displaystyle-$
$\displaystyle\alpha_{1}\bigg{[}\|\eta_{1}\|-\frac{\rho(\|\mu_{1}\|)}{2\alpha_{1}}\|\mu_{1}\|\bigg{]}^{2}+\frac{\rho^{2}(\|\mu_{1}\|)}{4\alpha_{1}}\|\mu_{1}\|^{2}$
$\displaystyle-$
$\displaystyle(k_{3}-\frac{1}{2})\|\xi_{3}\|^{2}-(k_{4}-\frac{1}{2})\|\xi_{4}\|^{2}-\|\eta_{2}\|^{2}$
$\displaystyle-$
$\displaystyle\alpha_{2}\bigg{[}\|\eta_{2}\|-\frac{\rho(\|\mu_{2}\|)}{2\alpha_{2}}\|\mu_{2}\|\bigg{]}^{2}+\frac{\rho^{2}(\|\mu_{2}\|)}{4\alpha_{2}}\|\mu_{2}\|^{2}$
$\dot{V}\leq-\bigg{[}c_{1}-\frac{\rho^{2}(\|\mu\|)}{4c_{2}}\bigg{]}\|\mu\|^{2},$
(69)

where
$c_{1}\triangleq\min\Big{[}min\\{(k_{1}-\frac{1}{2}),(k_{2}-\frac{1}{2}),1\\},min\\{(k_{3}-\frac{1}{2}),(k_{4}-\frac{1}{2}),1\\}\Big{]}$
and $c_{2}\triangleq min\\{\alpha_{1},\alpha_{2}\\}$. The following expression
can be obtained from (69)

$\dot{V}\leq-U\left(w\right),$ (70)

where $U(w)=c\left\|\mu\right\|^{2}$, for some positive constant
$c\in\mathbb{R}$ is a continuous positive semi-definite function that is
defined on the domain

$\mathcal{K}\triangleq\left\\{w\left(t\right)\in\mathbb{R}^{6n+2}|\left\|w\right\|\leq\rho^{-1}\left(2\sqrt{c_{1}c_{2}}\right)\right\\}.$
(71)

The expressions in (63) and (69), along with (56), (57) can be used to prove
that $V\left(w,t\right)\in\mathcal{L}_{\infty}$ in $\mathcal{K}$; hence,
$\xi_{1}(t),\xi_{2}(t),\xi_{3}(t),\xi_{4}(t)$,
$\eta_{1}\left(t\right),\eta_{2}(t)\in\mathcal{L}_{\infty}$ in $\mathcal{K}$.
Given that $\xi_{1}(t),\xi_{2}(t),\xi_{3}(t),\xi_{4}(t)$,
$\eta_{1}\left(t\right),\eta_{2}(t)\in\mathcal{L}_{\infty}$, a standard linear
analysis technique can be used along with (13), (15), (25), (27) to show that
$\dot{\xi}_{1}(t),\dot{\xi}_{2}(t),\dot{\xi}_{3}(t),\dot{\xi}_{4}(t)\in\mathcal{L}_{\infty}$
in $\mathcal{K}$. Since $\xi_{1}(t),\xi_{2}(t),\xi_{3}(t),\xi_{4}(t)$,
$\dot{\xi}_{1}(t),\dot{\xi}_{2}(t),\dot{\xi}_{3}(t),\dot{\xi}_{4}(t)\in\mathcal{L}_{\infty}$,
(12) and (24) can be used along with the Assumption 1 to prove that $P(t)$,
$V(t)\in\mathcal{L}_{\infty}$ in $\mathcal{K}$. Given that $P(t)$,
$V(t)\in\mathcal{L}_{\infty}$, (9a)-(9d) along with Assumption 3 and 4 to
prove that the control input
$F_{V}(t),\tau_{\Omega}(t)\in\mathcal{L}_{\infty}$ in $\mathcal{K}$. Since
$\eta_{1}\left(t\right),\eta_{2}(t)\in\mathcal{L}_{\infty}$, can be used to
prove that
$\dot{F}_{V}\left(t\right),\dot{\tau}_{\Omega}\in\mathcal{L}_{\infty}$ in
$\mathcal{K}$. Given that $\eta_{1}\left(t\right),\eta_{2}(t)$,
$\xi_{1}(t),\xi_{2}(t),\xi_{3}(t),\xi_{4}(t)\in\mathcal{L}_{\infty}$, the
bounding inequalities in (22), (37) can be used to prove that
$\dot{\eta}_{1}\left(t\right),\dot{\eta}_{2}(t)\in\mathcal{L}_{\infty}$ in
$\mathcal{D}$. Since
$\dot{\xi}_{1}(t),\dot{\xi}_{2}(t),\dot{\xi}_{3}(t),\dot{\xi}_{4}(t)$,
$\dot{\eta}_{1}\left(t\right),\dot{\eta}_{2}(t)\in\mathcal{L}_{\infty}$, (23)
and (38) can be used to prove that $\mu\left(t\right)$ is uniformly continuous
in $\mathcal{K}$. Hence, the definitions of $U\left(w\right)$ and
$\mu\left(t\right)$ can be used to prove that $U\left(w\right)$ is uniformly
continuous in $\mathcal{K}$.

Let $\mathcal{S}\subset\mathcal{K}$ denote a set defined as follows:

$\mathcal{S\triangleq}\left\\{w\left(t\right)\subset\mathcal{K}|U\left(w\left(t\right)\right)\leq\textstyle{\frac{1}{2}}\left(\rho^{-1}\left(2\sqrt{c_{1}c_{2}}\right)\right)^{2}\right\\}.$
(72)

Theorem $8.4$ of [29] can now be invoked to state that

$c\left\|\mu\left(t\right)\right\|^{2}\rightarrow 0\text{\qquad
as\qquad}t\rightarrow\infty\text{\qquad}\forall~{}w\left(0\right)\in\mathcal{S}\text{.}$

Based on the definition of $\mu\left(t\right)$, (72) can be used to show that

$\left\|\xi\left(t\right)\right\|\rightarrow 0\text{\qquad
as\qquad}t\rightarrow\infty\text{\qquad}\forall~{}w\left(0\right)\in\mathcal{S}\text{.}$
(73)

Hence, asymptotic regulation of the quadrotor states is achieved, provided the
initial conditions lie within the set $\mathcal{S}$, where $\mathcal{S}$ can
be made arbitrarily large by increasing the control gain $\alpha$ \- a semi-
global result. ∎

##  V Simulation Results

In this section, numerical examples are illustrated by conducting extensive
simulations to validate the efficiency of the proposed adaptive modified RISE
control algorithm for both the position and attitude loop with varying
magnitudes of the model, actuator uncertainties, and disturbances. During the
implementation of the control law in the current numerical simulation, the
discontinuous signum function is replaced with the continuously differentiable
tanh(·) function. This is a standard approximation, which relates to the well-
accepted definition of an “equivalent value operator” of a discontinuous
function [30].

The reader is referred to [25] for a detailed description of the physical
parameters, uncertainties, and external disturbance acting on the quadrotor.
The simulation results are summarized in Fig.1-6. The results show a
comparison between an MRISE-based control formulation in [25] and an adaptive
modified RISE formulation presented in this paper. The comparison is for a
specific case, with an uncertainty of $10\%$ deviation from true values and a
disturbance magnitude of 5.

Figure 1: [Left] Time evolution of the position of the quadrotor, [right]
Error between the desired and current state

A minimum snap trajectory proposed in [31] can be utilized to generate
feasible trajectories for quadrotors, but in this current work, the desired
trajectories are generated using the following definitions

$\displaystyle\begin{bmatrix}x_{des},y_{des},z_{des},\psi_{des}\end{bmatrix}^{T}=\begin{bmatrix}3\sin(t),3\cos(t),t,\sin(t)\end{bmatrix}^{T}.$
(74)

The control gains associated with the outer loop in (III-B1) are given as
$\alpha_{F}$ = 0.01, $\alpha_{1}$= 2, $k_{1}$ = 5, $k_{2}$= 2.5, and those of
the inner loop in (III-B2) are given as $\alpha_{\tau}$ = 0.01, $\alpha_{2}$=
5, $k_{3}$= 20, $k_{4}$ = 9, respectively.

Figure 2: Time evolution of the error between the desired and measured
translational position during the closed loop operation Figure 3: Time
evolution of the error between the desired and measured angular position
during the closed loop operation

Fig. 1 shows the positional state $x,y,z,\phi,\theta,\psi$ (blue) of the
quadrotor tracking using the control structure presented in this paper, is
compared with the quadrotor trajectory (red) using modified RISE-based control
in [25] with the desired (black) trajectory defined in (74). The disturbance
is introduced at $t=15$sec; the proposed adaptive control structure reacted
more robustly thereby reducing the error between the current and desired
states. Fig 2 shows the corresponding errors associated with the positional
states $x,y,z$ during the closed-loop control operation. Fig. 3 shows the
tracking error in the translational states of the quadrotor $\phi,\theta,\psi$
orientation during the closed-loop.

Fig. 4 shows the time evolution of the elements of the adaptive parameter
estimate $\hat{\lambda}_{1}$ and $\hat{\lambda}_{2}$ during closed-loop
controller operation. Fig. 5 shows the evolution of the control magnitudes
during closed-loop operation. The magnitude of these control signals closely
resembles the experimental results presented in [18] for agile trajectory
tracking. Fig. 6 shows the bar graph of the mean RMS error in the states
$P,V,\omega,\Omega$ over varying uncertainty levels. The results in Figs.2, 3
and 6 clearly demonstrate the improvement in the closed-loop performance that
is achieved by the proposed adaptive modified RISE-based control formulation
that compensates under varying levels of model and actuator uncertainties as
well as disturbance magnitudes.

Figure 4: Time response of the adaptive parameter estimates
$\hat{\lambda}_{1i}$ and $\hat{\lambda}_{2i}$ Figure 5: Commnaded control
inputs during the closed-loop operation Figure 6: A bar graph showing the mean
RMS error during the closed-loop operation for the states $P,V,\omega,\Omega$
under varying uncertainty levels

##  VI conclusion

In this paper, an adaptive MRISE state feedback controller is proposed that
achieves asymptotic trajectory tracking under gyroscopic effects, model, and
actuator uncertainties and at the same time mitigates external disturbances
acting on the quadrotor. The proposed nonlinear control algorithms adapt to
varying magnitudes of uncertainties, disturbances and track trajectories of
varying speeds. A rigorous Lyapunov-based analysis is utilized to prove
asymptotic trajectory tracking of both the position and attitude loops, where
the region of convergence can be made arbitrarily large through judicious
control gain selection. Detailed numerical simulations are provided to
evaluate the proposed control design. Future work will focus on evaluating the
proposed robust control methods through real-time experiments on a quadrotor.

## References

  * [1] M. Idrissi, M. Salami, and F. Annaz, “A review of quadrotor unmanned aerial vehicles: applications, architectural design and control algorithms,” Journal of Intelligent & Robotic Systems, vol. 104, no. 2, p. 22, 2022.
  * [2] G. Sonugur, “A review of quadrotor uav: Control and slam methodologies ranging from conventional to innovative approaches,” Robotics and Autonomous Systems, p. 104342, 2022.
  * [3] M. Rinaldi, S. Primatesta, and G. Guglieri, “A comparative study for control of quadrotor uavs,” Applied Sciences, vol. 13, no. 6, p. 3464, 2023.
  * [4] J.-T. Yu, “A unified SO (3) approach to the attitude control design for quadrotors,” IEEE Access, vol. 9, pp. 64871–64879, 2021.
  * [5] M. R. Cohen, K. Abdulrahim, and J. R. Forbes, “Finite-horizon LQR control of quadrotors on $se\\_2(3)$,” IEEE Robotics and Automation Letters, vol. 5, no. 4, pp. 5748–5755, 2020.
  * [6] R. Miranda-Colorado and L. T. Aguilar, “Robust pid control of quadrotors with power reduction analysis,” ISA transactions, vol. 98, pp. 47–62, 2020\.
  * [7] P. Foehn and D. Scaramuzza, “Onboard state dependent lqr for agile quadrotors,” in 2018 IEEE International Conference on Robotics and Automation (ICRA), pp. 6566–6572, IEEE, 2018.
  * [8] L. Martins, C. Cardeira, and P. Oliveira, “Inner-outer feedback linearization for quadrotor control: two-step design and validation,” Nonlinear Dynamics, vol. 110, no. 1, pp. 479–495, 2022.
  * [9] A. Mahmood and Y. Kim, “Decentrailized formation flight control of quadcopters using robust feedback linearization,” Journal of the Franklin Institute, vol. 354, no. 2, pp. 852–871, 2017.
  * [10] J. Wang, K. A. Alattas, Y. Bouteraa, O. Mofid, and S. Mobayen, “Adaptive finite-time backstepping control tracker for quadrotor uav with model uncertainty and external disturbance,” Aerospace Science and Technology, vol. 133, p. 108088, 2023.
  * [11] G. Wen, W. Hao, W. Feng, and K. Gao, “Optimized backstepping tracking control using reinforcement learning for quadrotor unmanned aerial vehicle system,” IEEE Transactions on Systems, Man, and Cybernetics: Systems, vol. 52, no. 8, pp. 5004–5015, 2021.
  * [12] Y.-C. Liu and T.-W. Ou, “Non-linear adaptive tracking control for quadrotor aerial robots under uncertain dynamics,” IET Control Theory & Applications, vol. 15, no. 8, pp. 1126–1139, 2021.
  * [13] K. Patnaik and W. Zhang, “Adaptive attitude control for foldable quadrotors,” IEEE Control Systems Letters, 2023.
  * [14] J. Bai, Y. Wang, and H. Xing, “Computational adaptive optimal tracking control of quadrotor uav based on robust control with unknown dynamics,” in 2021 33rd Chinese Control and Decision Conference (CCDC), pp. 4747–4752, IEEE, 2021.
  * [15] D. D. Dhadekar, P. D. Sanghani, K. Mangrulkar, and S. Talole, “Robust control of quadrotor using uncertainty and disturbance estimation,” Journal of Intelligent & Robotic Systems, vol. 101, pp. 1–21, 2021.
  * [16] X. Lin, Y. Wang, and Y. Liu, “Neural-network-based robust terminal sliding-mode control of quadrotor,” Asian Journal of Control, vol. 24, no. 1, pp. 427–438, 2022.
  * [17] J. Baek and M. Kang, “A synthesized sliding-mode control for attitude trajectory tracking of quadrotor uav systems,” IEEE/ASME Transactions on Mechatronics, 2023.
  * [18] J. Jia, K. Guo, X. Yu, L. Guo, and L. Xie, “Agile flight control under multiple disturbances for quadrotor: Algorithms and evaluation,” IEEE Transactions on Aerospace and Electronic Systems, vol. 58, no. 4, pp. 3049–3062, 2022.
  * [19] Z. Li, X. Ma, and Y. Li, “Model-free control of a quadrotor using adaptive proportional derivative-sliding mode control and robust integral of the signum of the error,” International Journal of Advanced Robotic Systems, vol. 15, no. 5, p. 1729881418800885, 2018.
  * [20] L. Yu, G. He, X. Wang, and L. Shen, “A novel fixed-time sliding mode control of quadrotor with experiments and comparisons,” IEEE Control Systems Letters, vol. 6, pp. 770–775, 2021.
  * [21] B. Xian, D. M. Dawson, M. S. de Queiroz, and J. Chen, “A continuous asymptotic tracking control strategy for uncertain nonlinear systems,” IEEE Transactions on Automatic Control, vol. 49, no. 7, pp. 1206–1211, 2004.
  * [22] G. Yang, T. Zhu, F. Yang, L. Cui, and H. Wang, “Output feedback adaptive rise control for uncertain nonlinear systems,” Asian Journal of Control, vol. 25, no. 1, pp. 433–442, 2023.
  * [23] H. Wang, X. Shao, J. Li, and J. Liu, “A velocity-free adaptive rise-based trajectory tracking approach for quadrotors with desired model compensation,” Aerospace Science and Technology, vol. 92, pp. 551–562, 2019.
  * [24] X. Shao, Q. Meng, J. Liu, and H. Wang, “Rise and disturbance compensation based trajectory tracking control for a quadrotor uav without velocity measurements,” Aerospace Science and Technology, vol. 74, pp. 145–159, 2018.
  * [25] K. B. Kidambi, C. Fermüller, Y. Aloimonos, and H. Xu, “Robust nonlinear control-based trajectory tracking for quadrotors under uncertainty,” IEEE Control Systems Letters, vol. 5, no. 6, pp. 2042–2047, 2020.
  * [26] S. Tang and V. Kumar, “Autonomous flight,” Annual Review of Control, Robotics, and Autonomous Systems, vol. 1, pp. 29–52, 2018.
  * [27] R. Mahony, V. Kumar, and P. Corke, “Multirotor aerial vehicles: Modeling, estimation, and control of quadrotor,” IEEE Robotics and Automation magazine, vol. 19, no. 3, pp. 20–32, 2012.
  * [28] J. Svacha, J. Paulos, G. Loianno, and V. Kumar, “Imu-based inertia estimation for a quadrotor using newton-euler dynamics,” IEEE Robotics and Automation Letters, vol. 5, no. 3, pp. 3861–3867, 2020.
  * [29] H. K. Khalil, Nonlinear control, vol. 406.  Pearson New York, 2015.
  * [30] S. V. Drakunov, “Sliding-mode observers based on equivalent control method,” in [1992] Proceedings of the 31st IEEE Conference on Decision and Control, pp. 2368–2369, IEEE, 1992.
  * [31] D. Mellinger and V. Kumar, “Minimum snap trajectory generation and control for quadrotors,” in 2011 IEEE international conference on robotics and automation, pp. 2520–2525, IEEE, 2011.


# BGP Typo: A Longitudinal Study and Remedies

Liron David  Dept. of Computer Science and Applied Mathematics
Weizmann Institute of Science
Email<EMAIL_ADDRESS>Yuval Shavitt  School of Electrical Engineering,
Tel-Aviv University
Email<EMAIL_ADDRESS>
###### Abstract

BGP is the protocol that keeps Internet connected. Operators use it by
announcing Address Prefixes (APs), namely IP address blocks, that they own or
that they agree to serve as transit for. BGP enables ISPs to devise complex
policies to control what AP announcements to accept (import policy), the route
selection, and what AP to announce and to whom (export policy). In addition,
BGP is also used to coarse traffic engineering for incoming traffic via the
prepend mechanism.

However, there are no wide-spread good tools for managing BGP and much of the
complex configuration is done by home-brewed scripts or simply by manually
configuring router with bare-bone terminal interface. This process generates
many configuration mistakes.

In this study, we examine typos that propagates in BGP announcements and can
be found in many of the public databases. We classify them and quantify their
presence, and surprisingly found tens of ASNs and hundreds of APs affected by
typos on any given time. In addition, we suggest a simple algorithm that can
detect (and clean) most of them with almost no false positives.

##  I Introduction

BGP (together with IP) is the glue that keeps the Internet connected.
Surprisingly, although its complexity, BGP is still largely managed manually,
and as a result BGP suffers from many configuration errors [1, 2, 3, 4, 5].
One specific problem in BGP announcements is typos, which are inserted by
operators, that result is corrupted route announcement. This problem is
missing from almost all previous analysis of BGP [6].

Many of the typos in BGP are due to route prepending. Route prepending is the
duplication of an ASN in the route to make it look longer and thus less
favorite for routing [7]. For example, if an AS X has two upstream providers:
a main provider M, and a more expensive backup provider B, it may prepend its
announcement to B in an attempt to make routes through B less favourable.
Namely it will send M the route ”X”, and B the route ”X X X”. If both B and M
are customers of AS Y, Y will receive the route ”M X” from M and the route ”B
X X X” from B. If no other preference exist the route to M will be selected by
Y since it is shorter (2 hops vs. 4 hops). Note that the more times X
duplicates itself in the route, the higher is the tendency of traffic to shift
from B to M [8]. Note that most prepending are small with 2, 3, and 4 ASN
copies, but much larger number are also seen.

Since prepending is done manually, typing mistakes happen with the ASN, such
as missing a digit, adding a digit, and swapping digits. One other common
typing mistake is typing the number of prepends at the end of the route,
sometimes instead of the prepending and sometimes in addition to [5].

Unlike many configuration errors, typing mistakes seem to be benign since they
seem not to change the routing, but they effect routing in several ways. If a
BGP message arrives at an AS with its ASN in it due to a typo, it will most
likely be rejected, since ASes are responsible to check that they do not
create AS-level routing loops. This may result in black-holes or longer
routes. The opposite effect may happen if prepending is replaced with typing
the number of prepends. If the original traffic engineering intent was the
route ”X X X X” we may get instead ”X 3” a shorter route and thus less traffic
shifting.

The recent increased deployment of RPKI [9] exposes messages with a typo in
the first AS vulnerable for special treatment since the ’origin AS’ does not
match the RPKI record. Depending on the RPKI implementation, such messages
will either be ignored or get the lowest selection priority. This may result
with black holes, or route length inflation. Roughly half of the typos we
found are exposed to this problem.

Finally, erroneous ASN in the path may trigger hijack detection systems [5],
especially in the near future where deep learning approaches will be put into
usage [10]. Commercial BGP monitoring services are currently reporting a
change in the origin AS and upstream provider, thus, almost all typos we find
will trigger an alert. Other hijack detection services perform analysis of the
entire route, e.g., by using valley-free analysis [11], making even the less
common cases, where the typos are found further left in the route, trigger an
alert, as well.

Today’s typos are largely ignored, and as a result they contaminate many
public databases: The RIPE database reports wrong AP ownership (Figure 1),
CAIDA database reports wrong neighborhood between ASNs (Figure 2) and deduce
their non-existent Type of Relationships in their ToR database, Hurricane
Electric (Figure 3) reports wrong AP ownership, and so do other public
commercial databases. We show that this errors can be detected with high
accuracy and almost with no false detection and removed from BGP, as well as
from these databases.

Figure 1: Erroneous APs (91.225.188.0/22, 45.4.30.0/24, 45.232.49.0/24)
associated with USC (AS4) from RIPE site. Figure 2: Erroneous neighboring ASNs
(24374, 6752,6751, 5064, 5057, 2104, 1601) associated with USC (AS4) from
CAIDA site. Figure 3: Erroneous APs (all except for the last one in the figure
are due to typos. The full list contains additional valid and invalid APs.)
associated with USC (AS4) from Hurricane Electric web site.

The rest of the paper is organized as follow. In section II we describe the
different and classify the typos and describe the data collection and
analysis. Section III brings the longitudinal (and other related) analysis.
Section IV discusses typo detection, and final section discusses the results.

##  II Methods and Data

###  II-A Typo classification

We classified the typing errors to the following categories:

  1. 1.

prepend count – In this scenario, the operator inserts the prepend amount
before the ASN, so if one wants to prepend AS X three times the results will
be either ”X 3” or ”X X X 3”. As a result, ASes with with small ASNs (AS3
which belongs to MIT in this example) are seen as the co-owners of many blocks
that are not connected to them.

For example, from late 2016 till early 2020, 202.56.168.0/23, which is owned
by AS131758 is prepended twice and routes end with the AS sequence: ”18351
131758 131758 131758”. At the same time 202.56.168.0/24, is announced with the
route ending by ”18351 131758 3”, obviously an attempt to prepend thrice
(Figure 4 depicts the announcements). Needless to say, AS3 (MIT) has no
relationships with AS131758 (PT. Bali Ning, a small ISP from Bali, Indonesia).
Interestingly, comparing all the 38 routes for the two APs in a one month
example, there was no difference in routing in any of them, albeit the
difference of 1 in the AS path length.

Figure 4: Announcement history of 202.56.168.0/24 from the RIPE site.

In the following examples, the number of prepends at the end of the path
corresponds to the number of repetitions (prepending) of the ASN.

     * •

5.100.240.0/24 “7660 2516 701 3356 42020 42020 42020 42020 42020 42020 31126
56902 56902 56902 3”

     * •

5.183.170.0/24 “3549 3356 8708 213323 213323 213323 213323 213323 213323
213323 213323 8”

     * •

103.49.56.0/24 ”57463 9498 133718 133718 2”

We searched for cases where the prepend number is in the range [1,12], though
there are also rare examples where we found 15, for example this route from
February 25, 2020: ”95.130.39.0/24 87.121.64.4 0 0 0 57463 6663 9002 2588
198138 198138 198138 198138 198138 198138 198138 198138 198138 198138 198138
198138 198138 198138 198138 15 ”.

  2. 2.

swap digits \- In this scenario, the operator, when prepending an ASN, swaps
two consecutive digits. In this example from December 2019 for the AP
2.58.168.0/22 we see the route ”3741 9002 29278 29728 29278 29278 29278 29278
29278 42864 i”

  3. 3.

insert/delete one digit \- In this scenario, the operator, when prepending the
AS, inserts or deletes one digit from the original ASN. In this example from
November 2019 for the AP 81.88.208.0/20 ”24441 6939 20764 39709 39709 3970
39709 39709 i”

  4. 4.

missing space  \- In this scenario, the operator, when prepending an AS,
misses a space between two ASNs. For example, in April 2017 the AP
72.5.214.0/24 announcement appears as ”3356 32026 32026 32026 32026 32026
32026 3202632026 32026 32026 32026 i”

  5. 5.

Other typos \- We found rare typos that were not counted like:

     * •

type 1 typos with very large numbers such as 15 or 20, for example this route
from February 25, 2020: ”95.130.39.0/24 87.121.64.4 0 0 0 57463 6663 9002 2588
198138 198138 198138 198138 198138 198138 198138 198138 198138 198138 198138
198138 198138 198138 198138 15”.

     * •

private ASNs that may be a leak but looks suspiciously similar to the ASN next
to them, for example: ”65100 100” and ”65292 292”.

###  II-B Data Collection and Identifying Typo

The data we examined was from the RouteViews project [12], where we extract
one RIB file from the first day of every month. We run a script that collected
the suspected announcements for each typo type. From each suspected
announcement, we extracted the suspected ASN pairs, and each pair was manually
evaluated to determine if it is legitimate. We ended up with three categories:
typo, OK, or unknown; the latter was quite small since it was quite easy in
most cases to determine the legitimacy of a path.

One exception to the above process was type 1 mistakes, since the problem
there is limited to identify the legitimate upstream providers of 12 stub ASNs
(1-12). After examining three months of data, we discovered all the legitimate
upstream providers, and any other provider was assumed a typo.

To identify the suspected routes with typo of type 2-4 we used the following
procedures ($||$ denotes concatenation):

0: $AS_{1},AS_{2}$

return $len(AS_{1})==len(AS_{2})$ and $\exists i$ s.t.
$AS_{1}[i]==AS_{2}[i+1]$ and $AS_{1}[i+1]==AS_{2}[i]$ and $\forall j\neq
i,i+1$ $AS_{1}[j]==AS_{2}[j]$

Algorithm 1 swap

0: $AS_{1},AS_{2}$

if $len(AS_{1})<len(AS_{2})$ then

$n=len(AS_{2})$

return $\exists i$ s.t. $AS_{1}==AS_{2}[1:i-1]$ $||$ $AS_{2}[i+1:n]$

else

$n=len(AS_{1})$

return $\exists i$ s.t. $AS_{2}==AS_{1}[1:i-1]$ $||$ $AS_{1}[i+1:n]$

end if

Algorithm 2 insert/delete

0: $AS_{1},AS_{2}$

return $AS_{1}==AS_{2}||AS_{2}$ or $AS_{2}==AS_{1}||AS_{1}$

Algorithm 3 missing space

To manually determine the legitimacy of a path we used several deduction
methods. Of course, routes with loops were declared a typo. Most of the
problematic pairs were at the beginning of the AS path (the right hand side),
thus, if the penultimate ASN owns the AP, the path was declared a typo.
Otherwise, there were many cases were a small ISP or stub AS from one country,
say the US, was between two ASes from a different country, say Brazil. In some
cases the AS types along the route were unreasonable, e.g., the announcement
of Rochester Institute of Technology (AS4385) for 129.21.0.0/16 from November
2017, ”6939 3356 385 4385 4385 4385 i”, puts AS385, which belongs to the US
Air Force, as its transit provider, clearly an unreasonable scenario. Pairs
with reasonable chances to have peering relationships, were declared OK. There
were cases where it was not clear if the path at hand is a typo, or a routing
glitch. These case were put in the ’unknown’ category, as well as cases were
the chances of peering between ASes seemed slim but not totally unreasonable.

##  III Longitudinal Study

Figure 5 depicts, for each type of typo and for each month from January 2017
till July 2020, the number of IP addresses in which there are typos, the
number of APs for which there are typos, and the number of ASN pairs that
comprise a typo. For type 1, instead of typo pairs, we count the number of
distinct ASNs, which come right before (form left side) the prepend digit. The
figure shows that there is no tendency of the problem to improve nor to worsen
for type 1 typos, but there is a clear decline in the number of affect APs for
type 3 and even more so for type 2 typos.

Figure 5: The number of APs, ASNs, and IP address affected by type 1 (top), 2
(middle), and 3 (bottom) typos over time.

The figures of the number of IP addresses affected by typos show occasional
spikes. We examine the spike in February-March 2018 of the type 1 graph (top-
right) and it is due to Belgian Proximus (AS5432) publishing five /14 APs with
a typo. The bottom row in Figure 5 shows a peak in type 3 typos in January
2017. We manually verified this month and see that in January 2017
2.176.0.0/12 is announced (over a million IP addresses) by Iran’s AS12880 with
the AS path “53767 3257 1299 12880 12880 12880 12880 2880 12880”. Quite a few
/16 APs that are not part of 2.176.0.0/12, all with the same typo are also
announced and together they explain the jump in IP addresses. The peak in May
2018 for type 2 IP addresses was also manually verified as discussed two
paragraphs below. We are, thus, confident that other peaks in the IP address
graphs represent real typos and not due to errors.

Next we discuss the number of APs. There is a large increase in the number of
APs affected by type 1 error in July 2020. In August (not shown in the figure)
this number abates to the levels of May-June 2020. The second row in Figure 5
shows swap errors (type 2). Interestingly, in about half of the depicted
months a few ASNs (10-15) inserted typos to announcements of 130-410 APs. We
manually verified a few of these months to make sure there are no mislabeled
pairs. For example, in May 2018 Vietnamese FPT Telecom (AS18403) published the
route ”37100 6453 18403 18043 18403 18403” for 184 APs with 737,280 IP
addresses. TATA (AS6453) is a provider of FPT Telecom, while AS18043 is a stub
AS from Taiwan, so this BGP path is certainly an error even without the loop
it contains.

We omitted the graph for type 4 typos since there are very few of them.
Throughout the study period, there was, at most, a single problematic ASN with
up to 3 affected APs, and up to 3328 affected IP addresses. Only two such ASNs
were detected.

Next we would like to study how long typos last. We searched for the typos
found in January 2017, the first month of our study, in all months from
February 2017 until July 2020. We depict the months when they existed in
Figures 6 and 7. The y-axis of Figure 6 is type 1 errors that appear in
November 2017 and in Figure 7 is type 2 (top) and 3 (bottom) errors that
appear in November 2017. If an error x appears at month y, the rectangle in
location (x,y) is colored. Of course, the first column, corresponding to
November 2017, is all colored and then most of the typos continue to appear in
the following months, some of them disappear for a while and then occur again.
Interestingly, a few typos were seen along the entire study period.

Figure 6: Timeline of Jan. 2017 ASNs with type 1 typos. A segment is colored
if the ASN had a typo in the corresponding month. Figure 7: Timeline of Jan.
2017 ASN pairs with swap typos (top) and insert/delete typos (bottom). A
segment is colored if the typo was found in the corresponding month.

To quantify typo persistence, Figure 8 plots the percent of typos in each
month that were seen also in the following month, i.e, for each month x from
January 2017 to July 2020, we calculate the percentage of errors in month x
that appear also in month x+1. As we can see on Figure 8, almost all plotted
markers are above two thirds, and the averages for type 1, 2 and 3 are 77.9%,
84.7% and 83.5% respectively. This means we can approximate the typo duration
as a Geometric random variable with $p=0.8$. The average duration is thus
$1/(1-p)$, namely 5 months.

Figure 8: The percentage of errors in one month that were seen in the
following month.

###  III-A Mistake Prevalence

Figure 9 shows a histogram of the number of BGP listeners (collectors) seen
each typo in the RouteView files for May-July 2020. Only Type 1 and Type 3
typos are presented since there were fewer type 2 typos and they behave
similarly to type 3 typos. Note that any AP announcement is seen by a
different number of collectors, all bounded by 41 collectors, and the number
of collectors with a typo are different.

Type 3 and 2 typos are usually seen only by less than a ten collectors. Type 1
mistakes have a significant portions of the typos propagating in to almost all
the collectors, 36-38 of them.

Figure 9: A histogram of the number of BGP listener seen each typo in the
RouteView files for May-July 2020.

Figure 10 shows a cdf of the cumulative percent of mistake seen by RouteViews
listeners (X axis) summed by typo for the months May-July 2020. For type 1
typos over 50% of the typos are seen at all the BGP listener that have an
entry for the relevant AP; for type 2 over 20% of the typos are seen at all
the BGP listener; and for type 3 this number is negligible. The majority of
the typos of type 2 and 3 propagate to less than 20% of the BGP listener.

Figure 10: The cumulative pairs portion with at least X percent of BGP
listeners that saw the typo in the RouteView files for May-July 2020.

###  III-B Offenders Study

Interestingly, the majority of the type 1 problems come from 4 countries:
Brazil, Indonesia, India and the USA, the first three are responsible for
close to half the typos. However, while 28.8% of the Internet ASNs are
registered as American (see Table I), only 12¼% are registered to the other
three combined.

Figure 11: Origin country of ASNs with Type 1 typos for May-July 2020. country | %
---|---
US | 28.83
BR | 7.80
RU | 6.83
GB | 3.05
DE | 2.98
AU | 2.73
PL | 2.73
IN | 2.65
UA | 2.38
CA | 2.22
ID | 1.81
TABLE I: Countries with most ASNs registered.

##  IV Typo Detection

In this section we present simple procedures to clean BGP tables from typos.
We then evaluate their success and false alarm rate.

###  IV-A Type 1 detection

As we mentioned in Sec. II-B, identifying type 1 mistakes is fairly easy, one
only needs to map all the upstream providers of ASNs 1-12, and every route
that has an ASN with a small number as its origin followed by an unknown
upstream providers can be classified as a typo.

Upstream providers are fairly static, so examining and updating the list
periodically should be a problem (e.g., twice a year examination is
sufficient). Alternatively, one can use a list of IP blocks owned or used by
these 12 ASes and flag announcements of APs not contained in these blocks. The
block ownership list for these ASes, unlike the list of APs, is also almost
static.

###  IV-B Type 2 & 3 detection

As we showed in Sec. II-A many routes have cycles and this alone can identify
many of the typos. Thus, we suggest the following procedures to identify a
typo

  1. 1.

If the pair is part of a loop then it is a typo. For example, in November 2017
the route to AP 143.208.148.0/24 was “293 6453 7738 8167 25933 25933 25933
264092 264092 _26402_ 264092 i”.

  2. 2.

If the pair has no ASN to its right, check if the right most ASN (the origin)
is the owner of the AP. If the right most is not the owner, the pair is a
typo. For example, in November 2017 the route to the AP 155.133.83.0/24 was
“1221 4637 174 50607 62081 199250 199250 199250 19925 19925 i” and the owner
of 155.133.83.0/24 is AS199250.

  3. 3.

Validate that the pair together with its immediate neighboring ASNs on either
side do not cause a geographic ownership cycle that span non-neighboring
countries. For example, in the April 2020 announcement of AP 193.93.216.0/22
”37100 37100 3255 49284 49824 49824 49824 49824 49824”, the country
registration of the triplet (3255 49284 49824) is (UA, IT, UA).

  4. 4.

If one ASN is not active, e.g., does not announce any AP, it is a typo.

Note that testing for ownership of an AP is somewhat problematic. Many of the
available databases, such as the one at RIPE (https://stat.ripe.net/) are
built based on AP announcements, so cannot help in our case. Another problem
is announcements by DDoS mitigators and other security services that announce
APs occasionally, e.g., when a DDoS attack is detected. The recent increase in
using RPKI [9] can help in this task.

###  IV-C Type 4 detection

In the few cases we found, the ASNs that resulted from a missing space had at
least 8 decimal digits, thus were obviously not valid. Currently, the largest
assigned ASN is below 400,000, so we can set the threshold there or with
sufficient margins, say at 500,000.

###  IV-D Identification Evaluation

We tested a simple algorithm based on the above procedure to detect typos in
routes. The algorithm accepts as input only paths that were flagged as
suspicious type 2 or type 3 typos.

if ASN cycles detected then

typo

else

if origin ASN is false then

typo

else

if Geo cycles detected then

typo

else

no typo

end if

end if

end if

Algorithm 4 Typos detection in routes.

Figure 12 shows the performance of the algorithm for type 2 and 3 typos over
time. The Bars are colored from bottom up according to the stage of the
algorithm were detection occurred. Blue for ASN cycles, red for origin
mismatch, and green for geographic loops. The white bar is for undetected
pairs. The typo detection rate is almost always between 80% and 100% (middle
row in Fig.12) while the number of undetected pairs (white in the top row of
Fig 12) is very small. Interestingly, the detection rate drops with time.

The false detection of routes as typos was quite small. For type 2 typos we
did not have even a single false detection (there were 9-18 such pairs every
month). For type 3 typos the false detection rate was between 0% and 7%, or
1-2 false detections out of 28-35 suspicious routes. Note that most of the
false detection come from the geo-cycles, which contribute very little to the
detection. So at least for type 3 typos one may consider not to use this test
in the algorithm.

Figure 12: Detection success and false detection (bottom row) of type 2 and 3
typos over time.

##  V Discussion

As we already mentioned, prepending is done manually in many cases. The
command line interface enables prepending both by entering the prepend route
as it should appear in BGP or by typing the number of times to prepend. For
example the Cisco IOS-XR command definition is:

    set as-path { tag |
      { prepend as-num [ ... as-num ] |
      last-as num }}

namely the operetor of AS 1 can prepend by writing ”set as-path prepend 1 1 1”
or ”set as-path prepend last-as 3”. In the older IOS, prepend definition was
part of the route-map and required operators to write the prepend route
verbosely.

Juniper (and Huawei most likely), on the other hand, does not support the
option to define the number of prepends

    set as-path prepend { list listName |
      asPathNumber [ asPathNumber ]* }

With these options it is not unlikely that type 1 typo will occur since one
can easily forget to remove the number of prepends when entering the full
prepend path. Indeed, in our data, the number of such errors is quite large.

While we present here ways to detect most of the typos we discussed, they are
only one example of the many BGP configuration errors reported in the
literature [1, 2, 3]. Thus, we believe the true solution for BGP configuration
is to mechanize this process with better tools. Recently, the research
community start suggesting solutions in this directions [13] and we hope that
the operator community will follow this direction.

## Acknowledgement

This research was funded in part by a grant on cyber research from the Israeli
PMO and the Blavatnik Interdisciplinary Cyber Research Center at Tel Aviv
University.

## References

  * [1] R. Mahajan, D. Wetherall, and T. Anderson, “Understanding BGP misconfiguration,” _ACM SIGCOMM Computer Communication Review_ , vol. 32, no. 4, pp. 3–16, 2002.
  * [2] N. Feamster and H. Balakrishnan, “Detecting BGP configuration faults with static analysis,” in _USENIX NSDI’05_ , Boston, Massachusetts, USA, May 2005.
  * [3] J. M. Del Fiore, P. Merindol, V. Persico, C. Pelsser, and A. Pescapé, “Filtering the noise to reveal inter-domain lies,” in _Network Traffic Measurement and Analysis Conference (TMA)_ , 2019, pp. 17–24.
  * [4] Y. Gilad, T. Hlavacek, A. Herzberg, M. Schapira, and H. Shulman, “Perfect is the enemy of good: Setting realistic goals for BGP security,” in _The 17th ACM Workshop on Hot Topics in Networks_ , 2018, pp. 57–63.
  * [5] S. Cho, R. Fontugne, K. Cho, A. Dainotti, and P. Gill, “BGP hijacking classification,” in _Network Traffic Measurement and Analysis Conference (TMA)_ , Jun 2019.
  * [6] B. Al-Musawi, P. Branch, and G. Armitage, “BGP anomaly detection techniques: A survey,” _IEEE Communications Surveys Tutorials_ , vol. 19, no. 1, pp. 377–396, 2017.
  * [7] R. Chang and M. Lo, “Inbound traffic engineering for multihomed ASs using AS path prepending,” _IEEE network_ , vol. 19, no. 2, pp. 18–25, 2005.
  * [8] B. Quoitin, C. Pelsser, O. Bonaventure, and S. Uhlig, “A performance evaluation of BGP-based traffic engineering,” _International journal of network management_ , vol. 15, no. 3, pp. 177–191, 2005.
  * [9] G. Huston and R. Bush, “Securing BGP and SIDR,” _IETF Journal_ , vol. 7, no. 1, 2011.
  * [10] T. Shapira and Y. Shavitt, “AP2Vec: an unsupervised approach for BGP hijacking detection,” _IEEE Transactions on Network and Service Management_ , 2022.
  * [11] L. Gao, “On inferring autonomous system relationships in the internet,” _IEEE/ACM Transactions on Networking_ , vol. 9, no. 6, pp. 733–745, 2001.
  * [12] U. of Oregon Advanced Network Technology Center, “Route views project,” http://www.routeviews.org/.
  * [13] M. Bahnasy, F. Li, S. Xiao, and X. Cheng, “DeepBGP: A machine learning approach for BGP configuration synthesis,” in _SIGCOMM Workshop on Network Meets AI & ML (NetAI’20)_, Aug. 2020, pp. 48–55.