EscalateQuotaRPCsPerFrame

EscalateQuotaRPCsPerFrame

#Overview

name: EscalateQuotaRPCsPerFrame

The value of this variable can be defined or overridden in .ini config files. 1 .ini config file referencing this setting variable.

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of EscalateQuotaRPCsPerFrame is to set a threshold for the number of Remote Procedure Calls (RPCs) allowed per frame before triggering the next stage of Denial of Service (DoS) detection in Unreal Engine’s networking system.

This setting variable is primarily used by the networking subsystem of Unreal Engine, specifically in the DoS detection module. Based on the callsites, it’s part of the Engine module and is utilized in the RPCDoSDetection system.

The value of this variable is set through configuration, as indicated by the UPROPERTY(config) decorator in the header file. It’s likely set in an .ini configuration file or through project settings.

EscalateQuotaRPCsPerFrame interacts with other variables in the DoS detection system, such as EscalateTimeQuotaMSPerFrame, EscalateQuotaRPCsPerPeriod, and EscalateQuotaTimePeriod. These variables work together to define thresholds for detecting potential DoS attacks.

Developers must be aware that:

  1. A value of -1 (the default) likely means the feature is disabled.
  2. Setting this value too low might trigger false positives, while setting it too high might allow actual DoS attacks to go undetected.
  3. This variable is part of a larger DoS detection system and should be configured in conjunction with other related variables.

Best practices when using this variable include:

  1. Carefully tuning the value based on the specific needs and characteristics of your game’s networking requirements.
  2. Testing thoroughly with various network conditions to ensure the setting doesn’t impact normal gameplay.
  3. Monitoring logs and server performance to adjust the value if necessary.
  4. Considering this setting in relation to other DoS detection settings for a comprehensive protection strategy.
  5. Documenting any changes made to this setting and the rationale behind them for future reference.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEngine.ini:1730, section: [RPCDoSDetection.Normal]

#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:136

Scope (from outer to inner):

file
function     bool FRPCDoSState::HasHitQuota_Count

Source code excerpt:

bool FRPCDoSState::HasHitQuota_Count(const FRPCDoSCounters(&PerPeriodHistory)[16], FRPCDoSCounters& InFrameCounter) const
{
	bool bReturnVal = EscalateQuotaRPCsPerFrame > 0 && InFrameCounter.RPCCounter >= EscalateQuotaRPCsPerFrame;

#if RPC_QUOTA_DEBUG
	UE_CLOG(bReturnVal, LogNet, Log, TEXT("HasHitQuota_Count: Hit Frame Quota: RPCCounter: %i, Limit: %i"),
			InFrameCounter.RPCCounter, EscalateQuotaRPCsPerFrame);
#endif

	if (EscalateQuotaRPCsPerPeriod > 0 && !bReturnVal)
	{
		const FRPCDoSCounters& PeriodCounter = PerPeriodHistory[EscalateQuotaTimePeriod - 1];

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Net/RPCDoSDetection.cpp:313

Scope (from outer to inner):

file
function     void FRPCDoSStateConfig::ApplyState

Source code excerpt:

	Target.bKickPlayer						= bKickPlayer;
	Target.bTrackRecentRPCs					= bTrackRecentRPCs;
	Target.EscalateQuotaRPCsPerFrame		= EscalateQuotaRPCsPerFrame;
	Target.EscalateTimeQuotaMSPerFrame		= EscalateTimeQuotaMSPerFrame;
	Target.EscalateQuotaRPCsPerPeriod		= EscalateQuotaRPCsPerPeriod;
	Target.EscalateTimeQuotaMSPerPeriod		= EscalateTimeQuotaMSPerPeriod;
	Target.EscalateQuotaTimePeriod			= EscalateQuotaTimePeriod;
	Target.RPCRepeatLimitPerPeriod			= RPCRepeatLimitPerPeriod;
	Target.RPCRepeatLimitMSPerPeriod		= RPCRepeatLimitMSPerPeriod;

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/Net/RPCDoSDetection.h:192

Scope: file

Source code excerpt:

	/** The number of RPC's per frame before the next stage of DoS detection is triggered */
	UPROPERTY(config)
	int16 EscalateQuotaRPCsPerFrame		= -1;

	/** The amount of time spent executing RPC's per frame, before the next stage of DoS detection is triggered */
	UPROPERTY(config)
	int16 EscalateTimeQuotaMSPerFrame	= -1;

	/** The number of RPC's per EscalateQuotaPeriod before the next stage of DoS detection is triggered */