networking/icmp

networking/icmp

Post by Martin Birte » Sun, 01 Aug 1999 04:00:00



Hi!
I want to write a program like traceroute monitoring which hops a packet
passes on his way. I want to use icmp and need information about how to
capture the replies i get when sending an icmp-echo-request.
I read that every gateway which gets an echo-reply-icmp packet sends one
packet back to the sender but how do i no if there are any incoming
packets.

(has anyone got the code of tcpdump???)

if anyone has an idea, source code, good sites...

thanx martin

 
 
 

networking/icmp

Post by Michael Fu » Sun, 01 Aug 1999 04:00:00



> I want to write a program like traceroute monitoring which hops a packet
> passes on his way. I want to use icmp and need information about how to
> capture the replies i get when sending an icmp-echo-request. =

> I read that every gateway which gets an echo-reply-icmp packet sends one
> packet back to the sender but how do i no if there are any incoming
> packets.

Traceroute works by sending packets with ever-increasing TTLs and
looking at the ICMP Time Exceeded messages returned by intermediate
routers.  Example:

1.  First packet sent with TTL=1
2.  Router A receives packet and decrements TTL by 1 (TTL now = 0)
3.  Since the TTL is now 0, router A sends Time Exceeded to the originator

4.  Second packet sent with TTL=2
5.  Router A receives packet and decrements TTL by 1 (TTL now = 1)
6.  Router B receives packet and decrements TTL by 1 (TTL now = 0)
7.  Router B sends Time Exceeded to originator

8.  Third packet sent with TTL=3
9.  Router A receives packet and decrements TTL by 1 (TTL now = 2)
10. Router B receives packet and decrements TTL by 1 (TTL now = 1)
11. Router C receives packet and decrements TTL by 1 (TTL now = 0)
12. Router C sends Time Exceeded to originator

etc.

The Unix traceroute program uses high UDP ports; the NT tracert program
uses ICMP Echo Request (ping).  It's also possible to use TCP, which
can come in handy when troubleshooting a connection that passes through
packet filters or a firewall.

Quote:> (has anyone got the code of =B4tcpdump=B4???)

> if anyone has an idea, source code, good sites...

You can find source for both traceroute and tcpdump (and libpcap, which
you'll need for tcpdump) at:

ftp://ftp.ee.lbl.gov/

Hope this helps.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

 
 
 

1. icmp : does icmp have no dependency on dns?

hi.

i was working on helping someone to get a suse-install fixed-up for dns,
and found out that he was able able to ping places even when there
apparently isn't a valid entry in /etc/rc.config ( which, by default, is
used by the suse scripts to generate a resolv.conf )

the question+:

does icmp-packet routing not depend on DNS ?

does tcp-packet routing depend on dns ?

does anything depend on dns besides whatever is buried in something like
a netscape?

  (if so, any tips on (a url for, or a book if no url) where to find a
table of what depends on what?)

thanks!

--
sc

2. poppassd for Solaris 2.6

3. ICMP HOST cannot build IP Header address to echo ICMP HOST

4. Rebbot remote server

5. make icmp.c be more verbose on broadcast icmp errors

6. when sendmsg(), get "broken pipe" error.

7. ICMP ping effecting network flow?

8. Y2K tests on "live" system

9. IP/ICMP networking oddity

10. Network Issue possibly from ICMP host unreachables

11. ICMP Issue (DHCP Internal network)

12. ICMP: Network Unreachable ignored from default route

13. ICMP -> Network error