Tuesday, October 4, 2011

PING with ToS

ICMP echo messages are sent to a remote host and are returned in an echo-reply response. The primary use for these messages is to check the availability of the target machine.
  1. Host A creates an ICMP echo datagram, using host A's address as the source, and host B's address as the destination.
  2. The ICMP echo datagram is transmitted via the network to the destination (host B).
  3. The destination system (host B) copies the echo information into a new echo-reply message datagram.
  4. The destination system (host B) destroys the original ICMP echo message.
  5. The destination machine (host B) now becomes the source of a new echo-reply datagram. Host B places it's own address in the source address field of the IP header, and host A's address in the destination field of the IP header.
  6. The datagram is transmitted to the network and is routed to host A.
For this very simple back to back topology, the ToS value has been copied to the new IP diagram (echo-reply). However, this is not always the case especially there are networks between them. The best way is to test your ruler before use them.

R1 ------- Serial ------- R2
.1                                   .2

R1-PE1#ping ip
Target IP address: 1.1.1.2
Repeat count [5]: 
Datagram size [100]: 
Timeout in seconds [2]: 
Extended commands [n]: y
Source address or interface: 
Type of service [0]: 48
Set DF bit in IP header? [no]: 
Validate reply data? [no]: 
Data pattern [0xABCD]: 
Loose, Strict, Record, Timestamp, Verbose[none]: 
Sweep range of sizes [n]: 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.2, timeout is 2 seconds:
!!!!!

R2 Debug (receives echo-request, and sends reply)

*Oct 10 13:42:54.871: IP: s=1.1.1.1 (Serial1/1), d=1.1.1.2, len 100, stop process pak for forus packet
*Oct 10 13:42:54.871:     ICMP type=8, code=0
*Oct 10 13:42:54.871: ICMP: echo reply sent, src 1.1.1.2, dst 1.1.1.1, topology BASE, dscp 12 topoid 0

R1 Debug

*Oct 10 13:42:54.868: IP: s=1.1.1.2 (Serial1/1), d=1.1.1.1, len 100, stop process pak for forus packet
*Oct 10 13:42:54.868:     ICMP type=0, code=0
*Oct 10 13:42:54.868: ICMP: echo reply rcvd, src 1.1.1.2, dst 1.1.1.1, topology BASE, dscp 12 topoid 0

Ref:
http://www.inetdaemon.com/tutorials/internet/icmp/echo.shtml
http://en.wikipedia.org/wiki/Ping
http://www.inetdaemon.com/tools/ping/how_ping_works.shtml
https://supportforums.cisco.com/thread/2090992

No comments:

Post a Comment