udp client: destination port unreachable question

Discussion in 'Java' started by vlyamtsev@gmail.com, May 13, 2007.

  1. Guest

    Hello,
    My question is concerned with java.net package. I used trivial
    UDPClient example to send datagrams from local interface eth1 on Linux
    to the ip host not included into local route table and I tried to
    capture outgoing udp traffic on interface eth1. I've got IOException
    "ICMP: destination unreachable" and I only could capture outgoing
    packets on loopback interface ( with Ethereal). Can someone help to
    resolve my confusion: I thought UDP is "connectionless", e.g. will be
    sent regardless. What does ICMP have to do with it and why does this
    traffic appear on loopback interface?
    Thank you,
     
    , May 13, 2007
    #1
    1. Advertising

  2. Esmond Pitt Guest

    wrote:
    > Hello,
    > My question is concerned with java.net package. I used trivial
    > UDPClient example to send datagrams from local interface eth1 on Linux
    > to the ip host not included into local route table and I tried to
    > capture outgoing udp traffic on interface eth1. I've got IOException
    > "ICMP: destination unreachable" and I only could capture outgoing
    > packets on loopback interface ( with Ethereal). Can someone help to
    > resolve my confusion: I thought UDP is "connectionless", e.g. will be
    > sent regardless. What does ICMP have to do with it and why does this
    > traffic appear on loopback interface?


    err, because the destination host is unreachable? Where would you expect
    UDP to send the packet *to* if there is no unicast route to the target?

    You get the ICMP response if you have used DatagramSocket.connect(). If
    you avoid that and put the destination address into the DatagramPacket,
    you won't get the exception, but the packet still won't go out as there
    is no unicast route. If that's what you want.
     
    Esmond Pitt, May 13, 2007
    #2
    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. Lincoln Yeoh
    Replies:
    1
    Views:
    1,025
    Ben Morrow
    Nov 12, 2003
  2. Gerald Klix
    Replies:
    0
    Views:
    1,325
    Gerald Klix
    Oct 26, 2005
  3. Satya

    Destination Unreachable --> WSE817:

    Satya, Jan 5, 2007, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    390
    Satya
    Jan 5, 2007
  4. Gavin Yap
    Replies:
    3
    Views:
    254
    Tanaka Akira
    Feb 7, 2009
  5. Lincoln Yeoh
    Replies:
    0
    Views:
    126
    Lincoln Yeoh
    Oct 17, 2003
Loading...

Share This Page