Thursday, September 17, 2015

Ping || Trace || Extended ping ||Extended trace || Trace layer 2


A tool used in day to day life of a network engineer but still many don't understand the difference.Why do you need these tools and would Cisco create a duplicate command for same purpose?

As most of you are aware these are the tools which are commonly  used to check reachabilty and trace a device.

Ping command as you know is used to check reachabilty of a device.ICMP echo request and reply are the two ICMP query messages used. First a echo request is sent and waits for a response. If it receives a response then ping  is successful.

Why Extended ping?
With normal ping,source address of the packet is the IP address assigned to the outgoing interface of a router/switch. With extended ping we can specify the source IP address.

For instance you need to check reachabilty to a server in Data center  and when you ping from the site WAN router you get a response but users in LAN are not able to reach.The reason is with normal ping its the WAN router interface IP which is the source and might be allowed in the access-list configured at server VLAN. LAN IP segment might not be allowed.

Understand ping error messages before proceeding further:
http://www.itgeared.com/articles/1094-ping-and-icmp-error-messages/

Traceroute is used to find the path from source to destination.The device on which traceroute is executed  sends out a sequence of User Datagram Protocol (UDP) datagrams, each with incrementing TTL values, to an invalid port address (Default 33434) at the remote host.


If IP unreachables  is disabled on any device along the path trace route wont work.

 Extended traceroute is similar to extended ping where you can specify a source.Usualy used to solve routing issue(loops,ACL block etc)

Error messages you should know to understand the output
1.time exceeded : Indicates that an intermediate communication node has seen and discarded the packet
2.destination unreachable : Indicates that the destination node has received the probe and discarded it because it could not deliver the packet

* asterisk is usually seen if the timer goes off before recieving a response. This can be because user interupted trace,TTL exceeded etc.

CTRL+SHIFT+6 is used to terminate the trace.
Layer 2 Traceroute is a nice feature from Cisco which is used to identify layer-2 path from source to destination.This is done by using the MAC address tables of the switches in the path.When the Layer 2 traceroute utility detects a device in the path that does not support Layer 2 traceroute, it continues to send Layer 2 trace queries and allows them to time out. 
 
 Points to keep in mind when using this utility
1. CDP should be enabled on all the switches along the path. Thus utility work only with help of CDP.
 3.Only uni-cast is supported. If you try tracing a multicast address it wont work and i believe you wont try tracing a broadcast address :)
3.All the switches/devices in the layer 2 path should be mutually reachable.
4.If source/destination MAC address belongs to multiple VLAN's, VLAN to which both the source and destination MAC addresses belongs to must be specified.
5. If a Hub is connected in between trace will not complete. 
6.Traceroute mac ip uses ARP to associate IP address with corresponding MAC. If ARP entry does not exist then it send a ARP query.
7.Maximum number of hops  is 10


Syntax:
Switch# traceroute mac [interface type interface_number] source_mac_address [interface type interface_number] destination_mac_address [vlan vlan_id] [detail]

Switch# traceroute mac ip {source_ip_address | source_hostname} {destination_ip_address | destination_hostname} [detail]  



 References:
http://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst6500/ios/12-2SX/configuration/guide/book/l2trace.html

No comments:

Post a Comment