}//public string TimeoutReply

  /// <summary>ButtonSubnetMask_Click().</summary>
  public void ButtonSubnetMask_Click
  (
   Object sender, 
   EventArgs e
  )
  {

   int          socketHostAvailable            =  -1;
   int          socketHostAvailableTimeElapse  =  -1;   
   int          socketHostAvailableTimeOut     =  -1;

   String       exceptionMessage  = null;
   
   IPAddress    iPAddressSubnetMask            =  null;

   UtilityICMP  utilityICMPPacketRequest       =  null;
   UtilityICMP  utilityICMPPacketResponse      =  null;

   if ( TimeoutReply != null && TimeoutReply != String.Empty )
   {
    socketHostAvailableTimeOut = System.Convert.ToInt32( TimeoutReply );
   }
   
   UtilitySubnetMask.SubnetMask
   (
    ref  exceptionMessage,
    ref  iPAddressSubnetMask,
    ref  utilityICMPPacketRequest,
    ref  utilityICMPPacketResponse,
    ref  socketHostAvailable,
    ref  socketHostAvailableTimeOut,
    ref  socketHostAvailableTimeElapse
   );

   Feedback = exceptionMessage;
   
   if ( exceptionMessage != null )
   {
    return;
   }
   
   Response.Write( iPAddressSubnetMask );
   Response.Write( utilityICMPPacketRequest );
   Response.Write( utilityICMPPacketResponse );
   Response.Write( socketHostAvailable );
   Response.Write( socketHostAvailableTimeOut );
   Response.Write( socketHostAvailableTimeElapse );

 
  }//public void ButtonSubnetMask_Click()
  }//public static void Main( String argv[] )
  	
  ///<summary>SubnetMask.</summary>
  ///<param name="exceptionMessage">exceptionMessage.</param>
  ///<param name="iPAddressSubnetMask">IPAddressSubnetMask.</param>
  ///<param name="utilityICMPPacketRequest">utilityICMPPacketRequest.</param>
  ///<param name="utilityICMPPacketResponse">utilityICMPPacketResponse.</param>
  ///<param name="socketHostAvailable">socketHostAvailable</param>
  ///<param name="socketHostAvailableTimeOut">socketHostAvailableTimeOut.</param>
  ///<param name="socketHostAvailableTimeElapse">socketHostAvailableTimeElapse.</param>  
  public static void SubnetMask
  (
   ref String       exceptionMessage,
   ref IPAddress    iPAddressSubnetMask,
   ref UtilityICMP  utilityICMPPacketRequest,
   ref UtilityICMP  utilityICMPPacketResponse,
   ref int          socketHostAvailable,
   ref int          socketHostAvailableTimeOut,
   ref int          socketHostAvailableTimeElapse
  )
  {
   byte[]           byteData                       =  null;
   
   int              utilityICMPPacketRequestSize   =  -1;   
   int              byteReceive                    =  -1; 
   int              socketHostAvailableTimeFrom    =  0;
   int              socketHostAvailableTimeUntil   =  0;
   
   long             utilityICMPPacketAnswer        =  -1;
   
   StringBuilder    stringBuilderExceptionMessage  =  null;

   UInt16           checkSum;        
   
   EndPoint         endPoint                       =  null;
   IPEndPoint       iPEndPoint                     =  null;
   Socket           socketHost                     =  null;
   
   byteData                                        =  new byte[1024];
   
   iPAddressSubnetMask                             =  null;
   utilityICMPPacketRequest                        =  null;
   utilityICMPPacketResponse                       =  null;
   socketHostAvailable                             =  -1;
   
   stringBuilderExceptionMessage                   =  new StringBuilder();
   
   try
   {

    socketHost = new Socket
    (
     AddressFamily.InterNetwork, 
     SocketType.Raw, 
     ProtocolType.Icmp
    );
  
    iPEndPoint = new IPEndPoint
    (
     IPAddress.Broadcast, 
     0
    );
      
    endPoint = ( EndPoint ) iPEndPoint;
      
    utilityICMPPacketRequest = new UtilityICMP();

    utilityICMPPacketRequest.Type = 0x11;
    utilityICMPPacketRequest.Code = 0x00;
    utilityICMPPacketRequest.Checksum = 0;
    Buffer.BlockCopy
    (
     BitConverter.GetBytes(1),
     0,
     utilityICMPPacketRequest.Message, 
     0,
     2
    );
    Buffer.BlockCopy
    (
     BitConverter.GetBytes(1),
     0,
     utilityICMPPacketRequest.Message,
     2,
     2
    );
    Buffer.BlockCopy
    (
     BitConverter.GetBytes(0),
     0,
     utilityICMPPacketRequest.Message,
     4,
     4
    );

    utilityICMPPacketRequest.MessageSize = 8;
    utilityICMPPacketRequestSize = utilityICMPPacketRequest.MessageSize + 4;
    
    //The GetChecksum() method should set the Checksum property.
    checkSum = utilityICMPPacketRequest.GetChecksum();
    utilityICMPPacketRequest.Checksum = checkSum;

    socketHost.SetSocketOption
    (
     SocketOptionLevel.Socket, 
     SocketOptionName.ReceiveTimeout,
     3000
    );
    
    socketHost.SetSocketOption
    (
     SocketOptionLevel.Socket,
     SocketOptionName.Broadcast,
     1
    );
    
    socketHost.SendTo
    (
     utilityICMPPacketRequest.GetBytes(), 
     utilityICMPPacketRequestSize, 
     SocketFlags.None, 
     iPEndPoint
    );

    byteData = new byte[1024];
    
    if ( socketHost.Available <= 0 )
    {
     socketHostAvailableTimeFrom = Environment.TickCount;
     while ( socketHost.Available == 0 && Environment.TickCount - socketHostAvailableTimeFrom <= socketHostAvailableTimeOut )
     {
     }//while ( socketHost.Available == 0 && Environment.TickCount - socketHostAvailableTimeFrom <= socketHostAvailableTimeOut )
    }//if ( socketHost.Available < 0 )
     
    socketHostAvailable           = socketHost.Available;
    socketHostAvailableTimeUntil  = Environment.TickCount;
    socketHostAvailableTimeElapse = socketHostAvailableTimeUntil - socketHostAvailableTimeFrom;
    
    byteReceive = socketHost.ReceiveFrom
    (
         byteData, 
     ref endPoint
    );

    utilityICMPPacketResponse = new 
    UtilityICMP
    (
     byteData, 
     byteReceive
    );

    utilityICMPPacketAnswer = BitConverter.ToUInt32
    (
     utilityICMPPacketResponse.Message,
     4
    );

    iPAddressSubnetMask = new IPAddress
    ( 
     utilityICMPPacketAnswer
    );

   }//Try 
   catch ( SocketException socketException )
   {
    exceptionMessage = "SocketException: " + socketException.Message;
    stringBuilderExceptionMessage.AppendFormat
    (
     FormatSocketException,
     socketException.ErrorCode,
     socketHostAvailable, 
     socketException.Message,
     byteReceive
    );
    exceptionMessage = stringBuilderExceptionMessage.ToString(); 
    System.Console.WriteLine( stringBuilderExceptionMessage );
   }//catch ( SocketException socketException )
   catch ( Exception exception )
   {
    exceptionMessage = "Exception: " + exception.Message;
    System.Console.WriteLine
    (
     "Exception: {0}",
     exception.Message
    );
   }//catch ( Exception exception )
   finally
   {
    if ( socketHost != null )
    {
     socketHost.Close();
    }//if ( socketHost != null )
   }//finally
   
  }//public static void SubnetMask()
  ///<summary>The entry point for the application.</summary>
  ///<param name="argv">A list of command line arguments</param>
  public static void Main
  (
   String[] argv
  )
  {

   int          socketHostAvailable            =  -1;
   int          socketHostAvailableTimeOut     =  200000;
   int          socketHostAvailableTimeElapse  =  -1;

   String       exceptionMessage               =  null;

   IPAddress    iPAddressSubnetMask            =  null;

   UtilityICMP  utilityICMPPacketRequest       =  null;
   UtilityICMP  utilityICMPPacketResponse      =  null;
   
   if 
   ( 
    argv.Length > ArgumentSocketHostAvailableTimeOut && 
    argv[ArgumentSocketHostAvailableTimeOut] != null &&
    argv[ArgumentSocketHostAvailableTimeOut] != String.Empty
   )
   {
    socketHostAvailableTimeOut = System.Convert.ToInt32( argv[ArgumentSocketHostAvailableTimeOut] );
   }
   
   SubnetMask
   (
    ref  exceptionMessage,
    ref  iPAddressSubnetMask,
    ref  utilityICMPPacketRequest,
    ref  utilityICMPPacketResponse,
    ref  socketHostAvailable,
    ref  socketHostAvailableTimeOut,
    ref  socketHostAvailableTimeElapse
   );

   if ( exceptionMessage != null )
   {
    return;
   }
   	
   #if (DEBUG)
    System.Console.WriteLine
    (
     "ICMP Response Type: {0} | IP Address Subnet Mask: {1}", 
     utilityICMPPacketResponse.Type,
     iPAddressSubnetMask.ToString()
    );
   #endif

   #if ( DEBUG )       
    System.Console.WriteLine
    (
     "Socket Host Available: {0} bytes | Timeout: {1} | Elapse: {2}", 
     socketHostAvailable,
     socketHostAvailableTimeOut,
     socketHostAvailableTimeElapse
    );
   #endif

  }//public static void Main( String argv[] )
  }//public static void Main( String argv[] )
  	
  ///<summary>TraceRoute.</summary>
  ///<param name="hostNameTarget">HostName target.</param>
  ///<param name="exceptionMessage">Exception message</param>
  ///<param name="iPHostEntry">IPHostEntry</param>
  ///<param name="maximumHops">MaximumHops</param>
  ///<param name="hopCount">Hop count</param>
  ///<param name="iCMPTimeExceeded">ICMPTimeExceeded</param>
  ///<param name="timeoutReply">Timeout Reply</param>
  public static void TraceRoute
  (
   ref String       hostNameTarget,
   ref String       exceptionMessage,
   ref IPHostEntry  iPHostEntry,
   ref int          maximumHops,
   ref int          hopCount,
   ref int          iCMPTimeExceeded,
   ref int          timeoutReply
  )
  {
   byte[]       byteData           = null;
   int          packetsize;   
   int          receive; 
   int          timestart;
   int          timestop;

   UInt16       checkSum;        
   
   EndPoint     endPoint                  =  null;
   IPEndPoint   iPEndPoint                =  null;
   Socket       socketHost                =  null;
   UtilityICMP  utilityICMPPacketRequest  =  null;
   UtilityICMP  utilityICMPPacketResponse =  null;
   exceptionMessage                       =  null;

   if ( maximumHops < 0 )
   {
    maximumHops = MaximumHops;
   }

   hopCount         = 0;
   iCMPTimeExceeded = -1;

   try
   {
    byteData    = new byte[1024];
    socketHost  = new Socket( AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.Icmp );
   
    if ( hostNameTarget == null || hostNameTarget == String.Empty )
    {
     hostNameTarget = IPAddress.Loopback.ToString();
    }
 	
    iPHostEntry = Dns.Resolve ( hostNameTarget );
    iPEndPoint  = new IPEndPoint ( iPHostEntry.AddressList[0], 0 );
    endPoint = ( EndPoint ) iPEndPoint;
    utilityICMPPacketRequest = new UtilityICMP();

    utilityICMPPacketRequest.Type = 0x08;
    utilityICMPPacketRequest.Code = 0x00;
    utilityICMPPacketRequest.Checksum = 0;
    Buffer.BlockCopy(BitConverter.GetBytes(1), 0, utilityICMPPacketRequest.Message, 0, 2);
    Buffer.BlockCopy(BitConverter.GetBytes(1), 0, utilityICMPPacketRequest.Message, 2, 2);
    byteData = Encoding.ASCII.GetBytes("test utilityICMPPacketRequest");
    Buffer.BlockCopy(byteData, 0, utilityICMPPacketRequest.Message, 4, byteData.Length);
    utilityICMPPacketRequest.MessageSize = byteData.Length + 4;
    packetsize = utilityICMPPacketRequest.MessageSize + 4;

    checkSum = utilityICMPPacketRequest.GetChecksum();
    utilityICMPPacketRequest.Checksum = checkSum;
    
    socketHost.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, 3000);

    for ( hopCount = 1; hopCount < maximumHops; hopCount++ )
    {
     socketHost.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.IpTimeToLive, hopCount);
     timestart = Environment.TickCount;
     socketHost.SendTo
     (
      utilityICMPPacketRequest.GetBytes(), 
      packetsize, 
      SocketFlags.None, 
      iPEndPoint
     );
     byteData = new byte[1024];
     receive = socketHost.ReceiveFrom(byteData, ref endPoint);
     timestop = Environment.TickCount;
     utilityICMPPacketResponse = new UtilityICMP(byteData, receive);
     if ( utilityICMPPacketResponse.Type == 11 )
     {
      System.Console.WriteLine("hop {0}: utilityICMPPacketResponse from {1}, {2}ms", hopCount, endPoint.ToString(), timestop-timestart);
     }//if ( utilityICMPPacketResponse.Type == 11 ) 
     if ( utilityICMPPacketResponse.Type == 0 )
     {
      //System.Console.WriteLine("{0} reached in {1} hops, {2}ms.", endPoint.ToString(), hopCount, timestop-timestart);
      iCMPTimeExceeded = timestop-timestart;
      break;
     }//if ( utilityICMPPacketResponse.Type == 0 )
     if ( timeoutReply > 0 )
     {
      Thread.Sleep( timeoutReply );
     }
    }//for ( hopCount = 1; hopCount < maximumHops; hopCount++ ) 
   }//try
   catch ( SocketException socketException )
   {
    exceptionMessage = "SocketException: " + socketException.Message;
    System.Console.WriteLine
    (
     "Socket Exception: {0} | Hop {1}",
     socketException.Message,
     hopCount
    );
   }//catch ( SocketException socketException )
   catch ( Exception exception )
   {
    exceptionMessage = "Exception: " + exception.Message;
    System.Console.WriteLine
    (
     "Exception: {0} | Hop {1}",
     exception.Message,
     hopCount
    );
   }//catch ( Exception exception )
   finally
   {
    if ( socketHost != null )
    {
     socketHost.Close();
    }//if ( socketHost != null )
   }//finally
  }//public static void TraceRoute()