EscalateQuotaRPCsPerPeriod
EscalateQuotaRPCsPerPeriod
#Overview
name: EscalateQuotaRPCsPerPeriod
The value of this variable can be defined or overridden in .ini config files. 5
.ini config files referencing this setting variable.
It is referenced in 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of EscalateQuotaRPCsPerPeriod is to set a threshold for the number of Remote Procedure Calls (RPCs) allowed within a specific time period before triggering the next stage of Denial of Service (DoS) detection in Unreal Engine 5.
This setting variable is primarily used by the Unreal Engine’s networking subsystem, specifically within the DoS detection module. It is part of the RPC DoS detection mechanism, which aims to prevent potential abuse of the networking system.
The value of this variable is likely set through configuration files or programmatically within the engine’s initialization process. It is defined as a config property in the FRPCDoSStateConfig struct, indicating that it can be set in configuration files.
EscalateQuotaRPCsPerPeriod interacts with several other variables, including:
- EscalateQuotaTimePeriod: Defines the time period for which the RPC quota is measured.
- EscalateTimeQuotaMSPerPeriod: Sets a time-based quota for RPC execution.
- InFrameCounter and PerPeriodHistory: Used to track the actual RPC counts.
Developers should be aware that:
- Setting this variable to -1 effectively disables the RPC count-based escalation.
- The value should be carefully tuned based on the expected legitimate RPC usage in the game to avoid false positives.
- It works in conjunction with time-based quotas, so both should be considered when configuring DoS detection.
Best practices when using this variable include:
- Set a reasonable value based on profiling of normal game behavior.
- Use in combination with EscalateTimeQuotaMSPerPeriod for more robust DoS detection.
- Test thoroughly with various network conditions to ensure it doesn’t interfere with normal gameplay.
- Monitor and adjust based on real-world data after deployment.
- Consider different values for different game modes or player counts if necessary.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEngine.ini:1735, section: [RPCDoSDetection.Hitch]
- INI Section:
RPCDoSDetection.Hitch
- Raw value:
512
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseEngine.ini:1743, section: [RPCDoSDetection.Burst]
- INI Section:
RPCDoSDetection.Burst
- Raw value:
1024
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseEngine.ini:1754, section: [RPCDoSDetection.PersistentBurst]
- INI Section:
RPCDoSDetection.PersistentBurst
- Raw value:
2048
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseEngine.ini:1767, section: [RPCDoSDetection.DoS]
- INI Section:
RPCDoSDetection.DoS
- Raw value:
4096
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseEngine.ini:1783, section: [RPCDoSDetection.ExpensiveDoS]
- INI Section:
RPCDoSDetection.ExpensiveDoS
- Raw value:
32768
- 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:124
Scope (from outer to inner):
file
function void FRPCDoSState::ApplyImpliedValues
Source code excerpt:
void FRPCDoSState::ApplyImpliedValues()
{
EscalateQuotaTimePeriod = (EscalateQuotaRPCsPerPeriod != -1 || EscalateTimeQuotaMSPerPeriod != -1) ? EscalateQuotaTimePeriod : -1;
RPCRepeatLimitTimePeriod = (RPCRepeatLimitPerPeriod != -1 || RPCRepeatLimitMSPerPeriod != -1) ? RPCRepeatLimitTimePeriod : -1;
bTrackRecentRPCs = bTrackRecentRPCs || (RPCRepeatLimitPerPeriod != -1 && RPCRepeatLimitTimePeriod != -1);
EscalateTimeQuotaSecsPerFrame = (EscalateTimeQuotaMSPerFrame != -1 ? (EscalateTimeQuotaMSPerFrame / 1000.0) : 0.0);
EscalateTimeQuotaSecsPerPeriod = (EscalateTimeQuotaMSPerPeriod != -1 ? (EscalateTimeQuotaMSPerPeriod / 1000.0) : 0.0);
RPCRepeatLimitSecsPerPeriod = (RPCRepeatLimitMSPerPeriod != -1 ? (RPCRepeatLimitMSPerPeriod / 1000.0) : 0.0);
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Net/RPCDoSDetection.cpp:143
Scope (from outer to inner):
file
function bool FRPCDoSState::HasHitQuota_Count
Source code excerpt:
#endif
if (EscalateQuotaRPCsPerPeriod > 0 && !bReturnVal)
{
const FRPCDoSCounters& PeriodCounter = PerPeriodHistory[EscalateQuotaTimePeriod - 1];
bReturnVal = PeriodCounter.RPCCounter + InFrameCounter.RPCCounter >= EscalateQuotaRPCsPerPeriod;
#if RPC_QUOTA_DEBUG
UE_CLOG(bReturnVal, LogNet, Log, TEXT("HasHitQuota_Count: Hit Period Quota: RPCsPerPeriodCounter: %i, Limit: %i"),
(PeriodCounter.RPCCounter + InFrameCounter.RPCCounter), EscalateQuotaRPCsPerPeriod);
#endif
}
return bReturnVal;
}
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Net/RPCDoSDetection.cpp:286
Scope (from outer to inner):
file
function void FRPCDoSStateConfig::ValidateConfig
Source code excerpt:
ValidateTimePeriod(EscalateQuotaTimePeriod, TEXT("EscalateQuotaTimePeriod"),
(EscalateQuotaRPCsPerPeriod > 0 || EscalateTimeQuotaMSPerPeriod > 0));
ValidateTimePeriod(RPCRepeatLimitTimePeriod, TEXT("RPCRepeatLimitTimePeriod"),
(RPCRepeatLimitPerPeriod > 0 || RPCRepeatLimitMSPerPeriod > 0));
if (AutoEscalateTime > 0 && AutoEscalateTime < CooloffTime)
{
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Net/RPCDoSDetection.cpp:315
Scope (from outer to inner):
file
function void FRPCDoSStateConfig::ApplyState
Source code excerpt:
Target.EscalateQuotaRPCsPerFrame = EscalateQuotaRPCsPerFrame;
Target.EscalateTimeQuotaMSPerFrame = EscalateTimeQuotaMSPerFrame;
Target.EscalateQuotaRPCsPerPeriod = EscalateQuotaRPCsPerPeriod;
Target.EscalateTimeQuotaMSPerPeriod = EscalateTimeQuotaMSPerPeriod;
Target.EscalateQuotaTimePeriod = EscalateQuotaTimePeriod;
Target.RPCRepeatLimitPerPeriod = RPCRepeatLimitPerPeriod;
Target.RPCRepeatLimitMSPerPeriod = RPCRepeatLimitMSPerPeriod;
Target.RPCRepeatLimitTimePeriod = RPCRepeatLimitTimePeriod;
Target.CooloffTime = CooloffTime;
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/Net/RPCDoSDetection.h:200
Scope: file
Source code excerpt:
/** The number of RPC's per EscalateQuotaPeriod before the next stage of DoS detection is triggered */
UPROPERTY(config)
int16 EscalateQuotaRPCsPerPeriod = -1;
/** The amount of time spent executing RPC's per EscalateQuotaPeriod, before the next stage of DoS detection is triggered */
UPROPERTY(config)
int16 EscalateTimeQuotaMSPerPeriod = -1;
/** The time period to use for determining RPC count and time escalation quotas (Max: 16) */