LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   why linux traceroute use UDP instead of ICMP ? (https://www.linuxquestions.org/questions/linux-networking-3/why-linux-traceroute-use-udp-instead-of-icmp-815625/)

laginagesh 06-22-2010 05:27 AM

why linux traceroute use UDP instead of ICMP ?
 
hi,

Why linux traceroute uses UDP protocol, we have basic ICMP protocol which is used in MS-windows tracert.
Any specific use of traceroute using with UDP,TCP than ICMP?

Windows is displaying all HOPs address but linux printing *.*.*

Please explain the reason.

cheers
Nagesh

jschiwal 06-22-2010 06:07 AM

Take a look at the manpage. If you want, you can use the -I option to use ICMP ECHO instead of UDP packets. However, you need to do so as root. The default can be performed by a regular user.

laginagesh 06-22-2010 06:20 AM

Quote:

traceroute to www.google.com (208.67.219.231), 30 hops max, 60 byte packets
1 192.168.199.2 (192.168.199.2) 4.295 ms 6.278 ms *
2 * * *
3 * * *
4 * * *
5 * * *
6 * google.navigation.opendns.com (208.67.219.231) 261.634 ms 273.154 ms
in the same network windows PC is displaying all HOP addresses.

what is advantage of using UDP over ICMP?

cheers
Nagesh

jschiwal 06-22-2010 07:23 AM

The advantage is that you don't need to be the root user. In your example, the route was incomplete. Using the -I option, you get all of the addresses.
Code:


Note: the -i and -I options were exchangedfor compability with LBL traceroute
Use -I for ICMP, and -i <ifname> to specify the interface name
traceroute to www.google.com (208.67.216.231), 30 hops max, 40 byte packets using ICMP
...
 6  te-4-4.car2.Seattle1.Level3.net (4.53.146.117)  68.047 ms  66.934 ms  65.645 ms
 7  ae-24-52.car4.Seattle1.Level3.net (4.68.105.37)  64.521 ms  63.325 ms  125.364 ms
 8  SPLICE-COMM.car4.Seattle1.Level3.net (4.71.156.130)  148.759 ms  148.715 ms  147.622 ms
 9  208.67.216.231 (208.67.216.231)  146.415 ms  145.330 ms  144.241 ms


laginagesh 06-28-2010 03:36 AM

if ICMP requires root permission then "PING" also using ICMP but ping not requires root privileges.ping works for all users.

jefro 06-28-2010 03:00 PM

ICMP tends to be a router or switch setting that may be selected to be dropped when traffic numbers reach a pre-determined point. Say when tcp traffic is 40% limit icmp traffic. ICMP would be a very subjective traffic on any network that you don't fully control.

laginagesh 06-29-2010 12:07 AM

could you please explain clearly...
"ping & traceroute -I using ICMP packets but why traceroute -I requires root why not for ping"

zirias 06-29-2010 01:33 AM

Quote:

Originally Posted by laginagesh (Post 4016961)
if ICMP requires root permission then "PING" also using ICMP but ping not requires root privileges.ping works for all users.

Sure it does! /bin/ping is installed suid-root, so any user can execute it with superuser privileges. I guess this is considered acceptable for such a small utility...

jork 06-30-2010 03:21 PM

no specific answer with me but my opinion.

ICMP echo request/replies are normally blocked on the routers/gateways. So if you use the echo request for traceroute, you wont get a proper reply most of the time. But it will work perfectly if you use UDP/TCP way.

HTH,
-jork


All times are GMT -5. The time now is 10:38 AM.