Title: Implementation of Traceroute In Java
1Implementation of Traceroute In Java
- Instructor Dr. Byrav Rammurthy
Present by Sheng Zhang
Xueming Wu
2Outline
- Introduction
- Implementation
- Eveluation
- Conclusion
3How Traceroute Work
- ICMP_TIMXCEED
- ICMP_UNREACH_PORT or ICMP_UNREACH_PROTOCOL
4How Traceroute Work
5Socket
6Socket
if ((pe getprotobyname("icmp"))
NULL) return -3
if ((c_rcvsock socket(AF_INET, SOCK_RAW,
pe-gtp_proto)) lt 0) return -4
if ((c_sndsock socket(AF_INET,
SOCK_RAW, IPPROTO_RAW)) lt 0)
close(c_rcvsock) c_rcvsock 0
return -5
7Java Native Iterface
8Java Native Iterface
public native int inittrroute(int
sockets) static
try System.loadLibrary("TrNat")
catch (UnsatisfiedLinkError e)
System.err.println("Can't Find Library")
catch (SecurityException e)
System.err.println("Can't Load
Library...Security Violation")
.. rc trobj.inittrroute(s
ockets)
9Java Native Iterface
// mtrace method public native int
inittrroute(int sockets) JNIEXPORT jint
JNICALL Java_mtrace_inittrroute (JNIEnv env,
jobject thisObj, jintArray sockets)
10Evaluation
11Conclusion
- a great opportunity
- can be evolved to a useful tool