Trace route example

How to use traceroute to see how many hops it takes to get to a web server . This requires the C2G traceroute component , you can get it here .

<%
Set trace = CreateObject("C2G.Tracert")
Set hops = CreateObject("C2G.Hop")
strURL = Request.Form("trace")
If Trace.trace("www.google.com", 1,64,TRUE) Then
For Each hop in trace
str = str + cstr(hop.number) + " "
str = str + cstr(hop.rtt) + " "
str = str + hop.HostIP + " "
str = str + hop.hostname + " "
Response.Write "<BR> " & str
Next
Else
Response.Write "Ping failed due to error: " & str(c2g.LastError)
End if
%>

 

Sponsors