EscalateQuotaDisconnPacketsPerSec

EscalateQuotaDisconnPacketsPerSec

#Overview

name: EscalateQuotaDisconnPacketsPerSec

The value of this variable can be defined or overridden in .ini config files. 2 .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 EscalateQuotaDisconnPacketsPerSec is to set a threshold for the number of recently disconnected NetConnection packets per second, beyond which the next stage of DDoS (Distributed Denial of Service) detection is triggered. This variable is part of Unreal Engine 5’s network security and DDoS protection system.

This setting variable is primarily used by the networking subsystem of Unreal Engine, specifically within the DDoS detection module. It’s referenced in the Net/Core module, which handles core networking functionalities.

The value of this variable is set through the engine’s configuration system. It’s loaded from the GEngineIni file in the InitConfig function of the FDDoSDetection class.

EscalateQuotaDisconnPacketsPerSec interacts with other DDoS detection variables such as EscalateQuotaPacketsPerSec, EscalateQuotaBadPacketsPerSec, and EscalateTimeQuotaMSPerFrame. Together, these variables form a comprehensive DDoS detection system.

Developers must be aware that this variable is crucial for balancing network security and performance. Setting it too low might trigger false positives, while setting it too high might make the system vulnerable to actual DDoS attacks.

Best practices when using this variable include:

  1. Carefully tuning its value based on the expected network traffic of your game.
  2. Testing thoroughly with various network conditions to ensure it’s not too sensitive or too lenient.
  3. Monitoring this value in conjunction with other DDoS detection variables to get a complete picture of network health.
  4. Considering the nature of your game (e.g., fast-paced multiplayer vs. slower turn-based games) when setting this value.
  5. Regularly reviewing and adjusting this value based on real-world performance and any detected attack patterns.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEngine.ini:1662, section: [DDoSDetection.Burst]

Location: <Workspace>/Engine/Config/BaseEngine.ini:1669, section: [DDoSDetection.PersistentBurst]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Net/Core/Private/Net/Core/Misc/DDoSDetection.cpp:135

Scope (from outer to inner):

file
function     void FDDoSDetection::InitConfig

Source code excerpt:

				GConfig->GetBool(*CurSection, TEXT("bSendEscalateAnalytics"), CurState.bSendEscalateAnalytics, GEngineIni);
				GConfig->GetInt(*CurSection, TEXT("EscalateQuotaPacketsPerSec"), CurState.EscalateQuotaPacketsPerSec, GEngineIni);
				GConfig->GetInt(*CurSection, TEXT("EscalateQuotaDisconnPacketsPerSec"), CurState.EscalateQuotaDisconnPacketsPerSec, GEngineIni);
				GConfig->GetInt(*CurSection, TEXT("EscalateQuotaBadPacketsPerSec"), CurState.EscalateQuotaBadPacketsPerSec, GEngineIni);
				GConfig->GetInt(*CurSection, TEXT("PacketLimitPerFrame"), CurState.PacketLimitPerFrame, GEngineIni);
				GConfig->GetInt(*CurSection, TEXT("PacketTimeLimitMSPerFrame"), CurState.PacketTimeLimitMSPerFrame, GEngineIni);
				GConfig->GetInt(*CurSection, TEXT("NetConnPacketTimeLimitMSPerFrame"), CurState.NetConnPacketTimeLimitMSPerFrame, GEngineIni);
				GConfig->GetInt(*CurSection, TEXT("CooloffTime"), CurState.CooloffTime, GEngineIni);

#Loc: <Workspace>/Engine/Source/Runtime/Net/Core/Public/Net/Core/Misc/DDoSDetection.h:71

Scope: file

Source code excerpt:


	/** The number of recently disconnected NetConnection packets/sec, before the next stage of DDoS detection is triggered. */
	int32 EscalateQuotaDisconnPacketsPerSec;

	/** The number of bad (failed to process correctly) packets/sec, before the next stage of DDoS detection is triggered */
	int32 EscalateQuotaBadPacketsPerSec;

	/** The amount of time spent processing packets, before the next stage of DDoS detection is triggered */
	int16 EscalateTimeQuotaMSPerFrame;

#Loc: <Workspace>/Engine/Source/Runtime/Net/Core/Public/Net/Core/Misc/DDoSDetection.h:95

Scope (from outer to inner):

file
function     FDDoSState

Source code excerpt:

		: bSendEscalateAnalytics(true)
		, EscalateQuotaPacketsPerSec(-1)
		, EscalateQuotaDisconnPacketsPerSec(-1)
		, EscalateQuotaBadPacketsPerSec(-1)
		, EscalateTimeQuotaMSPerFrame(-1)
		, PacketLimitPerFrame(-1)
		, PacketTimeLimitMSPerFrame(-1)
		, NetConnPacketTimeLimitMSPerFrame(-1)
		, CooloffTime(-1)

#Loc: <Workspace>/Engine/Source/Runtime/Net/Core/Public/Net/Core/Misc/DDoSDetection.h:115

Scope (from outer to inner):

file
function     bool HasHitQuota

Source code excerpt:

	{
		const bool bAtQuota = EscalateQuotaPacketsPerSec > 0 && InCounter.NonConnPacketCounter >= EscalateQuotaPacketsPerSec;
		const bool bAtDisconnQuota = EscalateQuotaDisconnPacketsPerSec > 0 && InCounter.DisconnPacketCounter >= EscalateQuotaDisconnPacketsPerSec;
		const bool bAtBadQuota = EscalateQuotaBadPacketsPerSec > 0 && InCounter.BadPacketCounter >= EscalateQuotaBadPacketsPerSec;
		const bool bAtTimeQuota = EscalateTimeQuotaMSPerFrame > 0 && TimePassedMS > EscalateTimeQuotaMSPerFrame;

		return bAtQuota || bAtDisconnQuota || bAtBadQuota || bAtTimeQuota;
	}
};

#Loc: <Workspace>/Engine/Source/Runtime/Net/Core/Public/Net/Core/Misc/DDoSDetection.h:141

Scope (from outer to inner):

file
function     void ApplyState

Source code excerpt:

		Target.bSendEscalateAnalytics				= bSendEscalateAnalytics;
		Target.EscalateQuotaPacketsPerSec			= EscalateQuotaPacketsPerSec;
		Target.EscalateQuotaDisconnPacketsPerSec	= EscalateQuotaDisconnPacketsPerSec;
		Target.EscalateQuotaBadPacketsPerSec		= EscalateQuotaBadPacketsPerSec;
		Target.EscalateTimeQuotaMSPerFrame			= EscalateTimeQuotaMSPerFrame;
		Target.PacketLimitPerFrame					= PacketLimitPerFrame;
		Target.PacketTimeLimitMSPerFrame			= PacketTimeLimitMSPerFrame;
		Target.NetConnPacketTimeLimitMSPerFrame		= NetConnPacketTimeLimitMSPerFrame;
		Target.CooloffTime							= CooloffTime;