LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-22-2010, 05:27 AM   #1
laginagesh
Member
 
Registered: Jul 2009
Posts: 42

Rep: Reputation: 16
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
 
Old 06-22-2010, 06:07 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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.
 
Old 06-22-2010, 06:20 AM   #3
laginagesh
Member
 
Registered: Jul 2009
Posts: 42

Original Poster
Rep: Reputation: 16
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
 
Old 06-22-2010, 07:23 AM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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
 
Old 06-28-2010, 03:36 AM   #5
laginagesh
Member
 
Registered: Jul 2009
Posts: 42

Original Poster
Rep: Reputation: 16
if ICMP requires root permission then "PING" also using ICMP but ping not requires root privileges.ping works for all users.
 
Old 06-28-2010, 03:00 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625
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.
 
Old 06-29-2010, 12:07 AM   #7
laginagesh
Member
 
Registered: Jul 2009
Posts: 42

Original Poster
Rep: Reputation: 16
could you please explain clearly...
"ping & traceroute -I using ICMP packets but why traceroute -I requires root why not for ping"
 
Old 06-29-2010, 01:33 AM   #8
zirias
Member
 
Registered: Jun 2010
Posts: 361

Rep: Reputation: 59
Quote:
Originally Posted by laginagesh View Post
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...
 
Old 06-30-2010, 03:21 PM   #9
jork
LQ Newbie
 
Registered: Jun 2010
Location: beweth
Distribution: Ubuntu, RHEL, Monta Vista, QNX
Posts: 16

Rep: Reputation: 0
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[kernel, ICMP] How to modify traceroute server end behavior anwarspl@hotmail.com Linux - Networking 2 07-16-2009 11:53 AM
ICMP in Kernel: how to modify server end of traceroute anwarspl@hotmail.com Linux - Kernel 1 07-15-2009 10:06 AM
How to receive UDP and ICMP packets, by one UDP socket(PMTUD) myself_rajat Linux - Networking 0 05-28-2004 05:43 AM
Terms re icmp, udp, etc. satimis Linux - Networking 2 09-22-2003 11:22 PM
traceroute + Udp? dunkyb Linux - Security 1 02-18-2003 01:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration