Lab 2
Lab 2
Lab 2
1
Software Engineering Department
Bahria University (Karachi Campus)
Lab Manual: Computer Communication & Networking
LAB EXPERIMENT # 2
To learn about and practice some of the Diagnostic Utilities for use with
computer networks.
THEORY:
Following table gives the descriptions of different diagnostic Utilities
2
Software Engineering Department
Bahria University (Karachi Campus)
Lab Manual: Computer Communication & Networking
PING
Objective:
Verify connections to a remote computer or computers
Theory:
The ping command verifies connections to remote computer or computers, by sending ICMP
echo packets to the computer and listening for echo reply packets. Ping waits for up to 1
second for each packet sent and prints the number of packets transmitted and received. Each
received packet is validated against the transmitted message. By default, four echo packets
containing 64 bytes of Computer (a periodic uppercase sequence of alphabetic characters) are
transmitted.
You can use the ping utility to test both the computer name and the IP address of the
computer. If the IP address is verified but the computer name is not, you may have a name
resolution problem. In this case, be sure that the computer name you are querying is in either
the local HOSTS file or in the DNS Computerbase.
The Ping stands for Packet Internet Groper.
Parameters:
-t
Pings the specified computer until interrupted.
Ping -t www.google.com
-a
Resolve addresses to computer names.
Ping -a 8.8.8.8
-n count
Sends the number of ECHO packets specified by count. The default is 4.
Ping -n 8 www.google.com
-l length
Sends ECHO packets containing the amount of Computer specified by length. The default is
64 bytes; Maximum Limit is 65500
Ping -l 8000 www.google.com
-f
Sends a Do Not Fragment flag in the packet. The packet will not be fragmented by gateways
on the route. Varies from network to network default is 1500.
Ping -l 8000 -f www.google.com
-i ttl
Sets the Time to Live field to the value specified by TTL. Normally, packets have a TTL of 64,
128, or 255, allowing them to traverse multiple routers before expiring
Ping -I 6 www.google.com
3
Software Engineering Department
Bahria University (Karachi Campus)
Lab Manual: Computer Communication & Networking
-v tos
Sets the Type of Service field to the value specified by TOS.
Common TOS(Type of Service) Values:
0: Normal Service (default)
8: Minimize Delay (e.g., video streaming, voice calls)
16: Maximize Throughput (e.g., large file transfers)
32: Maximize Reliability (e.g., critical data transmission)
Ping -l 8 www.google.com
-r count
Records the route of the outgoing packet and the returning packet in the Record Route field.
A minimum of 1 and a maximum of 9 computers may be specified by count.
Ping -r 9 www.google.com
-s count
Display timestamp. Specifies the timestamp for the number of hops specified by count.
Ping -s 3 www.google.com
-j computer-list
Routes packets via the list of computers specified by computer-list. Consecutive computers
may be separated by intermediate gateways (loose source routed). The maximum number
allowed by IP is 9.
-k computer-list
Routes packets via the list of computers specified by computer-list. Consecutive computers
may not be separated by intermediate gateways (strict source routed). The maximum number
allowed by IP is 9.
-w timeout
Specifies a timeout interval in milliseconds. Limit timeout for each hop
destination-list
Specifies the remote computers to ping. Ping Multiple remote computers in one go.
IPCONFIG
Theory
This diagnostic command displays all current TCP/IP network configuration values. This
command is of use on systems running DHCP, allowing users to determine which TCP/IP
configuration values have been configured by DHCP.
ipconfig [/all | /renew [adapter] | /release [adapter]]
4
Software Engineering Department
Bahria University (Karachi Campus)
Lab Manual: Computer Communication & Networking
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 systems 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 system
and is available only on DHCP clients. To specify an adapter name, type the adapter name
that appears when you use ipconfig without parameters.
With no parameters, the ipconfig utility presents all the current TCP/IP configuration values
to the user, including IP address and subnet mask. This utility is especially useful on systems
running DHCP, allowing users to determine which values have been configured by DHCP.
NSLOOKUP
This diagnostic tool displays information from Domain Name System (DNS) name servers.
Before using this tool, you should be familiar with how DNS works. Nslookup is available
only if the TCP/IP protocol has been installed.
nslookup [-option ...] [computer-to-find | - [server]]
Modes
> google.com
Nslookup Commands
Nslookup: finger
Connects with the finger server on the current computer. The current computer is defined
when a previous lookup for a computer was successful and returned address information (see
5
Software Engineering Department
Bahria University (Karachi Campus)
Lab Manual: Computer Communication & Networking
NSLOOKUP Syntax
Nslookup [-option …] [computer-to-find | - [server]]
Nslookup hostx
Where hostx is a host in your domain. NSLOOPKP will return the IP address of the computer
hostx because the information is stored in the DNS Computerbase.
Exit the command prompt
Nslookup IP/DNS name
HOSTNAME
It returns the local computer host name.
TRACERT
Verifies the route used from the local host to a remote host.
NETSTAT
Netstat -a, Netstat -an, Netstat
Route
Route Print
6
Software Engineering Department
Bahria University (Karachi Campus)
Lab Manual: Computer Communication & Networking
IFCONFIG
SYNOPSIS
ifconfig [interface]
ifconfig interface [aftype] options | address ...
DESCRIPTION
Ifconfig is used to configure the kernel-resident network interfaces. It is used at boot time to
set up interfaces as necessary. After that, it is usually only needed when debugging or when
system tuning is needed. If no arguments are given, ifconfig displays the status of the
currently active interfaces. If a single interface argument is given, it displays the status of the
given interface only; if a single -a argument is given, it displays the status of all interfaces,
even those that are down. Otherwise, it configures an interface down.
OPTIONS
interface
The name of the interface. This is usually a driver name followed by a unit number, for
example eth0 for the first Ethernet interface up. This flag causes the interface to be activated.
It is implicitly specified if an address is assigned to the interface down This flag causes the
driver for this interface to be shut down.
Who - It shows who is logged on.
-m Same as `who am i'.
-q, --count
Print only the login names and the number of users logged on. Overrides all other options.
-s Ignored; for compatibility with other versions of who.
7
Software Engineering Department
Bahria University (Karachi Campus)
Lab Manual: Computer Communication & Networking
Lab Assignments:
Run the following commands on the command prompt of your PCs and
attach snapshots of the result:
i. ping www.amazon.com
ii. tracert www.facebook.com
iii. ping -i 3 www.bahria.edu.pk, did you receive the correct reply? If not, explain
why.
iv. Ping www.jira.com with load of 220 bytes analyze the result, then trace the
route of outgoing packet.
v. nslookup www.play.com, did you result show ‘Non-authoritative answer’?
If yes, explain what does it indicate, you are advised to browse the internet
to attain this answer.
vi. Using interactive mode on NSlookup use set type= cname to look for
CNAME records.(Optional Task)
NOTE:
The commands must be run on the command prompt and clear snapshots with headings must
be attached with proper numbering. Answers to the other questions must be given on a
separate sheet, typed with proper numbering. Any other formats apart from the above will
not be entertained.
TIME BOXING:
8
Software Engineering Department
Bahria University (Karachi Campus)