CN Lab Manual
CN Lab Manual
COMMUNICATION ENGINEERING
COMPUTER NETWORKS
LABORATORY MANUAL
(17EC3107)
List of experiments in Computer Networks lab
At the end of the session you will be able to become familiar with different types of
equipment’s and cables used in the networked lab.
1.2.1 Server
Concept of a server is based on one or more personal computers to perform specific tasks for a
number of other PCs. The most common function is disk, file and print servers.
A Disk Server provides low-level support and performs basic read/write operation to disk
sectors.
A File Sever is a higher-level support mechanism, performing such function as lockout and
dynamic allocation of space on disk. In a star topology the server is the principal connection
point. All nodes, including the server, are connected to a hub. This enables the server to house
and administer software, fie sharing, file saving and to allocate printers or other peripherals. In
a bus topology, the server acts like arbitrator, each node talks to the server when requesting
information. The server then locates the information on one of the connected clients and sends
it to the requesting client. Servers in any network can be an ordinary node but having more
capabilities of handling the data and having more speed.
1.2.2 Workstation
A node or stand-alone PC that is connected with network is called Workstation. A
workstation is generally a Client.
NIC (Network Interface Card): The network Interface Card (NIC) is the interface between
the PC and physical network connection. It is also called as Network Adapter Card. The NIC
is responsible for the operation that tasks place in the physical layer of the OSI model. It is only
concerned with sending and receiving) 0s and 1s, using the IEEE 802.3 Ethernet standard.
In windows, the NIC card is identified in the network property; to use protocol with NIC you
must bind the protocol to the adapter card.
Function of NIC:
• Data Transfer
• Data Buffering
• Frame Construction
• Media Access Control
• Parallel/Serial Conversion
• Data Encoding/Decoding
• Data Transmission/Reception
A network printer: A network printer is a printer that is accessible by network connection,
making it usable by other computers connected to the network. The printer may have its own
network connection, or use the network connection of a single dedicated computer to which it
has a local connection.
1.2.3 Cables
To transmit the data the medium must exist, usually in the form of cables or wireless media.
Here are some most commonly used cable types.
RG-58 is typically used for wiring laboratories and offices, or another small group of
computers. The maximum length of thin wire Ethernet segment is 185 meters, which is due to
the nature of the CSMA/CD method of operation, the cable attenuation, and the speed at which
signals propagate inside the coax.
The length is limited to guarantee that collision is detected when machines that are apart
transmit at the same time. BNC connectors are used to terminate each end of the cable. When
many machines are connected to the same Ethernet segment, a daisy chain approach is used.
The BNC connectors allow the network interface card to the next machine. The machine each
end of the cable must use a terminating resistor to eliminate collision-causing reflection in the
cable.
The three popular types of connectors are: the BNC connector, the BNC T connector, and the
BNC terminator. The BNC connector is used to connect the end of the cable to a device, such
as a TV set. The BNC T connector is used in Ethernet networks to branch out to a connection
to a computer or other device. The BNC terminator is used at the end of the cable to prevent
the reflection of the signal.
Applications
1. Coaxial cable was widely used in analog telephone networks, and later with digital telephone
networks.
2. Cable TV networks use coaxial cables (RG-59) at the network boundaries. However, coaxial
cable has largely been replaced today with fiber-optic cable due to its higher attenuation.
3. Traditional Ethernet LAN
– 10Base-2, or thin Ethernet, uses RG-58 coax cable with BNC connectors.
– 10Base-5, or thick Ethernet, uses RG-11 coax cable with specialized connectors.
Twisted pair is probably the most widely used cabling system in Ethernet in networks. Two
copper wires twist around each other to form the twisted pair cable. Depending on category
several insulated wire strands can reside in the cable.
Unshielded Twisted Pair-Mostly the UTP is used. A twisted pair segment can’t exceed 100
meters. This limitation is the only drawback to twisted pair. Twisted pair is used for 10/100
based Ethernet networks. UTP cables are wired as straight through or crossover cables. Straight
through cables typically connect the computer’s networks interface can’t to be a port on the
hub. Crossover cables are used for NIC to communication and for hub-to-hub connections
when no crossover port is available.
Shielded Twisted Pair -It is 150Ω cable containing additional shielding that protects signals
against electromagnetic Interference (EMI) produced by electric motors power lines etc. It is
primarily used in Token Ring Network & where UTP cable would provide insufficient
protection against interface. Wires within cables are encased in a metallic sheath that is
conductive as copper in wires. This sheath when properly grounded converts it ambient noise
into current, like antenna. This current is carried to wires within where it creates an equal and
opposite current flowing in twisted pair thus getting cancelled and no noise signal is resulted.
2.0 Learning Objective: At the end of the session you will be able to be familiar with
different types of internetworking devices and their functions.
2.1 REPEATER
A Repeater is a purely electrical device that extends maximum distance a LAN cable
can span by Amplifying signals passing through it. A Repeater connects two segments
and broadcasts packets between them. Since signal loss is a factor in the maximum
length of a segment, a Repeater is used to amplify the signal and extend the usable
length.
Fig: Repeaters
A common Ethernet rule is that no more than four repeaters may be used to join
segments together. This is a physical limitation designed to keep collision detection
working properly. Repeaters operate at layer 1 (Physical layer) of the OSI model.
2.2 BRIDGES
The networks bridge provides an inexpensive and easy way to connect network
segments. A bridge provides Amplification function of a repeater plus, ability to select
filter packets based on their addresses. When network grows in size, it is often necessary
to partition it into smaller group of nodes to help isolate traffic and improve
performance. One way to do this is to use bridge, the operation of it is to keep one
segment traffic to that side and other side will cross the bridge.
The bridge learns which packets should cross it as it is used.
Fig: Bridged network
2.3 ROUTERS
Fig:Routers
The router examines each packet of information to detection weather the packet must
be translated form on one network to another network performing a function similar to
a bridge. Unlike a ridge, a router can connect network that use different technologies,
addressing methods, media type, frame format and speeds. A router is a special purpose
device designed to interconnect networks. Such that three networks can be connected
using two routers. Routers maintain routing tables in their memories to store
information about the physical connection on the network; the router examines each
packet of data, checks the routing table and then forwards the packet if necessary. Every
other router in the path (between any state destinations) performs a similar procedure.
Note that a router does not maintain any state information about the packets; it simply
moves them along the network. Routers are operated at layer 3(network) of OSI model.
2.4 HUBS
Hubs are also called concentrators; expand one Ethernet connection into many. For
example, a four-port hub connects up to four machines via UTP cables. The hub
provides a star connection for the four ports. Many hubs contain a single BNC
connectors as well to connect the hub to existing 10base2 network wiring, the hub can
also be connected via one of its ports. One pot is desired to operate in either straight
through or crossover mode, selected by a switch on the hub.
Hubs that can connect in this fashion are called stackable hubs. A hub is similar to a
repeater, expect it broadcasts data received by any port to all other ports on the hub.
Most hubs contain a small amount of intelligence as well. Examining received packets
and checking them for integrity. If a bad packet arrives or the hub determines that a port
is unreliable. It will shut down the line under the error condition is appears. The hub
also acts like a repeater. Because of its slight delay when processing a packet, the
numbers of hubs that may be connected in a series are limited.
2.5 SWITCHES
It is similar to a bridge, with some important enhancement. First, a switch may have
multiple ports, thus directing packets to several different segments further partitioning
and isolating network traffic in as way similar to router. For example, if 8-port n way
switch is there it can route packets from any input to any output.
Some or all of incoming packet is called store and forward, which stores the received
packet before examining it to for error before retransmitting. Bad packets are not
forwarded. A switch typically has auto-sensing 10/100 mbps ports and will just the
speed of each port accordingly; furthermore, a managed switch supports SNMP for
further control over network traffic. Switches operated at layer 2 (Data Link) of OSI
model.
EXPERIMENT-3
1. In the Cisco Packet Tracer console, click on the PC icon, click Generic, and
then click in the logical view area to add a Generic PC.
2. Repeat the same step to add three more Generic PCs in the logical view area,
as shown in the following figure.
Adding Switches in Cisco Packet Tracer
1. To add a switch in Cisco Packet Tracer, click the Switch icon, select a
switch t ype, such as 2960, and then add the selected switch in the logical
view area.
2. Repeat the same step to add one more switch.
1. To add a router in Cisco Packet Tracer, click the Router icon, select a router
type, such as 2811, and then add t he selected router in the logical view area.
2. Repeat the same step to add one more router.
To see the various t ypes of connect ions, click the Connection icon. Spend some
time to understand the connect ions. Once you are familiar with the typ es of
connect ions, connect the devices to create the network topology. The following
figure displays the various t ypes of connections used to connect devices.
Connect ing Devices in Cisco Packet Tracer
1. To connect devices in Cisco Packet Tracer, click the connect ion t ype icon,
and select an appropriate cable. For example, to
connect PC0 to Switch0, select the straight-through cable, click
on PC0, select the FastEthernet0 interface.
2. Next, click on Switch0, and then select the FastEthernet0/1 interface. The
following figure displays how to connect a PC to a switch in Cisco Packet
Tracer.
3. Now, add PC1 to Switch0 using the FastEthernet0/2 interface. Also,
4. If you have connected a wrong device to a wrong interface, you can use
the Delete option to delete a connect ion or device. The following figure
displays how to use the Delete option to delete a device or connect ion in
through cables.
Lab instructions
This lab will test your ability to configure basic settings such as hostname, motd banner,
encrypted passwords, and terminal options on a Packet Tracer simulated Cisco Catalyst switch.
1. Use the local laptop connect to the switch console and configure the laptop with the right
parameters for console access to the Cisco 2960 Catalyst switch
4. Configure the password for privileged mode access as "cisco". The password must be md5
encrypted
5. Configure password encryption on the switch using the global configuration command
7. Configure the IP address of the switch as 192.168.1.2/24 and it's default gateway IP
(192.168.1.1).
8. Test telnet connectivity from the Remote Laptop using the telnet client.
Network diagram:
Solution:
Configure Switch hostname as LOCAL-SWITCH
First connect switch from laptop using console cable (rs232 laptop side and console at switch
side)
Switch>enable
Switch#conf t
Switch#hostname LOCAL-SWITCH
Configure the password for privileged mode access as "cisco". The password must be
md5 encrypted
Configure password encryption on the switch using the global configuration command
service password-encryption
Configure CONSOLE access [...]
line con 0
password ciscoconsole
logging synchronous
login
history size 15
exec-timeout 6 45
line vty 0 15
exec-timeout 8 20
password ciscotelnet
logging synchronous
login
history size 15
Configure the IP address of the switch as 192.168.1.2/24 and it's default gateway IP
(192.168.1.1).
interface Vlan1
ip default-gateway 192.168.1.1
EXPERIMENT -5
Aim: Create a basic switch interfaces configuration using Cisco Packet Tracer
Apparatus (Software): CISCO Packet Tracer.
Procedure: This lab will test your ability to configure speed, duplex, and vlan settings on
Cisco switch network interfaces using Packet Tracer.
1. Connect to Switch0 using console interface and configure each Switch0 fastethernet
switchport for operation. Correct settings are :
- Port type : access port
- Speed : 100 Mbit/s
- Duplex mode : Full Duplex
- Autonegotiation disabled
Network diagram:
Solution:
Connect to Switch0 using console interface and configure each Switch0 fastethernet
switchport for operation.
Switch(config)#interface FastEthernet0/1
Switch(config)#interface FastEthernet0/2
Switch(config)#interface FastEthernet0/3
Switch(config)#interface FastEthernet0/4
PC "192.168.1.4" seems to be unable to ping other PCs in the network. Check switch
configuration.
Switch(config)#interface FastEthernet0/4
Objectives
Part 1: Verify the Default Router Configuration
R1(config)#no ip domain-lookup
R1(config)#enable secret class1
Step 2: Configure the console and virtual terminal line passwords on each of the routers.
Step 3: Add the logging synchronous command to the console and virtual terminal lines.
Step 4: Add the exec-timeout command to the console and virtual terminal lines.
R1(config)#line console 0
R1(config-line)#password exam1
R1(config-line)#login
R1(config-line)#logging synchronous
R1(config-line)#exec-timeout 0 0
R1(config-line)#exit
R1(config)#line vty 0 4
R1(config-line)#password cisco1
R1(config-line)#login
R1(config-line)# logging synchronous
R1(config-line)#exec-timeout 0 0
R1(config-line)#exit
R1(config)#exit
R1>exit
Click on CLI of ROUTER 2 Repeat the same steps (change passwords)
Step 1: On R1 from privileged EXEC mode, enter the debug ip routing command.
R1#debug ip routing
R1(config-if)#exit
R1(config)# end
R1#disable
R1>exit
R2(config)#interface se3/0
R2(config-if)#ip address 192.168.1.2 255.255.255.0
R2#disable
R2>exit
R3#disable
R3>exit
Task 4: Finish Configuring Router Interfaces
Step 1: Test connectivity. Test connectivity by pinging from each host to the default
gateway that has been configured for that host.
Step 2: Use the ping command to test connectivity between directly connected routers.
Step 3: Use ping to check connectivity between devices that are not directly connected.
Task 7: Gather Information.
Step 2: View the routing table to verify the new static route entry.
R3# show ip route ( Now 3 routes )
Step 3: Use ping to check connectivity between the host PC3 and the host PC2.
Step 4: On the R2 router, configure a static route to reach the 192.168.2.0 network.
R2(config)#ip route 192.168.2.0 255.255.255.0 192.168.1.1
Step 5: View the routing table to verify the new static route entry.
R2# show ip route (Now 4 routes)
Step 6: Use ping to check connectivity between the host PC3 and the host PC2.
Task 9: Configure a Static Route Using an Exit Interface.
R3#show running-config
Step 3: On the R2 router, configure a static route
R2(config)# ip route 172.16.3.0 255.255.255.0 Se2/0
Step 4: View the routing table to verify the new static route entry.
R2# show ip route ( Now 5 routes )
Step 5: Use ping to check connectivity between the host PC2 and PC1.
Task 10: Configure a Default Static Route.
Step 4: Verify that the routes are no longer in the routing table. (now 3 entries only)
Step 5: Use ping to check connectivity between the host PC3 and PC1.
Objectives
Part 1: Examine HTTP Web Traffic
Part 2: Display Elements of the TCP/IP Protocol Suite
Background
This simulation activity is intended to provide a foundation for understanding the TCP/IP
protocol suite and the relationship to the OSI model. Simulation mode allows you to view the
data contents being sent across the network at each layer.
As data moves through the network, it is broken down into smaller pieces and identified so that
the pieces can be put back together when they arrive at the destination. Each piece is assigned
a specific name (protocol data unit [PDU]) and associated with a specific layer of the TCP/IP
and OSI models. Packet Tracer simulation mode enables you to view each of the layers and the
associated PDU. The following steps lead the user through the process of requesting a web
page from a web server by using the web browser application available on a client PC.
Even though much of the information displayed will be discussed in more detail later, this is
an opportunity to explore the functionality of Packet Tracer and be able to visualize the
encapsulation process.
Part 1: Examine HTTP Web Traffic
In Part 1 of this activity, you will use Packet Tracer (PT) Simulation mode to generate web
traffic and examine HTTP.
Step 1: Switch from Realtime to Simulation mode.
In the lower right corner of the Packet Tracer interface are tabs to toggle between Realtime
and Simulation mode. PT always starts in Realtime mode, in which networking protocols
operate with realistic timings. However, a powerful feature of Packet Tracer allows the user to
“stop time” by switching to Simulation mode. In Simulation mode, packets are displayed as
animated envelopes, time is event driven, and the user can step through networking events.
a. Click the Simulation mode icon to switch from Realtime mode to Simulation mode.
b. Select HTTP from the Event List Filters.
1) HTTP may already be the only visible event. Click Edit Filters to display the available
visible events. Toggle the Show All/None check box and notice how the check boxes switch
from unchecked to checked or checked to unchecked, depending on the current state.
2) Click the Show All/None check box until all boxes are cleared and then select HTTP.
Click anywhere outside of the Edit Filters box to hide it. The Visible Events should now
only display HTTP.
Step 2: Generate web (HTTP) traffic.
Currently the Simulation Panel is empty. There are six columns listed across the top of the
Event List within the Simulation Panel. As traffic is generated and stepped through, events
appear in the list. The Info column is used to inspect the contents of a particular event.
Note: The Web Server and Web Client are displayed in the left pane. The panels can be
adjusted in size by hovering next to the scroll bar and dragging left or right when the double-
headed arrow appears.
a. Click Web Client in the far left pane.
b. Click the Desktop tab and click the Web Browser icon to open it.
c. In the URL field, enter www.osi.local and click Go.
Because time in Simulation mode is event-driven, you must use the Capture/Forward
button to display network events.
d. Click Capture/Forward four times. There should be four events in the Event List.
Look at the Web Client web browser page. Did anything change?
The web page was returned from the web server.
Step 3: Explore the contents of the HTTP packet.
a. Click the first colored square box under the Event List > Info column. It may be necessary
to expand the Simulation Panel or use the scrollbar directly below the Event List.
The PDU Information at Device: Web Client window displays. In this window, there are
only two tabs (OSI Model and Outbound PDU Details) because this is the start of the
transmission. As more events are examined, there will be three tabs displayed, adding a tab
for Inbound PDU Details. When an event is the last event in the stream of traffic, only the
OSI Model and Inbound PDU Details tabs are displayed.
b. Ensure that the OSI Model tab is selected. Under the Out Layers column, ensure that the
Layer 7 box is highlighted.
Information listed under the PDU Details is reflective of the layers within the TCP/IP model.
Note: The information listed under the Ethernet II section provides even more detailed
information than is listed under Layer 2 on the OSI Model tab. The Outbound PDU Details
provides more descriptive and detailed information. The values under DEST MAC and SRC
MAC within the Ethernet II section of the PDU Details appear on the OSI Model tab under
Layer 2, but are not identified as such.
What is the common information listed under the IP section of PDU Details as
compared to the information listed under the OSI Model tab? With which layer is it
associated? SRC IP and DST IP at Layer 3
What is the common information listed under the TCP section of PDU Details, as compared
to the information listed under the OSI Model tab, and with which layer is it associated?
SRC PORT and DEST PORT at Layer 4
What is the Host listed under the HTTP section of the PDU Details? What layer would this
information be associated with under the OSI Model tab? www.osi.local, Layer 7
g. Click the next colored square box under the Event List > Info column. Only Layer 1 is
active (not grayed out). The device is moving the frame from the buffer and placing it on to
the network.
h. Advance to the next HTTP Info box within the Event List and click the colored square
box. This window contains both In Layers and Out Layers. Notice the direction of the
arrow directly under the In Layers column; it is pointing upward, indicating the direction the
information is travelling. Scroll through these layers making note of the items previously
viewed. At the top of the column the arrow points to the right. This denotes that the server is
now sending the information back to the client.
Comparing the information displayed in the In Layers column with that of the Out Layers
column, what are the major differences? The Src and Dst Ports, Src and Dst IPs and MAC
addresses have been swapped.
i. Click the Outbound PDU Details tab. Scroll down to the HTTP section.
What is the first line in the HTTP message that displays? HTTP/1.1 200 OK – this means that
the request was successful and the page delivered from the server.
j. Click the last colored square box under the Info column. How many tabs are displayed with
this event and why?
Just 2, one for the OSI Model and one for Inbound PDU Details because this is the receiving
device.
Part 2: Display Elements of the TCP/IP Protocol Suite
In Part 2 of this activity, you will use the Packet Tracer Simulation mode to view and
examine some of the other protocols comprising of the TCP/IP suite.
Step 1: View Additional Events
a. Close any open PDU information windows.
b. In the Event List Filters > Visible Events section, click Show All.
What additional Event Types are displayed? Depending on whether any communications has
occurred prior to starting the original simulation, there should now be entries for ARP, DNS,
TCP and HTTP. It is possible that the ARP entries may not show, depending on what a
student may have done prior to going to simulation mode. If the activity is started from
scratch all of those will be listed.
These extra entries play various roles within the TCP/IP suite. If the Address Resolution
Protocol (ARP) is listed, it searches MAC addresses. DNS is responsible for converting a
name (for example, www.osi.local) to an IP address. The additional TCP events are
responsible for connecting, agreeing on communication parameters, and disconnecting the
communications sessions between the devices. These protocols have been mentioned
previously and will be further discussed as the course progresses. Currently there are over 35
possible protocols (event types) available for capture within Packet Tracer.
c. Click the first DNS event in the Info column. Explore the OSI Model and PDU Detail
tabs and note the encapsulation process. As you look at the OSI Model tab with Layer 7
highlighted, a description of what is occurring is listed directly below the In Layers and Out
Layers (“1. The DNS client sends a DNS query to the DNS server.”). This is very useful
information to help understand what is occurring during the communication process.
d. Click the Outbound PDU Details tab. What information is listed in the NAME: in the
DNS QUERY section?
www.osi.local
Click the last DNS Info colored square box in the event list. Which device is displayed?
The Web Client
What is the value listed next to ADDRESS: in the DNS ANSWER section of the Inbound
PDU Details?
192.168.1.254 – the address of the Web Server
f. Find the first HTTP event in the list and click the colored square box of the TCP event
immediately following this event. Highlight Layer 4 in the OSI Model tab. In the numbered
list directly below the In Layers and Out Layers, what is the information displayed under
items 4 and 5?
4. The TCP connection is successful. 5. The device sets the connection state to
ESTABLISHED.
TCP manages the connecting and disconnecting of the communications channel along with
other responsibilities. This particular event shows that the communication channel has been
ESTABLISHED.
g. Click the last TCP event. Highlight Layer 4 in the OSI Model tab. Examine the steps listed
directly below In Layers and Out Layers. What is the purpose of this event, based on the
information provided in the last item in the list (should be item 4)? CLOSING the connection.
EXPERIMENT -9
3. Configure DHCP server on the Router. In the server we will define a pool of IP
addresses to be assigned to hosts, Default gateway and a DNS Server.
4. Now go to every PC and on their IP configuration tabs, enable DHCP. Every PC
should be able to obtain the an IP address, default gateway and DNS server, as
defined in step 2.
For example, to enable DHCP on PC1:
You can test the configuration by pinging PC2 from PC1. Ping should succeed.
EXPERIMENT -10
Ping : The most commonly used network tool is the ping utility. This utility is used to provide
a basic connectivity test between the requesting host and a destination host. This is done by
using the Internet Control Message Protocol (ICMP) which has the ability to send an echo
packet to a destination host and a mechanism to listen for a response from this host. Simply
stated, if the requesting host receives a response from the destination host, this host is reachable.
This utility is commonly used to provide a basic picture of where a specific networking problem
may exist. For example, if an Internet connection is down at an office, the ping utility can be
used to figure out whether the problem exists within the office or within the network of the
Internet provider. Figure 1 below shows an example of the ping utility being used to obtain the
reachability status of the locally connected router.
Ipconfig: One of the most important things that must be completed when troubleshooting a
networking issue is to find out the specific IP configuration of the variously affected hosts.
Sometimes this information is already known when addressing is configured statically, but
when a dynamic addressing method is used, the IP address of each host can potentially change
often. The utilities that can be used to find out this IP configuration information include the
ipconfig utility on Windows machines and the ifconfig utility on Linux/*nix based machines.
Figure 3 below shows an example of the ifconfig utility showing the IP configuration
information of a queries host.
Figure 3: Ipconfig utility
Nslookup: Some of the most common networking issues revolve around issues with Dynamic
Name System (DNS) address resolution issues. DNS is used by everyone using the Internet to
resolve commonly known domain names (i.e. google.com) to commonly unknown IP addresses
(i.e. 74.125.115.147). When this system does not work, most of the functionality that people
are used to goes away, as there is no way to resolve this information. The nslookup utility can
be used to lookup the specific IP address(es) associated with a domain name. If this utility is
unable to resolve this information, there is a DNS issue. Along with simple lookup, the
nslookup utility is able to query specific DNS servers to determine an issue with the default
DNS servers configured on a host. Figure 4 below shows an example of how the nslookup
utility can be used to query the associated IP address information.
Figure 4: Nslookup utility
Netstat: Often, one of the things that are required to be figured out is the current state of the
active network connections on a host. This is very important information to find for a variety
of reasons. For example, when verifying the status of a listening port on a host or to check and
see what remote hosts are connected to a local host on a specific port. It is also possible to use
the netstat utility to determine which services on a host that is associated with specific active
ports. Figure 5 below shows an example of the netstat utility being used to display the currently
active ports on a Linux machine.
Figure 5: Netstat utility
Conclusion: This brings us to the end of the lab where we began our troubleshooting . The
scenario presented in this lab is very simple and we will encounter more difficult problems
as we go along with real hardware. This will be the basic knowledge required to proceed
further working with cisco hardware devices.