Computer Network Lab Manual
Computer Network Lab Manual
Submitted to:
Sir Ammar Rafiq
Submitted by:
Name: Saif Ul Rehman
Roll NO : 18-CS-09
Computer networks are the basis of communication in IT. They are used in a huge variety of
ways and can include many different types of network. A computer network is a set of computers
that are connected together so that they can share information. The earliest examples of computer
networks are from the 1960s, but they have come a long way in the half-century since then.
Computer networks are used to carry out a large number of tasks through the sharing of
information.
Sharing files
Twisted-Pair Cable
One of the earliest guided transmission media is twisted pair cables. A twisted pair cable comprises
of two separate insulated copper wires, which are twisted together and run in parallel. The copper
wires are typically 1mm in diameter. One of the wires is used to transmit data and the other is the
ground reference.
Reason for Twisting
All transmissions are prone to noise, interferences, and crosstalks. When the wires are twisted,
some part of the noise signals is in the direction of data signals while the other parts are in the
opposite directions. Thus the external waves cancel out due to the different twists. The receiver
calculates the difference in the voltages of the two wires for retrieving data. Thus a much better
immunity against noise is obtained.
In telephone lines
In DSL lines
In LANs
Category 1 − UTP used in telephone lines with data rate < 0.1 Mbps
Category 4 − UTP used in Token Ring networks with a data rate of 20 Mbps
Unshielded Twisted Pair ( UTP ): These generally comprise of wires and insulators.
Shielded Twisted Pair ( STP ): They have a braided wired mesh that encases each pair of
insulated wires.
Unshielded Twisted Pair (UTP)
Unshielded Twisted Pair or UTP are twisted pair cables and are used to transmit both data and
voice as their frequency range is suitable for transmission. UTPs are more cost effective and are
not needed to be grounded.
Shielded Twisted Pair or STP are also a twisted pair cables but are required to be grounded, wants
more maintenance, have high data trasmission capacity and are more costly then UTP.
Following are some of the important differences between Unshielded Twisted Pair (UTP) and
Abstract Classes in Scala.
Sr. Key Unshielded Twisted Pair (UTP) Shielded Twisted Pair (STP)
No.
1 Full for UTP stands for Unshielded STP stands for Shielded
Twisted Pair. Twisted Pair.
Coaxial cables, commonly called coax, are copper cables with metal shielding designed to provide
immunity against noise and greater bandwidth. Coax can transmit signals over larger distances at
a higher speed as compared to twisted pair cables.
Coax has a central core of stiff copper conductor for transmitting signals. This is covered by an
insulating material. The insulator is encased by a closely woven braided metal outer conductor that
acts as a shield against noise. The outer conductor is again enclosed by a plastic insulating cover.
The structure is shown in the following figure −
Coaxial cables are categorized into three types as per radio government (RG) ratings −
In analog telephone networks: A single coaxial network can carry about 10,000 voice
signals.
In cable TV networks
In MANs
Fiber optic cables have many uses in a variety of situations in industries and applications. Check
out some of these uses:
Medical
Optical fibers are suited for medical use. They can be made in flexible strands, extremely thin for
insertion into the lungs, blood vessels, and many hollow parts of the body. These optical fibers
are utilized in several instruments that allow doctors to observe internal body parts without
performing any surgery.
Telecommunications
Optic Fiber is installed and used for receiving and transmitting purposes. Telephone transmission
uses fiber optic cables. These fibers transmit energy in the form of light pulses. Its technology is
comparable to that of the coaxial cables, apart from that the optical fibers are able to handle
thousands of conversations concurrently.
Networking
Optic fibers are used to connect servers and users in a variety of network settings and also help in
increasing the accuracy and speed of data transmission.
Industrial/Commercial
Fibers are used for imaging in reach areas, such as sensory devices to make temperature, as
wiring where EMI is an issue, pressure, as wiring in industrial settings and automobiles.
Broadcast/CATV Cable companies use fiber optic cables for wiring HDTV, CATV, video-on-
demand, the internet and many other applications.
Defense/Government
They are used as hydrophones for SONAR and seismic uses, such as wiring in submarines,
aircraft, and other vehicles.
Data Storage
Fiber cables are used for data storage as well as transmission. Fiber optic cables are also used for
imaging and lighting and as sensors to monitor and measure a vast array of variables.
Furthermore, fiber cables are used in development, research and testing across all the
aforementioned applications.
Optical fibre and Coaxial cables, both are different types of guided media cables. Optical fibre is
made up of plastic and glass and is used to transmits signals in form of light or optics whereas
coaxial cable is made using plastic and copper wires and is used to transmits signals in form of
electric signals.
2 Material Optical fibre is made using Coaxial cable is prepared using plastic
plastic and glass. and copper wires.
4 Cost Optical fibre is costly and its Coaxial cable is cheap and its
installation is quite expensive. installation is less expensive.
7 Diameter Optical fibre is having a smaller Coaxial cable diameter is bigger than
diameter. that of optical fibre.
8 Installation The installation of Optical fibre The installation of Coaxial cable is
is complex. comparatively easy.
What is WiFi?
WiFi is a wireless technology that connects devices to the internet without any physical wired
connection. Introduced in 1999, it is the most popular type of connection used today.
What is Ethernet?
If the question was asked some time ago, the answer would be a bit different than it is today.
Because Ethernet uses cables, it tends to work slightly faster than a wireless connection.
Wireless connections are a bit slower, but provide the convenience of using it within range.
Today, WiFi hotspots can easily be found in many places.Thus, the choice lies between speed
and convenience.
Speed
WiFi was initially based on the 802.11g standard. The maximum theoretical speed was 54Mbps.
Mobile phones could be connected to the internet with this connection, but the speed was much
slower when compared to Ethernet – which could easily provide 100Mbps-1,000Mbps and
beyond.
Lab No 2
OSI Model:
We’ll describe OSI layers “top down” from the application layer that directly serves the end user,
down to the physical layer.
1. Application Layer
The application layer is used by end-user software such as web browsers and email clients. It
provides protocols that allow software to send and receive information and present meaningful
data to users. A few examples of application layer protocols are the Hypertext Transfer
Protocol (HTTP), File Transfer Protocol (FTP), Post Office Protocol (POP), Simple Mail
Transfer Protocol (SMTP), and Domain Name System (DNS).
2. Presentation Layer
The presentation layer prepares data for the application layer. It defines how two devices should
encode, encrypt, and compress data so it is received correctly on the other end. The presentation
layer takes any data transmitted by the application layer and prepares it for transmission over the
session layer.
3. Session Layer
The session layer creates communication channels, called sessions, between devices. It is
responsible for opening sessions, ensuring they remain open and functional while data is being
transferred, and closing them when communication ends. The session layer can also set
checkpoints during a data transfer—if the session is interrupted, devices can resume data transfer
from the last checkpoint.
4. Transport Layer
The transport layer takes data transferred in the session layer and breaks it into “segments” on
the transmitting end. It is responsible for reassembling the segments on the receiving end, turning
it back into data that can be used by the session layer. The transport layer carries out flow
control, sending data at a rate that matches the connection speed of the receiving device, and
error control, checking if data was received incorrectly and if not, requesting it again.
5. Network Layer
The network layer has two main functions. One is breaking up segments into network packets,
and reassembling the packets on the receiving end. The other is routing packets by discovering
the best path across a physical network. The network layer uses network addresses (typically
Internet Protocol addresses) to route packets to a destination node.
The data link layer establishes and terminates a connection between two physically-connected
nodes on a network. It breaks up packets into frames and sends them from source to destination.
This layer is composed of two parts—Logical Link Control (LLC), which identifies network
protocols, performs error checking and synchronizes frames, and Media Access Control (MAC)
which uses MAC addresses to connect devices and define permissions to transmit and receive
data.
7. Physical Layer
The physical layer is responsible for the physical cable or wireless connection between network
nodes. It defines the connector, the electrical cable or wireless technology connecting the
devices, and is responsible for transmission of the raw data, which is simply a series of 0s and 1s,
while taking care of bit rate control.
Advantages of OSI Model
IP Address:
An IP address is a numerical label assigned to the devices connected to a computer network that
uses the IP for communication. IP address act as an identifier for a specific machine on a
particular network. It also helps you to develop a virtual connection between a destination and a
source.
Types of IP address
Public,
Private,
Static
Dynamic.
Among them, public and private addresses are based on their location of the network private,
which should be used inside a network while the public IP is used outside of a network.
Public IP Addresses
A public IP address is an address where one primary address is associated with your whole
network. In this type of IP address, each of the connected devices has the same IP address.
A private IP address is a unique IP number assigned to every device that connects to your home
internet network, which includes devices like computers, tablets, smartphones, which is used in
your household.
It also likely includes all types of Bluetooth devices you use, like printers or printers, smart
devices like TV, etc. With a rising industry of internet of things (IoT) products, the number of
private IP addresses you are likely to have in your own home is growing.
Dynamic IP address:
Dynamic IP addresses always keep changing. It is temporary and are allocated to a device every
time it connects to the web. Dynamic IPs can trace their origin to a collection of IP addresses that
are shared across many computers.
Dynamic IP addresses are another important type of internet protocol addresses. It is active for a
specific amount of time; after that, it will expire.
Static IP Addresses
Static IP addresses are consistent, which is assigned once, that stays the same over the years.
This type of IP also helps you procure a lot of information about a device.
Version of IP address
1)IPV4
2) IPV6.
IPV4
IPv4 was the first version of IP. It was deployed for production in the ARPANET in 1983. Today
it is the most widely used IP version. It is used to identify devices on a network using an
addressing system.
The IPv4 uses a 32-bit address scheme allowing to store 2^32 addresses, which is more than 4
billion addresses. To date, it is considered the primary Internet Protocol and carries 94% of
Internet traffic.
IPV6
It is the most recent version of the Internet Protocol. Internet Engineer Taskforce initiated it in
early 1994. The design and development of that suite is now called IPv6.
This new IP address version is being deployed to fulfill the need for more Internet addresses. It
was aimed to resolve issues which are associated with IPv4. With 128-bit address space, it
allows 340 undecillion unique address space.
Classes of IP:
Subnet Mask
A subnet mask is a 32-bit number created by setting host bits to all 0s and setting network bits to
all 1s. In this way, the subnet mask separates the IP address into the network and host addresses.
The “255” address is always assigned to a broadcast address, and the “0” address is always
assigned to a network address. Neither can be assigned to hosts, as they are reserved for these
special purposes.
Lab No 4
Gateways
A gateway is a network node that forms a passage between two networks operating with different
transmission protocols. The most common type of gateways, the network gateway operates at layer
3, i.e. network layer of the OSI (open systems interconnection) model. However, depending upon
the functionality, a gateway can operate at any of the seven layers of OSI model. It acts as the entry
– exit point for a network since all traffic that flows across the networks should pass through the
gateway. Only the internal traffic between the nodes of a LAN does not pass through the gateway.
Features of Gateways
Gateway is located at the boundary of a network and manages all data that inflows or
outflows from that network.
It forms a passage between two different networks operating with different transmission
protocols.
A gateway operates as a protocol converter, providing compatibility between the different
protocols used in the two different networks.
The feature that differentiates a gateway from other network devices is that it can operate
at any layer of the OSI model.
It also stores information about the routing paths of the communicating networks.
When used in enterprise scenario, a gateway node may be supplemented as proxy server
or firewall.
Types of Gateways
On basis of direction of data flow, gateways are broadly divided into two categories −
1. Unidirectional Gateways :
They allow data to flow in only one direction. Changes made in the source node are replicated in
the destination node, but not vice versa. They can be used as archiving tools.
2. Bidirectional Gateways :
They allow data to flow in both directions. They can be used as synchronization tools.
Routers
Routers are networking devices operating at layer 3 or a network layer of the OSI model. They are
responsible for receiving, analysing, and forwarding data packets among the connected computer
networks. When a data packet arrives, the router inspects the destination address, consults its
routing tables to decide the optimal route and then transfers the packet along this route.
Features of Routers
A router is a layer 3 or network layer device.
It connects different networks together and sends data packets from one network to another.
A router can be used both in LANs (Local Area Networks) and WANs (Wide Area
Networks).
It transfers data in the form of IP packets. In order to transmit data, it uses IP address
mentioned in the destination field of the IP packet.
Routers have a routing table in it that is refreshed periodically according to the changes in
the network. In order to transmit data packets, it consults the table and uses a routing
protocol.
In order to prepare or refresh the routing table, routers share information among each other.
Routers are more expensive than other networking devices like hubs,bridges and switches.
o Cisco
o D-Link
o HP
o 3Com
o Juniper
o Nortel
Types of Routers
A variety of routers are available depending upon their usages. The main types of routers are −
Wireless Router − They provide WiFi connection WiFi devices like laptops, smartphones
etc. They can also provide standard Ethernet routing. For indoor connections, the range is
150 feet while its 300 feet for outdoor connections.
Broadband Routers − They are used to connect to the Internet through telephone and to
use voice over Internet Protocol (VoIP) technology for providing high-speed Internet
access. They are configured and provided by the Internet Service Provider (ISP).
Core Routers − They can route data packets within a given network, but cannot route the
packets between the networks. They helps to link all devices within a network thus forming
the backbone of network. It is used by ISP and communication interfaces.
Edge Routers − They are low-capacity routers placed at the periphery of the networks.
They connect the internal network to the external networks, and are suitable for transferring
data packets across networks. They use Border Gateway Protocol (BGP) for connectivity.
There are two types of edge routers, subscriber edge routers and label edge routers.
Brouters − Brouters are specialised routers that can provide the functionalities of bridges
as well. Like a bridge, brouters help to transfer data between networks. And like a router,
they route the data within the devices of a network.
Switches
Switches are networking devices operating at layer 2 or a data link layer of the OSI model. They
connect devices in a network and use packet switching to send, receive or forward data packets or
data frames over the network.
A switch has many ports, to which computers are plugged in. When a data frame arrives at any
port of a network switch, it examines the destination address, performs necessary checks and sends
the frame to the corresponding device(s).It supports unicast, multicast as well as broadcast
communications.
Types of Switches
There are variety of switches that can be broadly categorised into 4 types −
Bridges
A bridge operates at the data link layer. A bridge is a repeater, with add on the functionality of
filtering content by reading the MAC addresses of source and destination. It is also used for
interconnecting two LANs working on the same protocol. It has a single input and single output
port, thus making it a 2 port device.
Types of Bridges
Transparent Bridges:- These are the bridge in which the stations are completely unaware
of the bridge’s existence i.e. whether or not a bridge is added or deleted from the network,
reconfiguration of the stations is unnecessary. These bridges make use of two processes i.e.
bridge forwarding and bridge learning.
Source Routing Bridges:- In these bridges, routing operation is performed by the source
station and the frame specifies which route to follow. The host can discover the frame by
sending a special frame called the discovery frame, which spreads through the entire
network using all possible paths to the destination.
Lab No 5
Cisco Packet Tracer
Cisco Packet Tracer as the name suggests, is a tool built by Cisco. This tool provides a
network simulation to practice simple and complex networks.
As Cisco believes, the best way to learn about networking is to do it.
The main purpose of Cisco Packet Tracer is to help students learn the principles of networking
with hands-on experience as well as develop Cisco technology specific skills. Since the
protocols are implemented in software only method, this tool cannot replace the hardware
Routers or Switches. Interestingly, this tool does not only include Cisco products but also
many more networking devices.
Using this tool is widely encouraged as it is part of the curriculum like CCNA, CCENT where
Faculties use Packet Trace to demonstrate technical concepts and networking systems.
Students complete assignments using this tool, working on their own or in teams.
Task 1:
Connect pc1 with pc2 & and switch connect with pc3:
Workspace
PC0 IP config:
PC1 IP config:
Ping PC0:
Lab No 6
Task No 1:
Connect Routers with Routers.
Connect Routers with End users.
Set IP addresses of Routers.
Set IP addresses of End users.
2.
3. Enter WIC-2T card in routers
PC-2 configuration
Configuration of router – 1 to build the route
Configuration of router – 2 to build the route
Lab No 7
Task No 1:
Connect Switch with Switch.
Connect Routers with Pc.
Set IP addresses of Routers.
Set IP addresses of Pc.
Config Pc 0:
Config Pc1:
Task No 2:
Connect Switch with three pc and one server
Set IP addresses.
Send Packet successfully
Config pc 0
Config pc 1
Config pc 2
Config server
RIP versions :
There are three versions of routing information protocol – RIP Version1, RIP Version2,
and RIPng.
RIP v1 RIP v2 RIPng
Sends update as broadcast Sends update as multicast Sends update as multicast
Broadcast at 255.255.255.255 Multicast at 224.0.0.9 Multicast at FF02::9 (RIPng
can only run on IPv6
networks)
Classful routing protocol Classless protocol, supports Classless updates are sent
classful
RIP v1 is known as Classful Routing Protocol because it doesn’t send information of subnet
mask in its routing update.
RIP v2 is known as Classless Routing Protocol because it sends information of subnet mask in
its routing update.
Task:
Make a connection of routers and end users.
Enable RIP on the network.
Config pc 0:
Config pc 1:
Open Shortest Path First (OSPF) is a link-state routing protocol that is used to find the best path
between the source and the destination router using its own Shortest Path First). OSPF is
developed by Internet Engineering Task Force (IETF) as one of the Interior Gateway Protocol
(IGP), i.e, the protocol which aims at moving the packet within a large autonomous system or
routing domain. It is a network layer protocol which works on the protocol number 89 and uses
AD value 110. OSPF uses multicast address 224.0.0.5 for normal communication and 224.0.0.6
for update to designated router(DR)/Backup Designated Router (BDR).
OSPF terms :
1. Router I’d – It is the highest active IP address present on the router. First, highest loopback
address is considered. If no loopback is configured then the highest active IP address on the
interface of the router is considered.
2. Router priority – It is a 8 bit value assigned to a router operating OSPF, used to elect DR
and BDR in a broadcast network.
3. Designated Router (DR) – It is elected to minimize the number of adjacency formed. DR
distributes the LSAs to all the other routers. DR is elected in a broadcast network to which all
the other routers shares their DBD. In a broadcast network, router requests for an update to
DR and DR will respond to that request with an update.
4. Backup Designated Router (BDR) – BDR is backup to DR in a broadcast network. When
DR goes down, BDR becomes DR and performs its functions.
Task:
OSPF:
Config pc 0:
Config pc 1:
Router 0 OSpf:
Router 1 OSpf:
Router 2 OSpf: