aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-08-14 22:33:12 +0100
committerJustin Clark-Casey (justincc)2013-08-14 22:33:12 +0100
commit93dffe17773ee5af552ac64a7902f66d8acac1b3 (patch)
treebbd5d0cb44a63d7eb94eedf008ceeeb96b8f2175 /OpenSim/Region
parentCount any incoming packet that could not be recognized as an LLUDP packet as ... (diff)
downloadopensim-SC_OLD-93dffe17773ee5af552ac64a7902f66d8acac1b3.zip
opensim-SC_OLD-93dffe17773ee5af552ac64a7902f66d8acac1b3.tar.gz
opensim-SC_OLD-93dffe17773ee5af552ac64a7902f66d8acac1b3.tar.bz2
opensim-SC_OLD-93dffe17773ee5af552ac64a7902f66d8acac1b3.tar.xz
Add stat clientstack.<scene>.IncomingPacketsOrphanedCount to record well-formed packets that were not initial connection packets and could not be associated with a connected viewer.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs33
1 files changed, 29 insertions, 4 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
index 553250c..102e581 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
@@ -121,6 +121,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP
121 121
122 StatsManager.RegisterStat( 122 StatsManager.RegisterStat(
123 new Stat( 123 new Stat(
124 "IncomingPacketsOrphanedCount",
125 "Number of inbound packets that were not initial connections packets and could not be associated with a viewer.",
126 "",
127 "",
128 "clientstack",
129 scene.Name,
130 StatType.Pull,
131 MeasuresOfInterest.AverageChangeOverTime,
132 stat => stat.Value = m_udpServer.IncomingOrphanedPacketCount,
133 StatVerbosity.Info));
134
135 StatsManager.RegisterStat(
136 new Stat(
124 "OutgoingUDPSendsCount", 137 "OutgoingUDPSendsCount",
125 "Number of UDP sends performed", 138 "Number of UDP sends performed",
126 "", 139 "",
@@ -287,6 +300,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
287 public int IncomingMalformedPacketCount { get; private set; } 300 public int IncomingMalformedPacketCount { get; private set; }
288 301
289 /// <summary> 302 /// <summary>
303 /// Record how many inbound packets could not be associated with a simulator circuit.
304 /// </summary>
305 public int IncomingOrphanedPacketCount { get; private set; }
306
307 /// <summary>
290 /// Record current outgoing client for monitoring purposes. 308 /// Record current outgoing client for monitoring purposes.
291 /// </summary> 309 /// </summary>
292 private IClientAPI m_currentOutgoingClient; 310 private IClientAPI m_currentOutgoingClient;
@@ -1206,7 +1224,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1206 1224
1207 if ((IncomingMalformedPacketCount % 10000) == 0) 1225 if ((IncomingMalformedPacketCount % 10000) == 0)
1208 m_log.WarnFormat( 1226 m_log.WarnFormat(
1209 "[LLUDPSERVER]: Received {0} malformed packets so far, probable network attack. Last malformed was from {1}", 1227 "[LLUDPSERVER]: Received {0} malformed packets so far, probable network attack. Last was from {1}",
1210 IncomingMalformedPacketCount, endPoint); 1228 IncomingMalformedPacketCount, endPoint);
1211 } 1229 }
1212 1230
@@ -1279,9 +1297,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1279 { 1297 {
1280 if (IncomingMalformedPacketCount < 100) 1298 if (IncomingMalformedPacketCount < 100)
1281 { 1299 {
1282 m_log.ErrorFormat("[LLUDPSERVER]: Malformed data, cannot parse {0} byte packet from {1}:", 1300 m_log.WarnFormat("[LLUDPSERVER]: Malformed data, cannot parse {0} byte packet from {1}, data {2}:",
1283 buffer.DataLength, buffer.RemoteEndPoint); 1301 buffer.DataLength, buffer.RemoteEndPoint, Utils.BytesToHexString(buffer.Data, buffer.DataLength, null));
1284 m_log.Error(Utils.BytesToHexString(buffer.Data, buffer.DataLength, null));
1285 } 1302 }
1286 1303
1287 RecordMalformedInboundPacket(endPoint); 1304 RecordMalformedInboundPacket(endPoint);
@@ -1323,6 +1340,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1323 if (!m_scene.TryGetClient(endPoint, out client) || !(client is LLClientView)) 1340 if (!m_scene.TryGetClient(endPoint, out client) || !(client is LLClientView))
1324 { 1341 {
1325 //m_log.Debug("[LLUDPSERVER]: Received a " + packet.Type + " packet from an unrecognized source: " + address + " in " + m_scene.RegionInfo.RegionName); 1342 //m_log.Debug("[LLUDPSERVER]: Received a " + packet.Type + " packet from an unrecognized source: " + address + " in " + m_scene.RegionInfo.RegionName);
1343
1344 IncomingOrphanedPacketCount++;
1345
1346 if ((IncomingOrphanedPacketCount % 10000) == 0)
1347 m_log.WarnFormat(
1348 "[LLUDPSERVER]: Received {0} orphaned packets so far. Last was from {1}",
1349 IncomingOrphanedPacketCount, endPoint);
1350
1326 return; 1351 return;
1327 } 1352 }
1328 1353