EscalationTimeToleranceMS
EscalationTimeToleranceMS
#Overview
name: EscalationTimeToleranceMS
The value of this variable can be defined or overridden in .ini config files. 3
.ini config files referencing this setting variable.
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of EscalationTimeToleranceMS is to set a threshold for the maximum time spent executing RPCs (Remote Procedure Calls) per frame before an escalation stage is automatically confirmed for analytics in Unreal Engine’s network system.
This setting variable is primarily used in Unreal Engine’s networking subsystem, specifically in the RPC DoS (Denial of Service) detection module. It’s part of the engine’s network security features to prevent potential abuse or overload of the RPC system.
The value of this variable is set in the configuration files, as indicated by the UPROPERTY(config) macro in the header file. It’s defined as an int16 with a default value of -1.
EscalationTimeToleranceMS interacts with other variables in the RPC DoS detection system, such as EscalateQuotaRPCsPerFrame and EscalationCount. It’s converted to seconds (EscalationTimeToleranceSeconds) for internal use.
Developers must be aware that:
- A value of -1 means this feature is disabled.
- The value is in milliseconds, but it’s converted to seconds for internal use.
- This is part of a larger system for detecting and preventing RPC-based DoS attacks.
Best practices when using this variable include:
- Carefully consider the appropriate tolerance based on your game’s networking requirements and expected RPC load.
- Use in conjunction with other RPC DoS detection settings for a comprehensive protection strategy.
- Monitor analytics data to fine-tune this value based on real-world performance and any detected issues.
- Be cautious about setting this value too low, as it might lead to false positives in DoS detection.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEngine.ini:1758, section: [RPCDoSDetection.PersistentBurst]
- INI Section:
RPCDoSDetection.PersistentBurst
- Raw value:
8000
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseEngine.ini:1771, section: [RPCDoSDetection.DoS]
- INI Section:
RPCDoSDetection.DoS
- Raw value:
8000
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseEngine.ini:1787, section: [RPCDoSDetection.ExpensiveDoS]
- INI Section:
RPCDoSDetection.ExpensiveDoS
- Raw value:
8000
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Net/RPCDoSDetection.cpp:131
Scope (from outer to inner):
file
function void FRPCDoSState::ApplyImpliedValues
Source code excerpt:
EscalateTimeQuotaSecsPerPeriod = (EscalateTimeQuotaMSPerPeriod != -1 ? (EscalateTimeQuotaMSPerPeriod / 1000.0) : 0.0);
RPCRepeatLimitSecsPerPeriod = (RPCRepeatLimitMSPerPeriod != -1 ? (RPCRepeatLimitMSPerPeriod / 1000.0) : 0.0);
EscalationTimeToleranceSeconds = (EscalationTimeToleranceMS != -1 ? (EscalationTimeToleranceMS / 1000.0) : 0.0);
}
bool FRPCDoSState::HasHitQuota_Count(const FRPCDoSCounters(&PerPeriodHistory)[16], FRPCDoSCounters& InFrameCounter) const
{
bool bReturnVal = EscalateQuotaRPCsPerFrame > 0 && InFrameCounter.RPCCounter >= EscalateQuotaRPCsPerFrame;
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Net/RPCDoSDetection.cpp:643
Scope (from outer to inner):
file
function void FRPCDoSDetection::UpdateSeverity_Private
Source code excerpt:
{
NewState.bEscalationConfirmed = NewState.EscalationCount >= NewState.EscalationCountTolerance ||
(NewState.EscalationTimeToleranceMS != -1 && TickScope.FrameCounter.AccumRPCTime >= NewState.EscalationTimeToleranceSeconds);
if (NewState.bEscalationConfirmed)
{
TArray<FName> UntimedRPCs;
double RPCGroupTime = 0.0;
const int8 OldWorstState = WorstAnalyticsState;
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/Net/RPCDoSDetection.h:219
Scope: file
Source code excerpt:
/** The maximum time spent executing RPC's per frame, before this escalation stage is automatically 'confirmed' for analytics */
UPROPERTY(config)
int16 EscalationTimeToleranceMS = -1;
/** RPC Execution limits - for preventing execution of specific RPC's, after they have reached a count/time limit */
/** The limit for the number of times a single RPC can be repeated, over the time period specified by RPCRepeatTimeLimitPeriod */
UPROPERTY(config)
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/Net/RPCDoSDetection.h:257
Scope: file
Source code excerpt:
double RPCRepeatLimitSecsPerPeriod = 0.0;
/** EscalationTimeToleranceMS converted to seconds */
double EscalationTimeToleranceSeconds = 0.0;
public:
virtual ~FRPCDoSState()
{