Use Of Ping and Tracert/Traceroute and ARP Utilities



Use Of Ping and Tracert/Traceroute and ARP Utilities
Use Of Ping and Tracert/Traceroute and ARP Utilities

Download / View (PDF)

Course: B.Sc.IT
Semester: VI
Subject: Internet Technologies

Practical Question No. #01
AIM: Use Of Ping and Tracert/Traceroute and ARP Utilities

Software: Cisco Packet Tracer 7.2
Download: (Windows: 64-Bit | 32-Bit) / (Linux: 64-Bit)

Solution:
Diagnostic commands help you detect TCP/IP networking problems. Some of the diagnostic commands are arp, hostname, ipconfig, netstat, ping, route, and tracert.

(i) arp:
This diagnostic command displays and modifies the IP-to-Ethernet or Token Ring physical address translation tables used by the Address Resolution Protocol (ARP).

Syntax:
arp -a [inet_addr] [-N [if_addr]] arp -dinet_addr [if_addr]
arp -sinet_addrether_addr [if_addr]

Parameters:
  • -a – Displays current ARP entries by querying TCP/IP. If inet_addr is specified, only the IP and physical addresses for the specified host are displayed.
  • -d – Deletes the entry specified by inet_addr
  • -s – Adds an entry in the ARP cache to associate the IP address inet_addrwith the physical address ether_addr. The physical address is given as 6 hexadecimal bytes separated by hyphens. The IP address is specified using dotted decimal notation. The entry is static. It will not be automatically removed from the cache after the timeout expires and will not exist after a reboot of your computer.
  • -N [if_addr] – Displays the ARP entries for the network interface specified by if_addr. ether_addr Specifies a physical address. if_addr Specifies, if present, the IP address of the interface whose address translation table should be modified. If not present, the first applicable interface will be used. inet_addr Specifies an IP address in dotted decimal notation.




(ii) hostname:
This command has no parameters.

(iii) ipconfig:
This diagnostic command displays all current TCP/IP network configuration values. This command is useful on computers running DHCP because it enables users to determine which TCP/IP configuration values have been configured by DHCP. If you enter only ipconfigwithout parameters, the response is a display of all of the current TCP/IP configuration values, including IP address, subnet mask, and default gateway.

Syntax:
ipconfig [/all | /renew [adapter] | /release [adapter]]

Parameters:
  • all – Produces a full display. Without this switch, ipconfig displays only the IP address, subnet mask, and default gateway values for each network card.
  • renew [adapter] – Renews DHCP configuration parameters. This option is available only on computers running the DHCP Client service. To specify an adapter name, type the adapter name that appears when you use ipconfig without parameters.
  • release [adapter] – Releases the current DHCP configuration. This option disables TCP/IP on the local computer and is available only on DHCP clients. To specify an adapter name, type the adapter name that appears when you use ipconfig without parameters.




(iv) netstat:
This diagnostic command displays protocol statistics and current TCP/IP network connections.

Syntax:
netstat [-a] [-e][-n][-s] [-p protocol] [-r] [interval]

Parameters:
  • -a – Displays all connections and listening ports; server connections are usually not shown.
  • -e – Displays Ethernet statistics. This can be combined with the -s option.
  • -n – Displays addresses and port numbers in numerical form (rather than attempting name lookups).
  • -s – Displays per-protocol statistics. By default, statistics are shown for TCP, UDP, ICMP, and IP;
  • -p – The -p option can be used to specify a subset of the default.
  • -p protocol – Shows connections for the protocol specified.
  • -r – Displays the contents of the routing table.
  • interval – Redisplays selected statistics, pausing interval seconds between each display.




(v) ping:
This diagnostic command verifies connections to one or more remote computers.

Syntax:
ping [-t] [-a] [-n count] [-l length] [-f] [-i ttl] [-v tos] [-r count] [-s count] [[-j host-list] | [-k host-list]] [-w timeout] destination-list

Parameters:
  • -t – Pings the specified host until interrupted.
  • -a – Resolves addresses to host names.
  • -n count – Sends the number of ECHO packets specified by count. The default is 4.
  • -l length – Sends ECHO packets containing the amount of data specified by length. The default is 64 bytes; the maximum is 8192.
  • -f – Sends a Do Not Fragment flag in the packet. The packet will not be fragmented by gateways on the route.
  • -ittl – Sets the time to live field to the value specified by ttl.
  • -v tos – Sets the type of service field to the value specified by tos.
  • -r count – Records the route of the outgoing packet and the returning packet in the record route field. A minimum of 1 to a maximum of 9 hosts must be specified by count.
  • -s count – Specifies the timestamp for the number of hops specified by count.
  • -j host-list – Routes packets via the list of hosts specified by host-list. Consecutive hosts can be separated by intermediate gateways (loose source routed). The maximum number allowed by IP is 9.
  • -k host-list – Routes packets via the list of hosts specified by host-list. Consecutive hosts cannot be separated by intermediate gateways (strict source routed). The maximum number allowed by IP is 9.
  • -w timeout – Specifies a timeout interval in milliseconds.
  • destination-list – Specifies the remote hosts to ping.





(vi) route
This diagnostic command manipulates network routing tables.

Syntax:
route [-f] [command [destination] [MASK netmask] [gateway] [METRIC metric]]

Parameters:
  • -f – Clears the routing tables of all gateway entries. If this parameter is used in conjunction with one of the commands, the tables are cleared prior to running the command. 
  • commandSpecifies one of four commands below:
  1. print: Prints a route.
  2. add: Adds a route.
  3. delete: Deletes a route.
  4. change: Modifies an existing route.
  • destination – Specifies the host to send command.
  • MASK – Specifies, if present, that the next parameter be interpreted as the netmask parameter.
  • netmask – Specifies, if present, the subnet mask value to be associated with this route entry. If not present, this parameter defaults to 255.255.255.255.
  • gateway – Specifies the gateway.
  • METRIC – Specifies the route metric (cost) for the destination.


(vii ) tracert
This diagnostic utility determines the route taken to a destination by sending Internet Control Message Protocol (ICMP) echo packets with varying time-to-live (TTL) values to the destination. Each router along the path is required to decrement the TTL on a packet by at least 1 before forwarding it, so the TTL is effectively a hop count. When the TTL on a packet reaches 0, the router is supposed to send back an ICMP Time Exceeded message to the source computer.

Tracert determines the route by sending the first echo packet with a TTL of 1 and incrementing the TTL by 1 on each subsequent transmission until the target responds or the maximum TTL is reached. The route is determined by examining the ICMP Time Exceeded messages sent back by intermediate routers. Notice that some routers silently drop packets with expired TTLs and will be invisible to tracert.

Syntax:
tracert[-d] [-h maximum_hops] [-j host-list] [-w timeout] target_name

Parameters:
  • -d – Specifies not to resolve addresses to host names.
  • -h maximum_hops – Specifies maximum number of hops to search for target.
  • -j host-list – Specifies loose source route along host-list.
  • -w timeout – Waits the number of milliseconds specified by timeout for each reply.
  • target_name – Name of the target host.


Download / View (PDF)

0 Comments