CN Lab File
CN Lab File
PRACTICAL FILE
COMPUTER NETWORK
PCC-CS-604
1
Objective Page
S. No. Sign.
No.
INTRODUCTION 3
5. 19 - 21
Implementation of basic router configuration
22 - 23
6 Establish a web server Connection Using the PC’s Web
Browser
7. 24 - 28
To Configure network using static routing protocol
2
INTRODUCTION
That ‘learning is a continuous process’ cannot be over emphasized. The theoretical
knowledge gained during lecture sessions need to be strengthened through practical
experimentation. Thus practical makes an integral part of a learning process.
• To familiarize the students with the basic concepts, programming skill development
and the take home laboratory assignments mainly implementation-oriented which
have to be coded in high level language. The lab sessions will be based on exploring
the concepts discussed in class.
• Observing basic structure and characteristics of Computer Network
• Reporting and analysing the complexities.
• Hands on experience on the experimental setup and software tools
3
Program No. 1
Aim: Description of Various Equipment used in Networking
Equipment description
You will work with different pieces of network equipment such as cables, switches and
routers during this lab. You should know what their functions and capabilities are in general
terms. This section shows the actual models that you will find in the lab. It also contains
some guidelines to identify the equipment and its interfaces. All the equipment is classified
into four groups: cables, switches, routers and terminals. Below there is one subsection
dedicated to each group.
For data communication we will use different cables depending on the link layer technology,
though the media will always be copper. For the Ethernet connections, we will use four-pair
category 5 Unshielded Twisted-Pair (UTP) cabling with RJ45 plugs on both ends.
Figure 2.5 shows the RJ45 plug at the end of the UTP cable. This type of cable contains eight
individually insulated wires twisted in pairs. Each pair is colored with one wire having a
solid color (blue, orange, green, or brown) and the other wire having a stripe of the same
color over a white background. Each wire is named by its color when it is solid (e.g. green)
or by the pair white and color of the stripe otherwise (e.g. white-green). The pairs are
identified by the solid colors (e.g. green pair).
The RJ45 plug has eight pins, numbered from 1 to 8. So that each one of the wires of the four-
pairs UTP cable will be connected to one pin. The assignment of wires to pins is named color
code and it is different depending on the standard. We will use both the EIA/TIA 568A and
568B standards.
4
A straight-through cable must be used to connect the Ethernet ports of a switch to PCs or
routers. It has both RJ45 plugs wired following the 568B standard. The only way to identify
whether an
Ethernet cable is a crossover or straight-through cable is to check the color code at both
ends.
A different cable must be used to connect a PC to the console port of a Cisco device. The
console port is a serial port, thus it must be connected to the PC serial port. The console port is
a RJ45 jack while the PC serial port is a DB9 connector. To connect both ports properly, we
will use the DB9 to RJ45 adapter (see Figure 2.7) and a new type of cable known as roll-over
cable. A roll-over cable also uses 8 wires with RJ45 plugs on both ends, but it is different
from the straight-through or crossover cables. In a roll-over cable, the pins on one end are
reversed on the other end. Thus pin 1 on one end connects to pin 8 on the other end. Pin 2
connects to pin 7, pin 3 connects to pin 6 and so on. Figure 2.8 shows a roll-overcable.
Finally, yet another arrangement must be used to connect two PCs through their serial ports. In
this case, we would link two DB9 to RJ45 adapters using a roll-over cable. And then each
DB9 plug will be connected to the serial ports of each PC.
In addition to these cables, there is permanent cabling in the lab room that you will need to
use to connect the router's outer interface to the departmental backbones. The permanent
cables run in the ceiling and link each lab position with the lab's cabling rack. The cabling
rack is right by the entrance. It contains the departmental switches and two patch panels
above them. Figure 2.9 shows the interior of the cabling rack.
Routers
Instead of using router we will use CISCO router simulator T. All its ports are situated in the
back. It has two 10/100 Ethernet RJ45 ports, a RJ45 console port for its configuration, a
three-pin power socket and a power switch. Each port is labeled in the box with a name,
which it is also used to identify the port in the configuration file. Since the router forwards
packets between its ports, it is very important to connect each network to the proper port.
Terminals
Personal Computers (PCs) running Linux will be used as terminals in the lab. Each area
network
has a laptop PC, which will be used as the network server for the area network. All the ports
of this PC are in the back. Its most important ports for this lab are the 10/100 Ethernet RJ45
port and the DB9 serial port. Figure 2.11 shows the back of the laptop PC at the lab.
Additional PCs, laptops or desktops, can be connected to the area network. These PCs must
have a RJ45 Ethernet port. This port will be connected to any free port in the switch to join the
area network.
5
Starting up the router
This subsection describes how to start up your Cisco router, to interpret the power-on self-
test (POST) and to initially configure the router.
Starting Up
In contrast to the switch, the router will not boot when the power supply is connected. It will
boot when the power switch in the back part is set to on. It is important to connect the
management console before the router is powered on, so the console will display the
messages generated during the startup process. For the initial configuration, there is no need
to connect any cable to the Ethernet ports.
When the router starts up, it performs the POST without producing external signals. When
POST completes successfully, the bootstrap program is loaded from ROM into the RAM.
This process produces the first messages in the console. After bootstrap is loaded, it searches
and loads the Cisco IOS. In our case, this software is retrieved from the internal flash
memory, decompressed and loaded into RAM. More messages appear in the console reporting
the evolution of these steps. When it is successfully loaded, the router's configuration file is
searched and loaded.
When you boot the router for the first time, there is no configuration file, so you will be
asked whether you want to enter the ´initial configuration dialog´. Answer "yes" and you will
be configuring everything from scratch in the set-up mode. If this question does not appear, it
means that the router found some configuration. In this case, you will have to start the
initial configuration procedure from the privileged mode using the setup command as
described below:
Router> enable
Password: passwd
Router# setup
Continue with configuration dialog? [yes/no]: y
6
Program No. 2
Objective:
To know the procedure of making straight and cross over network cables which are used for
wired network communication.
Conceptual Background:
10/100BaseT Ethernet wiring is based upon 8-pin modular jacks. Two wiring guidelines are
offered in Electronic Industry Association (EIA)/Telecommunications Industry Association
(TIA) standards:
• EIA/TIA 568A
• EIA/TIA 568B
A standard Ethernet NIC card (DTE) has the following RJ-45 modular pinout:
Pin Function
1 Tx+
2 Tx-
3 Rc+
6 Rc-
The RJ-45 modular jack has 8 conductors/pins. Viewed from the front:
7
What is 568?
In the world of structured cabling systems the cryptic number 568 refers to the order in which
the individual wires inside a CAT 5 cable are terminated. The termination could come at either
the user’s end socket, the patch panel or termination frame or even the individual leads that
connect a computer to the wall socket. There are currently two different specifications with
respect to the order these cables should be terminated contained in the international standards
document (ISO/IEC 11801:1995) as there is no indication as to which of these standards is
preferred.
TIA-568A
In TIA-568A wiring schemes, the White/Orange and White/Green pairs are transposed. An
Ethernet "Crossover" cable can be made by using TIA-568B at one end of the cable and wiring
to TIA-568A at the other end of the cable. These "Crossover" cables can be used to interconnect
NIC cards directly, without the need for a hub. "Crossover" cables are usually "RED" in color:
8
FIGURE 1.0 SHOWS HOW THE TIA/EIA 568A STANDARD IS TO BE
TERMINATED. NOTE THE POSITION OF THE GREEN/WHITE GREEN AND
THE ORANGE/WHITE ORANGE PAIRS.
TIA-568B
TIA-568B is the most common wiring scheme used in 10/100BaseT configurations. The
standard Ethernet "Patch" cable that connects a hub port to a NIC card uses TIA-568 wiringat
both ends of a "straight-through" cable:
9
IN FIGURE 1.1 YOU CAN SEE THE TIA/EIA 568B STANDARD. ONCE AGAIN
NOTE THE POSITION OF THE GREEN/WHITE GREEN AND ORANGE/WHITE
ORANGE PAIRS.
By looking at the first two specifications we see that the only difference is that the green and
orange pairs are terminated to different pins, there is no difference as to what signal is usedon
what pin, only what color wire is terminated onto it. So technically the standards are the same,
they operate in the same manner and neither one is technically superior to another when used
in Ethernet applications.
It is when an Ethernet system and a phone system are combined that the difference really
becomes apparent.
Procedure:
10
However if you need T568A then use this order; White/Green, Green. Whit/Orange,
Blue, White/Blue, Orange, White/Brown, Brown. Bring all of the wires together, until they
touch.
5. Hold the grouped (and sorted) wires together tightly, between the thumb, and the
forefinger.
6. Cut all of the wires at a perfect 90 degree angle from the cable at 1/2" from the end of
the cable jacket. If the wires are not cut straight, they may not all make contact.
7. Insert the wires into the connector (pins facing up).
8. Place the connector into a crimp tool, and squeeze hard so that the handle reaches it's
full swing.
9. Repeat the process on the other end. For a straight through cable, use the same wiring.
10. Use a cable tester to test for proper continuity.
Straight-through cables get their name from how they are made. Out of the 8 pins that exist on
both ends of an Ethernet cable, each pin connects to the same pin on the opposite side. Review
the
diagram below for a visual example
11
Notice how each wire corresponds to the same pin. This kind of wiring diagram is part of the
568A standard. The 568B standard achieves the same thing, but through different wiring. It is
generally accepted to use the 568A standard as pictured, since it allows compatibility with
certain telephone hardware- while 568B doesn't.
Straight-through cables are primarily used for connecting unlike devices. A straight-through
cable is typically used in the following situations:
Note that some devices such as routers will have advanced circuitry, which enables them to
use both crossover and straight-through cables. In general, however, straight-through cables
will not
connect a computer and router because they are not "unlike devices."
12
PROGRAM NO – 3
Objective:
Procedure:-
1. From the network component box, click on End Devices and drag-and-drop
a Generic PC icon and a Generic laptop icon into the Workspace.
2. Click on Connections, then click on Copper Cross-Over, then on PC0, and
select FastEthernet. After this, click on Laptop0 and select FastEthernet. The link
status LED should show up in green, indicating that the link is up.
3. Click on the PC, go to the Desktop tab, click on IP Configuration, and enter an IP
address and subnet mask. In this topology, the default gateway and DNS server
information is not needed as there are only two end devices in the network.
4. Close the window, open the laptop, and assign an IP address to it in the same way.
Make sure that both of the IP addresses are in the same subnet.
13
5. Close the IP Configuration box, open the command prompt, and ping the IP address
of the device at the end to check connectivity.
What is a network topology without a single network device in it? Add an Ethernet switch to
this topology so that more than two end devices can be connected, by performing the
following steps:
1. Click on Switches from the device-type selection box and insert any switch
(except Switch-PT-Empty) into the workspace.
2. Remove the link between the PC and the laptop using the delete tool from the common
tools bar.
3. Choose the Copper Straight-Through cable and connect the PC and laptop with the
switch. At this point, the link indicators on the switch are orange in color because the
switch ports are undergoing the listening and learning states of the Spanning Tree
Protocol (STP).
14
4. Once the link turns green, as shown in the previous screenshot, ping again to check the
connectivity..
5. To save this topology, navigate to File | Save As and choose a location. The topology will
be saved with a .pkt extension, with the devices in the same state.
15
PROGRAM NO – 4
Objective:
To construct a simple network topology by using switch & hub on Packet Tracer.
Conceptual Background
Hub and Switch are the network connecting devices, both help to connect various devices.
Hub works at the physical layer and transmits the signal to the port. Switch route the
information and send it over the network.
16
Step 2: Link every device with the switch.
Step 4: Transfer message from one device to another and check the Table for Validation.
17
Now to check whether the connections are correct or not try to ping any device and the image
below is doing the same.
To do ping one terminal of one device and run the following command:
Command:
"ping ip_address_of _any_device"
Example:
ping 192.168.1.4
18
PROGRAM NO – 5
Objective:
Conceptual Background:
A router is a device that forwards data packets between computer networks, creating an overlay
internetwork. A router is connected to two or more data lines from different networks. When a
data packet comes in one of the lines, the router reads the address information in the packet to
determine its ultimate destination. Then, using information in its routing table or routing policy,
it directs the packet to the next network on its journey. Routers perform the "traffic directing"
functions on the Internet. A data packet is typically forwarded from one router to another
through the networks that constitute the internetwork until it reaches its destination node.
Procedure:
2. Then, configure the routers R1and R2 and activate the FastEthernet and serial port of
the routers by coding:-
Configuration of R_0 on fast Ethernet port
19
R_0(config)#int f0/0
R_0(config-if)#no shut
R_0(config-if)#
R_0(config-if)#exit
R_1(config)#int f0/0
R_1(config-if)#no shut
R_1(config-if)#
R_1(config-if)#exit
For R_0
R_0#
R_0#configure terminal
R_0(config)#int s 2/0
20
R_0(config-if)#ip address 192.168.20.1 255.255.255.0
R_0(config-if)#no shut
R_0(config-if)#exit
For R_1
R_1#
R_1#configure terminal
R_1(config)#int s 2/0
R_1(config-if)#no shut
R_1(config-if)#
R_1(config-if)#exit
3. Now, configure the PC1 and PC2 by giving ip address and default gateway as:-
For PC0- IP address: 192.168.10.2 and default gateway as 192.168.10.1.
For PC1- IP address: 192.168.30.2 and default gateway as 192.168.30.1.
4. After doing configuration of the routers and PCs we ping the router to thePC and
output come as:-
21
PROGRAM NO – 6
Aim: Establishing a Web Server Connection Using the PC’s Web Browser
Objective:
To study the concept of receiving a web page from server, requested by a client.
Conceptual Background:
The primary function of a web server is to deliver web pages on the request of clients using the
Hypertext Transfer Protocol (HTTP). This means delivery of HTML documents and any
additional content that may be included by a document, such as images, style sheets and scripts.
A user agent, commonly a web browser or web crawler, initiates communication by making a
request for a specific resource using HTTP and the server responds with the content of that
resource or an error message if unable to do so. The resource is typically a real file on the
server's secondary storage, but this is not necessarily the case and depends on how the web
server is implemented.
While the primary function is to serve content, a full implementation of HTTP also includes
ways of receiving content from clients. This feature is used for submitting web forms, including
uploading of files.
Procedure:
22
6. Close the window and try the same steps in Simulation Mode. In this mode, the user
controls time, so the network can be viewed running at a slower pace, allowing
observation of the paths packets take and inspection of packets in detail.
7. Select the PC again and go to the Web Browser in the Desktop tab. Type
www.firstlab.com as the URL again and click Go. The welcome page should not appear
right away.
8. Switch to the main interface of Packet Tracer without closing the PC configuration
window. Notice that a DNS packet is added to the event list.
9. Click Auto Capture/Play or repeatedly click the Capture/Forward button until the HTTP
packet appears on the PC. Go back to the PC configuration window. The Packet Tracer
welcome page is now shown.
10. Close the PC configuration window.
23
PROGRAM NO – 7
Objective:
Conceptual Background:
Routing is a process in which the layer 3 devices (either router or layer 3 switches) find the
optimal path to deliver a packet from one network to another. Dynamic routing protocols use
metric, cost, and hop count to identify the best path from the path available for the destination
network.
Procedure:-
24
Step 1: Draw the Topology diagram as mentioned in above diagram.
25
Step 3: Assign Ip Address on each Router One by One
Now assign IP Address on Router R2, Router R3, and Router R4 as done in R1.
Step 4: Now it’s Time to configure Static Route over all those Four Routers R1, R2, R3 and
R4.
26
Static Routing Configuration on Router R2
27
AT the End test the communication between two PC to test whether your Routing is properly
configured or not.
28
PROGRAM NO – 8
Objective:
Conceptual Background:
Router0
Router>en
Router#conf t
Router(config)#hostname Router0
Router0(config)#int s0/3/0
Router0(config-if)#ip add 192.168.3.1 255.255.255.252
Router0(config-if)#no shut
Router0(config-if)#desc connection to Router1
Router0(config-if)#int f0/0
29
Router0(config-if)#ip add 192.168.0.1 255.255.255.0
Router0(config-if)#no shut
Router0(config-if)#desc connection to LAN
Router0(config-if)#exit
Router0(config)#router RIP
Router0(config-router)#netw 192.168.0.0
Router0(config-router)#netw 192.168.3.0
Router0(config-router)#no auto
Router0(config-router)#exit
Router0(config)#exit
Router0#copy run start
Router1
Router>en
Router#conf t
Router(config)#hostname Router1
Router1(config)#int s0/3/0
Router1(config-if)#clock rate 64000
Router1(config-if)#ip add 192.168.3.2 255.255.255.252
Router1(config-if)#no shut
Router1(config-if)#desc connection to Router0
Router1(config-if)#int s0/2/0
Router1(config-if)#clock rate 64000
Router1(config-if)#ip add 192.168.4.1 255.255.255.252
Router1(config-if)#no shut
Router1(config-if)#desc connection to Router2
Router1(config-if)#int f0/0
Router1(config-if)#ip add 192.168.1.1 255.255.255.0
Router1(config-if)#no shut
Router1(config-if)#desc connection to LAN
Router1(config-if)#exit
Router1(config)#router RIP
Router1(config-router)#netw 192.168.1.0
Router1(config-router)#netw 192.168.3.0
Router1(config-router)#netw 192.168.4.0
Router1(config-router)#no auto
Router1(config-router)#exit
Router1(config)#exit
Router1#copy run start
Router2
Router>en
Router#conf t
Router(config)#hostname Router0
Router2(config)#int s0/3/0
Router2(config-if)#ip add 192.168.4.2 255.255.255.252
30
Router2(config-if)#no shut
Router2(config-if)#desc connection to Router1
Router2(config-if)#int f0/0
Router2(config-if)#ip add 192.168.2.1 255.255.255.0
Router2(config-if)#no shut
Router2(config-if)#desc connection to LAN
Router2(config-if)#exit
Router2(config)#router RIP
Router2(config-router)#netw 192.168.4.0
Router2(config-router)#netw 192.168.2.0
Router2(config-router)#no auto
Router2(config-router)#exit
Router2(config)#exit
Router2#copy run start
Verification
To verify the working of the lab, we need to confirm that we are learning all routes via RIP. To
do this, we need to use #show ip route command. See results from Router0:
31
PROGRAM NO – 9
Ipconfig displays all current TCP/IP network configuration values and refreshes Dynamic
Host Configuration Protocol (DHCP) and Domain Name System (DNS) settings. Used
without parameters, ipconfig displays the IP address, subnet mask, and default gateway for all
adapters.
There are several options available with the ipconfig command, accessible with the command
ipconfig/? To show the most information about the network connections, use the command
ipconfig/all.
Examining Routes
On host computers, netstat command displays active TCP connections, ports on which the
computer is listening, Ethernet statistics, the IP routing table, IPv4 statistics (for the IP,
ICMP, TCP, and UDP protocols), and IPv6 statistics (for the IPv6, ICMPv6, TCP over IPv6,
and UDP over IPv6 protocols). Used without parameters, netstat displays active TCP
connections.
32
There are several options available with the netstat command, accessible with the command
netstat/? . To display the contents of the IP routing table, use the command netstat –r.
Route command displays and modifies the entries in the local IP routing table. Used without
parameters, route displays help.
Tools that are indispensable when testing TCP/IP network connectivity are ping and tracert.
Ping is a utility for testing IP connectivity between hosts. Ping sends out requests for
responses from a specified host address. Ping uses a Layer 3 protocol that is a part on the
TCP/IP suite called Internet Control Message Protocol (ICMP). Ping uses an ICMP Echo
Request datagram.
If the host at the specified address receives the Echo request, it responds with an ICMP Echo
Reply datagram. For each packet sent, ping measures the time required for the reply.
As each response is received, ping provides a display of the time between the ping being sent
and the response received. This is a measure of the network performance. Ping has a timeout
value for the response. If a response is not received within that timeout, ping gives up and
provides a message indicating that a response was not received.
After all the requests are sent, the ping utility provides an output with the summary of the
responses. This output includes the success rate and average round-trip time to the
destination.
33
Step 1 Access the command prompt
Use the Start menu to open the Command Prompt window. Press Start > Programs >
Accessories > Command Prompt or Start > run > cmd
In the window, type ping, a space, and the IP address of a computer recorded in the
previous lab. The following figure shows the successful results of ping to this IP address.
Ping uses the ICMP echo request and echo reply feature to test physical connectivity. Since
ping reports on four attempts, it gives an indication of the reliability of the connection. Look
over the results and verify that the ping was successful. Is the ping successful? If not, perform
appropriate troubleshooting.
Try to ping the IP address of the default gateway. If the ping is successful, it means
there is physical connectivity to the router on the local network and probably the rest of the
world.
Try to ping the hostname of the computer of your partner. The figure shows the successful
result of the ping the hostname.
34
Address Resolution Protocol (ARP)
ARP is used as a tool for confirming that a computer is successfully resolving network Layer
3 addresses to Media Access Control (MAC) Layer 2 addresses. The TCP/IP network
protocol relies on IP addresses like 192.168.14.211 to identify individual devices and to assist
in navigating data packets between networks. While the IP address is essential to move data
from one LAN to another, it cannot deliver the data in the destination LAN by itself. Local
network protocols, like Ethernet or Token Ring, use the MAC, or Layer 2, address to identify
local devices and deliver all data.
ARP maintains a table in the computer of IP and MAC address combinations. In other words,
it keeps track of which MAC address is associated with an IP address. If ARP does not know
the MAC address of a local device, it issues a broadcast using the IP address. This broadcast
searches for the MAC address that corresponds to the IP address. If the IP address is active on
the LAN, it will send a reply from which ARP will extract the MAC address. ARP will then
add the address combination to the local ARP table of the requesting computer.
35
Program No. 10
1- Create a home page for your Web site using any web page design tool
2- Name your home page file Default.htm or Default.asp
3- Copy your home page into the default Web publishing directory for IIS also called the
home directory located in \inetpub\wwwroot
4- If your network has a name resolution system (typically DNS), then visitors can
simply type your computer name in the address bar of their browsers to reach your site. If
your network does not have a name resolution system, visitors must type the numerical IP
address of your computer.
36
Program No. 11
Aim: How to transfer the data using ftp.
To Publish Content on your FTP Site
1- Copy or move your files into the default FTP publishing directory. The
default directory provided by Setup is\inetpub\ftproot.
2- If your network has a name resolution system (typically DNS), then visitors
can Type ftp:// followed by your computer name in the address bar of their
browsers to reach your site. If your network does not have a name resolution
system, visitors must type ftp:// and the numerical IP address of your computer.
Using Windows XP Professional you can host one Web site and one FTP site
on a single computer.
37
PROGRAM NO – 12
Protocol (EIGRP)
REQUIREMENT:
PROCEDURE:
OUTPUT:
38
39
40
41
42
43
44