CN Record
CN Record
AIM: Study of Networking Commands (Ping, Tracert, TELNET, nslookup, netstat, ARP) and
Network Configuration Files
C:\>arp –a: ARP is short form of address resolution protocol, It will show the IP address of your
computer along with the IP address and MAC address of your router.
C:\>hostname: This is the simplest of all TCP/IP commands. It simply displays the name of your
computer.
C:\>ipconfig: The ipconfig command displays information about the host (the computer your
sitting at)computer TCP/IP configuration.
C:\>ipconfig /all: This command displays detailed configuration information about your TCP/IP
connection including Router, Gateway, DNS, DHCP, and type of Ethernet adapter in your
system.
C:\>Ipconfig /renew: Using this command will renew all your IP addresses that you are currently
(leasing) borrowing from the DHCP server. This command is a quick problem solver if you are
having connection issues, but does not work if you have been configured with a static IP address.
C:\>Ipconifg /release: This command allows you to drop the IP lease from the DHCP server.
C:\>ipconfig /flushdns: This command is only needed if you’re having trouble with your networks
DNS configuration. The best time to use this command is after network configuration frustration sets
in, and you really need the computer to reply with flushed.
C:\>nbtstat –a: This command helps solve problems with NetBIOS name resolution. (Nbt stands
for NetBIOS over TCP/IP)
C:\>netdiag: Netdiag is a network testing utility that performs a variety of network diagnostic tests,
allowing you to pinpoint problems in your network. Netdiag isn’t installed by default, but can be
installed from the Windows XP CD after saying no to the install. Navigate to the CD ROM drive
letter and open the support\tools folder on the XP
CD and click the setup.exe icon in the support\tools folder.
C:\>netstat: Netstat displays a variety of statistics about a computers active TCP/IP connections. This
tool is most useful when you’re having trouble with TCP/IP applications such as HTTP, and FTP.
C:\>nslookup: Nslookup is used for diagnosing DNS problems. If you can access a resource by
specifying an IP address but not it’s DNS you have a DNS problem.
C:\>pathping: Pathping is unique to Window’s, and is basically a combination of the Ping and
Tracert commands. Pathping traces the route to the destination address then launches a 25 second test
of each router along the way, gathering statistics on the rate of data loss along each hop.
C:\>ping: Ping is the most basic TCP/IP command, and it’s the same as placing a phone call to your
best friend. You pick up your telephone and dial a number, expecting your best friend to reply with
“Hello” on the other end. Computers make phone calls to each other over a network by using a Ping
command. The Ping commands main purpose is to place a phone call to another computer on the
network, and request an answer. Ping has 2 options it can use to place a phone call to another
computer on the network. It can use the computers name or IP address.
C:\>route: The route command displays the computers routing table. A typical computer, with a
single network interface, connected to a LAN, with a router is fairly simple and generally doesn’t
pose any network problems. But if you’re having trouble
accessing other computers on your network, you can use the route command to make sure the entries
in the routing table are correct.
C:\>tracert: The tracert command displays a list of all the routers that a packet has to go through to
get from the computer where tracert is run to any other computer on the
internet.
RESULT
Thus the above list of primitive has been studied.
EXPERIMENT-2
Aim: Study of different types of Network cables and practically implements the cross-wired cable and
straight through cable using clamping tool.
1. Start by stripping off about 2 inches of the plastic jacket off the end of the cable. Be very careful at
this point, as to not nick or cut into the wires, which are inside. Doing so could alter the characteristics
of your cable, or even worse render is useless. Check the wires, one more time for nicks or cuts.
If there are any, just whack the whole end off, and start over.
2. Spread the wires apart, but be sure to hold onto the base of the jacket with your other hand. You do
not want the wires to become untwisted down inside the jacket. Category 5 cable must only have 1/2
of an inch of 'untwisted' wire at the end; otherwise it will be 'out of spec'. At this point, you obviously
have ALOT more than 1/2 of an inch of un-twisted wire.
3. You have 2 end jacks, which must be installed on your cable. If you are using a pre-made cable,
with one of the ends whacked off, you only have one end to install - the crossed over end. Below
are two diagrams, which show how you need to arrange the cables for each type of cable end. Decide
at this point which end you are making and examine the associated picture below.
Green-White
Gree
n Orange-
White
Bl
ue Blue-
White
Oran
ge Brown-
White
Brown
Diagram shows you how to prepare Cross wired connection
Green-White
Green
Orange-White
Blue
Blue-White
Orange
Brown-White
Brown
AIM: Implementing Data link layer farming methods such as bit stuffing and character stuffing.
Bit Stuffing
SOURCE CODE:
#include<stdio.h>
#include<string.h>
int main()
{
int a[20],b[30],i,j,k,count,n;
printf("\n \n \t \t Dept of Artificial Intelligence And Machine Learning.**(SCET)**\n\t\n20CS5L01-
COMPUTER NETWORKS LAB\n \t\t--**Bit Stuffing**--\n");
Source Code:
#include<stdio.h>
#include<string.h>
int main()
{
char a[30], fs[50] = " ", t[3], sd, ed, x[3], s[3], d[3], y[3];
int i, j, p = 0, q = 0;
printf("\n \n \t \t Dept of Artificial Intelligence And Machine Learning .**(SCET)**\n\t\n\t\t
20CS5L01-COMPUTER NETWORKS LAB\n \t\t--**Character Stuffing**--\n");
printf(" \t\tEnter characters to be stuffed:");
scanf("%s", a);
printf("\n \t\tEnter a character that represents starting delimiter:"
);
scanf(" %c", &sd);
printf("\n \t\tEnter a character that represents ending delimiter:");
scanf(" %c", &ed);
x[0] = s[0] = s[1] = sd;
x[1] = s[2] = '\0';
y[0] = d[0] = d[1] = ed;
d[2] = y[1] = '\0';
strcat(fs, x);
for(i = 0; i < strlen(a); i++)
{
t[0] = a[i];
t[1] = '\0';
if(t[0] == sd)
strcat(fs, s);
else if(t[0] == ed)
(fs, d);
Else
strcat(fs, t);
}
strcat(fs, y);
printf("\n\t\tAfter stuffing:%s", fs);
getch ();
}
OUTPUT:
EXPERIMENT-4
7. In the Internet Protocol (TCP/IP) Properties dialog box, click Obtain an IP address
automatically (if it is not already selected), and then click OK.
Note: You can also assign a unique static IP address in the range of 192.168.0.2 to
254. For example, you can assign the following static IP address, subnet mask, and default gateway:
8. IP Address 192.168.31.202
9. Subnet mask 255.255.255.0
10. Default gateway 192.168.31.1
11. In the Local Area Connection Properties dialog box, click OK.
In this EXPERIMENT- students have to understand basic networking commands e.g ping,
tracert etc.
All commands related to Network configuration which includes how to switch to privilege
mode and normal mode and how to configure router interface and how to save this
configuration to flash memory or permanent memory.
ping:
ping(8) sends an ICMP ECHO_REQUEST packet to the specified host. If the host responds,
you get an ICMP packet back. Sound strange? Well, you can “ping” an IP address to see if a
machine is alive. If there is no response, you know something is wrong.
Traceroute:
Tracert is a command which can show you the path a packet of information
takes from your computer to one you specify. It will list all the routers it passes
through until it reaches its destination, or fails to and is discarded. In addition to
this, it will tell you how long each 'hop' from router to router takes.
nslookup:
pathping:
A better version of tracert that gives you statics about packet lost and latency.
Getting Help
In any command mode, you can get a list of available commands by entering a question
To obtain a list of commands that begin with a particular character sequence, type in
those haracters followed immediately by the question mark (?).
Router#co?
Router#configure ?
Configuration Files
Any time you make changes to the router configuration, you must save the changes to
memory because if you do not they will be lost if there is a system reload or power outage.
There are two types of configuration files: the running (current operating) configuration and
the startup configuration.
Use the following privileged mode commands to work with configuration files.
• configure terminal – modify the running configuration manually from the terminal.
IP Address Configuration
Router>enable password
Step 2: Enter the configure terminal command to enter global configuration mode.
Router#config terminal
Step 3: Enter the interface type slot/port (for Cisco 7000 series) or interface type port (for
Cisco 2500 series) to enter the interface configuration mode.
Example:
Router (config)#interface ethernet 0/1
Step 4: Enter the IP address and subnet mask of the interface using the ip address ipaddress
subnetmask command.
Example,
Router (config-if)#ip address 192.168.10.1 255.255.255.0
AIM: Performing initial Switch and Router configuration using packet tracer.
Switch configuration:
Topology Diagram
Objectives
Perform an initial configuration of a Cisco Catalyst 2960 switch.
Background / Preparation
In this activity, you will configure these settings on the customer Cisco Catalyst 2960 switch:
Host name
Console password
vty password
Privileged EXEC mode password
Privileged EXEC mode secret
IP address on VLAN1 interface
Default gateway
Note: Not all commands are graded by Packet Tracer.
Switch>enable
Switch#configure terminal
Switch(config)#hostname CustomerSwitch
b. From line configuration mode, set the password to cisco and require the password to be
entered at login.
CustomerSwitch(config-line)#password
cisco CustomerSwitch(config-line)#login
CustomerSwitch(config-line)#exit
CustomerSwitch(config)#line vty 0 15
b. From line configuration mode, set the password to cisco and require the password to be
entered at login.
CustomerSwitch(config-line)#password
cisco CustomerSwitch(config-line)#login
CustomerSwitch(config-line)#exit
CustomerSwitch(config)#interface vlan 1
CustomerSwitch(config-if)#ip address 192.168.1.5 255.255.255.0
CustomerSwitch(config-if)#no shutdown
CustomerSwitch(config-if)#exit
CustomerSwitch(confi
g)#end
CustomerSwitch#ping
209.165.201.10
181/189/197 ms CustomerSwitch#
Reflection
a. What is the significance of assigning the IP address to the VLAN1 interface instead
of any of the Fast Ethernet interfaces?
b. What command is necessary to enforce password authentication on the console and vty lines?
Objectives
Configure the router host name.
Configure passwords.
Configure banner messages.
Verify the router configuration.
Background / Preparation
In this activity, you will use the Cisco IOS CLI to apply an initial
configuration to a router, including host name, passwords, a message-of-
the-day (MOTD) banner, and other basic settings.
Note: Some of the steps are not graded by Packet Tracer.
Router>ena
ble
Router#conf
igure
terminal
Router(config)#hostname CustomerRouter
CustomerRouter(config)#line console 0
Set the password to cisco123, require that the password be entered at login, and then exit line
configuration mode.
CustomerRouter(config-
line)#password cisco123
CustomerRouter(config-
line)#login
CustomerRouter(config-line)#exit
CustomerRouter(config)#
Step 4: Configure the vty password to allow Telnet access to the router.
a. In global configuration mode, switch to line configuration mode to
specify the vty lines.
CustomerRouter(config)#line vty 0 4
Set the password to cisco123, require that the password be entered at login, exit line
configuration mode, and then
exit the configuration session.
CustomerRouter(config-
line)#password cisco123
CustomerRouter(config-
line)#login
CustomerRouter(config-line)#exit
CustomerRouter(config)#
Step 5: Configure password encryption, a MOTD banner, and turn off domain server lookup.
a. Currently, the line passwords and the enable password are shown in
clear text when you show the running configuration. Verify this
now by entering the show running-config command.
To avoid the security risk of someone looking over your shoulder and
reading the passwords, encrypt all clear text passwords.
CustomerRouter(config)#service password-encryption
Use the show running-config command again to verify that the passwords are encrypted.
To provide a warning when someone attempts to log in to the router, configure a MOTD
banner.
Test the banner and passwords. Log out of the router by typing the exit command
twice. The banner displays before the prompt for a password. Enter the password to
log back into the router.
You may have noticed that when you enter a command incorrectly at the user or
privileged EXEC prompt, the router pauses while trying to locate an IP address for
the mistyped word you entered. For example, this output shows what happens when
the enable command is mistyped.
CustomerRouter>emable
Translating "emable"...domain server (255.255.255.255)
To prevent this from happening, use the following command to stop all
DNS lookups from the router CLI.
CustomerRouter(config)#no ip domain-lookup
CustomerRouter(
config)#end
CustomerRouter
#copy run start
Reflection
Which Cisco IOS CLI commands did you use most?
How can you make the customer router passwords more secure?
EXPERIMENT-7
AIM: Configure a network topology using packet tracer software using two different net- works.
Procedure:
Step 1: First, open the cisco packet tracer desktop and select the devices given below:
1. PC PC 8
2. Switch 2960-24TT 5
3. Router 2911 1
IP Addressing Table for PCs of LAN1 and LAN2:
LAN1:
LAN2:
S.No. Device IPv4 Address Subnet Mask Default gateway
Configuring RIP
Topology Diagram
Objectives
Configure routers using basic interface configuration commands.
Enable RIP.
Verify the RIP configuration.
Background / Preparation
A simple routed network has been set up to assist in reviewing RIP routing behavior. In this
activity, you will configure RIP across the network and set up end devices to communicate on the
network.
Procedure:
Objective
Observe the network behavior using static and default routing only and compare it to the behavior of
dynamic routing.
Background / Preparation
In this exercise, you will observe what the adaptability of dynamic routing compared to static and
default routing. The Ticket Sales Office network is currently configured using static and default
routing.
a. Configure EIGRP (AS 10) on the BR2 and ISP2 routers. Be sure to include all directly
connected networks and turn off auto-summary.
b. Do a third trace from PC0 to the Edge1 FastEthernet 0/0 interface. (It should be successful again.)
c. Did the path change? If so, how?
Reflection
What are the advantages of using dynamic routing? Static and default routing?
The static routes in this lab were set with an administrative distance of 130. What
would have happened if they were set at 30? At 230?
EXPERIMENT-11
Objectives
Examine NAT processes as traffic traverses a NAT border router.
Background / Preparation
In this activity, you will use Packet Tracer Simulation mode to examine the contents of the IP
header as traffic crosses the NAT border router.
Step 2: Send an HTTP request from an inside host to an outside web server.
Click Customer PC. Click the Desktop tab and then Web Browser. In the URL field,
type the web address for the ISP server (www.ispserver.com). Make sure that you are
in Simulation mode, and then click Go.
In the event list, notice that Customer PC queues a DNS request and sends out an ARP request.
You can view the contents of the ARP request by either clicking on the packet in the topology
or clicking on the packet color under Info in the Event List window.
In the PDU Information at Device: Customer PC window, which IP address is Customer PC
attempting to find a MAC address for?
In the Event List window, click Capture/Forward twice. Which device answers the ARP request
from Customer PC? Which MAC address is placed inside the ARP reply?
In the Event List window, click Capture/Forward twice. Customer PC accepts the ARP replay
and then builds another packet. What is the protocol for this new packet? If you click Outbound
PDU Details for this packet, you can see the details of the protocol.
In the Event List window, click Capture/Forward twice. Click the packet at the
www.customerserver.com server. Then click the Outbound PDU Details tab. Scroll down to the
bottom to see the Application Layer data. What is the IP address for the ISP server?
In the Event List window, click Capture/Forward twice. Customer PC now formulates another ARP
request. Why?
In the Event List window, click Capture/Forward 10 times until Customer PC formulates an
HTTP request packet. Customer PC finally has enough information to request a web page from
the ISP server.
In the Event List window, click Capture/Forward three times. Click the packet at Customer
Router to examine the contents. Customer Router is a NAT border router. What is the inside local
address and the inside global address for Customer PC?
In the Event List window, click Capture/Forward seven times until the HTTP reply reaches
Customer Router. Examine the contents of the HTTP reply and notice that the inside local and
global addresses have changed again as the packet is forwarded on to Customer PC.
Step 3: Send an HTTP request from an outside host to an inside web server.
Customer Server provides web services to the public (outside addresses) through the domain
name www.customerserver.com. Follow a process similar to Step 2 to observe an HTTP
request on ISP Workstation.
a. Click ISP Workstation. Click the Desktop tab, and then Web Browser. In the URL field, type the
Customer Server web address (www.customerserver.com). Make sure that you are in Simulation mode,
and then click Go.
b. You can either click Auto Capture/Play or Capture/Forward to step through each stage of the
process. The same ARP and DNS processes occur before the ISP Workstation can formulate an HTTP
request.
c. When the HTTP request arrives at Customer Router, check the packet contents. What is the inside
local address? What is the inside global address?