Export (0) Print
Expand All

IPGlobalStatistics.ReceivedPacketsWithUnknownProtocol Property

Gets the number of Internet Protocol (IP) packets received on the local machine with an unknown protocol in the header.

Namespace:  System.Net.NetworkInformation
Assembly:  System (in System.dll)

public abstract long ReceivedPacketsWithUnknownProtocol { get; }

Property Value

Type: System.Int64
An Int64 value that indicates the total number of IP packets received with an unknown protocol.

The protocol field in the IP header indicates the next-level protocol used in the data portion of the IP datagram. If the protocol is not recognized, the data cannot be passed to the correct application.

The following code example displays statistics for received IP packets with errors.

public static void ShowInboundIPErrors()
{
    IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties();
    IPGlobalStatistics ipstat = properties.GetIPv4GlobalStatistics();
    Console.WriteLine("  Inbound Packet Errors:");
    Console.WriteLine("      Header Errors ....................... : {0}", 
        ipstat.ReceivedPacketsWithHeadersErrors);
    Console.WriteLine("      Address Errors ...................... : {0}", 
        ipstat.ReceivedPacketsWithAddressErrors);
    Console.WriteLine("      Unknown Protocol Errors ............. : {0}", 
        ipstat.ReceivedPacketsWithUnknownProtocol);
}
void ShowInboundIPErrors()
{
    IPGlobalProperties* properties = IPGlobalProperties::GetIPGlobalProperties();
    IPGlobalStatistics* ipstat = properties->GetIPv4GlobalStatistics();
    Console::WriteLine(S"  Inbound Packet Errors:");
    Console::WriteLine(S"      Header Errors ....................... : {0}", __box(ipstat->ReceivedPacketsWithHeadersErrors));
    Console::WriteLine(S"      Address Errors ...................... : {0}", __box(ipstat->ReceivedPacketsWithAddressErrors));
    Console::WriteLine(S"      Unknown Protocol Errors ............. : {0}", __box(ipstat->ReceivedPacketsWithUnknownProtocol));
}

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0

Community Additions

ADD
Show:
© 2015 Microsoft