accretion, accretion disks — stars: black holes — stars: jets — X-rays:
binaries

#  Steady jet ejections from the innermost region of advection-dominated
accretion flow around a black hole

Hajime Inoue11affiliation: Institute of Space and Astronautical Science, Japan
Aerospace Exploration Agency, 3-1-1 Yoshinodai, Chuo-ku, Sagamihara, Kanagawa
252-5210, Japan<EMAIL_ADDRESS>
###### Abstract

We study ejection mechanisms for two kinds of steady jets: one observed from
black hole binaries in the low/hard state and the other from SS433. The
specific energy of the ejected gas is required to be positive for the jets to
get to infinity, while that of the accreted gas is naively considered to be
negative at the outermost boundary of the accretion flow. To reconcile the
opposite sign of the specific energies, we propose a situation where two
layers exist in the accretion flow and one layer receives energy from the
other sufficiently for the specific energy to be positive. For the steady jets
in the low/hard state, the accretion ring at the outermost end of the
accretion flow is considered to yield two-layer flow in which a geometrically
thick ADAF sandwiches a geometrically thin accretion disk and the thin disk is
supposed to turn to another ADAF on the inner side. The energy transfer is
expected to occur through turbulent mixing between the two layers and the
upper layer is discussed to have the positive specific energy large enough for
the terminal velocity to be $\sim$ 0.1 $c$. For the steady jets from SS433, a
slim disk is argued to separate into two stratified layers due to the photon
diffusion in the direction perpendicular to the equatorial plane under the
advection dominated situation. In this case, the specific energy of the upper
layer is expected to be positive such that the terminal velocity exceeds 0.2
$c$. The jet ejection process near the black hole is investigated commonly to
both the two-layer cases and predicts the jet opening angle becomes as small
as 2∘.

##  1 Introduction

Relativistic jets are often observed from binary X-ray sources and active
galactic nuclei (AGN). The jet features were first found from the nuclei of
galaxies and such observational evidences as superluminal motions indicate
that the jet velocity is close to the velocity of light, $c$ (see e.g. Bridle
& Perley 1984 for the review on extragalactic radio jets). Relativistic jets
from Galactic binary sources was first discovered from SS433 by detecting
Doppler drifts in the optical lines, which is naturally explained by
precessing motions of jets collimated to two opposite directions with velocity
of 0.26 $c$ (see Margon 1984 for the early review). In early 1990s, multi-
wavelength studies of X-ray and gamma-ray sources in the Galactic center
region discovered that some X-ray persistent sources exhibited radio images
consisting of compact components at the center and two-sided jets and,
furthermore, superluminal motions were detected from some recurrent transient
X-ray sources (see Mirabel & Rodriguez 1999 for the review of relativistic jet
sources in the Galaxy).

These discoveries stimulated observational studies of relativistic jets in
transient X-ray sources, and, based on them, Fender, Belloni and Gallo (2004)
presented a unified model for the disk-jet coupling in black hole X-ray
binaries, suggesting existence of two types of jets: steady jets and transient
jets.

The transient jets are always observed around the peak of an X-ray outburst
and superluminal motions are often detected. The sources around the outburst
peak are considered to be in the very high state which is characterized by the
various time variabilities (see e.g. section 5 of Inoue 2022a for the review
of X-ray observations of accretion disks and references therein). The various
time variabilities are understood to be basically governed by the limit cycle
behavior between the gas-pressure dominated standard disk and the slim disk.
The transient jets are discussed to appear at the moment when the innermost
front of the slim disk extending from the outside reaches the boundary with
the black hole in the cyclic behavior (see subsection 6.1 of Inoue 2022a).

The steady jets persist in the low/hard state, characterized by the radio
emissions which probably arise in the synchrotron emission from conical,
partially absorbed jets (Fender 2001). A positive correlation between the
radio flux and the X-ray flux is found for several sources (e.g. Corbel et al.
2003; Gallo et al. 2003). The Lorentz factor of the jet velocity is estimated
to be less than two and is significantly smaller that those of the transient
jets (Fender et al. 2004).

The steady jets are also observed from SS433, but the source is considered to
be not in the low/hard state but in a special state under the supercritical
accretion rate (e.g. Margon 1984; Fabrika 2004; see also Inoue 2022b). The
steady jets from SS433 should be regarded as another type of steady jets than
those in the low/hard state.

These observations reveal that the relativistic jets appear in the particular
states of accretion flow, which strongly indicates that the jets arise in
association with mass accretion on to a compact object at the activity center.
Although it is unclear yet whether SS433 is a neutron star source or a black
hole source, we will hereafter advance considerations on the two types of the
steady relativistic jets: the steady jets in the low/hard state, and the
steady jets under the supercritical accretion, on the assumption that the
central object is a black hole. The transient jets will be discussed in a
separate paper.

Recently, Inoue (2021a) discussed that matter flowing into the gravitational
field of a black hole from the companion star in a close binary once forms a
geometrically thick accretion ring around the black hole, and then the ring
extends two layer accretion flow in which an optically thick and geometrically
thin accretion disk (the standard disk: Shakura & Sunyaev 1973) is sandwiched
by an optically thin and geometrically thick advection-dominated accretion
flow (ADAF: Narayan & Yi 1994). Inoue (2022a) further argued that the
observations need three steady states for configurations of the accretion flow
from the outermost accretion ring to the innermost stable circular orbit
around a black hole.

The basic configuration of the accretion flow could be a situation that the
two parallel flows from the outermost part of the accretion disk extends to
the innermost stable circular orbit, called as the standard disk
configuration. The high/soft state can be considered to be in this
configuration.

The configuration on the lower accretion rate side of the standard disk
configuration is such that an optically gray ADAF appears on the down stream
side of the truncated standard disk sandwiched by the optically thin ADAF,
called as the ADAF configuration. Several observational evidences indicate
that the low/hard state is in this configuration.

The configuration on the higher accretion rate side of the standard disk
configuration is such that an optically thick ADAF (the slim disk: Abramovicz
et al. 1988) exists on the down stream side of the truncated gas-pressure-
dominated standard disk sandwiched by the optically thin ADAF, called as the
slim disk configuration. This configuration happens in the very high state.

The terminal velocities of the jets are close to the velocity of the light,
which suggests that the jets come from the vicinity of the event horizon of
the black hole. Then, the steady jets from SS433 are likely to appear in the
boundary region of the slim disk to the black hole, while the steady jets in
the low/hard state could arise in the innermost region of the optically gray
ADAF. Since the slim disk is a kind of ADAF, we can say that the boundary
region of ADAF to the black hole would play a key role on ejections of the
relativistic jets.

The equation for specific energy of matter in the ADAF is generally given as

$\frac{1}{2}v^{2}+\frac{1}{2}\frac{\ell^{2}}{r^{2}}+\frac{1}{\gamma-1}c_{\rm
s}^{2}-\frac{GM}{r-R_{\rm s}}-(\ell-\ell_{\rm in})\Omega=e,$ (1)

by approximately averaging the quantities over the $z$ direction at $r$. Here
and hereafter, we introduce the cylindrical coordinate ($r$, $\phi$, $z$),
where the $z$ direction is the angular momentum axis of the accretion flow,
and the radial distance $R$ as $R=\sqrt{r^{2}+z^{2}}$. $v$ is the inflowing
velocity, and $c_{\rm s}$ is the sound velocity defined as $c_{\rm
s}^{2}=\gamma P/\rho$. Here, we adopt the polytropic relation between the
pressure, $P$, and the density, $\rho$, as

$P=K\rho^{\gamma},$ (2)

where $K$ is the proportional constant. We also adopt the pseudo-Newtonian
potential (Paczynsky & Wiita 1980) as

$\Phi(R)=-\frac{GM}{R-R_{\rm s}},$ (3)

where $G$ and $M$ are the gravitational constant and the black hole mass,
respectively, and $R_{\rm s}$ is the Schwarzschild radius. $\ell$ and $\Omega$
are the specific angular momentum and the angular velocity of the inflowing
matter, respectively. $\ell_{\rm in}$ is the value of $\ell$ at the innermost
radius of the ADAF. $e$ is the specific total energy of the infalling matter
given at the outer boundary.

Our concern in this paper is on jet ejections from the innermost regions of
the ADAFs in the slim disk configuration and in the ADAF configuration and
those ADAFs are considered to evolve from the thin standard disk in the outer
regions. Hence, $e$ is expected to be negative in these cases. Furthermore,
according to the studies of the accretion ring by Inoue (2021a; 2021b), the
specific total energy, $e$, is approximately estimated to be $-GM/r_{\rm ar}$
at the distance of the accretion ring, $r_{\rm ar}$, even for the
geometrically thick accretion flow (see appendix in Inoue 2021b). Hence, we
adopt the following premise to the present study as

$e<0.$ (4)

The specific total energy $e$ consists of two components, as seen from
equation (1), the matter transport energy $e_{\rm b}$ (often called the
Bernoulli parameter) and the viscous transport energy $e_{\rm v}$ respectively
defined as

$e_{\rm
b}=\frac{1}{2}v^{2}+\frac{1}{2}\frac{\ell^{2}}{r^{2}}+\frac{1}{\gamma-1}c_{\rm
s}^{2}-\frac{GM}{r-R_{\rm s}},$ (5)

and

$e_{\rm v}=(\ell-\ell_{\rm in})\Omega.$ (6)

Since the following relation holds from equation (1) as

$e_{\rm b}=e+e_{\rm v},$ (7)

the Bernoulli parameter $e_{\rm b}$ can be positive in the typical region of
ADAF with $e_{\rm v}>0$ even if $e<0$, which was pointed out by Narayan and Yi
(1994).

The positive Bernoulli parameter means that the accreted matter is possible to
escape from the gravitational potential. Utilizing the possibility, Blandford
and Begelman (1999) proposed a model, called as advection-dominated inflow-
outflow solutions (ADIOS), in which a small fraction of the supplied matter
actually falls on to the black hole and the remain is driven away in the form
of a wind by the viscous transport energy. Although further studies have been
done in the extension of this idea (e.g. Blandford & Begelman 2004; Ferreria
et al. 2006), a physical mechanism for the positive energy to change the
inflow to the outflow is yet unclear and no obvious reason seems to exist why
the place of the mass ejection is biased to the vicinity of the black hole,
making the relativistic jets.

In order to understand the ejection mechanism of the relativistic jets, it
should be necessary to know properties of the innermost region of the
accretion flow on to the black hole. The flow velocity should be the velocity
of the light, $c$, at the event horizon, while the sound velocity is limited
to be $c/\sqrt{3}$ at largest. Hence, the innermost accretion flow should be
supersonic, and pass through the transonic point somewhere before reaching the
event horizon, since the accretion flow on the upstream side where the angular
momentum is transfered outward should be subsonic. Behaviors of the transonic
flow have been studied in many papers too (see e.g. chapter 8 of Kato et al.
2008; a brief review in the introduction section of Kumar & Chattopadhyay
2013). An interesting argument among them is that a shock appears between two
critical points from a subsonic flow to a supersonic flow and a mass outflow
is induced behind the shock (see Kumar & Chattopadhyay 2013; 2017 and
references therein). The simulated solutions for mass ejection behind the
shock are, however, obtained only when $e$ is slightly positive (e.g. Kumar &
Chattopadhyav 2013), and are not simply applicable to the present study under
the premise in equation (4).

In this paper, we study two cases of the two-layer situations of the accretion
flow in which a part of specific energy of one layer is transfered to the
other and the specific energy of the energy-transfered laye becomes positive
so as for mass ejection to be possible.

One case is a two-layer situation in which an optically thin ADAF flowing from
far outside runs on the upper side of an optically gray ADAF or a slim disk in
the ADAF configuration or the slim disk configuration respectively. Hereafter
we call the flows on the equatorial plain side and the upper side as the main
flow and the upper flow respectively. Figure 1 exhibits the schematic diagram
of the two-layer situation expected in the ADAF configuration. Such a
configuration was already drawn in figure 9-(c) in Kumar and Yuan (2021) as
the result of the theoretical works.

Figure 1: Schematic diagram of the ADAF configuration. The standard thin disk
is sandwiched by the optically thin ADAF on the outer side, and the standard
thin disk changes to the optically gray ADAF on the inner side, where the
optically thin ADAF runs on the optically gray ADAF. We call the optically
gray ADAF and the optically thin ADAF on the inner side as the main flow and
the upper flow respectively.

The other case of the two-layer situation is discussed to appear in the main
flow in the slim-disk configuration as the result of the photon diffusion from
the bottom layer to the upper layer.

Then, we investigate how jets are ejected by utilizing the positive specific
energy of the upper flow, commonly to the two cases of the two-layer
situation.

##  2 Transonic conditions from the outer subsonic flow to the inner
supersonic flow

We first review transonic conditions from the outer subsonic flow to the inner
supersonic flow in an ADAF, to give bases for the study of steady jet
ejections done in this paper. The results in this section are consistent with
the relevant works in the literature.

Assumptions of the study are as follows: First, the total specific energy of
the flow, $e$, is conserved over the entire flow, assuming that the radiative
energy loss is negligibly small. Then, equation (4) is set as the premise on
$e$ as discussed earlier. Next, it is further premised that the inner
supersonic flow is inviscid and the specific angular momentum is kept constant
through the flow. In the current study of the ADAF, the equation of angular
momentum transfer is diffusive in form and signals can propagates to the up-
stream side even in the supersonic flow (see e.g. Narayan et al. 1997).
However, this treatment in the case of the turbulence-dominated viscosity is
problematic from the viewpoint of the causality (Kato 1994 and references
therein). Hence, we simply assume that the inner supersonic flow is inviscid.

We approximate that the supersonic flow is in a layer on a hollow cone surface
with a constant $\theta$, where $\theta$ is an elevation angle from the
equatorial plane of a position as viewed from the center.

If the flow becomes supersonic at the distance, $R_{\rm in}$, of the innermost
boundary of the outer subsonic flow, the specific angular momentum can be
considered to be conserved at $\ell_{\rm in}$ on the inner side than $R_{\rm
in}$. Thus, the dynamical equation of the inner supersonic flow along a hollow
cone layer is expressed as

$v\frac{dv}{dR}+\frac{1}{\rho}\frac{dP}{dR}+\frac{GM}{(R-R_{\rm
s})^{2}}-\frac{\ell_{\rm in}^{2}}{r^{3}}\cos\theta=0,$ (8)

and the energy equation is given as

$\frac{1}{2}v^{2}+\frac{1}{2}\frac{\ell_{\rm
in}^{2}}{r^{2}}+\frac{1}{\gamma-1}c_{\rm s}^{2}-\frac{GM}{R-R_{s}}=e_{\rm
in}.$ (9)

Here, the parameter $e_{\rm in}$ is the specific total energy of the inflowing
matter at $R_{\rm in}$ and is conserved through the supersonic flow inner than
$R_{\rm in}$. Since the specific angular momentum in the inner supersonic flow
than $R_{\rm in}$ is conserved at $\ell_{\rm in}$, the viscous transport
energy $e_{\rm v}$ should be zero at $R_{\rm in}$ as seen from equation (6).
Then, considering a possibility for an energy increment transported from the
adjacent layer, $e_{\rm in}$ is expressed as

$e_{\rm in}=e+\Delta e,$ (10)

where $\Delta e$ is the energy increment if it exists.

The continuity equation is written as

$\rho vS=A,$ (11)

where $S$ is the cross section of the layer and $A$ is the constant
representing the mass flow rate through it. Differentiating equation (11) with
$R$ on the assumption of $S\propto R^{2}$, and combining the result and
equation (8) with the help of the polytropic relation, we have the following
equation for the transonic condition as

$(v^{2}-c_{\rm s}^{2})\frac{1}{v}\frac{dv}{dR}=\frac{2c_{\rm
s}^{2}}{R}-\frac{GM}{(R-R_{\rm s})^{2}}+\frac{\ell_{\rm
in}^{2}}{r^{3}}\cos\theta.$ (12)

Since the right side of the above equation should be zero at the sonic point,
we have the equation to determine the positions of the sonic point as

$\frac{2c_{\rm s}^{2}}{R}-\frac{GM}{(R-R_{\rm s})^{2}}+\frac{\ell_{\rm
in}^{2}}{r^{3}}\cos\theta=0.$ (13)

The sound velocity is calculated from equation (9) by equating $v=c_{\rm s}$
as

$c_{\rm s}=\Gamma\left(e_{\rm in}+\frac{GM}{R-R_{\rm
s}}-\frac{1}{2}\frac{\ell_{\rm in}^{2}}{r^{2}}\right),$ (14)

where

$\Gamma=\left(\frac{1}{2}+\frac{1}{\gamma-1}\right)^{-1}=\frac{2(\gamma-1)}{\gamma+1},$
(15)

and equation (13) is rewritten as

$2\Gamma\frac{e_{\rm in}}{R}-\frac{GM}{(R-R_{\rm
s})^{2}R}\\{R-2\Gamma(R-R_{\rm s})\\}+(1-\Gamma)\frac{\ell_{\rm
in}^{2}}{r^{3}}\cos\theta=0.$ (16)

From this equation, we obtain the following equation as

$\frac{\lambda_{\rm
in}^{2}}{\cos^{2}\theta}=\frac{1}{2(1-\Gamma)}\frac{X^{2}}{(X-1)^{2}}\\{-2\Gamma\varepsilon_{\rm
in}(X-1)^{2}+(1-2\Gamma)X+2\Gamma\\},$ (17)

where we have introduced non-dimensional parameters $X$ for the position of
the sonic point, $\lambda$ for the specific angular momentum and $\varepsilon$
for the specific energy, defined as $X=R/R_{\rm s}$, $\lambda=\ell/(R_{\rm
s}c)$ and $\varepsilon=e/(GM/R_{\rm s})$ respectively. The values of
$\lambda_{\rm in}^{2}/\cos^{2}\theta$ calculated from this equation are
plotted against $X$ in figure 2-(a) for various $\varepsilon_{\rm in}$ values
in case of $\gamma$ = 3/2.

Figure 2: Diagrams showing normalized positions $X$ of the sonic points and
their properties for inviscid and adiabatic flows, having the normalized
specific energy $\varepsilon_{\rm in}$ and the normalized specific angular
momentum $\lambda_{\rm in}$, along hollow cone surfaces with the elevation
angle $\theta$, in case of $\gamma=3/2$. (a) Relations between $\lambda_{\rm
in}^{2}/\cos^{2}\theta$ and $X$ for given $\varepsilon_{\rm in}$; (b)
Relations between $\varepsilon_{\rm in}$ and $X$ for given $\lambda_{\rm
in}^{2}/\cos^{2}\theta$; and (c) Diagram indicating the reduction factor
$\omega$ of the specific angular momentum from that of the Keplerian circular
motion at the position of ($X$, $\theta$). The portions of the thin solid line
and the dotted line indicate the type of the sonic points as the saddle type
and the center type respectively. The thick solid lines in (b) represent the
boundaries of the region in which the saddle-type sonic point exists. The
boundaries, A to D are characterized as follows, A: the constraint from
equation (19); B: the case of the Bondi accretion ($\lambda_{\rm in}=0$), C:
the constraint from equation (20) ;D: the boundary between the saddle-type
region and the center type region. The arrow in (b) exhibits the range of $X$
for the transonic point of the main flow, which is discussed in subsubsection
3.1.1.

Here, the innermost point of ($X_{\rm imp}$, $\lambda_{\rm imp}$) is obtained
from the necessary condition that the sum of the kinetic energy and the
thermal enthalpy cannot be negative in equation (9), which is written as

$\frac{\lambda_{\rm
in}^{2}}{\cos^{2}\theta}\leq\frac{X^{2}}{X-1}\\{\varepsilon_{\rm
in}(X-1)+1\\}.$ (18)

From the above two equations, the values of $X_{\rm imp}$ and $\lambda_{\rm
imp}$ are calculated as

$X_{\rm imp}\simeq 2(1-\varepsilon_{\rm in}),$ (19)

and

$\frac{\lambda_{\rm imp}^{2}}{\cos^{2}\theta}\simeq 4(1+\varepsilon_{\rm
in}),$ (20)

when $|\varepsilon_{\rm in}|\ll 1$.

This figure tells us the positions of the sonic points and also the types of
them. This trend as shown in this figure was already studied by several
authors (see chapter 8 of Kato et al. 2008 and references therein) and it is
shown that the portions of the solid lines and the dashed lines in figure 2
correspond to the saddle-type sonic points and the the center-type sonic
points respectively. The flow can smoothly pass through the saddle-type sonic
point but not through the center-type. The center-type sonic point appears due
to the effect of the centrifugal force on the flow. On the outer side than the
center type sonic point, the effect of the gravitational force is dominant to
that of the centrifugal force, but the latter becomes dominant on the inner
side. As the result, the situation to satisfy equation (16) is mathematically
realized. This center type sonic point cannot, however, be the transonic point
between the subsonic region and the supersonic region of the flow.

In parallel to the $X$ \- $\lambda_{\rm in}^{2}/\cos^{2}\theta$ plots,
equation (16) also gives us plots of $\varepsilon_{\rm in}$ against $X$ for
given $\lambda_{\rm in}^{2}/\cos^{2}\theta$ values, which are shown in figure
2-(b). We can clearly see the region where the saddle-type sonic point exists
on the $X$ \- $\varepsilon_{\rm in}$ plane.

In case of $\varepsilon_{\rm in}\leq 0$, the saddle-type sonic point appears
only in the region of $X$ from 2 to $\sim$ 5\. Hence, the viscid ADAF from the
far outside in which the angular momentum is transfered outward should change
to the inviscid supersonic flow through the inner saddle-type sonic point very
close to the black hole.

The case of $\varepsilon_{\rm in}>0$ is further divided into two sub-cases.

When $\varepsilon_{\rm in}$ is larger than the critical value,
$\varepsilon_{\rm in,\;c}$, which is 0.012 for $\gamma=3/2$, only one saddle-
type sonic point appears in the fairly large range of $X$. The position of the
transonic point goes inward as the specific angular momentum increases from
$\lambda_{\rm in}^{2}=0$ at the outermost point to $\lambda_{\rm
in}^{2}/\cos^{2}/\cos^{2}\theta=4$ at the innermost point. The outer and inner
side of the range can be called as the Bondy type and the disk type
respectively (see section 8.1 in Kato et al. 2008).

When $\varepsilon_{\rm in,\;c}\geq\varepsilon_{\rm in}>0$, the region where
the saddle-type sonic point exists are separated into two regions, the inner
region and the outer region. Although the two regions simultaneously appear
for the same $\varepsilon_{\rm in}$, it is because equation (16) is obtained
by differentiating the continuity equation (11) and does not mean that the
inner and outer sonic points simultaneously appear in every practical flow.
Considering $c_{\rm s}^{2}=\gamma K\rho^{\gamma-1}$ and $v=c_{\rm s}$ at the
sonic point, we can have the following two non-dimensional equations from
equations (11) and (9), which should be satisfied at the sonic points given by
equation (17), as

$\Psi=\Xi^{1/\Gamma}X^{2},$ (21)

and

$\Xi=\Gamma\left(\varepsilon_{\rm in}+\frac{1}{X-1}-\frac{\lambda_{\rm
in}^{2}/\cos^{2}\theta}{X^{2}}\right),$ (22)

where $\Psi$ is the parameter of a combination of $A$, $K$ and $\gamma$ and
$\Xi$ is defined to be $v^{2}/(GM/R_{\rm s})$. We can calculate the $\Psi$
value from the above two equations for given values of $\lambda_{\rm
in}^{2}/\cos^{2}\theta$, $\varepsilon_{\rm in}$ and $X$, and have a locus on
the $\lambda_{\rm in}^{2}/\cos^{2}\theta$ and $\Psi$ plane for a given
$\varepsilon_{\rm in}$ by changing the $X$ value. A typical example is shown
in figure 3 and we see that the inner and outer saddle-type sonic points
simultaneously appear only at the cross point of the respective loci for the
inner and outer transonic points and the other flows have either of the two.
Fukue (1987) shows that when the specific angular momentum is larger than the
value at the cross point, the supersonic flow to the black hole is realized
through the inner sonic point, and that, on the other hand, when the specific
angular momentum is smaller than the cross point value, the supersonic flow is
realized through the outer sonic point.

Figure 3: Loci of the sonic point solutions given by equation (17) on the
$\lambda_{\rm in}^{2}/\cos^{2}\theta$ \- $\Psi$ plane, in case of
$\varepsilon_{\rm in}$ = 0.004 and $\gamma$ = 3/2. One cross point appears
between the loci of the inner saddle-type points and the outer saddle-type
points

From the values of $\lambda_{\rm in}^{2}/\cos^{2}\theta$ at the cross point on
the $\lambda_{\rm in}^{2}/\cos^{2}\theta$ \- $\Psi$ plane for various
$\varepsilon_{\rm in}$ values, we can have the boundary between the respective
regions in which the transonic point appears in the inner region and in the
outer region, on the $\lambda_{\rm in}^{2}/\cos^{2}\theta$ \-
$\varepsilon_{\rm in}$ plane, which is shown in figure 4. Figure 4 also
reveals the region in which the three-sonic-point solutions exist on the
$\lambda_{\rm in}^{2}/\cos^{2}\theta$ \- $\varepsilon_{\rm in}$ plane. The two
thick boundary lines are obtained from equations of $d(\lambda_{\rm
in}^{2}/\cos^{2}\theta)/dX\;=\;0$ for various $\varepsilon_{\rm in}$ values
and the thick dashed line represents the relation in equation (20).

This figure is consistent with the result by Fukue (1987). It should be noted
here that Fukue (1987) pointed out a possibility for a shock to appear in the
region B1 and to change the path of the supersonic flow through the outer
sonic point to a subsonic flow returning to the supersonic flow through the
inner sonic point. This idea was later expanded to the model for the mass
ejection behind the shock (e.g. Kumar & Chattopadhyay 2013; 2017).

Figure 4: Domains for the characteristics of the sonic-point solutions on the
$\lambda_{\rm in}^{2}/\cos^{2}\theta$ \- $\varepsilon_{\rm in}$ plane. The
hatched region on the right hand side is the forbidden region given by the
discussion on equation (20). The other hatched region on the left, bottom
corner is the no-solution region. This region in which the specific angular
momentum is very low is identical to the case of the Bondi accretion in which
no solution exists when the specific energy is negative. As the result, the
transonic flow is realized only in the region A in which the specific angular
momentum is high enough for the sonic point to appear even when
$\varepsilon_{\rm in}<0$. Three (inner, middle and outer) sonic-point
solutions are obtained in the region surrounded by the a-b-c-d-a lines, in
which the transonic flow through the outer point is realized in the region B1
and that through the inner point happens in the region B2. Including the
regions of C1 and C2, we can say that we have the transonic flow through the
outer point and inner point in the region of B1 + C1, and of B2 + C2
respectively, when $0<\varepsilon_{\rm in}\leq\varepsilon_{\rm in,\;c}$. There
exists one saddle-type solution in the region D when $\varepsilon_{\rm
in}>\varepsilon_{\rm in,\;c}$ and the distance of the transonic point
decreases as the specific angular momentum increases as seen from figure
2-(b).

Here, let us compare the specific angular momentum, $\ell_{\rm in}$, with that
of the Keplerian circular motion, $\ell_{\rm k}$, at the place with a
distance, $R$, and an elevation angle, $\theta$, which is given as

$\ell_{\rm k}=\sqrt{GM}\frac{R^{3/2}\cos^{2}\theta}{R-R_{\rm s}}.$ (23)

If we introduce the ratio parameter, $\omega$, defined as $\omega=\ell_{\rm
in}/\ell_{\rm k}$, we can obtain the following equation from equations (16)
and (23) as

$\omega^{2}\cos^{2}\theta=\frac{1}{1-\Gamma}\frac{1}{X}\\{-2\Gamma\varepsilon_{\rm
in}(X-1)^{2}+(1-2\Gamma)X+2\Gamma\\}.$ (24)

Figure 2-(c) shows the distributions of $\omega\cos\theta$ against $X$ for
various $\varepsilon_{\rm in}$ values and we see that $\omega\cos\theta$ is
close to unity in the inner region, while it is significantly smaller than
unity in the outer region. Since the viscid, subsonic ADAF is considered to
tend to have a $\omega$ significantly smaller than unity (Narayan & Yi 1995),
it would be natural that the outer viscid subsonic ADAF turns to the inner
inviscid supersonic flow through the outer sonic point corresponding to the
lower $\omega$ value, in the three-sonic-point range of $\varepsilon_{\rm
in,\;c}\geq\varepsilon_{\rm in}>0$.

The same three diagrams as in figure 2 are presented for $\gamma=4/3$ in
figure 5. In this case, $\varepsilon_{\rm in,\;c}$ = 0.046.

Figure 5: The same diagrams as in figure 2 but in case of $\gamma=4/3$.

##  3 Steady jet ejections from the vicinity of black hole

As shown in section 1, the steady jet ejections are observed in the ADAF
configuration and the slim disk configuration. In the contexts, we discuss the
following two scenarios for steady jet ejections from the vicinity of the
black hole.

###  3.1 Steady jet ejection in the low/hard state

We suppose the two-layer situation in the ADAF configurations as schematically
drawn in figure 1 and discuss a scenario for the steady jet ejection in the
low/hard state here.

Although the two-layer situation is likely to appear even in the slim disk
configuration, the mass flow rate through the upper flow is considered to be
significantly smaller than that through the main flow in the slim-disk
configuration (Inoue 2021a) and the presence of the upper flow would be
negligible in the more powerful jet-ejection process in the main flow of the
slim disk, which is discussed later in subsection 3.2.

####  3.1.1 Structure of the main flow

The main flow is considered to evolve from the standard thin disk on the outer
side and thus $\varepsilon_{\rm in}$ should be negative by a minute amount of
10-4 or so. In the case of $\varepsilon_{\rm in}<0$ as studied in the previous
section, the viscid subsonic ADAF inflowing from the outside is considered to
turn to the inviscid supersonic flow through the transonic point close to the
black hole. Since the absolute value of $\varepsilon_{\rm in}$ is very small,
the range of the transonic position in $X$ can be seen practically from the
case of $\varepsilon_{\rm in}=0$ and is 2 $\sim$ 4.7 for $\gamma=3/2$ as seen
from figure 2. The reduction factor, $\omega$, of the specific angular
momentum at the transonic point from that of the Keplerian circular motion is,
on the other hand, presented in figure 2-(c) and is seen to decrease from
unity as $X$ increases from 2. Here, we set $\cos\theta=1$ for the main flow.
The outer viscid subsonic ADAF is considered to tend to have the lower
$\omega$ and thus the transonic point is likely to be selected at the
outermost position of the allowed range. Hence, we can expect that the main
flow turns from the viscid subsonic ADAF to the inviscid supersonic flow at
$X\sim 5$, and that the supersonic flow gets geometrically thiner and thiner
as the Mach number increases in approaching to the black hole (see e.g.
Sadowski 2009).

####  3.1.2 Structure of the upper flow and jet ejection

Let us consider, now, what happens to the upper flow above the main flow as it
approaches to the black hole.

The matter in the upper flow could tend to merge with the main flow through
turbulent motions transferring the angular momentum across the boundary
between the two flows. Then, the viscous transport energy, $\varepsilon_{\rm
v}$, outflowing in the main flow could be carried into the upper flow. If this
energy transfer from the main flow to the upper flow really takes place, we
can expect a situation for the upper flow to have a transonic point,
corresponding to the case of $e_{\rm in}>0$ as considered in the previous
section.

The viscous transport energy, $\varepsilon_{\rm v}$, in the main flow can be
expressed as a function of $X$ from equations (6) as

$\varepsilon_{\rm
v}=\omega^{2}\frac{X}{(X-1)^{2}}\left\\{1-\frac{\omega}{\omega_{\rm
in}}\frac{X-1}{X_{\rm in,\;m}-1}\left(\frac{X_{\rm
in,\;m}}{X}\right)^{3/2}\right\\},$ (25)

where $X_{\rm in,\;m}$ represents the position of the transonic point of the
main flow and $\omega_{\rm in}$ is $\omega$ at the transonic point. Figure 6
shows the $\varepsilon_{\rm v}$ distribution as a function of $X$ calculated
assuming $\omega=\omega_{\rm in}=0.8$ and $X_{\rm in,\;m}=4.7$. If a fraction
of this amount of $\varepsilon_{\rm v}$ is transfered to the upper flow, we
can roughly expect that the upper flow has a positive specific energy around
0.01.

If the upper flow has $\varepsilon_{\rm in}\sim 0.01$, the viscid subsonic
ADAF in the upper flow is expected to turn to the inviscid supersonic flow
around $X\sim 20$ as seen from figure 2-(a).

Figure 6: Distribution of $\varepsilon_{\rm v}$ against $X$ calculated from
equation (25) assuming $\omega$ = 0.8 and $X_{\rm in,\;m}$ = 4.7.

The supersonic upper flow advances inward along the uppermost limb of the main
flow, while the main flow turns to the supersonic flow at $X\sim 5$ and gets
geometrically thin on the closer side to the black hole. Since the limb of the
main flow is considered to change its elevation angle from say 45∘ to almost
0∘ around $X\sim 3\sim 4$, the kinetic energy of the $v_{\rm z}$ component in
the supersonic upper flow should be converted to the thermal energy and the
oblique shock is likely to be formed there. Figure 7 exhibits the schematic
diagram of the situation.

Figure 7: Schematic cross section of the innermost part of the two-layer
configuration indicating the jet-ejecting process. The main flow on the bottom
side of the two layers turns to be supersonic at $r/R_{\rm s}\sim 5$ and tends
to be geometrically thin as it approaches the black hole. The supersonic upper
flow along the uppermost limb of the main flow forms the oblique shock by
colliding to the thin supersonic main flow. A part of the upper flow behind
the oblique shock which enters the region of $z/R_{\rm s}>1$ is pushed back in
the $r$ direction by the centrifugal force and pushed up in the $z$ direction
by the thermal pressure enhanced behind the second shock. As the result, the
flow changes to the outward flow and turns to be supersonic at the distance of
2 to 3 $R_{\rm s}$. Here, the thin dashed line indicates the boundary of
$f_{\rm r}=0$ from equation (26) for $\lambda_{\rm in}=1$ above which the
centrifugal force is dominant to the gravitational force in the $r$ direction,
and the hatched region is the forbidden area given by the constraint from
equation (18) for $\lambda_{\rm in}=1$. Thin dotted lines represent the
turning positions to the supersonic flow and thin short dashed lines indicate
the shock positions.

The gas comes to flow in parallel to the equatorial plane on the downstream
side of the oblique shock, having a slight expanding motion in the $z$
direction due to the thermalization of the partial kinetic energy. The force
per mass, $f_{\rm r}$, which the gas receives in the $r$ direction in the
region behind the oblique shock is given as

$f_{\rm r}=\frac{GM}{R_{\rm s}^{2}}\left(\frac{2\lambda_{\rm
in}^{2}}{\xi^{3}}-\frac{\xi}{(X-1)^{2}X}\right),$ (26)

where $\xi=r/R_{\rm s}$, and the boundary of $f_{\rm r}=0$ for $\lambda_{\rm
in}=1$ is indicated with the thin dashed line in figure 7.

The parameter, $\lambda_{\rm in}^{2}/\cos^{2}\theta$, of the upper flow with
$\varepsilon_{\rm in}\sim 0.01$ can roughly be estimated from figure 2-(a) or
(b), and is seen to distribute around 2 for the outer sonic point of the flow.
If we adopt the typical values of $\lambda_{\rm in}^{2}/\cos^{2}\theta$ and
$\theta$ to be 2 and 45∘ respectively, $\lambda_{\rm in}$ is unity.

The centrifugal force becomes dominant to the gravitational force in the
region above the boundary of $f_{\rm r}=0$ in figure 7 and thus the flow which
enters this $f_{\rm r}>0$ region is braked, forming another shock there. Then,
it is expected that the kinetic energy of the $v_{\rm r}$ component is even
converted to the thermal energy behind the shock and the enhanced pressure
pushes up the gas in the $z$ direction.

Since the gas has the positive specific energy of $\varepsilon_{\rm in}\sim
0.01$, the gas is likely to start outflowing towards infinity and to get
supersonic at some distance. If we assume that it flows along a hollow cone
surface with an elevation angle of $\theta$, the outflow is the reverse case
of the accretion flow as just studied in the previous section. Hence, we can
see where the sonic point appears from figure 2.

The outflowing gas has the normalized specific angular momentum $\lambda_{\rm
in}\sim 1$. The ejected direction, on the other hand, is constrained by
equation (18) and $\theta$ cannot be larger than 60∘.

If $\theta$ is slightly smaller than 60∘, the parameter value of $\lambda_{\rm
in}^{2}/\cos^{2}\theta$ becomes slightly smaller than 4. In this case, the
sonic point appears around $X=2\sim 3$ as seen from figure 2 \- (a). The
outflow is considered to get supersonic at such a short distance from the
black hole.

The trajectory of the flow tends to be ballistic as the Mach number increases
and is expected to finally advance along the line on which the centrifugal
force and the gravitational force in the $r$ direction balance with each
other. If we introduce the slant angle of the balance line from the $z$
direction, $\psi=(\pi/2)-\theta$, we can obtain the following equation from
equation (26) as

$\psi\simeq\left(\frac{2\lambda^{2}}{X}\right)^{1/4},$ (27)

when $X\gg 1$.

The possibility for jets to flow between the two boundaries as in figure 7 was
already discussed by several authors, where the boundaries given by $f_{\rm
r}$ = 0 and equation (18) were called as the centrifugal barrier and the
funnel wall respectively (e.g. Molteni et al. 1996; Chattopadhyay & Das 2007;
Kumar & Chattopadhyay 2013).

###  3.2 Steady jet ejection from the slim disk

Another scenario for the steady jet ejection than what is studied above is
discussed for the slim disk itself in this subsection.

The optical depth is considered to be sufficiently large for the radiation
field to be established in the slim disk. If the radiation pressure is much
stronger than the gas pressure, the mechanical balance in the $z$ direction is
approximately written as

$\frac{dP_{\rm rad}}{dz}\simeq-\rho\frac{GMz}{r^{3}},$ (28)

where $P_{\rm rad}$ is the radiation pressure. On the other hand, the photon
flux in the $z$ direction, $F_{\rm z}$, is given as

$F_{\rm z}=-\frac{c}{3\kappa_{\rm T}\rho}\frac{dU_{\rm rad}}{dz},$ (29)

where $U_{\rm rad}$ is the radiation energy density and $\kappa_{\rm T}$ is
the opacity for the Thomson scattering. Considering the relation of $P_{\rm
rad}=U_{\rm rad}/3$, we obtain from above two equations

$F_{\rm z}\simeq\frac{cGM}{\kappa_{\rm T}}\frac{z}{r^{3}}.$ (30)

Hence, the radiation flow from the bottom side to the upper side should be
induced in this situation.

The cooling time of the matter, $t_{\rm c}$, is determined by the photon
diffusion time in the $z$ direction and is approximately written as

$t_{\rm c}\simeq\frac{h\tau}{c},$ (31)

where $\tau$ is the optical depth over the half-thickness of the disk, $h$,
which is given as

$\tau\simeq\rho h\kappa_{\rm T}.$ (32)

The slim disk is advection-dominated and thus the cooling time should be
longer than the matter flowing time, $t_{\rm f}$, which is approximated as

$t_{\rm f}\simeq\frac{r}{v_{\rm r}}.$ (33)

Hence, it is expected that the radiation flux is transfered from the bottom
side to the upper side since the two sides co-moves with each other, but that
it stops and is carried inward in the upper layer.

Now, we can draw a picture that the main flow of the slim disk itself has two-
layers, the bottom layer and the upper layer, and the energy is transfered
from the bottom layer to the upper layer by the radiation flux.

The energy loss rate per mass of the bottom layer, $\dot{e}_{\rm bl}^{(-)}$,
could approximately calculated as

$\displaystyle\dot{e}_{\rm bl}^{(-)}$ $\displaystyle\simeq$
$\displaystyle\frac{F_{\rm z}}{\rho h_{\rm bl}}$ (34) $\displaystyle\simeq$
$\displaystyle\frac{cGM}{\kappa_{\rm T}\rho r^{3}}$ $\displaystyle\simeq$
$\displaystyle\left(\frac{\dot{M}}{\dot{M}_{\rm
E}}\right)^{-1}\left(\frac{h}{r}\right)\left(\frac{v_{\rm r}}{r}\right)\eta
c^{2},$

with the help of equation (30) with $z=h_{\rm bl}$ and relations

$\rho\simeq\frac{\dot{M}}{4\pi rhv_{\rm r}},$ (35)

and

$\dot{M}_{\rm E}=\frac{L_{\rm E}}{\eta c^{2}},$ (36)

where $h_{\rm bl}$ is the half thickness of the bottom layer, $L_{\rm E}=4\pi
cGM/\kappa_{\rm T}$ is the Eddington limit and $\eta$ is the energy conversion
rate of the black hole accretion. Then, the energy gain rate per mass of the
upper layer, $\dot{e}_{\rm ul}^{(+)}$, is roughly given as

$\dot{e}_{\rm ul}^{(+)}\simeq\dot{e}_{\rm bl}^{(-)}\frac{\dot{M}_{\rm
bl}}{\dot{M}_{\rm ul}},$ (37)

where $\dot{M}_{\rm bl}$ and $\dot{M}_{\rm ul}$ are the accretion rate through
the bottom layer and upper layer respectively. The total energy gain per mass
of the upper layer, $\Delta e_{\rm ul}$, at a position, $r$, can be calculated
as

$\displaystyle\Delta e_{\rm ul}$ $\displaystyle\simeq$
$\displaystyle-\int_{r_{\rm ob,\;s}}^{r}\dot{e}_{\rm ul}^{(+)}\frac{dr}{v_{\rm
r}}$ (38) $\displaystyle\simeq$
$\displaystyle\left(\frac{\dot{M}}{\dot{M}_{\rm
E}}\right)^{-1}\left(\frac{\dot{M}_{\rm bl}}{\dot{M}_{\rm
ul}}\right)\left(\frac{h}{r}\right)\ln\left(\frac{r_{\rm ob,\;s}}{r}\right)$

with the help of equations (37) and (34), where $h/r$ is assumed to be
constant against the position change. Here, $r_{\rm ob,\;s}$ is the outer
boundary of the slim disk. The non-dimensional amount of
$\Delta\varepsilon_{\rm ul}=\Delta e_{\rm ul}/(GM/R_{\rm s})=2\Delta e_{\rm
ul}c^{2}$ is estimated to be $\sim 5\times 10^{-2}$ for $\eta=0.1$,
$\dot{M}/\dot{M}_{\rm E}=10$, $\dot{M}_{\rm bl}=\dot{M}_{\rm ul}$, $(h/r)=1$
and $(r_{\rm ob}/r)=10$.

In this picture, the upper layer can have a positive specific energy of
$\varepsilon_{\rm in}\sim 0.05$ and then is likely to change from the viscid
subsonic flow to the inviscid supersonic flow at $X\sim 10\sim 20$ in which
the normalized specific angular momentum of $\lambda_{\rm
in}^{2}/\cos^{2}\theta\sim 2$ is carried inward, as seen from figure 5-(a). On
the other hand, the bottom layer has a negative specific energy and is
considered to turn to the supersonic flow at $X\sim 4$ as seen from figure
5-(b). This situation is very similar to the two layer configuration as
discussed in the previous subsection and the mass ejection is expected to
arise in the similar way as discussed there.

##  4 Summary and discussion

Relativistic jet ejections are often observed from binary X-ray sources and
AGNs. Observations indicate that they are associated with accretion flows on
to compact objects and emerge from the innermost regions of the accretion
flows.

The specific energy of the jet matter is required to be sufficiently positive
at the innermost region as to get to infinity with a relativistic speed, while
that of the accreted matter is considered to be slightly negative at the outer
boundary of the accretion flow as discussed in section 1. Hence, there should
exist a mechanism for the jet matter to get the specific energy in the course
of the accretion flow. For the mechanism, we have proposed a scenario in which
two layers exist in the direction perpendicular to the equatorial plane of the
accretion flow and one gets energy from the other so largely as to have
sufficient specific energy for the jet ejection.

Two cases have been considered for the two-layer situation.

One is what is expected for the accretion flow from the accretion ring at the
outermost end which is discussed by Inoue (2021a). Inoue (2021a) predicts that
a geometrically thick accretion flow and a geometrically thin accretion disk
extend from the accretion ring. The geometrically thin accretion disk is
currently considered to turn to the optically thin ADAF on the way to the
compact object in the ADAF configuration and to the slim disk in the slim disk
configuration. As the result, such configuration as in figure 1 is likely to
appear. For the configurations, the possibility for the energy transfer from
the main flow to the upper flow through turbulent mixing of the matter between
the two layers has been discussed, and the specific energy normalized by
$GM/R_{\rm s}$ transfered to the upper flow has been estimated to be around
0.01. If the matter with this amount of the specific energy is ejected as the
jet, the terminal velocity at infinity should get $\sim$ 0.1 $c$. Since the
ADAF configuration corresponds to the low/hard state in the black hole
binaries, the jets in this case can explain the weakly relativistic steady
jets observed in the low/hard state.

The power of the mass ejections from the upper flow is expected to be
proportional to the accretion rate through the upper flow, namely, the
optically thin ADAF sandwiching the standard thin disk from the outermost side
of the accretion flow. Inoue (2021a) studied properties of the accretion ring
at the outermost edge of the accretion flow and predicted that the ratio of
the accretion rate through the thick ADAF to that through the standard disk
increases as the total accretion rate decreases. This predicted relative
behavior of the two accretion rates could explain the increase of the jet
power relative to that in the X-ray emission in association with the decrease
of the mass accretion rate (Fender et al. 2003).

The other case for the two-layer situation has been argued for the slim disk
itself, which is the result of the energy transfer by the upward photon
diffusion in the disk. The normalized specific energy transfered is
approximately estimated to be $\sim$ 0.05 and the terminal velocity is
expected to $\sim$ 0.22 $c$ in this case. This velocity roughly agrees to the
jet velocity observed from SS433.

It should be noted here that no steady jet ejection is observed in the
high/soft state. Several observational evidences indicate that an optically
thin ADAF extends close to the central compact object even in the high/soft
state (see e.g. section 3 in Inoue 2022a), when no significant evidence of
mass ejection is observed (Fender et al. 2004). This means that simple
presence of an ADAF cannot yield the mass ejection. Something which exists not
in the high/soft state but in the low/hard state should play a key role for
the steady mass ejection, and it could be the situation of two layer ADAFs. It
is likely to be essential for the jet ejection from the upper flow that the
main flow changes from the geometrically thick subsonic ADAF to the
geometrically thin supersonic flow near the black hole, which causes the steep
drop of the upper flow to the equatorial plane, triggering the jet ejection
process.

The process for the jet ejection has been considered commonly to both the two
cases of the two-layer situation. Two steps of conversion of the kinetic
energy to the thermal energy are discussed to exist in the jet-ejection
process. The first step is the thermalization of the $v_{\rm z}$ component of
the supersonic upper flow through the oblique shock. This happens by the
collision of the supersonic upper flow to the geometrically thin, supersonic
main flow. The remaining $v_{\rm r}$ component is considered to be still
supersonic even behind the oblique shock but to be thermalized through another
shock for a part of the flow entering the region with $z>R_{\rm s}$ where the
centrifugal force becomes dominant to the gravitational force and is likely to
completely stop the inward motion. If all the kinetic energy of the inward
motion is converted to the thermal energy there, the thermal energy + the
rotational energy is considered to exceed the gravitational energy since the
specific energy of the upper flow is positive, and the gas is expected to
start outflowing toward infinity.

If the gas outflows along a hollow cone surface with a constant elevation
angle, $\theta$, the discussion on the sonic points in the inviscid and
adiabatic accretion flow in section 2 is applicable even to the outflow. Then,
the outflow is inferred to get supersonic soon after the start as discussed in
subsection 3.1.2. When the Mach number becomes sufficiently large, the flow is
expected to become ballistic and to advance balancing the centrifugal force
with the gravitational force in the $r$ direction. If so, the flow is
collimated to have a small opening angle, $\psi$, as given in equation (27).

If the jet advances close to the Roche lobe, the tidal force from the
companion star is likely to weaken the effects of the centrifugal force and
the gravitational force within the gravitational territory of the compact
object. If we assume the radius of the territory to be $\sim 10^{6}$ in $X$
and $\lambda_{\rm in}$ of the outflow to be $\sim$ 1, the final opening angle
is estimated from equation (27) to be $\sim 2^{\circ}$, which roughly agrees
to that determined from the observation of SS433 (Marshall et al. 2002).

As shown above, the scenarios for the steady jets from the slim disk and from
the ADAF in the low/hard state are presented and they are shown to well
explain the basic features of the observations. Since the study is still
primitive and leaves many questions to solve, further detailed study is
obviously desired.

The author appreciates the detailed comments from the referee.

## References

  * [] Abramowicz, M.A., Czerny, B., Lasota, J.P., & Szuszkiewicz, E. 1988, ApJ, 332, 646
  * [] Blandford, R.D., & Begelman, M.C. 1999, MNRAS, 303, L1
  * [] Blandford, R.D., & Begelman, M.C. 2004, MNRAS, 349, 68
  * [] Bridle, A.H., & Perley, R.A. 1984, ARA&A, 22, 319
  * [] Chattopadhyay, I., & Das, S. 2007, New Astronomy, 12, 454
  * [] Corbel, S., Nowak, M. A., Fender, R. P., Tzioumis, A. K., & Markoff, S. 2003, A&A, 400, 1007
  * [] Fabrika, S. 2004, Astrophysics & Space Physics Reviews, 12, 1
  * [] Fender, R.P. 2001, MNRAS, 322, 31
  * [] Fender, R.P., Belloni, T.M., & Gallo, E. 2004, MNRAS, 355, 1105
  * [] Fender, R.P., Gallo, E., & Jonker, P.G. 2003, MNRAS, 343, L99
  * [] Ferreira, J., Petrucci, P.O., Henri, G., Sauge, L., & Pelletier, G. 2006, A&A, 447, 813
  * [] Fukue, J. 1987, PASJ, 39, 309
  * [] Gallo, E., Fender, R. P., & Pooley, G. G. 2003, MNRAS, 344, 60
  * [] Inoue, H. 2021a, PASJ, 73, 795
  * [] Inoue, H. 2021b, PASJ, 73, 1429
  * [] Inoue, H. 2022a, PASJ, 74, R1
  * [] Inoue, H. 2022b, PASJ, in press
  * [] Kato, S. 1994, PASJ, 46, 589
  * [] Kato, S., Fukue, J., & Mineshige, S. 2008, Black-Hole Accretion Disks Towards a New Paradigm (Kyoto: Kyoto University Press)
  * [] Kumar, R., & Chattopadhyay, I. 2013, MNRAS, 430, 386
  * [] Kumar, R., & Chattopadhyay, I. 2017, MNRAS, 469, 4221
  * [] Kumar, R., & Yuan, Y.F. 2021, ApJ, 910, 9
  * [] Margon, B. 1984, ARA&A, 22, 507
  * [] Marshall, H.L., Canizares, C.R., & Schultz, N.S. 2002, ApJ, 564, 941
  * [] Mirabel, I.F., & Rodriguez, L.F. 1999, ARA&A, 37, 409
  * [] Molteni, D., Ryu, D., & Chakrabarti, S.K. 1996, ApJ, 470, 460
  * [] Narayan, R., & Yi, I. 1994, ApJ, 428, L13
  * [] Narayan, R., & Yi, I. 1995, ApJ, 444, 231
  * [] Narayan, R., Kato, S., & Honma, F. 1997, ApJ, 476, 49
  * [] Paczynsky, B., & Wiita, P.J. 1980, A&A, 88, 23
  * [] Sadowski, A. 2009, ApJS, 183, 171
  * [] Shakura, N.I., & Sunyaev, R.A. 1973, A&A, 24, 337


# OMINACS: Online ML-Based IoT Network Attack Detection and Classification
System

1st Diego Abreu  Federal University of Pará (UFPA)
Belém, Brazil
<EMAIL_ADDRESS>2nd Antonio Abelém The authors would like to thank
the São Paulo Research Foundation (FAPESP) for the financial support through
Grant 2020/04031-1. Federal University of Pará (UFPA)
Belém, Brazil
<EMAIL_ADDRESS>
###### Abstract

Several Machine Learning (ML) methodologies have been proposed to improve
security in Internet Of Things (IoT) networks and reduce the damage caused by
the action of malicious agents. However, detecting and classifying attacks
with high accuracy and precision is still a major challenge. This paper
proposes an online attack detection and network traffic classification system,
which combines stream Machine Learning, Deep Learning, and Ensemble Learning
technique. Using multiple stages of data analysis, the system can detect the
presence of malicious traffic flows and classify them according to the type of
attack they represent. Furthermore, we show how to implement this system both
in an IoT network and from an ML point of view. The system was evaluated in
three IoT network security datasets, in which it obtained accuracy and
precision above 90% with a reduced false alarm rate.

###### Index Terms:

Machine Learning, Network Security, Internet of Things.

##  I Introduction

With the rise of the Internet of Things (IoT), the number and diversity of
threats to the security of computer networks are increasing[1]. Thus,
detecting attacks and protecting the network has become a very challenging
task for security mechanisms, such as the Intrusion Detection System (IDS) and
Intrusion Prevention System (IPS) [2]. The main challenges faced in monitoring
and preventing these attacks are the large amount of data generated by the IoT
devices and the costs and time of analysis and processing involved. With a
large number of IoT devices and with the heterogeneity of the network, attacks
can come from multiple sources, generating a constant flow of data to be
analyzed. [3]. This results in a long delay in detecting attacks and in the
number of false alarms generated by current monitoring systems [1].

In this context, several Machine Learning (ML) techniques have been proposed
to detect the presence of malicious agents in the network, which can mean the
occurrence of an attack. In particular, Deep Learning techniques and
techniques based on Ensemble Learning have obtained significant results in
terms of precision and accuracy [4].

However, many of these proposals tackle attack detection as an offline
learning task, in which learning models are first trained and fine-tuned, only
and then applied to a test detection system. These approaches tend to
disregard the dynamic and adversarial behavior network attacks, in which the
concept drift occurs, both in changes in the statistics of the learning and
prediction target and in the network features. Thus, the models trained
offline quickly become obsolete, which reduces the system accuracy.
Furthermore, it is not only relevant to detect malicious activity on the
network but it is also crucial to identify and classify the attacks. According
to the specific type of attack identified, various actions can be taken to
stop and prevent the future occurrence of this attack [2].

Our proposal seeks to detect IoT attacks and classify them according to
classes of attacks. Our approach consists of multiple online stages of network
flow data analysis, applying specific ML techniques according to the most
appropriate task for these stages. Our research hypothesis is that it is
possible to develop a system capable of detecting and classifying dynamic
attacks and combining the advantages of stream ML, Deep Learning and Ensemble
Learning. The rest of the paper is organized as follows: section II presents
the theoretical background; sections III and IV present the related works and
the proposed system; section V presents the results of experiments and
discussions; finally, section VI concludes the work and points out future
works.

##  II Machine Learning Background

This section presents the theoretical foundation for the system proposed in
this work. The proposed system combines Ensemble ML, Deep Learning, and stream
ML, seeking to obtain the main advantages of each methodology.

Ensemble Machine Learning: is a methodology that uses different classification
algorithms to create prediction models and combine individual results to
obtain an optimized collective result [5]. Among the different approaches of
Ensemble, we can highlight the Majority Voting [5]. In this approach, each
model makes its own prediction about the association of each instance to a
class, which represents a vote. The class that receives the highest number of
votes is then chosen for the analyzed instance and the final prediction is
determined according to the majority of votes cast. This process is finished
when all instances in the dataset have been classified.

In the proposed system three supervised ML methods are used as the Ensemble
classifiers: Random Forest, K-Nearest Neighbor (kNN), and Support Vector
Machine (SVM). These classifiers were chosen because they are often used in
the context of attack detection and also because they work differently from
each other, which improves their use within the Majority Vote approach [4].

Deep Learning: in the context of network attack detection, one of the most
used Deep Learning techniques is the Long Short-Term Memory Networks (LSTMs)
[6]. While some DL can work with long sequences of data, such as time series,
there is a limitation in retrieving information from previous sequences. LSTMs
seek to mitigate this limitation of using long-term memory cells, with
specific gates for information control. Thus LSTMs are suitable to be used to
identify patterns in a normal traffic network and compare it with known attack
classes.

Stream Machine Learning: unlike traditional offline Machine Learning, in which
the whole dataset is available to the learning method at the time of training,
in Stream ML the data is classified at the moment it arrives at the predictor.
Thus, stream ML processes data one instance, or set of instances, at a time.
Therefore, it is possible to use this approach to perform data classification
in real-time, as the data arrives at the learning system.

During the processing of data in stream ML, it is common to see significant
changes in the values of attributes, named concept drifts. In the context of
an IoT network, concept drifts can be caused either by changes in the normal
behavior of the network or by the action of malicious agents in network
attacks. For this reason, the learning model tends to lose part of its
predictive capacity, making it necessary to re-train the model. The stream ML
algorithms look for ways to be more robust to these concept changes, in order
to avoid decreasing the accuracy and precision, thus avoiding model
retraining. In this work we will use the Hoeffding Adaptive Tree (HAT) [7],
which is a tree-based stream ML that adapts and learns from the changing data
streams over time and has been proven to be very effective in detecting and
classifying network attacks [8].

In Stream ML, the first data to arrive at the system is used to train the
learning model. This model is then applied to the next data sequence,
performing the prediction and classification of the data. When a concept drift
is detected, it is necessary to perform a new training of the model, so that
it can be adapted to the new state of the data flow. With the adapted model,
the data prediction for the next data sequence is then performed again. This
process continues until all data is read. The feature selection process is
performed at each training or re-training of the model. The technique used has
to be fast enough not to delay detection and should also help to create more
robust models, able to adjust to changes in concept, and thus avoid
retraining. In our system, the feature selection is approached in an
integrated way both in the online detection of the models and in the
classification by type of attacks, using the feature selection by clustering
[9], an unsupervised technique that avoids overfitting the majority classes by
disregarding the data labels in the selection of the feature set.

##  III Related Works

In Lucas et al. (2021) [10] a multi-stage attack detection system based on
Ensemble Learning is proposed. The authors combine several classification
methods to get the best configuration of the classifiers’ hyperparameters. The
system is then tested using the CICID17 [11] dataset, obtaining results of
accuracy and precision close to 100%. However, despite these good results, the
paper does not analyze the time used to generate these optimized settings, and
all of the processing is done offline. In our proposal, a multi-stage attack
detection and classification system is also used, however, unlike that
proposed in Lucas et al (2021), the time and impact that the generation and
application of models cause on the system will also be evaluated. In addition,
we will also use the Ensemble approach as a part of our detection system.

In Tian et al. (2021) [12] a two-stage attack detection and classification
approach is proposed for the context of Software Defined Networks (SDN). The
authors use the first stage to select the network features using a bio-
inspired method to obtain an optimized set of the most relevant features. In
the second stage, with the reduced set of features, is applied an Ensemble
classifier that combines a Decision Tree, an MLP Neural Network (Multilayer
Perceptron) and the k-Nearest Neighbor. The proposed system is tested in the
NSL-KDD [13] and UNSW-NB15 [14] datasets, obtaining results close to 100% for
the binary detection, which classify the network traffic data between
malicious and benign. However, in the multiclass classification, which
considers the type of attack, the system only has good results for attacks
with a high amount of data available for training. This is due both to the
unbalance of the classes and the fact that the features set was optimized to
detect the attack class itself but not specific attacks as the target. This
caused the system to overfit the model towards the majority class. In our
work, the feature selection is done continuously within the ML process,
dynamically selecting the features according to the incoming data stream and
thus not requiring a previous stage of feature analysis, which, in an online
system, could cause a significant increase in attack detection time.

In our previous research [15] an ML pipeline based on stream learning is
presented, which integrates dynamic feature selection, and fast decision tree
models, to detect and classify network attacks on stream ML. The ML pipeline
was tested in the NLS-KDD, UNSW-NB15, and CICIDS17 datasets, showing high
accuracy results, with low false alarms. Now, with the focus on IoT networks,
this ML pipeline combined with the fog, edge, and cloud network view, creating
the OMINACS system. The idea is to apply the ML pipeline into a system that
can be distributed through an IoT network, considering the multiple network
layers such as the edge, fog, and cloud devices.

##  IV OMINACS: Online ML-Based IoT Network Attack Detection and
Classification System

###  IV-A The Machine Learning Pipeline

Essentially the proposed system can be understood as a sequence of Machine
Learning processes. The system takes as input the data of the network traffic
and, as an output, it presents the data classified according to traffic
classes and the system evaluation metrics. Figure 1 shows how the system
works. The system has four stages that perform network traffic classification
and attack detection.

Figure 1: OMINACS: Online ML-Based IoT Network Attack Detection and
Classification System.

Stage 1 is the first part of the system. The network data flow is analyzed and
classified between traffic data considered as normal or attack data. Thus, for
this stage, an ML-based detection system is implemented using the HAT stream
ML method. At this stage, the HAT has a binary target and classifies the data
into two classes: normal traffic and attack traffic. At each training or re-
training of the model, the feature selection technique [9] is applied,
improving the performance of the HAT. Classified instances are streamed to
stage 2 or 3, as they are labeled by the HAT. The data classified as an attack
is sent to stage 2, and data classified as normal is sent to stage 3.

Similar to stage 1, in stage 2, the data is classified according to the
continuous flow of incoming data from network traffic. In this step, stream ML
is used to classify data that was already flagged in stage 1 as an attack, now
between types of attacks. Thus, the multiclass version of HAT, which targets
multiple data classes, was implemented. At the end of this stage, the data is
classified into different classes, the types of attack and the normal class.
The attack data then move forward to stage 4, receiving the flag of its
specific attack class. If the data is found now to be from a normal class, the
data is sent to stage 3.

Stage 3 consists of verifying the data flagged in stages 1, 2, or 4, as normal
data. In this stage, a Deep Learning model is applied to classify the data in
a multiclass way, among the different classes of the data. Although the input
data from this stage has been previously flagged as normal data, a second step
is needed to reduce the possibility of false positives and false negatives.
Thus, the chosen methodology consists of applying an LSTM, which requires a
robust model, capable of classifying the data more accurately. At the end of
stage 3, we have: True Negatives ($TN^{\prime}$), normal data correctly
verified as belonging to the normal flow of the network; True Positives
($TP^{\prime}$), data from attacks that were previously flagged as normal, but
which stage 3 has verified are attacks; False Positives ($FP^{\prime}$),
normal behavior data that was incorrectly classified as an attack by stage 3;
False Negatives ($FN^{\prime}$), attacks that were not detected by stage 3.

Stage 4 receives the data considered to be from attacks in Stage 2, separated
by attack class. Thus, this stage serves to verify the real belonging of the
data to this class in order to reduce the number of false positives. At this
stage, each attack has a specific model, which will verify if this data really
belongs to that type of attack, or if it is a false positive. Thus, at this
stage, Ensemble classifiers are used to generate a specific and accurate model
for each type of attack. The RF, kNN and SVM classifiers are applied to the
stage 4 data and perform the classification based on the majority vote of
their predictions. At the end of stage 4, the data is classified by type of
attack, and thus we have: True Positives ($TP^{\prime\prime}$), attacks
correctly classified in their attack class; False Positives
($FP^{\prime\prime}$), attacks incorrectly classified between attack classes,
False Negatives ($FN^{\prime\prime}$), attacks incorrectly classified as
normal class.

Thus, to obtain the results of the total system performance, the values of
Total True Positive ($TP_{t}$), Total False Positive ($FP_{t}$), Total True
Negative ($TN_{t}$), Total False Negative ($FN_{t}$), are calculated following
equations 1, 2, 3 and 4:

$TP_{t}=TP^{\prime}+TP^{\prime\prime}$ (1)
$FP_{t}=FP^{\prime}+FP^{\prime\prime}$ (2) $TN_{t}=TN^{\prime}$ (3)
$FN_{t}=FN^{\prime}+FN^{\prime\prime}$ (4)

The $TP_{t}$, Equation 1, and the $FP_{t}$, Equation 2, are related to the
stages where the attack class is assigned, and this classification can be
correct ($TP_{t}$) or incorrect ($FP_{t}$). On the other hand, $TN_{t}$,
Equation 3, and $FN_{t}$, Equation 4, are related to normal class assignment,
both for instances truly belonging to the normal class ($TN_{t}$), and for
attack data that were not correctly identified. ($FN_{t}$). Based on these
equations the following metrics are calculated: Accuracy (ACC), Precision
(Prec), True Positive Rate (TPR), False Alarm Rate (FAR ) and F1 score (F1).

It is important to note that in the proposed system, the data is sent in a
continuous flow between the stages. As an instance is labeled, it is sent to
the next part of the system, so it is not necessary to finish processing all
the instances from one stage to start another. Thus, the system finishes when
all instances of the dataset are labeled. Depending on the time required in
each stage, this can be either at the end of stage 3 or at the end of stage 4.

###  IV-B The Network point of view

As Figure 1 shows, the system can be distributed in the network, each stage
from the ML pipeline being part of a network layer.

IoT layer: This layer has a great diversity of IoT devices, such as sensors,
smart lamps, and cameras, among other applications. These devices generate
network traffic that serves as input to the system (a).

Edge layer: In this second layer we have the edge routers, which receive the
network data flow coming from the IoT layer. In edge routers, the first stage
of the pipeline is implemented, the binary stream ML attack detection. As This
stage does not require much processing power, it can be implemented in SDN
edge routers. The data considered as normal traffic goes to the cloud layer
(b), while data that was considered as attack data is sent to the fog layer
(c).

Fog Layer: This layer consists of more robust devices such as IDS and IPS that
can implement stage 2 of the ML pipeline. After this layer, the data is sent
to the cloud layer, flagged either as a normal (d) or an attack data (e).

Cloud Layer: At the cloud layer, remote data centers are then used to apply
stage 3 and stage 4 of the ML pipeline system. With more processing and memory
capacity it is possible to implement the Deep Learning and the Ensemble stages
of the ML pipeline.

##  V Evaluation and Results

###  V-A Experiment and Datasets

To evaluate the proposed system, we use three network security datasets: BoT-
IOT, TON-IOT, and CIC-IOT-2022. These datasets contain IoT network traffic
data, both from normal behavior and from different types of attacks, and are
among the most used in the context of detection and classification of IoT
attacks in using ML techniques [16]. The following is a brief description of
the three datasets:

BOT-IOT: The dataset have 13,428,602 instances between data related to the
normal network behavior and four types of attacks: Denial of Service Attack
(DoS), Distributed Denial of Service Attack (DDoS), Information Theft Attack
(Theft), Reconnaissance (Recon) attacks.

TON-IOT: It contains 3,202,452 instances related to normal behavior and 9
different types of attacks: Backdoor, DoS, DDoS, Injection, Man-in-the-middle
(MITM), Password, Ransomware, Scanning, XSS.

CIC-IOT-2022: The dataset has 373,988 instances and aggregates data regarding
the normal behavior of the IoT network and 4 classes of attacks: UDPflood,
TCPflood, HTTTPflood and Real Time Streaming Protocol Brute Force Attack
(RTSP).

All three datasets we pre-process from their original raw files (.pcap), and
then converted to a .csv file using the CICFlowMeter toll [17], with
aggregates network packets by flows with IP and Port from the same
origin/destination. This tool is used in network benchmarks [16] [11] to give
the same feature set to all datasets used in the experiment. Thus all three
datasets have contains the 81 flow features provided by [17]. The datasets
were used as input for the proposed system, read as an online and continuous
flow of data. The experiments were carried out using a machine with an Intel
Core i5-5200U processor with 2.20 GHz and 8 GB of available RAM, using the
Windows 10 x64 operating system.

###  V-B Results

This section presents the results obtained with the proposed system in the
three databases presented in the case study. Table I presents the result
obtained at the end of the data classification process in the BOT-IOT, TON-
IOT, and CIC-IOT-2022 databases, according to equations 1, 2, 3, and 4.

In Table I, we can observe that the proposed system had a performance above
90% in the evaluated metrics, in all the databases used in the case study.
Also, the value of false alarms is less than 10% in all cases. The system had
similar Prec and TPR between BOT-IOT (96.76%) and IOT-22 (96.97%) datasets,
however, the accuracy and F1 in the base BOT-IOT (98.91 % and 98.46%) is
higher than the ones obtained in IOT-22 (96.55% and 97.16%). Thus, we have
that the system had its best performance on the BOT-IOT dataset, followed by
IOT-22, and finally on TON-IOT dataset, which had the lowest values in the
evaluated metrics.

TABLE I: OMINIACS final results

Dataset | ACC% | Prec% | TPR% | FAR% | F1%
---|---|---|---|---|---
BOT-IOT | 98.91 | 96.76 | 99.88 | 03.24 | 98.46
TON-IOT | 94.33 | 90.45 | 99.83 | 9.55 | 94.35
IOT-22 | 96.55 | 96.97 | 99.89 | 03.03 | 97.16

TABLE II: Results by stage: BOT-IOT Dataset

Stage | ACC% | Prec% | TPR% | FAR% | F1%
---|---|---|---|---|---
1 | 72.77 | 99.93 | 72.63 | 00.07 | 84.12
2 | 97.14 | 99.47 | 97.65 | 00.53 | 98.55
3 | 98.02 | 98.01 | 99.96 | 01.99 | 98.98
4 | 99.26 | 99.62 | 99.63 | 00.38 | 99.62

TABLE III: Results by stage: TON-IOT dataset

Stage | ACC% | Prec% | TPR% | FAR% | F1%
---|---|---|---|---|---
1 | 89.78 | 99.89 | 85.07 | 00.11 | 91.89
2 | 84.96 | 98.06 | 86.38 | 01.94 | 91.85
3 | 99.48 | 98.32 | 99.50 | 01.68 | 98.91
4 | 99.75 | 99.81 | 99.91 | 00.19 | 99.86

TABLE IV: Results by stage: CIC-IOT dataset

Stage | ACC% | Prec% | TPR% | FAR% | F1%
---|---|---|---|---|---
1 | 81.37 | 99.96 | 81.21 | 00.04 | 89.62
2 | 97.84 | 97.85 | 99.55 | 02.15 | 98.91
3 | 99.59 | 99.56 | 99.78 | 00.44 | 99.78
4 | 99.37 | 99.90 | 99.45 | 00.10 | 99.68

Tables II, III, and IV present the results for each stage of the system. In
these tables, it is possible to observe the specific performance of each stage
of the proposed system, in terms of the evaluated metrics. In general, we can
observe that the ACC, Prec, TPR, and F1 results obtained in most stages are
above 80%, and that the FAR results are also below 3%. An exception to this is
stage 1 of the BOT-IOT database, Table 4, which had ACC (72.77%) and TPR
(72.63%) less than 80%, these being the worst results we obtained.

In addition, we can observe in tables II, III, and IV, the tendency of the
metrics ACC, Prec, and TPR to have a lower value in stage 1, which increases
in stages 2 and 3, and has a reduction in stage 4. This is due to the behavior
of the ML methods used in each step of the system. In Stage 1, we have a
binary classification system in a stream of data, which provides real-time
data analysis. resulting in lower values in the evaluated metrics. Stage 2 is
a multiclass stream classification, which no longer receives most of the data
considered normal, thus having a better performance than the binary system of
Stage 1. In stages 3 and 4, more accurate ML methods are used, deep learning
LSTM and ensemble-based ML, giving better classification results.

Tables V, VI, and VII present the results obtained by type of traffic class,
for each dataset. These tables highlight the detection results of each class
and the false alarms generated by the system for that specific class. In Table
VI, we have the performance by class type for the BOT-IOT dataset. We can see
that the normal class has the highest TPR (98.21%), followed by DoS, DDoS,
Recon and Theft. This follows the trend of classes with more data available
having better results in terms of detection. On the other hand, the Theft
attack class had a significantly higher FAR (19.12%) and lower TPR (82.30%)
than the others class, this may be a result of the confusion between this
class with others such as DDoS and the Normal class that also have a large
number of instances available.

TABLE V: Results by Attack Class: BOT-IOT dataset

Class | TPR% | FAR% | Instances
---|---|---|---
DoS | 97.57 | 01.66 | 89,246
DDoS | 97.17 | 00.49 | 4,909,405
Theft | 82.30 | 19.12 | 4,913,920
Reconn | 95.90 | 00.05 | 1,701
Normal | 98.21 | 4.86 | 3,514,330

TABLE VI: Results by Attack Class: TON-IOT

Class | TPR% | FAR% | Instances
---|---|---|---
Backdoor | 91.73 | 02.75 | 27,145
DoS | 92.41 | 02.90 | 145
DDoS | 95.54 | 03.98 | 202
Injection | 98.49 | 00.55 | 277,696
MITM | 97.29 | 0.54 | 517
Password | 97.00 | 15.9 | 340,208
Ransomware | 68.65 | 37.02 | 5,098
Scanning | 82.31 | 7.01 | 36,205
XSS | 87.23 | 0.32 | 2,149,308
Normal | 98.82 | 1.18 | 2,515,236

TABLE VII: Results by Attack Class: CIC-IOT-2022

Class | TPR% | FAR% | Instances
---|---|---|---
UDPflood | 93.33 | 00.85 | 7,136
TCPflood | 89.99 | 00.95 | 28,560
HTTPflood | 98.14 | 00.28 | 327,496
RTSP | 74.05 | 00.19 | 6,914
Normal | 99.64 | 07.20 | 3,882

TABLE VIII: Time taken to process data in OMINACS system: by each stage and by
each dataset.

Stages | BOT-IOT | TON-IOT | CIC-IOT-2022
---|---|---|---
Total Time | 2,984 (s) | 843 (s) | 91 (s)
Stage 1 | 310 (s) | 155 (s) | 22 (s)
Stage 2 | 790 (s) | 182 (s) | 39 (s)
Stage 3 | 2,686 (s) | 758 (s) | 82 (s)
Stage 4 | 2,201 (s) | 680 (s) | 76 (s)

Table VI shows the result by type of attack of the TON-IOT dataset. Again the
Normal class, having the largest amount of data available, had one of the
higher TPR rates (98.82%). However, the XSS class, that have the second
largest number of instances, had one of the lowest TPR results (87.23%). In
addition to this, the ransomware and the scanning attacks also had low TPR
results (68.65% and 82.31%), with significantly high false alarm rates. These
results might help explain the fact that the TON-IOT dataset had the lowest
accuracy in this experiment, as shown in Table I.

Table VII shows the performance by traffic class for the CIC-IOT-2022 dataset.
As in the other datasets, the Normal class also had the best TPR results
(99.64%), but in this case without having the largest amount of data. This
might have caused the normal traffic class to have a higher FAR (07.20%). The
HTTPflood class that had the more number of instances got the second higher
TPR (98.14%), followed by the UDPflood (93.33%), TCPflood (89.99%) and the
RTSP (74.05%), all of them having a FAR lower than 1%.

Therefore, considering all the results, we have that the normal traffic class
had the best detection in all three datasets, with the highest TPR and lowest
FAR. This is mainly due to stage 3, where the LSTM is used to verify the data
considered normal in stages 2, 3, and 4. This factor contributes to the
reduction of false positives in the system since most of the normal traffic
class is correctly classified.

Table VIII shows the time, measured in seconds, that the input data take to go
through the system. For each dataset, it is shown the total time required to
detect and classify network traffic data and the time spent in each stage of
the system. We can see that the time required to process the BOT-IOT data is
much higher than for the other datasets. This is due to the number of
instances in this dataset BOT being much larger than the other datasets. Also,
we can see that the CIC-IOT-2022 is processed very fast (in only 91 seconds)
compared with the other datasets.

In addition, we can observe that Stage 3 has the determining time for the
total system time, being the most time-consuming stage of the system. This is
because at this stage the data classification process is carried out using the
LSTM, a deep learning approach, which tends to be a more time-consuming method
than the ones used in the other stages. However, as the results of tables II,
III and IV demonstrate, this step has a high performance, with is reflected
mainly in the high value of TPR and low FAR of the Normal class. Thus,
although it is the most time-consuming stage, this stage is fundamental to the
proposed system.

##  VI Conclusion and Future Works

Detecting online network attacks is still a major challenge in today’s IoT
networks. This paper tackles this issue by proposing an online and ML-Based
system named OMINACS. With both an ML pipeline and IoT network view, OMINACS
distributes four stages of attack detection and classification through the
network. We tested OMINACS with three IoT datasets achieving accuracy and
precision results above 90%, with a reduced false alarm rate. We also were
able to analyze the results by each stage and by each attack class. Therefore,
the results confirm that the system is able to detect and classify a large
variety of network attacks. In future work, the authors aim to test the
proposed system in a production network, such as in a small campus network
where the scalability of the system can be evaluated, allowing further
improvements on both the ML pipeline and the IoT network view.

## ACKNOWLEDGMENT

The authors would like to thank the São Paulo Research Foundation (FAPESP) for
the financial support through Grant 2020/04031-1.

## References

  * [1] X. Liang and Y. Kim, “A survey on security attacks and solutions in the iot network,” in _2021 IEEE 11th Annual Computing and Communication Workshop and Conference (CCWC)_. IEEE, 2021, pp. 0853–0859.
  * [2] P. R. Maidamwar, M. M. Bartere, and P. P. Lokulwar, “Implementation of network intrusion detection system using artificial intelligence: Survey,” in _Proceedings of the 2nd International Conference on Recent Trends in Machine Learning, IoT, Smart Cities and Applications_. Springer, 2022, pp. 185–198.
  * [3] A. G. P. Lobato, M. Andreoni Lopez, and O. Duarte, “Um sistema acurado de detecção de ameaças em tempo real por processamento de fluxos,” _XXXIV Simpósio Brasileiro de Redes de Computadores e Sistemas Distribuídos-SBRC_ , 2016.
  * [4] A. Salih, S. T. Zeebaree, S. Ameen, A. Alkhyyat, and H. M. Shukur, “A survey on the role of artificial intelligence, machine learning and deep learning for cybersecurity attack detection,” in _2021 7th International Engineering Conference “Research & Innovation amid Global Pandemic”(IEC)_. IEEE, 2021, pp. 61–66.
  * [5] R. Polikar, “Ensemble learning,” in _Ensemble machine learning_. Springer, 2012, pp. 1–34.
  * [6] P. Malhotra, L. Vig, G. Shroff, P. Agarwal _et al._ , “Long short term memory networks for anomaly detection in time series,” in _Proceedings_ , vol. 89, 2015, pp. 89–94.
  * [7] A. Bifet and R. Gavalda, “Adaptive learning from evolving data streams,” in _International Symposium on Intelligent Data Analysis_. Springer, 2009, pp. 249–260.
  * [8] U. Adhikari, T. H. Morris, and S. Pan, “Applying hoeffding adaptive trees for real-time cyber-power event and intrusion classification,” _IEEE Transactions on Smart Grid_ , vol. 9, no. 5, pp. 4049–4060, 2017.
  * [9] D. Abreu, I. Carvalho, A. J. Abelém, D. Menasché, R. M. Leão, and E. Silva, “Seleção de Características por Clusterização para Melhorar a Detecção de Ataques de Rede,” in _Proceedings of the 38th Brazilian Symposium on Computer Networks and Distributed Systems_. Porto Alegre, RS, Brasil: SBC, 2020, pp. 295–308.
  * [10] T. J. Lucas, K. A. da Costa, E. A. Moraes, P. R. H. Júnior, and M. J. das Neves, “Stacking-based committees para detecção de ataques em redes de computadores-uma abordagem por exaustão,” in _Anais do XXXIX Simpósio Brasileiro de Redes de Computadores e Sistemas Distribuídos_. SBC, 2021, pp. 644–657.
  * [11] I. Sharafaldin, A. H. Lashkari, and A. A. Ghorbani, “Toward generating a new intrusion detection dataset and intrusion traffic characterization.” in _ICISSp_ , 2018, pp. 108–116.
  * [12] Q. Tian, D. Han, M.-Y. Hsieh, K.-C. Li, and A. Castiglione, “A two-stage intrusion detection approach for software-defined iot networks,” _Soft Computing_ , vol. 25, no. 16, pp. 10 935–10 951, 2021.
  * [13] L. Dhanabal and S. Shantharajah, “A study on nsl-kdd dataset for intrusion detection system based on classification algorithms,” _International Journal of Advanced Research in Computer and Communication Engineering_ , vol. 4, no. 6, pp. 446–452, 2015.
  * [14] N. Moustafa and J. Slay, “Unsw-nb15: a comprehensive data set for network intrusion detection systems (unsw-nb15 network data set),” in _2015 Military Communications and Information Systems Conference (MilCIS)_ , 2015, pp. 1–6.
  * [15] D. Abreu and A. Abelém, “Sistema híbrido e on-line de detecção e classificação de tráfego malicioso,” in _Anais do XL Simpósio Brasileiro de Redes de Computadores e Sistemas Distribuídos_. Porto Alegre, RS, Brasil: SBC, 2022, pp. 322–335. [Online]. Available: https://sol.sbc.org.br/index.php/sbrc/article/view/21180
  * [16] A. Khraisat, I. Gondal, P. Vamplew, and J. Kamruzzaman, “Survey of intrusion detection systems: techniques, datasets and challenges,” _Cybersecurity_ , vol. 2, no. 1, pp. 1–22, 2019.
  * [17] Q. Zhou and D. Pezaros, “Evaluation of machine learning classifiers for zero-day intrusion detection–an analysis on cic-aws-2018 dataset,” _arXiv preprint arXiv:1905.03685_ , 2019.