[fieldset=month, null] [fieldset=address, null] [fieldset=location, null]
[fieldset=publisher, null] [fieldset=url, null] [fieldset=isbn, null]

# Early Detection of Network Service Degradation: An Intra-Flow Approach

Balint Bicski and Adrian Pekar  Department of Networked Systems and Services,
Faculty of Electrical Engineering and Informatics,
Budapest University of Technology and Economics, Műegyetem rkp. 3., H-1111
Budapest, Hungary.
Email<EMAIL_ADDRESS><EMAIL_ADDRESS>
###### Abstract

This research presents a novel method for predicting service degradation (SD)
in computer networks by leveraging early flow features. Our approach focuses
on the observable (O) segments of network flows, particularly analyzing Packet
Inter-Arrival Time (PIAT) values and other derived metrics, to infer the
behavior of non-observable (NO) segments. Through a comprehensive evaluation,
we identify an optimal O/NO split threshold of 10 observed delay samples,
balancing prediction accuracy and resource utilization. Evaluating models
including Logistic Regression, XGBoost, and Multi-Layer Perceptron, we find
XGBoost outperforms others, achieving an F1-score of 0.74, balanced accuracy
of 0.84, and AUROC of 0.97. Our findings highlight the effectiveness of
incorporating comprehensive early flow features and the potential of our
method to offer a practical solution for monitoring network traffic in
resource-constrained environments. This approach ensures enhanced user
experience and network performance by preemptively addressing potential SD,
providing the basis for a robust framework for maintaining high-quality
network services.

###### Index Terms:

Service degradation detection, intra-Flow analysis, early flow features,
hardware offloading, predictive modeling

##  I Introduction

In the era of relentless digitization, residential networks have become
critical to our everyday digital activities, underpinning everything from
streaming high-definition videos to facilitating real-time multiplayer games.
As the demand for uninterrupted, high-quality digital experiences grows, so
does the need for resilient and high-performing networks that can consistently
meet these expectations [1, 2].

However, service degradation (SD) poses a substantial threat to these
expectations. SD, characterized by the deterioration of network performance,
leads to suboptimal user experiences due to factors such as network
congestion, inefficiencies in data routing, or external interferences [3]. The
effects are noticeable: users may experience increased latency, buffering in
video streams, or even complete service outages. In essence, SD undermines the
promise of a seamless digital experience.

Addressing this issue is complex. To proactively counteract SD, it is crucial
to gain insights into network flows through comprehensive monitoring [4, 5].
Yet, network devices, which serve as the gatekeepers of residential networks,
often have limited computational capabilities. While they are proficient at
forwarding traffic, they struggle with the intensive monitoring of every flow
due to hardware limitations [6]. Instead of exhaustively monitoring every
packet in a data flow, a common workaround is to observe each flow up to a
predetermined packet threshold. Once this threshold is reached, flow
management transitions to hardware accelerators, which handle high volumes of
data efficiently but lack the capability for detailed, packet-level monitoring
[7]. Consequently, this approach effectively splits flows into observable (O)
and non-observable (NO) parts, leading to the loss of detailed insights into
the flow’s behavior beyond the threshold.

This limitation in monitoring capability presents a challenge in effectively
predicting and managing SD leading to our primary research question: In the
face of these constraints, how can we leverage the O segments of network flows
to deduce the status of the NO segments, thereby identifying and possibly
predicting SD in residential networks? The core of our approach is to derive
patterns from the O segments, which can then be extrapolated to make informed
assumptions about the NO segments and, by extension, the network’s overall
health. Specifically, our methodology tackles this issue with a primary focus
on the LAN segment of home networks, leveraging the Packet Inter-Arrival Time
(PIAT) metric to gain profound insights into network performance.

Our study introduces a method called intra-flow service degradation detection,
which uses early flow features to predict SD in network flows after they
transition from an O state to an NO state. By capturing information from the
initial part of a flow, we aim to infer the behavior and characteristics of
the flow after it moves to a fast-processing but less O state. To validate the
effectiveness of this approach, we conducted a comprehensive experimental
analysis.

Our experimental design focused on evaluating the predictive power of O parts
of network flows to predict the presence of SD events in the NO part. We
compared simple heuristics and advanced techniques such as Logistic
Regression, XGBoost, and Multi-Layer Perceptron (MLP). This comprehensive
assessment aimed to identify the most effective models for the objective.

Our analysis reveals that the XGBoost model, with an O/NO split threshold of
10 observed delays, provides the best performance in predicting non-observable
SD events. This threshold balances prediction accuracy with resource
utilization, while the XGBoost model offers superior precision and recall
compared to simpler heuristics and other sophisticated models. This
combination proves optimal for our SD prediction task in resource-constrained
environments.

Our main contributions in this paper are as follows:

  * •

We propose a novel method for predicting SD in network flows by leveraging
early flow features, particularly focusing on the O segments to infer behavior
in NO parts.

  * •

We introduce and evaluate the concept of intra-flow SD detection, which uses
information available within a specific flow to predict later flow behavior in
resource-constrained environments.

  * •

We determine an optimal O/NO split threshold of 10 delay samples, balancing
prediction accuracy with practical implementation considerations in network
devices with hardware offloading capabilities.

The rest of this paper is organized as follows: Section II discusses hardware
offloading in network devices. Section III provides an overview of existing
works relevant to this area. Section IV introduces the foundational concepts
and preparatory considerations. Section V presents the method to identify SD
events. Section VI evaluates the predictive power of the O parts of network
flows in a binary classification setting, covering data preparation,
experimental design, model performance metrics, and limitations. Finally,
Section VII concludes the paper.

##  II Hardware Offloading in Network Devices

Network devices utilize a dual-path architecture to handle packet processing
efficiently: the fast path, which employs dedicated hardware for forwarding
tasks, and the slow path, which relies on CPU resources for more complex
processing. Depicted in Fig. 1, this design effectively caters to the distinct
requirements of data plane and control plane tasks, where packets requiring
minimal processing are directed through the fast path, and those necessitating
more extensive processing are handled by the slow path [8, 7, 6].

Typically, the initial packets in a network flow are processed by the CPU.
This initial slow-path processing involves critical tasks such as forwarding
lookup to determine the egress port/zone, NAT policy lookup, and security
policy enforcement. The CPU’s processing capabilities enable thorough
inspection and enforcement of policies. However, relying on the CPU for packet
forwarding across all network flows can be resource-intensive and may lead to
performance bottlenecks under heavy traffic loads.

To mitigate these performance issues, certain flows that meet specific
criteria are offloaded to specialized hardware for fast-path processing. In
connection-oriented protocols like TCP, flows might be flagged for fast-path
processing after the connection is fully established, which typically occurs
after the TCP three-way handshake. In contrast, for connectionless protocols
like UDP, flows can be offloaded to the fast path after processing the initial
packet, as there is no formal connection establishment process. Additionally,
some flows might be flagged for fast-path processing once encryption tunnel
establishment is complete.

Figure 1: Generic architecture of a network device with hardware offloading
capabilities.

Once the necessary initial packets are processed, subsequent packets in the
same flow can be offloaded to specialized hardware for fast-path processing.
This offloading significantly reduces the CPU’s workload, enhancing the
device’s overall performance. The dedicated hardware processor then handles
the remaining packets in the flow, ensuring swift and efficient processing.

However, certain flows may require specialized network functions that cannot
be fully addressed by inspecting only the initial packets. These functions
include complex analysis and inspection tasks such as application control,
device intelligence, deep packet inspection, and intrusion prevention system
functions. For example, an IPS might need to analyze the entire payload of
packets in a flow to detect sophisticated attacks, or application control
might require ongoing inspection to enforce usage policies for specific
applications.

To maintain necessary visibility over network flows, network devices can be
configured to handle flows in the slow path up to a certain threshold before
offloading them to hardware-accelerated processing. This approach ensures that
essential visibility and control for performing network functions are
retained. While the CPU manages the traffic, detailed inspection and
comprehensive monitoring are possible, providing deep visibility into the
network.

The implementation of offloading mechanisms varies across different vendors
and their product lines, each differing in technical, methodological, and
functional details. For instance, some implementations might support flagging
flows that meet specific criteria in the fast path to be redirected back to
the CPU for more detailed inspection. Other implementations may utilize more
than the initial packets of a flow before offloading to hardware-accelerated
processing. Criteria for fast-path processing might include trusted
applications or low-risk traffic, and latency-sensitive applications requiring
minimal delay.

This architecture has significant implications for network performance and
monitoring, particularly in the context of SD detection. The transition from
slow-path to fast-path processing creates a fundamental challenge: how to
maintain visibility and detect performance issues in flows after they have
been offloaded to hardware. This challenge forms the core motivation for our
research into using early flow features to predict SD, as we aim to bridge the
gap between the detailed visibility of the slow path and the performance
benefits of the fast path.

##  III Related Work

Research on network performance prediction and SD detection has been a topic
of interest for nearly two decades. Early work by [9] [9] explored the
predictability of Internet SDs by analyzing round-trip time deviations, laying
the groundwork for future studies in this field.

Several studies have focused on detecting and predicting SD using various
network metrics. [10] [10] proposed a method, which uses end-to-end delay and
loss measurements to assess Internet path service quality. Their approach
effectively detects abrupt changes and identifies service-level events,
demonstrating the feasibility of service quality assessment based solely on
end-to-end measurements. In a similar vein, [11] [11] proposed a real-time
packet loss monitoring system to address network quality of SD.

Machine learning techniques have been increasingly applied to network
performance prediction. [12] [12] employed Deep Neural Networks to predict
throughput and duration of flows in a campus network, showcasing the potential
of machine learning in network flow analysis. Our work builds on this trend,
applying machine learning techniques to predict SD in resource-constrained
environments.

Latency has been identified as a crucial indicator of SD, particularly in
specific application domains. [13] [13] investigated the impact of network
impairments on video quality in cloud gaming, developing an algorithm to
predict real-time visual degradations based on accumulated latency. Similarly,
[14] [14] introduced an adaptive bit rate algorithm for enhancing user QoE in
low-latency live video streaming. These studies underscore the importance of
latency as a key metric in SD detection, which aligns with our focus on PIAT
analysis.

In the context of cloud computing, [15] [15] introduced an approach to detect
inter-VM interference and estimate performance degradation in public cloud
environments. While their focus is on cloud environments, their use of multi-
variable regression models for performance estimation shares similarities with
our approach.

Some researchers have explored the concept of controlled SD as a resource
management strategy. [16] [16] and [17] [17] proposed algorithms for
predictive resource allocation in optical data center networks, using
controlled SD to manage network overloads. While these studies approach SD
from a different perspective, they highlight the importance of balancing
service quality and resource utilization.

Our research distinguishes itself by focusing on residential LAN environments
with significant resource constraints. We employ PIAT analysis up to a
predetermined packet threshold, aiming to balance resource conservation with
effective network monitoring. Like previous studies, we recognize latency as a
key metric for SD identification. However, our approach is uniquely tailored
to hardware-constrained environments, targeting the internal network segment
to provide early indications of potential SD. This focus on early detection in
resource-limited settings contributes a novel perspective to the domain of
network monitoring and optimization.

##  IV Key Metrics and Concepts

###  IV-A Metrics Indicative of SD

Building on the dual-layer architecture of home routers, it is vital to delve
into the specific metrics that influence network performance, particularly in
the context of SD. We begin our analysis with PIAT, a fundamental metric that
forms the basis for understanding more complex network behaviors.

####  IV-A1 Packet Inter-Arrival Time

PIAT quantifies the time interval between the arrivals of two consecutive
packets within a network flow at the flow meter. For a sequence of packet
arrival times $t_{1},t_{2},\ldots,t_{n}$, PIAT for the i-th packet is
mathematically defined as:

$\text{PIAT}_{i}=t_{i}-t_{i-1}$

for $i>1$, with $\text{PIAT}_{1}=0$ indicating no preceding packet for the
first in the sequence.

PIAT is crucial in network analysis, serving various purposes from traffic
characterization to behavior analysis. Its utility stems from providing
detailed insights into traffic patterns and assisting in the detection of
anomalies or disruptions within network flows. In our study, we leverage PIAT
to estimate latency, a critical indicator of SD.

####  IV-A2 Latency

Latency is a primary metric for assessing the network performance and is
mathematically defined as:

$\text{Latency (L)}=\text{Time (T2)}-\text{Time (T1)}.$ (1)

Here:

  * •

T1 represents the time when an action or request is initiated.

  * •

T2 is the time when a response is received.

Latency is essentially the sum of the PIATs for all packets within a given
communication sequence. It significantly impacts user experience, with even
slight increases potentially leading to noticeable SD. We represent SD
($\Delta S$) as a function of increased latency ($\Delta L$):

$\Delta S=f(\Delta L)$ (2)

In this context, $f$ denotes the function that quantifies the extent to which
service quality diminishes as latency increases.

####  IV-A3 Jitter

In addition to latency, it is also important to consider latency variability,
known as jitter, which is defined as the variation in latency measurements
over successive intervals:

$\text{Jitter (J)}=\text{Latency (L2)}-\text{Latency (L1)},$ (3)

where:

  * •

L1 is the latency measured at an earlier time point.

  * •

L2 is the latency measured at a subsequent time point.

Jitter essentially measures the fluctuation in PIAT values over time. High
jitter indicates significant variability in PIAT, which can lead to
inconsistent latency. The occurrence of both high latency and significant
jitter may indicate more severe instances of SD. Therefore, examining both
metrics is essential in our efforts to identify SD events and understand their
underlying causes.

###  IV-B Vertical Separation of Delays

From the vantage point of the network edge, which serves as the observation
point in our study, network flow packets can be distinctly categorized into
two primary directions: towards the LAN and towards the WAN. In the context of
latencies determined via PIATs, a vertical separation of delays is essential
for effective traffic monitoring and precise analysis of key metrics.

Isolating LAN-side delays is particularly important because external factors
on the WAN side, which are beyond the network provider’s control, can
significantly influence the analysis results. Understanding local network
conditions accurately necessitates focusing on LAN-specific metrics, as WAN-
side delays introduce variability that can obscure the true performance of the
residential network.

Fig. 2 illustrates this concept clearly. The diagram shows the division of the
bidirectional packet transfer within a flow, with PIATs measured in the WAN
highlighted in orange with a crosshatch pattern to represent delays and
interactions that occur outside the immediate control of the local network.
Conversely, LAN PIAT components are depicted in blue, showcasing the internal
network dynamics. Arrows in the figure indicate the direction of packet
traffic, moving between LAN and WAN endpoints, providing a visual
representation of data traversal across these network segments.

Figure 2: Visual representation of network traffic flow showing the vertical
separation between WAN and LAN delays.

In Fig. 2, there are two visual representations of LAN PIAT components. One
has a filling pattern diagonal from top left to bottom right, and the other
has a mirrored filling pattern with a thicker border. These different
representations correspond to distinct aspects of LAN traffic behavior.
Traffic often appears as a burst of multiple packets. Our analysis focuses on
the time interval between the arrival of the last packet in such a burst
(incoming direction) and the first outgoing packet that responds to this burst
within the same flow. We make two key assumptions:

  1. 1.

Delays caused by local endpoints are negligible compared to those induced by
broader network conditions.

  2. 2.

The response to the last packet in a burst is instantaneous (a condition
typically met with TCP traffic).

Under these assumptions, these specific PIATs correspond to the latency
introduced by traversing the LAN. In Fig. 2, instances meeting these
conditions are highlighted with a filling pattern from bottom left to top
right and a thick blue border. Our research focuses on examining these
specific LAN PIATs.

Figure 3: Illustration of the horizontal separation of a network flow into O
and NO segments.

###  IV-C Horizontal separation of Flows

In our study, the decision to keep a flow in the software layer or transition
it to the hardware layer is governed by a threshold parameter, $\theta$. This
threshold defines the packet limit within which each flow should be monitored
by the software layer. Once a flow’s packet count surpasses this threshold, it
transitions to the hardware layer.

Mathematically, if $p$ represents the number of packets in a flow, then:

$\text{State of Flow}=\begin{cases}\text{Observable}&\text{if }p\leq\theta\\\
\text{Non-observable}&\text{if }p>\theta\end{cases}$

This threshold-based differentiation can be understood as the horizontal
separation of communication space. The $\theta$ parameter determines how many
packets of a given flow are considered observable.

Based on this parameter’s value, two scenarios can occur:

  1. (i)

If the size of a given flow (number of packets) is less than or equal to the
threshold, $||f_{i}||\leq\theta$, where $f_{i}$ denotes the $i^{th}$ network
flow, all packets of the flow are observed.

  2. (ii)

For $||f_{i}||>\theta$, the observed packets are denoted by $O_{p}$ and the
unobserved by $NO_{p}$. Individual packets are represented as $p_{j}$, where
$j$ indicates the chronological order. The flow $f_{i}$ then breaks down into
two subsets: $O_{p}=\\{p_{1},\dots,p_{\theta}\\}\subseteq f_{i}$ and
$NO_{p}=\\{p_{\theta+1},\dots,p_{||f_{i}||}\\}\subseteq f_{i}$.

Fig. 3 illustrates a flow separated into O and NO segments based on the
$\theta$ parameter. In this figure, the O segments are highlighted in green,
indicating the portion of the flow that remains within the software layer. The
NO segments are shown in gray, representing the portion of the flow that
transitions to the hardware layer. The red dashed line denotes the threshold
$\theta$ at which this transition occurs. We refer to this process as
horizontal separation.

##  V Service Degradation Detection Methodology

###  V-A Refining Observability of LAN Delays

The $\theta$ parameter does not guarantee a consistent number of observable
LAN-side delays. Due to the vertical separation process, the first $\theta$
packets will have a substantially lower number of LAN delays, as WAN-side
delays are excluded and packet bursts may occur, further reducing the useful
PIAT values.

To focus on studying the behavior and predictive power of selected LAN delays,
we introduce an additional threshold parameter, $m$, specifically for LAN
delays. This threshold is defined similarly to $\theta$ but is applied
exclusively to LAN delays. Essentially, the O part of the flow consists of the
delays measured up to this new threshold $m$, while delays collected beyond
this point are considered non-observable. Similar to the packet-based
separation, if a flow has fewer delays than the threshold $m$, it will be
entirely observable.

###  V-B Heuristic Detection of Service Degradation Events

Building on our refined observability of LAN delays, we now turn to the
detection of SD events within network flows. SD events can be identified using
a heuristic based on the behavior of latency and jitter over time, as we
established in our previous work [18]. This approach provides a framework for
identifying SD events across various application types.

Different application categories exhibit unique characteristics for extreme
delay and jitter occurrences. These characteristics can be used to define
application-specific SD event requirements, identifying events that begin with
an extreme delay and jitter followed by a sequence of additional extreme
delays. The minimum number of such delays required for an event to be
classified as SD is referred to as the Minimum Sequence Length (MSL).

Fig. 4 illustrates an SD event for a flow with a Minimum Sequence Length of 2.
In this figure, LAN delay and LAN jitter are depicted, along with the SD event
highlighted in red. The pattern shows how an initial extreme delay and jitter
are followed by subsequent extreme delays, meeting the criteria for
identifying an SD event.

Figure 4: An SD event in a flow with a MSL of 2.

###  V-C Handling Split SD Events

As we apply our SD detection method across the O and NO parts of network
flows, we encounter scenarios where SD events may span this divide.
Identifying and handling SD events in this context is more complex. Properly
handling the split SD events is therefore crucial for maintaining the accuracy
and reliability of our detection and prediction methods.

There are three possible scenarios when performing horizontal separation
regarding SD events:

  * •

The entire SD event falls into the O part of the flow (i.e.,
$SD_{\text{end}}<O_{\text{end}}$).

  * •

The entire SD event falls into the NO part of the flow (i.e.,
$SD_{\text{start}}>O_{\text{end}}$).

  * •

The SD event is split between the O part and the NO part of the flow (i.e.,
$SD_{\text{start}}<O_{\text{end}}$ and $SD_{\text{end}}>O_{\text{end}}$).

In the latter case, it is necessary to decide whether to eliminate the SD
event or to divide it into two smaller events. The rationale for eliminating
the SD event is to prevent incomplete SD events from appearing at the end of
the O part and the beginning of the NO part, especially when these segments do
not meet the SD event requirements, such as being shorter than the MSL for
that specific category. Conversely, the rationale for retaining and splitting
the SD event is based on the importance of preserving potentially crucial
information. Therefore, we chose to preserve these events by splitting them
and marking them as split SD events for further study. Fig. 5 visually
illustrate this scenario.

Figure 5: Illustration of a split SD event in a flow.

However, this approach introduces another complexity: how to handle LAN delay
sequences that nearly qualify as SD events but fall short at the end of the O
part? These sequences resemble split SD events but do not develop into full SD
events in the NO part. From an objective perspective, we can only observe the
O part of a flow and lack information to determine whether a partial SD event
is a true split event. To address this, we mark both actual split SD events
and apparent split SD events, where delays end precisely at the O part’s
boundary, as split SD events. We refer to this latter case as an apparent
split as it creates the illusion that it may be a split SD event continuing
into the NO part. This scenario is depicted in Fig. 6.

Figure 6: Illustration of a potential split SD event.

To quantify the extent of these split events and facilitate further analysis,
we calculate the ratio of the length of a split event to the MSL for that
flow’s application category as follows:

$f_{\text{split SD ratio}}=\frac{f_{|\text{partial SD
event}|}}{f_{\text{MSL}}},$

where $f$ stands for a flow. This split SD ratio provides a measure of how
close a partial event is to meeting the full criteria for an SD event, which
is valuable for our predictive modeling.

The $f_{\text{split SD ratio}}$ may exceed 1 if the SD event at the end of the
flow surpasses the MSL limit. This can occur when an SD event concludes
exactly at the end of the flow or continues into the NO part of the flow.

###  V-D Intra-Flow Service Degradation Detection

Preserving a high-quality user experience hinges on the timely and accurate
detection of SD, a task that presents challenges in edge devices (such as home
routers) with limited resources. Once the flow crosses the threshold into the
non-observable domain, degradation becomes imperceptible. This limitation
necessitates a novel approach to SD detection that can operate within these
constraints.

The cornerstone of our method capitalizes on the O states of specific flows.
Using early flow features available up to the O/NO split threshold, we make
educated inferences about the behavior and characteristics of flows that have
advanced into the NO realm. This strategy involves harnessing the wealth of
information from the O part to infer the state and performance of flows that
elude direct observation. We call this procedure intra-flow service
degradation detection as it uses information available within a specific flow
to predict later flow behavior, hence the intra-flow nature of the detection.
Fig. 7 visually depicts this process.

Figure 7: Intra-flow SD detection.

The ultimate objective is to perform a binary classification using information
from the O portion of the flow to determine the presence or absence of SD in
the NO portion. By analyzing the early flow characteristics, our goal is to
accurately predict whether an SD event occurs later in the flow. This approach
differs from traditional SD detection methods that rely on continuous
monitoring of entire flows, offering a solution tailored to the constraints of
resource-limited edge devices.

##  VI Model Evaluation and Performance Analysis

In this section, we explore the potential of the O parts of flows to predict
characteristics in the NO parts. Our primary goal is to assess how well
information from the O part can infer the presence of SD events in the NO
part. Specifically, we use classification models in a binary setting to
determine the presence or absence of SD events in the NO part.

###  VI-A Dataset

We utilize a dataset compiled in [18], consisting of TCP network flows
measured over five consecutive days in a university dormitory network. This
dataset includes:

  * •

Aggregated flow features and packet-level characteristics for the first 255
packets of each flow.

  * •

LAN delay and jitter values extracted using the vertical separation process
described in Section IV-B.

  * •

Marked SD events with application category-specific MSL thresholds.

Our analysis focuses on flows measured at Location 2 to simplify our
evaluation while maintaining result transferability to similar environments.

###  VI-B Data Preparation

Data collected from Monday to Wednesday was used as training data, while data
from Thursday and Friday was used for testing. Only flows that last at least
until the O/NO split were included, as shorter flows do not have an NO part.

Input features include:

  * •

Statistical measures (min, max, median, mean, std) of delays and jitters in
the O part.

  * •

Individual delay and jitter values in the O part.

  * •

SD event count in the O part.

  * •

Attributes (length, start, and end) of the longest SD event in the O part,
indexed from the start of the O part.

  * •

Application and category information.

  * •

Location and connection type (wired or wireless).

  * •

$f_{\text{split SD ratio}}$.

We performed one-hot encoding on categorical variables (application name,
application category name, location, and connection type) and created scaled
versions of the input datasets using Standard Scaler for compatibility with
all models, particularly MLP. Table I summarizes the input sizes and feature
counts for different O/NO splits.

TABLE I: Train and Test Sizes with Input Feature Counts for Different O/NO Splits O/NO Split | Train Size | Test Size |  Input Feature Count
---|---|---|---
5 | 905,407 flows | 507,359 flows |  141 features (including 6 application category name, 101 application name, 9 location, 2 connection type OH encoded features)
10 | 264,183 flows | 154,021 flows |  140 features (including 6 application category name, 90 application name, 9 location, 2 connection type OH encoded features)
15 | 168,463 flows | 99,290 flows |  144 features (including 6 application category name, 84 application name, 9 location, 2 connection type OH encoded features)
20 | 122,814 flows | 73,043 flows |  152 features (including 6 application category name, 82 application name, 9 location, 2 connection type OH encoded features)

###  VI-C Experimental Design and Evaluation Metrics

For the binary classification problem of determining SD event presence in the
NO part, we evaluated:

  * •

Null predictor (always predicts no SD in the NO part),

  * •

All true predictor (always predicts SD in the NO part),

  * •

Random predictor,

  * •

O SD-based predictor (predicts SD if present in O part),

  * •

Split SD metric-based predictor (predicts SD if split SD ratio $>0$),

  * •

Logistic Regression,

  * •

XGBoost,

  * •

Multi-Layer Perceptron (MLP).

We employed Grid Search to identify the best parameter settings for all
models, and training was conducted using 5-fold cross-validation. For
classification, we aimed to maximize the Area Under the Receiver Operating
Characteristic (AUROC) for the Logistic Regression and XGBoost models, and
minimize the training loss for the MLP. To ensure reproducibility, random
states were set to 42, and the MLP was run for 1000 iterations.

We used various metrics to compare model performance: precision, recall (true
positive rate (TPR)), F1-score, specificity (true negative rate (TNR)),
negative predictive value (NPV), accuracy, and balanced accuracy. These
metrics provide a comprehensive view of model performance, accounting for
class imbalance and different aspects of predictive accuracy.

###  VI-D Classification Performance

Figure 8: Classification metrics for NO SD presence prediction at different
O/NO split thresholds.

Fig. 8 compares the classification metrics for each O/NO split threshold
studied, while Fig. 9 depicts the Receiver Operating Characteristic (ROC)
curves and corresponding areas under the curves (AUROC).

####  VI-D1 Overall Performance

All trained models showed significantly better performance than the random
predictor, as well as the all-true or all-null predictors. The null predictor
achieved an accuracy over 95% for all metrics (but only a balanced accuracy of
0.5), indicating a strong presence of flows with no SD events in the NO part.

In terms of specificity, NPV, and accuracy, all models at every threshold
showed excellent results (over 95% for all metrics, many approaching 100%).
This suggests that all approaches are able to correctly classify flows that
have no SD in the NO part, as these flows seem to exhibit consistent behavior
with no SD events in the O part, nor split SDs. This is true both in terms of
identifying the majority of such flows (high TNR) and having a high number of
correct predictions for flows predicted not to have SD in the NO part (high
NPV). The similarly high accuracy underscores the high imbalance towards these
types of flows in the data. However, when it came to correctly identifying
flows with non-observable SDs, the models did not perform as well.

Figure 9: ROC curves with corresponding AUROC metrics for NO SD presence
prediction at different O/NO split thresholds.

####  VI-D2 Model Comparison

Heuristic models (SD Based Predictor and Split SD Heuristic) demonstrated
moderate effectiveness with highly similar prediction results across all
metrics when examined individually at each threshold. They achieved the
highest recall and balanced accuracy at all O/NO split thresholds (50% and
72%, respectively, for the two metrics at threshold 5, and around 0.8 and over
0.85, respectively, for the other thresholds). However, these heuristics
underperformed in terms of precision and, consequently, the F1-score when
compared to other models. These results suggest that many of the flows with
non-observable SD events also have SD in their O parts, but many flows with SD
events in the O part or guessed split SD events do not have SD events forming
in the NO part.

The sophisticated models (Logistic Regression, XGBoost, and MLP) exhibited
much higher precision at the cost of lower recall. This discrepancy was
greatest at the O/NO split threshold of 5, with XGBoost achieving a precision
of 66% and over 72% for the other two models, while recall was only 19% for
XGBoost and just 9% for Logistic Regression and MLP. Consequently, the
F1-scores were low (with 30% for XGBoost and half of this for the other two
models, and a balanced accuracy of around 55-60%), suggesting that at this
split threshold, the models did not gather enough information to confidently
predict the more volatile behavior in the NO part.

####  VI-D3 Impact of O/NO Split Threshold

By the O/NO split threshold of 10, the prediction metrics became more balanced
for all models. The simple heuristics maintained their lead in recall (78%)
and balanced accuracy (86%), while also improving their precision. However,
precision remained under 45%. The sophisticated approaches offered balanced
results with all metrics exceeding 64%. XGBoost and MLP achieved a recall of
69% and a corresponding balanced accuracy of 84%. XGBoost excelled in
precision at over 80% and achieved the best F1-score at 74%.

Going beyond this threshold to O/NO splits of 15 and 20 offered only marginal
improvements for all models. The XGBoost model excelled in terms of precision
(85%) and F1-score (77%). At threshold 20, there were only minor improvements
in specific metrics, with some even decreasing, likely due to the
significantly reduced number of flows considered. This suggests that choosing
an elevated split threshold offers no clear benefits.

####  VI-D4 ROC Curve Analysis

The ROC curves show similar behavior to the patterns identified earlier. The
simple heuristics demonstrate clear inferiority to the other models, even at
the O/NO split threshold of 5 (with AUROC scores of 72% compared to over 87%
for the other models). The superior robustness of the XGBoost model is evident
at every threshold, exceeding 0.9 in AUROC at the O/NO split of 5, reaching
0.97 by threshold 10 and 0.98 by 15.

Logistic Regression and MLP exhibit similar patterns with highly correlated
ROC curves and nearly identical AUROC values. The lack of significant
improvement beyond threshold 10 is also evident in this figure.

####  VI-D5 Summary of Findings

All models significantly outperformed simple baseline predictors,
demonstrating the value of our approach. The XGBoost model showed the most
promising results, offering a balance of high precision and good recall with a
high balanced accuracy. Given its lower training time and lack of need for
feature scaling, it is an ideal choice for the non-observable SD prediction
task. We identified threshold 10 as the best in terms of prediction
performance relative to the O/NO split ratio, offering decent prediction
performance at a reasonable O/NO split point. A lower threshold does not
include enough information for a reliable prediction, while increasing the
threshold further leads to only marginal improvements in performance,
resulting in diminishing returns.

####  VI-D6 Limitations

Our study, while promising, has certain limitations. The analysis was
conducted on a specific network environment, and further validation in diverse
settings would enhance the generalizability of our findings. The accuracy of
predictions may vary depending on the nature of the flow and the specific
characteristics of SD events. While our model performs well in predicting the
presence of SD events, predicting their exact characteristics (such as
duration or severity) remains a challenge. Additionally, the method’s
effectiveness is influenced by the choice of the O/NO split threshold and the
features selected for analysis. Despite these limitations, our intra-flow SD
detection approach offers a novel and resource-efficient method for
maintaining network quality in challenging environments.

##  VII Conclusion

This paper presented a novel method for predicting service degradation in
computer networks by leveraging early flow features. Our approach focused on
the O segments of network flows, particularly analyzing packet inter-arrival
time values and other derived metrics, to infer the behavior of NO segments.
We identified an optimal O/NO split threshold of 10 observed delays, balancing
prediction accuracy and resource utilization. We also demonstrated that
XGBoost can achieve an F1-score of 0.74, a balanced accuracy of 0.84, and an
AUROC of 0.97. Our findings highlight the effectiveness of incorporating
comprehensive early flow features and the potential of our method to offer a
practical solution for monitoring network traffic in resource-constrained
environments. Future work in this area is aimed at investigating the
applicability of this approach to other types of network anomalies beyond SD.
We also plan to extend the analysis to include a wider range of network
environments and traffic types to further validate and refine the model.

## Acknowledgment

Supported by the János Bolyai Research Scholarship of the Hungarian Academy of
Sciences. Supported by the ÚNKP-23-5-BME-461 New National Excellence Program
of the Ministry for Culture and Innovation from the source of the National
Research, Development and Innovation Fund.

## References

  * [1] Jürgen Cito et al.  “Identifying Root Causes of Web Performance Degradation Using Changepoint Analysis”  In _Web Engineering_ , 2014, pp. 181–199  DOI: 10.1007/978-3-319-08245-5_11
  * [2] Pavle Vuletić et al.  “Localization of network service performance degradation in multi-tenant networks”  In _Computer Networks_ 168, 2020, pp. 107050  DOI: 10.1016/j.comnet.2019.107050
  * [3] Pedro Casas et al.  “Unveiling network and service performance degradation in the wild with mplane”  In _IEEE Communications Magazine_ 54.3, 2016, pp. 71–79  DOI: 10.1109/mcom.2016.7432151
  * [4] Sihyung Lee et al.  “Network monitoring: Present and future”  In _Computer Networks_ 65, 2014, pp. 84–98  DOI: 10.1016/j.comnet.2014.03.007
  * [5] Rick Hofstede et al.  “Flow Monitoring Explained: From Packet Capture to Data Analysis With NetFlow and IPFIX”  In _EEE Commun. Surv. Tutor._ 16.4, 2014, pp. 2037–2064  DOI: 10.1109/comst.2014.2321898
  * [6] Annus Zulfiqar et al.  “The Slow Path Needs an Accelerator Too!”  In _ACM SIGCOMM Computer Communication Review_ 53.1, 2023, pp. 38–47  DOI: 10.1145/3594255.3594259
  * [7] Danilo Cerovic et al.  “Fast Packet Processing: A Survey”  In _EEE Commun. Surv. Tutor._ 20.4, 2018, pp. 3645–3676  DOI: 10.1109/comst.2018.2851072
  * [8] Edgar Costa Molero et al.  “Hardware-Accelerated Network Control Planes”  In _Proceedings of the 17th ACM Workshop on Hot Topics in Networks_ , HotNets ’18, 2018  DOI: 10.1145/3286062.3286080
  * [9] A. Bremler-Barr et al.  “Predicting and bypassing end-to-end Internet service degradations”  In _IEEE Journal on Selected Areas in Communications_ 21.6, 2003, pp. 961–978  DOI: 10.1109/JSAC.2003.814614
  * [10] Atef Abdelkefi et al.  “Assessing the service quality of an Internet path through end-to-end measurement”  In _Computer Networks_ 70, 2014, pp. 30–44  DOI: https://doi.org/10.1016/j.comnet.2014.04.016
  * [11] Hua Wu et al.  “LossDetection: Real-Time Packet Loss Monitoring System for Sampled Traffic Data”  In _IEEE Trans. Netw. Service Manag._ 20.1, 2023, pp. 30–45  DOI: 10.1109/TNSM.2022.3203389
  * [12] Christoph Hardegen et al.  “Predicting Network Flow Characteristics Using Deep Learning and Real-World Network Traffic”  In _IEEE Trans. Netw. Service Manag._ 17.4, 2020, pp. 2662–2676  DOI: 10.1109/TNSM.2020.3025131
  * [13] Alex Amaral et al.  “Prediction of Video Quality Degradation on a Cloud Gaming Platform”  In _2023 IEEE International Symposium on Broadband Multimedia Systems and Broadcasting (BMSB)_ , 2023, pp. 1–5  DOI: 10.1109/BMSB58369.2023.10211223
  * [14] Yunlong Li et al.  “Fleet: Improving Quality of Experience for Low-Latency Live Video Streaming”  In _IEEE Trans. Circuits Syst. Video Technol._ 33.9, 2023, pp. 5242–5256  DOI: 10.1109/TCSVT.2023.3243901
  * [15] Lucía Pons et al.  “Cloud White: Detecting and Estimating QoS Degradation of Latency-Critical Workloads in the Public Cloud”  In _Future Generation Computer Systems_ 138, 2023, pp. 13–25  DOI: https://doi.org/10.1016/j.future.2022.08.012
  * [16] Boyi Xian et al.  “Prediction-based and provident service degradation in optical data center networks”  In _2016 15th International Conference on Optical Communications and Networks (ICOCN)_ , 2016, pp. 1–3  DOI: 10.1109/ICOCN.2016.7875717
  * [17] Weigang Hou et al.  “Service Degradability Supported by Forecasting System in Optical Data Center Networks”  In _IEEE Systems Journal_ 13.2, 2019, pp. 1514–1525  DOI: 10.1109/JSYST.2018.2821714
  * [18] FlowFrontiers  “Servie Degradation Detection - Digital Artifacts”, http://github.com/FlowFrontiers/ServDeg-Dataset, 2024


# The Source Spectra and Residence Times of Galactic Cosmic Rays Derived from
CALET and AMS Measurements

Ramanath Cowsik<EMAIL_ADDRESS>Dawson Huth  Washington University in St.
Louis,
Physics Department and McDonnell Center for the Space Sciences

###### Abstract

The recent measurements of the spectral intensities of cosmic-ray nuclei have
suggested that the ratio of Boron to Carbon nuclei, $R(E)$, comprises two
components, one which carries all of the energy dependence and the other a
constant independent of energy per nucleon. This supports the earlier
theoretical expectations and results of gamma-ray astronomy that one of these
components is attributable to spallation in a cocoon like region surrounding
the sources and the other in the general interstellar medium before cosmic
rays leak away from the Galaxy. A new way of analyzing cosmic-ray spectra is
presented here to shed light on the recent findings: based solely on the
assumption that the B nuclei in cosmic rays are entirely the products of
spallation of heavier nuclei, we solve a cascade of propagation equations to
derive both the source-spectra of p, C, O, and Fe nuclei prior to any
spallation effects and the energy dependence of the leakage lifetime,
$\tau(E)$, implied by the energy dependence of $R(E)$. We find that the source
spectra of these nuclei are nearly power laws with the same index, in the
nested leaky-box model where the energy-dependent part of the matter is
traversed in a cocoon surrounding the sources, and the constant part of the
traversal is in the interstellar medium. This is not the case for the
alternate choice with the grammage in the sources being a constant. We briefly
discuss our results and comment on some aspects of cosmic-ray propagation.

††preprint: APS/123-QED

Introduction.—The low abundances of Li, Be, and B in the Solar System with
respect to neighboring elements like C and O, and their significant
enhancement in Galactic cosmic rays has provided much insight into the
propagation of cosmic rays. In order to interpret this enhancement as arising
from spallation of the heavier elements during the traversal of matter by
cosmic rays after the acceleration process, in a manner consistent with their
spectra the ”leaky box model” was formulated [1, 2]. This model envisages a
steady state established by the balance between injection of cosmic rays by
their sources into the interstellar medium and their subsequent loss due to
spallation, leakage from the Galaxy, and other processes [3]. As cosmic ray
observations became more precise the ”nested leaky box” model (NLB) was
developed [4, 5, 3, 6] to address the energy dependence of the B/C ratio,
matter traversed in the source regions, and the spectral intensities of
antiparticles in cosmic rays. In this model cosmic rays spend time interacting
with material in a cocoon-like region surrounding the sources before leaking
out into the general interstellar medium, wherefrom they eventually leak out
of the Galaxy. The decrease of the B/C ratio with energy was also addressed in
energy-dependent leakage (EDL) models where the energy dependence of the
leakage lifetime $\tau(E)$ was chosen suitably to reproduce the observations
[3, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]

This paper is stimulated by the recent measurements of Adriani et al. [18, 19]
of the spectra of Boron, Carbon, other elements and the B/C ratio extending
over the energy range 8.4 GeV/$n$ up to 3.8 TeV/$n$ using the CALET instrument
aboard the International Space Station. Adriani et al. also plot the B/C ratio
as a function of $E/n$ along with the earlier measurements [20, 21, 22, 23,
24, 25, 26, 27, 28]. This ratio is an important probe of the several
theoretical suggestions such as energy dependent diffusion constants $D(E)$
[17, 29, 30], or equivalently energy dependent residence times $\tau(E)$, EDL
models, in NLB models [31, 32, 6, 33] and in models where the rerversed
version of NLB models with constant grammage in the sources [34, 35]. We
display their measurement of the B/C ratio in Figure 1., with an extension to
lower energies to accommodate the AMS-02 data [36]. The B/C ratio, $R(E)$,
shows the slow monotonic decrease with energy, which has been studied earlier
theoretically by many authors cited above, but it is only the recent data that
show the tendency to level-off at high energies, prompting the comments by
Adriani et al. [19] that there are two contributions to the Boron flux, one
dependent on energy and the other constant independent of energy. These two
components arise during the propagation after the acceleration of cosmic rays
in two regions: one in the cocoon surrounding the sources and the other in the
interstellar medium. These two components are conveniently fit with two
functions:

$R_{1}(E)=R_{o}E^{-\mu-\delta ln(E)}$ (1) $R_{2}(E)=R_{A}=constant,$ (2)

with $R_{o}=0.275$, $\mu=0.06$ (added to accommodate the peak in $R$ slightly
shifted from 1 GeV/$n$), $\delta=0.07$, and $R_{A}=0.04$, the assumed
asymptotic value of $R$. In the following analysis we will use cosmic-ray
spectra measured by CALET and AMS-02 to derive the residence times and
injection spectra in the sources of p, C, O, and Fe nuclei, and the energy
dependence offering insight into which region predomninantly carries energy
dependent propagation effects.

Figure 1: Ratio of the cosmic-ray boron and carbon fluxes measured by the
CALET [19] and AMS-02 [36] instruments. Fit lines represent energy dependent
(solid line) and independent (dashed line) propagation components $R_{1}(E),\
R_{A}$ and their sum $R_{1}(E)+R_{A}$ (chain-dotted line) modeled according to
Equations 1 and 2.

Analysis.— We start the analysis with the standard transport equations; here
the spectral intensities of various nuclei are represented as p$(E)$, B$(E)$,
C$(E)$, O$(E)$, etc. Our primary focus is in the energy region $>$ 5 GeV/$n$
where the loss of energy due to ionization during traversal of matter is
assumed to be independent of energy, the effects of Solar modulation are small
and the secondary nuclei produced in the spallation process carry away the
same $E/n$ as their parent nuclei. The velocity of the nuclei is taken to be
$c$. The rate of change of the spectral intensity of a cosmic-ray nucleus
$N_{j}$ during propagation in a region is the sum of the losses due to leakage
and spallation of the nucleus, and gain from the production as the spallation
product of a heavier nucleus and possible injection by the sources:

$\frac{dN_{j}}{dt}=-N_{j}\left(\frac{1}{\tau}+c\sigma_{jj}n_{H}\right)+\sum_{i<j}N_{i}c\sigma_{ij}n_{H}+Q_{j}$
(3)

Here the lower value of the subscript, higher is the atomic mass of the
nuclei, and $Q_{j}$ is the source function, $\tau(E)$ is the leakage lifetime
of the nucleus in the region under consideration, $n_{H}$ is the number
density of target atoms, $\sigma_{jj}$ and $\sigma_{ij}$ are the total and
partial spallation cross sections (for the production of $N_{j}$ from
$N_{i}$), obtained by fitting the data compilations of
GALPROP111https://galprop.stanford.edu/ and EXFOR222https://www-
nds.iaea.org/exfor/. Subscripts will be added to indicate the regions, cocoons
around the sources with an ’$S$’ and the interstellar region of the Galaxy
with a ’$G$’. This set of equations starting with the heaviest nucleus to the
lightest nucleus can be written as a matrix equation

$M\mathbf{N}=\mathbf{Q},$ (4)

$M$ is a lower-triangular matrix, with all the entries above the diagonal
being zero, and under conditions of steady state, $\frac{dN_{j}}{dt}=0$ with
only $\left(\frac{1}{\tau}+c\sigma_{jj}n_{H}\right)$ and
$\sum_{i<j}c\sigma_{ij}n_{H}$ as the diagonal and sub-diagonal terms
respectively. In the solution of Equation 4. the customary method is to assume
the energy dependence of $\tau(E)$ (or alternatively that of the diffusion
constant $D(E)$) and a set of source spectra $Q(E)$ and solve the equation
$M^{-1}\mathbf{Q}=\mathbf{N}$. Instead, it is adequate to assume that
$\mathrm{Q_{B}(E)=0}$, implying boron nuclei with their negligible universal
abundances are not accelerated by the sources. This assumption is adequate to
explicitly derive the energy dependence of $\mathrm{\tau(E)}$ and
$\mathrm{\mathbf{Q}(E)}$ from the cosmic-ray data.

The cascade of equations represented by Equation 4. can be solved to get both
the source vector $\mathbf{Q}(E)$ and the energy dependence of $\tau(E)$ given
the observed spectral intensities vector $\mathbf{N}(E)$, or vice versa. For
example, when we have a single region of propagation, say the interstellar
medium and cosmic rays are directly injected into it by the sources, then for
each energy bin, we can vary $\tau$ in the matrix $M$ so as to minimize the
value of $Q_{B}$ at that energy. This procedure when carried out at all energy
bins determines both $\tau(E)$ and $Q(E)$. When we have two regions, one
nested within the other, the procedure is not significantly different and the
solution is readily obtained.

Propagation back to the cosmic-ray accelerator reversing the affects of
spallation in the ISM and the cocoon surrounding the sources.— In order to
analyze the cosmic-ray data based on the procedure detailed above we ascribe
20% of the B flux to cosmic ray nuclei other than the major contributors C and
O, namely to N, Ne, Mg, S, Fe etc. We nominally choose the number density of
hydrogen atoms in the interstellar medium, $n_{H,G}=1$ H atom cm-3 and
$\tau_{G}=3.64\times 10^{13}$ s for reproducing the asymptotic value of the
spectral density of B nuclei at high energies where spallation effects are
small. We also choose for the density in the cocoon, $n_{H,S}=200$ H atoms
cm-3; these specific values of $n_{H,G}$ and $n_{H,S}$ are not crucial, even
though there does exist a small sensitivity to the choice. As the abundance of
B nuclei in the Galaxy [39] is extremely low, we minimize the amount of B
accelerated by the sources to determine the value and the energy dependence of
$\tau_{S}(E)$ as well as the source functions for the nuclei C, O, Fe and
protons.

Before beginning the calculation of the source spectra all of the observed
spectra being considered [36, 19] are adjusted to a standard energy bin
choice. Typically at energies below $\sim 50$ GeV/$n$ most of the spectra
share common energy bins for each experiment but that is not generally the
case at higher energies. A combination of linear interpolation and
extrapolation methods are used to estimate the flux measurements at new energy
bins where the measured spectra do not share a common bin in the CALET and
AMS-02 data [36, 19].

The standard NLB model.—We begin with the scenario where the residence time of
cosmic rays $\tau_{G}$ is independent of energy in the interstellar medium and
has some unspecified energy dependence $\tau_{S}(E)$ in the cocoon regions
around the sources. The first step is straightforward; all of the elements of
the transport matrix $M_{G}$ are known, and we have

$M_{G}\mathbf{N}_{G}=\mathbf{Q}_{G}.$ (5)

Here, $\mathbf{N}_{G}$ are the observed spectral intensities of the elements
in the Galactic cosmic rays and $\mathbf{Q}_{G}$ is the injection rate of
these cosmic-ray elements into the Galactic volume. In each energy bin , $i$,
of the observations we have a vector $\mathbf{N}_{G}(E_{i})$ that yields the
corresponding injection vector $\mathbf{Q}_{G}(E_{i})$, which represents the
rate at which cosmic rays leak out of the cocoons into the interstellar
medium. Note further that

$\displaystyle\begin{split}\mathbf{Q}_{G}(E)&=\mathbf{N}_{S}(E)/\tau_{S}(E)\
\\\ &\mathrm{or\ }\\\
\mathbf{N}_{S}(E)&=\mathbf{Q}_{G}(E)\tau_{S}(E).\end{split}$ (6)

At the present level of the calculation we have not yet determined either
$\mathbf{N}_{S}(E)$ or $\tau_{S}(E)$, but demand that they satisfy the
transport equation

$M_{S}\mathbf{N}_{S}=\mathbf{Q}_{S}.$ (7)

Note that $M_{S}(E)$ is also not known because of its dependence on
$\tau_{S}(E)$. However for any given choice of $\tau_{S}(E)$ at any $E=E_{i}$
we can solve this equation; accordingly we vary $\tau_{S}(E_{i})$ for each
energy bin until $\mathbf{Q}_{B,S}(E_{i})$, the rate at which boron nuclei are
accelerated in the sources is minimized. This procedure not only determines
$\mathbf{N}_{S}(E_{i})$ but also $\tau_{S}(E_{i})$ and
$\mathbf{Q}_{S}(E_{i})$, and is carried out for all the energy bins. The
results are displayed in Figures 2 and 3 and are summarized below:

  1. 1.

The $\tau_{S}(E)$ derived from the analysis, shown in Figure 2, declines
steeply with the energy per nucleon as $\sim E^{-1}$ or even steeper at very
high energies. As the diffusion constant $D$ is inversely proportional to
$\tau(E)$, it implies that $D$ is proportional to $p\beta/Z$ (Bohm diffusion)
and steepening to $\sim(p\beta/Z)^{2}$ behavior, in a manner not unlike the
diffusion of cosmic rays in the solar wind leading to the modulation of
Galactic cosmic rays [40, 41, 42, 43]. Note that $\mathrm{\tau_{S}(E)}$ does
not have the same energy dependence of $\mathrm{R_{1}(E)}$, but is
considerably steeper.

  2. 2.

The spectrum of Fe, O, C, and p emerging from the cosmic-ray acceleration,
shown in Figure 3, are all nearly identical to one another and over the energy
range beyond $\sim 5$ GeV/$n$ fit a power-law with an index of $\sim-2.75$ and
similar at higher energies. This indicates that the observed spectra
$\mathbf{N}_{G}$ are flatter than the source spectra $\mathbf{Q}_{S}$
especially at low energies and the energy dependence of the C/O ratio are due
to spallation processes during propagation. The falling B/C ratio implies
greater spallation at lower energies and less at higher energies. For the
cross sections $\sigma_{CB}$, $\sigma_{CC}$, etc. independent of energy used
in the present calculation $\mathbf{Q}_{S}\sim E^{-2.75}$, fits the entire
energy band from 7 GeV/$n$ to $\sim 2000$ GeV/$n$ and the fit would extend to
lower energies when solar modulation effects are corrected for. Splitting the
energy domain into two segments, we note that the region below $\sim 50$
GeV/$n$ is steeper and changes to $\sim E^{-2.67}$ at higher energies beyond
$\sim 70$ GeV/$n$. These spectral characteristics will change if the cross
sections turn out to be dependent on energy.

Figure 2: In this figure the lifetimes $\tau_{S}(E)$, $\tau_{G}$, and
$\tau_{S}(E)+\tau_{G}$ derived from the data using the nested leaky-box model
are compared with the observed B/C ratios parameterized in functions
$R_{1}(E)$ and $R_{A}$ (see Equations 2 and 3) after scaling. It is clear that
one needs much steeper dependencies of $\tau(E)$ to match the falling B/C
ratios. Spallation of B nuclei and their parent nuclei like C and O is the
basic cause of this (see the discussion section). Figure 3: Source spectra in
the nested leaky-box model obtained with the CALET and AMS-02 cosmic ray flux
data. The grey dashed lines represent power laws fit and normalized to the O
and Fe source functions. Error bars on interpolated/extrapolated points are
taken from the measurement errors of the nearest point in the raw spectra to
the estimated point, causing overestimates in the error of the AMS-02 proton
source function at high energies. Note that oxygen is multiplied by a factor
of 10 for readability. The progressive flattening below $\sim 5$ GeV/$n$ is
due to modulation effects in the solar wind which were not accounted for.

The reversed NLB-model.—We now reverse the roles of the two regions in our
analysis with the source region having a constant residence time
$\tilde{\tau}_{S}$ and the interstellar medium governed by some energy
dependent residence time $\tilde{\tau}_{G}(E)$ as one of the possibilities
[44, 34] suggested by Adriani et al. [18, 19]. The prescription is much the
same as before except now it is $\tilde{\tau}_{G}(E)$ being varied to minimize
the source function of B. We maintain our previous choice of $n_{H,G}=1$ and
$n_{H,S}=200$. To ensure cosmic rays traverse the same grammage in the source
region as they had in the interstellar medium from the standard scenario we
take $\tilde{\tau}_{S}=\tau_{G}/200=1.82\times 10^{11}$ s. The source
functions, $\tilde{\mathbf{Q}}_{S}$, are shown in Figure 4.

Figure 4: Source spectra obtained in the alternative model with energy
dependent leakage from the interstellar medium. Unusually flat source spectra
$\sim E^{-1.7}$ are needed in this model. Note that around 200 GeV/$n$ this
model becomes problematic. This is because all the energy dependence in the
B/C ratio in the alternate model requires a rapidly declining lifetime
$\tilde{\tau}_{G}(E)$. (This problem at high energies can not be easily
remedied, see discussion below.)

  1. 1.

In contrast with the NLB model, here the source spectra are extremely flat and
have indices of $\sim-1.7$ because $\tilde{\tau}_{G}(E)\sim E^{-1}$.

  2. 2.

The source spectra become indeterminate at energies above $\sim 100$ GeV/$n$
because $\tilde{\tau}_{G}(E)$ in the interstellar medium drops sharply towards
zero above 100 GeV/$n$ (similar to $\tau_{S}(E)$ shown in Figure 2). This very
small escape time from the Galaxy essentially implies that at high energies as
soon as cosmic rays leak out from their source region they also leave the
Galaxy. Accordingly the sources in the reversed model have to put out a very
large amount of power in cosmic rays at high energies in order to generate the
observed intensities.

Discussion of the results.— In this paper a new method of analyzing the
spectra and composition of cosmic rays has been presented and the emphasis has
been on the methodology rather than precisely fitting the observed spectra.

  1. 1.

The main conclusion that emerges is that the dominant part of the energy-
dependent portion of the grammage is in the cocoon and the leakage of cosmic
rays from the Galaxy is constant or weakly dependent on energy.

  2. 2.

We now turn to the unexpected behavior of the source spectra in the reversed
nested leaky-box model where the energy dependent component of the B/C ratio,
$R_{1}(E)$, is attributed to spallation effects in the interstellar medium.

    1. a)

Here, the residence time in the Galaxy $\tilde{\tau}_{G}(E)$ has to steeply
decline with energy at energies beyond $\sim 100$ GeV/$n$ where $R_{1}(E)$
becomes very small and the constant component $R_{A}$ from the sources
dominates. As a consequence in order to generate the observed spectra the
source spectra ought to be very flat or even increasing with energy. As the
calculated residence times, $\tau$, are equally applicable to all the
different elements, the steepness of $\tilde{\tau}(E)$ becomes especially
clear in the case of the spectrum of protons which suffer much smaller
reduction in nuclear interactions.

    2. b)

The difficulty addressed above in item a) can not be ameliorated by assuming a
small constant lifetime in the interstellar medium at $E>200$ GeV/$n$. In this
situation, $\tilde{\tau}_{S}$ and $\tilde{\tau}_{G}(E)$ will both be constant
and the injected spectrum will rapidly change from $\sim E^{-1.7}$ towards the
observed spectrum $\sim E^{-2.7}$.

    3. c)

This difficulty is avoided in the standard nested leaky-box model because,
$\mathbf{Q}_{G}(E)=\mathbf{N}_{S}(E)/\tau_{S}(E)$ and as
$\mathbf{N}_{S}(E)\sim\mathbf{Q}_{S}(E)\tau_{S}(E)$ at high energies where
spallation effects are small (and for protons at almost all energies),
$\mathbf{Q}_{G}(E)$ sensibly becomes independent of $\tau_{S}(E)$ at high
energies.

  3. 3.

An intuitive understanding of $\tau(E)$ being much steeper than $R(E)$ can be
gained by looking at a scenario with only two elements, say B and C, escaping
from a single region - the interstellar medium. The transport equations yield
the results:

$C(E)=\frac{Q_{C}(E)\cdot\tau(E)}{1+c\tau(E)\sigma_{CC}n_{H}}$ (8)
$B(E)=C(E)\cdot\frac{c\tau(E)\sigma_{CB}n_{H}}{1+c\tau(E)\sigma_{BB}n_{H}}$
(9)
$R(E)=\frac{B(E)}{C(E)}=\frac{c\tau(E)\sigma_{CB}n_{H}}{1+c\tau(E)\sigma_{BB}n_{H}}$
(10)
$\displaystyle\begin{split}\tau(E)&=\frac{R(E)}{cn_{H}(\sigma_{CB}-R(E)\sigma_{BB})}\\\
&=\frac{R(E)}{cn_{H}\sigma_{BB}(R_{x}-R(E))}\end{split}$ (11)

with $R_{x}=\frac{\sigma_{CB}}{\sigma_{BB}}\approx 0.14$. Note that as $E$
decreases $R(E)$ increases towards $R_{x}$ and as a consequence $\tau(E)$
increases rapidly at low energies. Thus in all models $\tau(E)$ is always a
steeper function of energy than $R(E)$, which becomes a constant independent
of $\tau(E)$ at $R(E)\approx R_{x}$.

  4. 4.

The results presented here are for the energy-independent partial and total
cross-sections, $\sigma_{ij}$ and $\sigma_{ii}$. Both the absolute value and
the energy dependence of the cross-sections will affect the values and energy
dependence of $\tau(E)$ and the spectral indices of the calculated spectra.
Improved cosmic-ray observations and accurate measurements of the cross-
sections up to several 1000 GeV/$n$ are needed.

  5. 5.

The constant grammage in the interstellar medium corresponding to $R_{A}$ is
$\sim 2$ g cm-2, and this is just about adequate to generate the flux of
positrons and anti-protons observed in Galactic cosmic rays. The steeply
decreasing grammage corresponding to $R_{1}(E)$, does not contribute
significantly to the antiparticle $(\bar{p}\ \mathrm{and}\ e^{+})$ fluxes at
high energies because of the production-kinematics [31, 32, 33].

  6. 6.

A few avenues for future investigations:

    1. a)

The steeply declining $\tau_{S}(E)$ in the cocoons need to be addressed on the
basis of transport theory. In this context Reichherzer et al. [45] have shown
that the quasi-linear theory of particle transport is valid only when the
ratio of the random component in the magnetic fields $\Delta B$ to the
background field $B$ is below $0.05$. Observations of Galactic fields yield
$\Delta B/B\approx 1$; the diffusion constant increases rapidly (even for
smaller $\Delta B/B\approx 1$) to $E^{+1}$ behavior, or equivalently
$\tau(E)\sim E^{-1}$. Secondly, Shroer et al. [46, 47] have already shown that
cocoons around cosmic-ray sources do form due to particle-field interactions.
It will be useful to apply the Green-Taylor-Kubo formalism developed by
Reichherzer et al. to understand the particle transport in the cocoon. It is
also relevant to note that the diffusion constant in the interplanetary medium
responsible for modulation depends linearly or as a steeper function of
rigidity [40, 41, 42, 43].

    2. b)

Similarly, the near constancy of $\tau_{G}$ has also to be placed on a
theoretical footing - Reichherzer et al [45] and other authors [48, 49, 50]
have evoked a convection or advection of cosmic rays in this context. Also
Parker [51, 52] has noted that instabilities cause magnetic flux tubes
inflated by cosmic-ray pressure to emerge out of the Galactic plane. As this
happens the interstellar gas slides down forming clouds and the cosmic rays
escape into the intergalactic medium.

    3. c)

It will be interesting to repeat the present analysis by including all the
nuclides at least up to and including Fe.

## References

  * Cowsik  _et al._ [1966] R. Cowsik, Y. Pal, S. Tandon, and R. Verma, 3° k blackbody radiation and leakage lifetime of cosmic-ray electrons, Physical Review Letters 17, 1298 (1966).
  * Cowsik  _et al._ [1967] R. Cowsik, Y. Pal, S. N. Tandon, and R. P. Verma, Steady State of Cosmic-Ray Nuclei—Their Spectral Shape and Path Length at Low Energies, Phys. Rev. 158, 1238 (1967).
  * Cesarsky [1980] C. J. Cesarsky, Cosmic-ray confinement in the galaxy, Annual review of astronomy and astrophysics 18, 289 (1980).
  * Cowsik and Wilson [1973] R. Cowsik and L. W. Wilson, Is the residence time of cosmic rays in the galaxy energy-dependent?, in  _International Cosmic Ray Conference_ , Vol. 1 (1973) p. 500.
  * Cowsik and Wilson [1975] R. Cowsik and L. W. Wilson, The nested leaky-box model for galactic cosmic rays, in  _Proceedings from the 14th International Cosmic Ray Conference, held in München, Germany, 15-29 August, 1975. Volume 2 (OG Session)., p. 659_ , Vol. 2 (1975) p. 659.
  * Cowsik [2016] R. Cowsik, Positrons and antiprotons in galactic cosmic rays, Annual Review of Nuclear and Particle Science 66, 297 (2016).
  * Moskalenko and Strong [1998] I. V. Moskalenko and A. Strong, Production and propagation of cosmic-ray positrons and electrons, The Astrophysical Journal 493, 694 (1998).
  * Maurin  _et al._ [2001] D. Maurin, F. Donato, R. Taillet, and P. Salati, Cosmic rays below z= 30 in a diffusion model: new constraints on propagation parameters, The Astrophysical Journal 555, 585 (2001).
  * Strong  _et al._ [2007] A. W. Strong, I. V. Moskalenko, and V. S. Ptuskin, Cosmic-ray propagation and interactions in the galaxy, Annu. Rev. Nucl. Part. Sci. 57, 285 (2007).
  * Blasi [2009] P. Blasi, Origin of the positron excess in cosmic rays, Physical Review Letters 103, 051104 (2009).
  * Maccione  _et al._ [2011] L. Maccione, C. Evoli, D. Gaggero, and D. Grasso, Dragon: galactic cosmic ray diffusion code, Astrophysics source code library , ascl (2011).
  * Serpico [2012] P. D. Serpico, Astrophysical models for the origin of the positron “excess”, Astroparticle Physics 39, 2 (2012).
  * Blasi [2013] P. Blasi, The origin of galactic cosmic rays, The Astronomy and Astrophysics Review 21, 1 (2013).
  * Burch and Cowsik [2013] B. Burch and R. Cowsik, Properties of galactic dark matter: Constraints from astronomical observations, The Astrophysical Journal 779, 35 (2013).
  * Gaggero  _et al._ [2013] D. Gaggero, L. Maccione, G. Di Bernardo, C. Evoli, and D. Grasso, Three-dimensional model of cosmic-ray lepton propagation reproduces data from the alpha magnetic spectrometer on the international space station, Physical Review Letters 111, 021102 (2013).
  * Mertsch and Sarkar [2014] P. Mertsch and S. Sarkar, Ams-02 data confront acceleration of cosmic ray secondaries in nearby sources, Physical Review D 90, 061301 (2014).
  * Jóhannesson  _et al._ [2016] G. Jóhannesson, R. R. de Austri, A. Vincent, I. Moskalenko, E. Orlando, T. Porter, A. Strong, R. Trotta, F. Feroz, P. Graff, _et al._ , Bayesian analysis of cosmic ray propagation: Evidence against homogeneous diffusion, The Astrophysical Journal 824, 16 (2016).
  * Adriani  _et al._ [2020] O. Adriani _et al._ (CALET Collaboration), Direct Measurement of the Cosmic-Ray Carbon and Oxygen Spectra from $10\text{ }\text{ }\mathrm{GeV}/n$ to $2.2\text{ }\text{ }\mathrm{TeV}/n$ with the Calorimetric Electron Telescope on the International Space Station, Phys. Rev. Lett. 125, 251102 (2020).
  * Adriani  _et al._ [2022] O. Adriani _et al._ (CALET Collaboration), Cosmic-Ray Boron Flux Measured from $8.4\text{ }\text{ }\mathrm{GeV}/n$ to $3.8\text{ }\text{ }\mathrm{TeV}/n$ with the Calorimetric Electron Telescope on the International Space Station, Phys. Rev. Lett. 129, 251103 (2022).
  * Engelmann  _et al._ [1990] J. Engelmann, P. Ferrando, A. Soutoul, P. Goret, E. Juliusson, L. Koch-Miramond, N. Lund, P. Masse, B. Peters, N. Petrou, _et al._ , Charge composition and energy spectra of cosmic-ray nuclei for elements from Be to NI-Results from HEAO-3-C2, Astronomy and Astrophysics 233, 96 (1990).
  * Swordy  _et al._ [1990] S. P. Swordy, D. Mueller, P. Meyer, J. L’Heureux, and J. M. Grunsfeld, Relative abundances of secondary and primary cosmic rays at high energies, The Astrophysical Journal 349, 625 (1990).
  * Ahn  _et al._ [2008] H. Ahn, P. Allison, M. Bagliesi, J. Beatty, G. Bigongiari, P. Boyle, T. Brandt, J. Childers, N. Conklin, S. Coutu, _et al._ , Measurements of cosmic-ray secondary nuclei at high energies with the first flight of the CREAM balloon-borne experiment, Astroparticle Physics 30, 133 (2008).
  * Ahn  _et al._ [2009] H. Ahn, P. Allison, M. Bagliesi, L. Barbier, J. Beatty, G. Bigongiari, T. Brandt, J. Childers, N. Conklin, S. Coutu, _et al._ , Energy spectra of cosmic-ray nuclei at high energies, The Astrophysical Journal 707, 593 (2009).
  * Panov  _et al._ [2009] A. Panov, J. H. Adams, H. Ahn, G. Bashinzhagyan, J. Watts, J. Wefel, J. Wu, O. Ganel, T. Guzik, V. Zatsepin, _et al._ , Energy spectra of abundant nuclei of primary cosmic rays from the data of ATIC-2 experiment: Final results, Bulletin of the Russian Academy of Sciences: Physics 73, 564 (2009).
  * Obermeier  _et al._ [2012] A. Obermeier, P. Boyle, J. Hörandel, and D. Müller, The boron-to-carbon abundance ratio and Galactic propagation of cosmic radiation, The Astrophysical Journal 752, 69 (2012).
  * Adriani  _et al._ [2014] O. Adriani, G. Barbarino, G. Bazilevskaya, R. Bellotti, M. Boezio, E. Bogomolov, M. Bongi, V. Bonvicini, S. Bottai, A. Bruno, _et al._ , Measurement of boron and carbon fluxes in cosmic rays with the PAMELA experiment, The Astrophysical Journal 791, 93 (2014).
  * Aguilar  _et al._ [2018] M. Aguilar, L. A. Cavasonza, G. Ambrosi, L. Arruda, N. Attig, S. Aupetit, P. Azzarello, A. Bachlechner, F. Barao, A. Barrau, _et al._ , Observation of new properties of secondary cosmic rays lithium, beryllium, and boron by the alpha magnetic spectrometer on the international space station, Physical review letters 120, 021101 (2018).
  * Aguilar  _et al._ [2021] M. Aguilar _et al._ , The Alpha Magnetic Spectrometer (AMS) on the international space station: Part II — Results from the first seven years, Physics Reports 894, 1 (2021), the Alpha Magnetic Spectrometer (AMS) on the International Space Station: Part II - Results from the First Seven Years.
  * Aloisio  _et al._ [2015] R. Aloisio, P. Blasi, and P. Serpico, Nonlinear cosmic ray Galactic transport in the light of AMS-02 and Voyager data, Astronomy & Astrophysics 583, A95 (2015).
  * Tomassetti [2012] N. Tomassetti, Origin of the cosmic-ray spectral hardening, The Astrophysical Journal Letters 752, L13 (2012).
  * Cowsik and Burch [2010] R. Cowsik and B. Burch, Positron fraction in cosmic rays and models of cosmic-ray propagation, Physical Review D 82, 023009 (2010).
  * Cowsik  _et al._ [2014] R. Cowsik, B. Burch, and T. Madziwa-Nussinov, The origin of the spectral intensities of cosmic-ray positrons, The Astrophysical Journal 786, 124 (2014).
  * Cowsik and Madziwa-Nussinov [2016] R. Cowsik and T. Madziwa-Nussinov, Spectral intensities of antiprotons and the nested leaky-box model for cosmic rays in the galaxy, The Astrophysical Journal 827, 119 (2016).
  * Evoli  _et al._ [2019] C. Evoli, R. Aloisio, and P. Blasi, Galactic cosmic rays after the ams-02 observations, Physical Review D 99, 103023 (2019).
  * Evoli  _et al._ [2020] C. Evoli, G. Morlino, P. Blasi, and R. Aloisio, Ams-02 beryllium data and its implication for cosmic ray transport, Physical Review D 101, 023013 (2020).
  * Aguilar  _et al._ [2016] M. Aguilar _et al._ (AMS Collaboration), Precision measurement of the boron to carbon flux ratio in cosmic rays from 1.9 gv to 2.6 tv with the alpha magnetic spectrometer on the international space station, Phys. Rev. Lett. 117, 231102 (2016).
  * Note [1] https://galprop.stanford.edu/.
  * Note [2] https://www-nds.iaea.org/exfor/.
  * Boesgaard [1976] A. Boesgaard, Stellar abundances of lithium, beryllium, and boron., Publications of the Astronomical Society of the Pacific 88, 353 (1976).
  * Fujii  _et al._ [2003] Z. Fujii, F. McDonald, and H. Moraal, Cosmic ray diffusion coefficients in the outer heliosphere at solar maximum, Advances in Space Research 32, 639 (2003).
  * Komori [2005] Y. Komori, Calet observations of galactic electrons in the heliosphere, in  _International Cosmic Ray Conference Pune_ , Vol. 2 (2005) pp. 453–456.
  * Potgieter [2013] M. S. Potgieter, Solar modulation of cosmic rays, Living Reviews in Solar Physics 10, 1 (2013).
  * Caballero-Lopez  _et al._ [2019] R. Caballero-Lopez, N. Engelbrecht, and J. Richardson, Correlation of long-term cosmic-ray modulation with solar activity parameters, The Astrophysical Journal 883, 73 (2019).
  * Korsmeier and Cuoco [2021] M. Korsmeier and A. Cuoco, Implications of lithium to oxygen ams-02 spectra on our understanding of cosmic-ray diffusion, Physical Review D 103, 103016 (2021).
  * Reichherzer  _et al._ [2022] P. Reichherzer, L. Merten, J. Dörner, J. Becker Tjus, M. Pueschel, and E. Zweibel, Regimes of cosmic-ray diffusion in galactic turbulence, SN Applied Sciences 4, 15 (2022).
  * Schroer  _et al._ [2021] B. Schroer, O. Pezzi, D. Caprioli, C. Haggerty, and P. Blasi, Dynamical effects of cosmic rays on the medium surrounding their sources, The Astrophysical Journal Letters 914, L13 (2021).
  * Schroer  _et al._ [2022] B. Schroer, O. Pezzi, D. Caprioli, C. Haggerty, and P. Blasi, Cosmic-ray generated bubbles around their sources, Monthly Notices of the Royal Astronomical Society 512, 233 (2022).
  * Skilling [1971] J. Skilling, Cosmic rays in the galaxy: Convection or diffusion?, Astrophysical Journal, vol. 170, p. 265 170, 265 (1971).
  * Jokipii [1976] J. Jokipii, Consequences of a lifetime greater than 10 to the 7th power years for galactic cosmic rays, Astrophysical Journal, vol. 208, Sept. 15, 1976, pt. 1, p. 900-902. 208, 900 (1976).
  * Ptuskin  _et al._ [1997] V. Ptuskin, H. Völk, V. Zirakashvili, and D. Breitschwerdt, Transport of relativistic nucleons in a galactic wind driven by cosmic rays., Astronomy and Astrophysics, v. 321, p. 434-443 321, 434 (1997).
  * Parker [1966] E. Parker, The dynamical state of the interstellar gas and field, Astrophysical Journal, vol. 145, p. 811 145, 811 (1966).
  * Parker [1969] E. Parker, Galactic effects of the cosmic-ray gas, Space Science Reviews 9, 651 (1969).