Home All Groups Group Topic Archive Search About
Author
28 Mar 2005 1:13 PM
Bernd
hi,

is it possible to use a Socket (proto_udp) and recieve icmp messages ?
what i want to do is, send a datagram to a remote host/port and check if
the host replies with port_unreachable (i think icmp type 3).
is this possible with a udp Socket and the RecieveFrom() method ?.
another approach would be (at least thats what i think) to use a raw
socket with proto_udp.
is this a wrong way to go ?

thanks

Author
28 Mar 2005 10:54 PM
Andy Schmidt
Bernd schrieb:
> hi,
>
> is it possible to use a Socket (proto_udp) and recieve icmp messages ?
> what i want to do is, send a datagram to a remote host/port and check if
> the host replies with port_unreachable (i think icmp type 3).
> is this possible with a udp Socket and the RecieveFrom() method ?.
> another approach would be (at least thats what i think) to use a raw
> socket with proto_udp.
> is this a wrong way to go ?
>
> thanks

Hi,

hhmmm, I think ICMP messages are not sent through UDP. So, I'm not sure
but I think its not possible to do that with a UDP Socket.

Yours sincerely

Andy
Are all your drivers up to date? click for free checkup

Author
29 Mar 2005 11:51 AM
Bernd
Andy Schmidt schrieb:
Show quoteHide quote
> Bernd schrieb:
>
>> hi,
>>
>> is it possible to use a Socket (proto_udp) and recieve icmp messages ?
>> what i want to do is, send a datagram to a remote host/port and check if
>> the host replies with port_unreachable (i think icmp type 3).
>> is this possible with a udp Socket and the RecieveFrom() method ?.
>> another approach would be (at least thats what i think) to use a raw
>> socket with proto_udp.
>> is this a wrong way to go ?
>>
>> thanks
>
>
> Hi,
>
> hhmmm, I think ICMP messages are not sent through UDP. So, I'm not sure
> but I think its not possible to do that with a UDP Socket.
>
> Yours sincerely
>
> Andy


ok, thanks for your answer. and yes you are right, icmp is not sent
through udp.
would it be possible to work with 2 sockets ? lets say i create an udp
socket, send a dgram and recieve the reply with a raw socket
proto_type_icmp ?

thanks
Author
29 Mar 2005 6:23 PM
Andy Schmidt
Bernd schrieb:
Show quoteHide quote
>
>
> Andy Schmidt schrieb:
>
>>Bernd schrieb:
>>
>>
>>>hi,
>>>
>>>is it possible to use a Socket (proto_udp) and recieve icmp messages ?
>>>what i want to do is, send a datagram to a remote host/port and check if
>>>the host replies with port_unreachable (i think icmp type 3).
>>>is this possible with a udp Socket and the RecieveFrom() method ?.
>>>another approach would be (at least thats what i think) to use a raw
>>>socket with proto_udp.
>>>is this a wrong way to go ?
>>>
>>>thanks
>>
>>
>>Hi,
>>
>>hhmmm, I think ICMP messages are not sent through UDP. So, I'm not sure
>>but I think its not possible to do that with a UDP Socket.
>>
>>Yours sincerely
>>
>>Andy
>
>
>
> ok, thanks for your answer. and yes you are right, icmp is not sent
> through udp.
> would it be possible to work with 2 sockets ? lets say i create an udp
> socket, send a dgram and recieve the reply with a raw socket
> proto_type_icmp ?
>
> thanks

Hi,

ok, I've looked in W. Richard Stevens book "TCP/IP Volume 1" and found
out, that you can use the UDP Socket to receive the ICMP reply of your
sent datagram. In the ICMP message the IP-Header and the first 8 bytes
of the IP-Data are transmitted. And Stevens wrote: the ICMP module can
assiciate with this information an UDP Port and respectivly a process
with the ICMP reply.

Yours sincerely

Andy

Bookmark and Share