nearest router

Discussion in 'Java' started by stephane.chouinard.ptelebel@gmail.com, Nov 3, 2006.

  1. Guest

    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
     
    , Nov 3, 2006
    #1
    1. Advertising

  2. Guest

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

    wrote:
    > 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
     
    , Nov 3, 2006
    #2
    1. Advertising

  3. Mark Space Guest

    wrote:
    > The nearest router is the default gateway. There are some commands that
    > shows that, may be you can invoke the in your java programme.
    >
    > wrote:
    >> 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

    >


    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.
     
    Mark Space, Nov 3, 2006
    #3
  4. Guest

    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 ?


    wrote:
    > The nearest router is the default gateway. There are some commands that
    > shows that, may be you can invoke the in your java programme.
    >
    > wrote:
    > > 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
     
    , Nov 3, 2006
    #4
  5. Daniel Pitts Guest

    wrote:
    > 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 ?
    >
    >
    > wrote:
    > > The nearest router is the default gateway. There are some commands that
    > > shows that, may be you can invoke the in your java programme.
    > >
    > > wrote:
    > > > 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


    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.
     
    Daniel Pitts, Nov 3, 2006
    #5
  6. Guest

    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
    Daniel Pitts wrote:
    > wrote:
    > > 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 ?
    > >
    > >
    > > wrote:
    > > > The nearest router is the default gateway. There are some commands that
    > > > shows that, may be you can invoke the in your java programme.
    > > >
    > > > wrote:
    > > > > 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

    >
    > 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.
     
    , Nov 3, 2006
    #6
  7. Daniel Pitts Guest

    Top posting corrected...
    wrote:
    > Daniel Pitts wrote:
    > > wrote:
    > > > 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 ?
    > > >
    > > >
    > > > wrote:
    > > > > The nearest router is the default gateway. There are some commands that
    > > > > shows that, may be you can invoke the in your java programme.
    > > > >
    > > > > wrote:
    > > > > > 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

    > >
    > > 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.

    > 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.
     
    Daniel Pitts, Nov 3, 2006
    #7
  8. steve Guest

    On Sat, 4 Nov 2006 04:12:30 +0800,
    wrote
    (in article <>):

    > 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 ?
    >
    >
    > wrote:
    >> The nearest router is the default gateway. There are some commands that
    >> shows that, may be you can invoke the in your java programme.
    >>
    >> wrote:
    >>> 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

    >


    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
     
    steve, Nov 3, 2006
    #8
  9. wrote:
    > 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
     
    Patricia Shanahan, Nov 4, 2006
    #9
  10. writes:

    > 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.]

    --
    Mark Jeffcoat
    Austin, TX
     
    Mark Jeffcoat, Nov 4, 2006
    #10
  11. Mark Jeffcoat wrote:
    > writes:
    >
    >> 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.


    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.]
     
    Patricia Shanahan, Nov 4, 2006
    #11
  12. Mark Space Guest


    > thanks anyway
    > Daniel Pitts wrote:
    >> wrote:
    >>> 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 ?
    >>>
    >>>
    >>> wrote:
    >>>> The nearest router is the default gateway. There are some commands that
    >>>> shows that, may be you can invoke the in your java programme.
    >>>>
    >>>> wrote:
    >>>>> 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

    >> 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.

    >


    wrote:
    > 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.
     
    Mark Space, Nov 4, 2006
    #12
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steve
    Replies:
    5
    Views:
    42,721
    Steve
    May 17, 2004
  2. Fred
    Replies:
    3
    Views:
    63,558
  3. nkunapa

    XPATH Nearest Node

    nkunapa, Apr 5, 2005, in forum: XML
    Replies:
    2
    Views:
    878
    nkunapa
    Apr 11, 2005
  4. Greg Young [MVP]

    Re: rounding values to the nearest 5 or 10

    Greg Young [MVP], Apr 27, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    475
    Greg Young [MVP]
    Apr 27, 2006
  5. chaz
    Replies:
    0
    Views:
    388
Loading...

Share This Page