nearest router

  • Thread starter stephane.chouinard.ptelebel
  • Start date
S

stephane.chouinard.ptelebel

hi !

I would like to know if there is a way to retrieve the ip or the name
of the nearest router when we send a socket ?

thanks
 
N

nikosft

The nearest router is the default gateway. There are some commands that
shows that, may be you can invoke the in your java programme.
 
M

Mark Space

The nearest router is the default gateway. There are some commands that
shows that, may be you can invoke the in your java programme.

You could also try traceroute. Check the implementation to see how it's
done.

Assuming the default gateway is the nearest router sounds reasonable in
most cases to me. There may be a few unusual configurations when it's
not, but you've got to be able to reach the default gateway, regardless,
or most packets aren't going to route at all.
 
S

stephane.chouinard.ptelebel

hi !

is there a java command or a property that I can check ?

probably i can use traceroute, but it will be difficult because i use a
pocket pc ?
 
D

Daniel Pitts

hi !

is there a java command or a property that I can check ?

probably i can use traceroute, but it will be difficult because i use a
pocket pc ?

Maybe knowing why you need this, we'd be able to give more help.
Generally with network programming, you're not supposed to care/know
about the route. Information is generally sent in the form of
"packets" into a black box (the internet) and comes out the other side
in the same packet form.

If you really must know the first IP in the route, then you need to
find a system specific way (try a networking newsgroup maybe?) and
implement it using JNI or an external process call.
 
S

stephane.chouinard.ptelebel

Hi,

I will try with a network newsgroup, but I sent my question here
because i'am doing an homework in java. The reason I would like to know
the first router (nearest one) is because i want to be able to know
where is the person with the pocket pc. I was supposed to do something
with infrared access point but the project aborded. So i was thinking
that maybe it was possible to do something with the ip data from the
network. Like, my pocket pc can send a packet in a specified interval
of time to a server and the server or the pocket pc could determine the
position with the info. from the nearest router. In the university we
are using wireless network...

thanks anyway
 
D

Daniel Pitts

Top posting corrected...
Hi,

I will try with a network newsgroup, but I sent my question here
because i'am doing an homework in java. The reason I would like to know
the first router (nearest one) is because i want to be able to know
where is the person with the pocket pc. I was supposed to do something
with infrared access point but the project aborded. So i was thinking
that maybe it was possible to do something with the ip data from the
network. Like, my pocket pc can send a packet in a specified interval
of time to a server and the server or the pocket pc could determine the
position with the info. from the nearest router. In the university we
are using wireless network...

thanks anyway

Please don't top post, makes it harder to follow conversations...

Sounds like an interesting project. If the pocket pc was configured
with GPS, it might be easier :).
Unfortunatly, I don't know anything about Pocket PC, but you might look
for a way to interface with the OS and ask it about the current
wireless connection.
 
S

steve

hi !

is there a java command or a property that I can check ?

probably i can use traceroute, but it will be difficult because i use a
pocket pc ?

It all depends on if the router wants to expose it's self, many routers are
in a stealth mode, I.E they are basically invisible to a trace program, it
depends on what you are trying to do , and how important it is that you get
your next hop address.

steve
 
P

Patricia Shanahan

Hi,

I will try with a network newsgroup, but I sent my question here
because i'am doing an homework in java. The reason I would like to know
the first router (nearest one) is because i want to be able to know
where is the person with the pocket pc. I was supposed to do something
with infrared access point but the project aborded. So i was thinking
that maybe it was possible to do something with the ip data from the
network. Like, my pocket pc can send a packet in a specified interval
of time to a server and the server or the pocket pc could determine the
position with the info. from the nearest router. In the university we
are using wireless network...

If you are trying to find locations of devices, based on wireless access
points and similar, I strongly recommend looking into the Placelab
project, http://placelab.org/.

Patricia
 
M

Mark Jeffcoat

Hi,

I will try with a network newsgroup, but I sent my question here
because i'am doing an homework in java. The reason I would like to know
the first router (nearest one) is because i want to be able to know
where is the person with the pocket pc. I was supposed to do something
with infrared access point but the project aborded. So i was thinking
that maybe it was possible to do something with the ip data from the
network. Like, my pocket pc can send a packet in a specified interval
of time to a server and the server or the pocket pc could determine the
position with the info. from the nearest router. In the university we
are using wireless network...

Wow. Are you trying to triangulate the position of the
handheld computer by timing the response from multiple
wireless routers? Because that would be a sexy project,
though extremely ambitious if you don't already have a
rough idea of what you're doing.

Seems unlikely that the the timing difference would
map very well to physical differences, though, since
the actual travel time of the signals is negligible.
Maybe you'd end up with some sort of interference map?

Ping estimates timings with ICMP, which Java definitely
doesn't natively support. You'd need to go through JNI,
or find some library that wraps the JNI for you.


[Sigh. On my fourth reading of the post I'm replying
to, I've decided that the original poster probably
just wants to figure out, say, which building the
pocket pc is in based on which router it's connected
to. I just can't throw away the (hopeless) triangulation
idea; I live in a house with two wireless routers and
a Treo I lose all the time.]
 
P

Patricia Shanahan

Mark said:
Wow. Are you trying to triangulate the position of the
handheld computer by timing the response from multiple
wireless routers? Because that would be a sexy project,
though extremely ambitious if you don't already have a
rough idea of what you're doing.

I don't think signal travel times would be very good. As well as the
issues you mention, any reflections would really mess things up. Most of
the systems I've read about or been involved in use either signal
strengths, or the set of access points with signals above a threshold.

Of course, GPS does use signal travel time, but the beacons are very
accurate clocks, and transmit timing signals so that a GPS receiver can
measure the differences in travel times extremely precisely.
Seems unlikely that the the timing difference would
map very well to physical differences, though, since
the actual travel time of the signals is negligible.
Maybe you'd end up with some sort of interference map?

Ping estimates timings with ICMP, which Java definitely
doesn't natively support. You'd need to go through JNI,
or find some library that wraps the JNI for you.


[Sigh. On my fourth reading of the post I'm replying
to, I've decided that the original poster probably
just wants to figure out, say, which building the
pocket pc is in based on which router it's connected
to. I just can't throw away the (hopeless) triangulation
idea; I live in a house with two wireless routers and
a Treo I lose all the time.]

There has been a lot of research on finding location from wireless
access point measurements. The Placelab publications page,
http://placelab.org/publications/, is a good starting point for seeing
the current state of the art.

Usually, location is driven off signal strengths, or the set of visible
beacons. Millions of access points have already been mapped - see
http://wigle.net/

Indoor location in office buildings does have problems with reflections
and variations in signal strength due to walls, floors, metal beams, etc.

The ActiveCampus project, which does indoor location using 802.11
wireless access points, has arrangements for user-entered corrections to
deal with some of those problems.

For a general description of ActiveCampus, see W. G. Griswold, P.
Shanahan, S. W. Brown, R. Boyer, M. Ratto, R. B. Shapiro, and T. M.
Truong, "ActiveCampus - Experiments in Community-Oriented Ubiquitous
Computing", IEEE Computer, Vol. 37, No. 10., pp. 73-81, October 2004.

Generally, 802.11 works much better than cell phones, but cell phones
are rapidly displacing 802.11 equipped PDAs as the common handheld
device. There is some hope for combined cell and 802.11 devices being
able to find themselves accurately.

Patricia

[Who should be getting on with her ubiquitous computing research instead
of reading newsgroups.]
 
M

Mark Space

thanks anyway

> Hi,
>
> I will try with a network newsgroup, but I sent my question here
> because i'am doing an homework in java. The reason I would like to know
> the first router (nearest one) is because i want to be able to know
> where is the person with the pocket pc. I was supposed to do something
> with infrared access point but the project aborded. So i was thinking
> that maybe it was possible to do something with the ip data from the
> network. Like, my pocket pc can send a packet in a specified interval
> of time to a server and the server or the pocket pc could determine the
> position with the info. from the nearest router. In the university we
> are using wireless network...
>

Hmm, I think "do something" is the problem here. Do what? You're a
coder in search of a customer.

I think first you should investigate Java thoroughly. You'll have to
know it really well if you are going to do tricky networking. Next
you'll have to figure out exactly what it is you want to do.

Java is a very high level language. Think further up the computer food
chain. Determining locations of close-by systems is relatively low
level. You should also check out some books on TCP/IP to learn it
better. Not programming books, per se, but books on how TCP/IP works.
Something like The Protocols (TCP/IP Illustrated, Volume 1) by W.
Richard Stevens .

Anyway, a neat app might be a Java applet than anyone can download on
their PC (pocket or otherwise) and chat over the wireless network.
It'll need a central server to send all the chat messages to and
download the app from.

Good luck.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top