LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 07-12-2004, 04:55 PM   #1
nedian123
Member
 
Registered: Jun 2004
Location: PAKISTAN
Posts: 46

Rep: Reputation: 15
Unhappy plz plz help me regarding route mapping


hi,

Actually i have to count number of routers to reach a specific IP. What i did is i created a packet with the help of DatagramPacket class and used the method "setAddress(InetAddress ip)".NOTE:I m sending the packet to my self...
DatagramPacket obj3= new DatagramPacket(data1,10,obj2.getLocalHost(),25);
Now since this class sends the packet thru a connectionless facility.
therefore i didn't used the DatagramSocket function connect.
Then i used the function of class DatagramSocket the function is
send(obj3);

Now to count number of routers i have to use the abstract class DatagramSocketImpl and its method getTimeToLive() and setTimeToLive()

Since these methods are abstract what would be its implementation.......
Shall i receive that sent packet(which was sent to me by myself) how will i access its new TTL value updated by ROUTER........, with which function i will get the intermediate IP's(i.e. Router IP's)


Kindly solve my problem...............
 
Old 07-13-2004, 09:17 AM   #2
deiussum
Member
 
Registered: Aug 2003
Location: Santa Clara, CA
Distribution: Slackware
Posts: 895

Rep: Reputation: 32
Are you trying to create a traceroute type functionality? I'm not familiar with the objects you are using (are those Java objects??), but I know a bit about how trace route works.

For a typical trace route, you generally try to send a series of pings to your destination IP, with each of the pings having an incrementing time to live value. The time to live is decremented by each router that passes it on until it gets to 0. If it gets to 0, the router sends some form of a nack back.

So, you start out by sending a ping with a TTL of 1. The first router to get it will nack back. Then you send a ping with a TTL of 2. The second router will nack back. Etc. etc.

If you want more details of how traceroute works, there is probably an RFC describing it somewhere. Do a search at http://www.faqs.org/rfcs/ Also, you might be able to find the source to the linux traceroute implementation.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PLZ, PLZ help - need some info kevmif Linux - General 9 12-17-2007 07:12 AM
plz plz solve my route mapping problem nedian123 Linux - Networking 1 07-12-2004 10:41 PM
Help with this plz. Zinctek Linux - Newbie 6 05-03-2004 04:51 PM
plz, help me (plz realy ) h4ng4m3 Linux - General 10 08-18-2003 07:07 AM
redhat problems plz plz help sap666 Linux - Newbie 5 07-30-2003 11:57 AM


All times are GMT -5. The time now is 11:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration