Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
13 views

Computer networks

Uploaded by

tejsvibhat
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Computer networks

Uploaded by

tejsvibhat
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 50

PRACTICAL - 1

 AIM : To study the different devices used in Computer Networks.


 Theory :
 What are Connecting Devices?
Network connecting devices, or network interconnection devices, are essential hardware
that link various network resources, enabling data transmission between devices. This
includes hubs, switches, routers, bridges, gateways, load balancers, modems, and
repeaters. Their primary purpose is to ensure quick and secure data transfer. However, in
networks with many devices, congestion can occur due to excessive data packets on the
same path, leading to performance issues. These devices facilitate smooth communication
and resource sharing across connected systems.

Some connecting devices are:


1.) Repeater :
Repeaters are networking devices that regenerate
incoming signals at the physical layer of the OSI model,
allowing signals to travel longer distances without
weakening or corruption. They do not amplify signals but
copy and regenerate them at their original strength. Used
in both Local Area Networks (LANs) and Wide Area
Networks (WANs), repeaters help reduce errors and data
loss while ensuring secure data transfer over extended
distances.

Based on the type of network the repeaters can connect they are categorized as below:

Based on the type of network the repeaters can connect they are categorized as below:

 Wired Repeaters: Wired repeaters are used in wired Local Area Networks(LANs). Wired repeater
receives the signal and repeats it. This helps to extend the network travel data without loosing it’s
strength and data.
 Wireless Repeaters: Wireless repeaters are used in wireless Local Area Networks(LANs) and Cellular
networks. A router connected in the network sends wireless signal to the repeater. Once received,
repeater broadcast the signal to increase the coverage of network.
2.) Hub :
A hub is a physical-layer device that acts on
individual bits rather than frames. Hubs cannot filter
data, so data packets are sent to all connected
devices. A hub receives a bit from one interface,
recreates it, and broadcasts it to all other interfaces,
creating a single collision domain. If two bits arrive
simultaneously, a collision occurs, requiring
retransmission. Lacking routing intelligence, a hub
acts as a multi-port repeater, connecting multiple
wires in a star topology.

There are 3 types of Hub :


 Active Hub:- These are the hubs that have their power supply and can clean, boost, and relay
the signal along with the network. It serves both as a repeater as well as a wiring center. These
are used to extend the maximum distance between nodes.

 Passive Hub:- These are the hubs that collect wiring from nodes and power supply from the
active hub. These hubs relay signals onto the network without cleaning and boosting them and
can’t be used to extend the distance between nodes.

 Intelligent Hub:- It works like an active hub and includes remote management capabilities.
They also provide flexible data rates to network devices. It also enables an administrator to
monitor the traffic passing through the hub and to configure each port in the hub.

3.) Switch : A switch is a multiport network device


operating at the data link layer, designed to improve efficiency
by reducing traffic. When a data frame arrives, it checks the
destination MAC address and conducts error checking,
forwarding only valid packets to the correct port. This process
effectively divides the collision domain for connected devices
while keeping the broadcast domain unchanged. With multiple
ports, switches help streamline network communication.
There are many different types of switches available today, such as Unmanaged switches ,
Managed switches , Smart switch , Layer 2 switch , Layer 3 switch , PoE switchGigabit switch ,
Rack-mounted switch , Desktop switch , Modular switch.

4.) Bridge :

A bridge is a network device that operates at the data


link layer device. A bridge is a repeater with the
added functionality of filtering content by reading
the MAC addresses of the source and destination. It is
also used to connect two LANs that use the same
protocol. It has a single input and output port,
making it a two-port device.

Three types of bridges are used in networks.


 Transparent Bridge: This type of bridge is invisible to other devices on the network and only
blocks or sends data based on MAC addresses. It operates without the connected devices being
aware of its presence and is the most common type of bridge.
 Translational Bridge: A translational bridge facilitates connections between different
networking systems, such as Ethernet and Token Ring. It translates incoming data and can add
or remove information from frames as needed, depending on the direction of transmission.
 Source-Route Bridge: Developed by IBM for Token Ring networks, source-route bridges include
the entire routing information within the frame itself. This allows the bridge to make precise
decisions about how to send the frame through the network.

5.) Gateway :
A gateway is a network node that connects two
networks using different transmission protocols, serving
as an entry and exit point for data. It enhances network
flexibility by allowing multiple computers to connect
through a single device. In most IP-based networks,
traffic typically flows through a gateway, except for
nodes on the same local area network (LAN) segment.
The primary advantage of a gateway is consolidating
internet connectivity into one device, and it can also function as a proxy server and firewall in
enterprise settings. However, gateways do not filter data, and protocol conversion can result in
slower transmission rates.

Gateways can be divided into different types based on different factors:

 Gateways can be classified into two types based on the direction of flow --
Unidirectional Gateways & Bidirectional Gateways.

 Gateways can be classified into five types based on functionalities --


Network Gateway , Cloud Storage Gateway , IoT Gateway , Internet-To-Orbit Gateway (I2O) &
VoIP Trunk Gateway.
6.) Router :

A router is a Network Layer device that routes data


packets based on IP addresses. It is considered an
intelligent device because it uses dynamic routing
algorithms to calculate the best path for packets from
source to destination. By examining the destination IP
address and using forwarding tables, routers connect
LANs and WANs while dividing broadcast domains. They
also communicate between networks using protocols like ICMP and help reduce network traffic by
establishing collision domains. However, routers are typically more expensive and slower than
bridges or repeaters.
There are various types of routers used in networking are ---- Wireless Router , Brouter , Core
Router , Edge Router and Broadband Router.

 Brouter :
Brouter is an abbreviated term for “bridge router” ,
a special type of networking device . A brouter is a
hybrid of a bridge and a router. It is also known as
the bridging router. It can work either at the data
link layer or a network layer. It acts as a bridge,
allowing data to be transferred between networks,
and it can also route data within a network to
individual systems, much like a router. As a result, it combines the functions of a bridge and a
router by routing some incoming data to the appropriate systems while transferring the rest to
another network.
7.) Modem :
A modem is a network device that modulates and
demodulates analog carrier signals (known as sine
waves) to encode and decode digital data for processing.
Because modems perform both of these tasks
simultaneously, the term modem is a combination
of "modulate" and "demodulate".However, There is no
traffic maintenance in modem and it is unaware of its
destination path.

There are generally five types of modem:

 Optical Modem
 Digital Modem
 Acoustic Modem
 Smart Modem
 Short Haul Modem
PRACTICAL - 2

 AIM : To study the various transmission media used in Computer Networks.

 Theory :
 What is Transmission Media?
A transmission medium is a physical connection or interface between a transmitter and
receiver in a computer network. It's a communication channel that carries data from one
device to another. Transmission media in computer networks are directly controlled by the
physical layer and located below the physical layer, as physical layer is responsible for the
transmission and reception of unstructured raw data bits over a physical medium.

 Factors of Transmission Impairment:


The signal at the beginning of the medium is not the same as the signal at the end of the
medium. The imperfection causes signal impairment. Below are the causes of the impairment :

1. Attenuation and Distance: This refers to the loss of signal strength over distance,
known as an attenuated signal. Amplifiers can restore the original signal to compensate
for this loss.
2. Noise and Interference: Unwanted signals (noise) and external disruptions
(interference) can distort the intended signal. Common sources include thermal noise
and electromagnetic interference (EMI). Shielding, filters, and error correction
algorithms can help minimize these effects.

3. Distortion: This occurs when the original signal shape is altered during transmission,
leading to data misinterpretation. Signal conditioning and equalization techniques can
help correct distortion before reception.
4. Cross-talk: Interference from adjacent transmission paths can degrade signal quality. To
reduce cross-talk, use twisted pair cables or proper shielding.

5. Propagation Delay and Bandwidth Limitations: Propagation delay affects signal


synchronization, while insufficient bandwidth can lead to congestion and packet loss.
Upgrading infrastructure and optimizing routing can help reduce latency.

6. Signal-to-Noise Ratio (SNR): This ratio compares desired signal strength to background
noise. A low SNR complicates data detection. Increasing signal power and implementing
noise reduction techniques can improve SNR.

7. Signal Quality Monitoring: Regular assessment of signal integrity can help detect issues
early. Monitoring tools like spectrum analyzers and SNMP (Simple Network
Management Protocol) enable continuous tracking and corrective actions.

These consolidated factors encompass the primary sources of transmission impairment in


computer networks and collectively impact data communication quality.

 Types of Transmission Media :


There are two main types of transmission media:
1.) Guided Transmission Media
2.) Unguided Transmission Media

 Guided Transmission Media :


Guided Media is also referred to as Wired or Bounded transmission media. Signals being
transmitted are directed & confined in a narrow pathway by using physical links. These media
are characterized by their physical nature, offering a level of reliability and controlled
transmission that is well-suited for various communication needs. High Speed and security are
some features of guided media. These media are better suited for shorter distances.
There are 3 major types of Guided Media:

1.) Twisted Pair Cable:


Description : Twisted pair is a physical media made
up of a pair of cables twisted with each other. To try
to reduce electromagnetic interference, insulated
copper wires are twisted together in pairs to create
twisted pair cables. Generally, several such pairs are
bundled together in a protective sheath. A twisted
pair cable is cheap as compared to other transmission
media and are the most widely used Transmission
Media. Installation of the twisted pair cable is easy,
and it is a lightweight cable. The frequency range for
twisted pair cable is from 0 to 3.5KHz.
Application: Twisted-pair cable is commonly used in telephone networks, Ethernet networks, and
home networking applications.
Types:
a) Unshielded Twisted Pair (UTP): UTP consists of two insulated
copper wires twisted around one another without any additional
shielding. This type of cable has the ability to block interference and
does not depend on a physical shield for this purpose. It is used for
telephonic applications.

b) Shielded Twisted Pair (STP): This type of cable consists of a


special jacket (a copper braid covering or a foil shield) to
block external interference. It is used in fast-data-rate
Ethernet and in voice and data channels of telephone lines.

2.) Coaxial Cable :


Description : Coaxial cable is very commonly
used transmission media, for example, TV
wire is usually a coaxial cable. The name of
the cable is coaxial as it contains two
conductors parallel to each other , each
having a separate insulated protection cover.
The inner conductor of the coaxial cable is
made up of copper, and the outer conductor
is made up of copper mesh. The middle core
is made up of non-conductive cover that
separates the inner conductor from the outer
conductor. The middle core is responsible for
the data transferring whereas the copper mesh prevents from the EMI(Electromagnetic interference). It
has an outer plastic covering containing an insulation layer made of PVC or Teflon . It has a higher
frequency as compared to Twisted pair cable.

Applications: . Cable TVs and analog television networks widely use Coaxial cables.
3.) Optical Fibre Cable :
Description : Fibre optic cable is a cable that uses electrical signals for
communication by holding the optical fibres coated in plastic that are
used to send the data by pulses of light.Optical Fibre Cable uses the
concept of refraction of light through a core made up of glass or plastic.
The core is surrounded by a less dense glass or plastic covering called the
cladding. The plastic coating protects the optical fibres from heat, cold,
electromagnetic interference from other types of wiring. It is used for the
transmission of large volumes of data. The cable can be unidirectional or
bidirectional. The WDM (Wavelength Division Multiplexer) supports two
modes, namely unidirectional and bidirectional mode. Fibre optics
provide faster data transmission than copper wires.

Applications:
 Medical Purpose: Used in several types of medical instruments.
 Defence Purpose: Used in transmission of data in aerospace.
 For Communication: This is largely used in formation of internet cables.
 Industrial Purpose: Used for lighting purposes and safety measures in designing the interior and exterior
of automobiles.

 Unguided Transmission Media :


It is also referred to as Wireless or Unbounded transmission media . An unguided transmission
transmits the electromagnetic waves without using any physical medium. Therefore it is also
known as wireless transmission. In unguided media, air is the media through which the
electromagnetic energy can flow easily. It is less secure in comparison to guided media and is
suitable for larger distances.

1.) Radio Waves :


Description :
Radio waves are the electromagnetic waves that are transmitted in all the directions of free space.
Radio waves are omnidirectional, i.e., the signals are propagated in all the directions.
The range in frequencies of radio waves is from 3Khz to 1 Ghz. In the case of radio waves, the sending and
receiving antenna need not be aligned, i.e., the wave sent by the sending antenna can be received by any
receiving antenna. Radio waves are easy to generate and can penetrate through buildings. These can be
further categorized as : Terrestrial and Satellite.
Applications:
 A Radio wave is useful for multicasting when there is one sender and many receivers.
 FM radio, television, cordless phones are examples of a radio wave.

2.) Microwaves :
Description :
It is a line of sight transmission i.e. the sending and
receiving antennas need to be properly aligned with
each other. The distance covered by the signal is
directly proportional to the height of the antenna.
Frequency Range:1GHz – 300GHz.
Applications: Microwaves are majorly used for
mobile phone communication and television
distribution.

3.) Infrared :
Description :
It is a line of sight transmission i.e. the sending and
receiving antennas need to be properly aligned with
each other. The distance covered by the signal is
directly proportional to the height of the antenna.
Frequency Range:1GHz – 300GHz.
Applications: Microwaves are majorly used for
mobile phone communication and television
distribution.
PRACTICAL - 3

 AIM : To show a visual guide connect the computers in a Local Area Network.
 Theory :
A Local Area Network (LAN) connects devices within a limited area, such as a home or office,
facilitating efficient communication and resource sharing, including files, printers, and internet
access. Typically owned by a single organization or individual, LANs support applications like
shared file storage and networked gaming. They use high-speed hardware, such as Ethernet
cables and switches, and employ private IP addressing. Covering distances of up to a few
kilometers, LANs offer data transfer rates of 100 to 1000 Mbps, minimizing propagation delay
and errors. Key advantages include fast communication, easy setup and management,
peripheral sharing, and enhanced security compared to wider networks like WANs.

 Procedure:
On the Host Computer :
On the host computer, follow these steps to share the Internet connection:

1.Log on to the host computer as Administrator or as Owner.


2.Click Start and then open Control Panel.

3.Click Network and Internet Connections.


4.Click Network Connections.

5.Right-click the connection that you use to connect to the Internet. For example, if you
connect to the Internet by using a modem, right-click the connection that you want under Dial-
up / another network available.
6.Click Properties.
7.Under Internet Connection Sharing, select the Allow other network users to connect through
this computer's Internet connection check box.
8.If you are sharing a dial-up Internet connection, select the Establish a dial-up connection
whenever a computer on my network attempts to access the Internet check box if you want to
permit your computer to automatically connect to the Internet.
9.Click OK. You receive the following message:
“When Internet Connection Sharing is enabled, your LAN adapter will be set to use IP address
192.168.0.1. Your computer may lose connectivity with other computers on your network. If
these other computers have static IP addresses, it is a good idea to set them to obtain their IP
addresses automatically. Are you sure you want to enable Internet Connection Sharing?”
10.Click Yes.

On the Client computer:


To connect to the Internet by using the shared connection, you must confirm
the LAN adapter IP configuration, and then configure the client computer. To
confirm the LAN adapter IP configuration, follow these steps:
1. Log on to the client computer as Administrator or as Owner.
2. Click Start, and then click Control Panel.
3. Click Network and Internet Connections.
4. Click Network Connections & then look for change adapter settings.
5. Right-click Local Area Connection and then click Properties.
6. Click the General tab, click Internet Protocol (TCP/IP) in the connection
uses the following items list, and then click Properties.
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 192.168.0.254.
For example, you can assign the following static IP address,
subnet mask, and default gateway:
IP Address 192.168.31.202
Subnet mask 255.255.255.0
Default gateway 192.168.31.1

8. In the Local Area Connection Properties dialog box, click OK.


9. Quit Control Panel.
PRACTICAL - 4

 AIM : To
 Theory:
The Command Prompt, often referred to as CMD or the command line, is a command-line
interpreter available in Windows operating systems. It allows users to execute commands to
perform various tasks, such as file management, system configuration, and network
troubleshooting.

 Procedure :
1 . Log on to the host computer as Administrator or as Owner.
2 . Click Start, and then click and open Command Prompt.

3 . Help: Displays a list of available commands and their syntax.


 Steps:
o Open Command Prompt by pressing Windows + R, typing cmd, and hitting Enter.
o Type help and press Enter. Review the list of available commands.
help color: Provides help on the "color" command, which changes text and background colors
in the Command Prompt.
 Steps:
o Type help color and press Enter. Read the instructions on how to change text
and background colors.

4. ipconfig: Displays the current IP configuration of the computer, including IP address, subnet
mask, and default gateway.
 Steps:
o Type ipconfig and press Enter. Review the output for your IP address, subnet mask, and
default gateway.

ipconfig /all: Shows detailed information about all network interfaces, including MAC addresses
and DNS settings.
 Steps:
o Type ipconfig /all and press Enter. Examine the detailed information about all
network interfaces.
5 . ping: Tests the reachability of a host by sending ICMP echo requests and measuring response
times.
 Steps:
o Type ping [hostname/IP] (replace with the actual hostname or IP) and press Enter.
Check for replies to see if the host is reachable.

6 . nslookup: Queries DNS to resolve domain names into IP addresses.


 Steps:
o Type nslookup and press Enter. This will open the nslookup mode.

nslookup google.com: Specifically queries the DNS for the IP address associated with the
domain "google.com".
 Steps:
o While in nslookup mode, type google.com and press Enter. Review the IP
address associated with "google.com".

7. tracert: Traces the route packets take to reach a specific destination, showing each hop along
the way.
 Steps:
o Type tracert [hostname/IP] (replace with the actual hostname or IP) and press
Enter. Observe the route taken by packets.
tracert www.asura.gg: Traces the route to the domain "www.asura.gg".
 Steps:
o Type tracert www.asura.gg and press Enter. Check the hops taken to reach the
domain.
8. wmic: Windows Management Instrumentation Command-line tool that provides a command-
line interface for WMI.
 Steps:
o Type wmic and press Enter. This will enter the Windows Management
Instrumentation command-line interface.

wmic process list brief: Displays a brief list of running processes on the system.
 Steps:
o While in WMIC, type process list brief and press Enter. Review the brief list of
running processes.

9 . net view: Displays a list of computers or shared resources on the network.


 Steps:
o Type net view and press Enter. Check the list of computers or shared resources on
the network.
10 . net share: Shows shared resources on the local computer, including shared folders and
printers.
 Steps:
o Type net share and press Enter. View the shared resources on the local computer.

11 . net sh: Allows for managing network settings, including configurations related to network
interfaces.
 Steps:
o Type netsh and press Enter. This will enter the network shell for managing network
settings.

net sh [parameters]: Used with additional parameters to specify the type of network settings to
manage or modify.
 Steps:
o Type netsh [parameters] (replace with the desired parameters) and press Enter.
Manage or modify specific network settings as needed.

12 . nbtstat: Displays NetBIOS over TCP/IP statistics and current connections.


 Steps:
o Type nbtstat and press Enter. View NetBIOS over TCP/IP statistics.
nbtstat -: Displays the NetBIOS name table and connections for all network interfaces.
 Steps:
o Type nbtstat - and press Enter. Display the NetBIOS name table and connections for
all network interfaces.

PRACTICAL - 5

 AIM : Installation of Cisco Packet Tracer.


 Theory :
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.
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.

 Procedure :
Here's a step-by-step guide to download and install Cisco Packet Tracer 8.2.2:
Step 1: Visit the Cisco Networking Academy Website
 Open Your Browser: Launch your preferred web browser.
 Navigate to the Website: Go to the Cisco Networking Academy website.

Step 2: Sign Up or Log In


 Create an Account: If you don’t have an account, click on "Sign Up" and register for a
new account.
 Log In: If you already have an account, click "Sign In" and enter your credentials.

Step 3: Search for Cisco Packet Tracer


 Access Courses: After logging in, search for "Packet Tracer" in the search bar.
 Enroll in the Course: Look for the "Packet Tracer" course (usually under the
"Introduction to Packet Tracer" course for Cisco Networking Academy). Enroll in this
course to gain access to download links.

Step 4: Download Cisco Packet Tracer 8.2.2


 Navigate to Resources: Once you’re in the course, locate
the "Resources" or "Downloads" section.
 Select the Version: Find the Cisco Packet Tracer 8.2.2 download option for your
operating system (Windows, macOS, or Linux).
 Download the File: Click the appropriate link to download the installer file. Wait for the
download to complete.

Step 5: Install Cisco Packet Tracer For Windows:


 Locate the Downloaded File: Go to your Downloads folder and find
the PacketTracer-8.2.2-win.exe file.
 Run the Installer: Double-click the downloaded .exe file to start the
installation.
 Follow Installation Prompts:
a) Click Next on the welcome screen.
b) Accept the license agreement and click Next.
c) Choose the installation directory or leave it at the default,
then click Next.
d) Click Install to begin the installation.
 Complete Installation: Once the installation completes, click Finish

Step 6: Launch Cisco Packet Tracer


 Find the Application: After installation, locate Cisco Packet Tracer on your desktop or
applications menu.
 Open the Program: Double-click the icon to launch the software.
 Log In: If prompted, log in using your Cisco Networking Academy credentials.

Step 7: Explore and Practice


 Familiarize Yourself: Once open, explore the user interface and tools available for
network simulation.
 Start a Project: You can either create a new network simulation or load existing
examples.

Troubleshooting
 Install Issues: If you run into problems installing, make sure your operating system
meets the requirements for Packet Tracer and check for updates.
 Resources and Help: Visit the Cisco Networking Academy FAQ or support section for
additional assistance if needed.

By following these steps, you should be able to successfully download and install
Cisco Packet Tracer 8.2.2.
PRACTICAL - 6
 AIM : To create a BUS TOPOLOGY in Cisco Packet Tracer and implement it.
 Theory :
Definition:
Bus topology is a network configuration where all
devices connect to a single central cable, known as
the "bus." Data travels along this cable in both
directions.

 Procedure :
Here’s the step-by-step guide for creating a bus
topology in Cisco Packet Tracer :

Step 1: Open Cisco Packet Tracer


Launch the Cisco Packet Tracer application on your computer.
Step 2: Create a New Project
Click on File and then select New to start a new project.
Step 3: Select and Place Devices
 In the bottom left corner, use the Device-Type Selection box to select End Devices &
Connecting devices.
 Drag and drop several PCs onto the workspace.
 Next, select a Switch from the Switches category and place it in the workspace.

Step 4: Connect Devices


 Select the Connections icon (cable icon) from the bottom left toolbar.
 Choose the Copper Cable (or Simple Cable) for connecting devices.
 Connect each PC to the switch using the Generic port on each PC to one of the switch's
ports.

Step 5: Configure IP Addresses


 Click on each PC, go to the Desktop tab, then select IP Configuration.
 Assign unique IP addresses to each PC (e.g., PC1: 192.168.1.1, PC2: 192.168.1.2, etc.) and
the same subnet mask (e.g., 255.255.255.0).

Step 6: Simulate Message Transmission


 Switch to Simulation Mode (click on the bottom right corner).
 Select the Add Complex PDU icon (a paper with a lightning bolt and a document).
 Click on the source PC (e.g., PC1) and if needed, specify a detailed message, such as "Hello,
PC2! This is a complex message."
 Click on the destination PC (e.g., PC2) to initiate the sending of the complex message
through the network.

Step 7: Observe the Simulation


 After adding the complex PDU, watch the simulation panel to see the message transmission
process.
 The complex message should appear as a PDU traveling from the source PC to the
destination PC, demonstrating successful communication.
Step 8: Verify Connections
Ensure that the PDU successfully reaches the intended destination by checking for any errors or
issues in the simulation panel.

Step 9: Save Your Project


Click on File and select Save or Save As to save your topology.
PRACTICAL - 7

 AIM : To create a STAR TOPOLOGY in Cisco Packet Tracer and implement it.
 Theory :
Definition:
Star topology is a network configuration where all devices
are connected to a central hub or switch. Each device has
a dedicated point-to-point connection to the hub.

 Procedure :
Step 1: Open Cisco Packet Tracer
Launch the Cisco Packet Tracer application.
Step 2: Create a New Project
Click on File and select New.
Step 3: Select and Place Devices
 Drag and drop several PCs onto the workspace.
 Select a Switch from the Switches category and place it in the center of your workspace.

Step 4: Connect Devices


 Select the Connections icon.
 Choose Copper Cable.
 Connect each PC to the switch using the Generic port on each PC to one of the switch's
ports.

Step 5: Configure IP Addresses


 Click on each PC, go to the Desktop tab, then select IP Configuration.
 Assign unique IP addresses to each PC (e.g., PC1: 192.168.1.1, PC2: 192.168.1.2, etc.) and
the same subnet mask (e.g., 255.255.255.0).
Step 6: Simulate Message Transmission
 Switch to Simulation Mode.
 Use the Add Complex PDU icon to send a message from one PC to another.

Step 7: Observe the Simulation


Watch the simulation panel to see the PDU travel from the source PC to the destination PC.
Step 8: Verify Connections
Check for any issues in the simulation panel.

Step 9: Save Your Project


Click on File and select Save or Save As.
PRACTICAL - 8

 AIM : To create a RING TOPOLOGY in Cisco Packet Tracer and implement it


 Theory :
Definition:
Ring topology is a network configuration where each
device is connected to two other devices, forming a
circular pathway for data.

 Procedure :
Step 1: Open Cisco Packet Tracer
Launch the Cisco Packet Tracer application.
Step 2: Create a New Project
Click on File and select New.

Step 3: Select and Place Devices


 Drag and drop several PCs onto the workspace.
 Select a Switch from the Switches category and place it in the center of your workspace.
Step 4: Connect Devices
 Select the Connections icon.
 Choose Copper Cable.
 Connect the PCs in a circular manner, linking the last PC back to the first.

Step 5: Configure IP Addresses


 Click on each PC, go to the Desktop tab, then select IP Configuration.
 Assign unique IP addresses.
Step 6: Simulate Message Transmission
 Switch to Simulation Mode.
 Use the Add Complex PDU icon to send a message from one PC to another.

Step 7: Observe the Simulation


Watch the PDU travel around the ring until it reaches the destination.

Step 8: Verify Connections


Ensure the message travels correctly around the ring.

Step 9: Save Your Project


Click on File and select Save or Save As.
PRACTICAL - 9

 AIM : To create a MESH TOPOLOGY in Cisco Packet Tracer and implement it.
 Theory :
Definition:
Mesh topology is a network configuration where each device is interconnected, allowing for
multiple pathways for data transmission.

 Procedure :
Step 1: Open Cisco Packet Tracer
Launch the Cisco Packet Tracer application.

Step 2: Create a New Project


Click on File and select New.

Step 3: Select and Place Devices


 Drag and drop several PCs onto the workspace.
 Select a Switch from the Switches category and place it in the center of your workspace.

Step 4: Connect Devices


 Select the Connections icon.
 Choose Copper Cable.
 Connect each PC to every other PC, creating a full mesh.
Step 5: Configure IP Addresses
 Click on each PC, go to the Desktop tab, then select IP Configuration.
 Assign unique IP addresses.

Step 6: Simulate Message Transmission


 Switch to Simulation Mode.
 Use the Add Complex PDU icon to send a message from one PC to another.
Step 7: Observe the Simulation
Watch the PDU travel directly from the source to the destination.

Step 8: Verify Connections


Ensure all connections are functional and messages are received.

Step 9: Save Your Project


Click on File and select Save or Save As.
PRACTICAL - 10

 AIM : To create a TREE TOPOLOGY in Cisco Packet Tracer and implement it.
 Theory :
Definition:
Tree topology is a hybrid network configuration that combines characteristics of star and bus
topologies, featuring a central hub connected to multiple star-configured devices.

 Procedure :

Step 1: Open Cisco Packet Tracer


Launch the Cisco Packet Tracer application.
Step 2: Create a New Project
Click on File and select New.

Step 3: Select and Place Devices


 Drag and drop several PCs onto the workspace.
 Add a Switch and a Root Switch (or Hub) to the layout.

Step 4: Connect Devices


 Use the Copper Cable to connect the root switch to the other switch.
 Connect the PCs to their respective switch.
Step 5: Configure IP Addresses
 Click on each PC, go to the Desktop tab, then select IP Configuration.
 Assign unique IP addresses.

Step 6: Simulate Message Transmission


 Switch to Simulation Mode.
 Use the Add Complex PDU icon to send a message from one PC to another.

Step 7: Observe the Simulation


Watch the PDU travel through the switches to reach the destination PC.
Step 8: Verify Connections
Ensure the message is routed correctly through the switches.

Step 9: Save Your Project


Click on File and select Save or Save As.
PRACTICAL - 11

 AIM : To create a HYBRID TOPOLOGY in Cisco Packet Tracer and implement it.
 Theory :
Definition:
Hybrid topology combines two or more different
types of topologies (e.g., star, ring, bus) into a
single network configuration.

 Procedure :
Step 1: Open Cisco Packet Tracer
Launch the Cisco Packet Tracer application.
Step 2: Create a New Project
Click on File and select New.

Step 3: Select and Place Devices


 Drag and drop several PCs onto the workspace.
 Add Switches.

Step 4: Connect Devices


 Use Copper Cables to create connections between PCs, switches, and routers.
 Ensure different topology types (like star and ring) are represented.

Step 5: Configure IP Addresses


 Click on each PC, go to the Desktop tab, then select IP Configuration.
 Assign unique IP addresses as appropriate.
Step 6: Simulate Message Transmission
 Switch to Simulation Mode.
 Use the Add Complex PDU icon to send messages between devices.

Step 7: Observe the Simulation


Watch the PDU travel through different topologies to reach the destination.

Step 8: Verify Connections


Ensure that messages are routed correctly through the various components.

Step 9: Save Your Project


Click on File and select Save or Save As.
PRACTICAL -12
 Aim: To study about NS2 simulator in detail.

 Theory:
Network Simulator (Version 2), widely known as NS2, is simply an event driven simulation tool
that has proved useful in studying the dynamic nature of communication networks. Simulation
of wired as well as wireless network functions and protocols (e.g., routing algorithms, TCP,
UDP) can be done using NS2. In general, NS2 provides users with a way of specifying such
network protocols and simulating their corresponding behaviors. Due to its flexibility and
modular nature, NS2 has gained constant popularity in the networking research community
since its birth in 1989. Ever since, several revolutions and revisions have marked the growing
maturity of the tool, thanks to substantial contributions from the players in the field. Among
these are the University of California and Cornell University who developed the REAL network
simulator, the foundation which NS is based on. Since 1995 the Defense Advanced Research
Projects Agency (DARPA) supported development of NS through the Virtual Inter Network
Testbed (VINT) project. Currently the National Science Foundation (NSF) has joined the ride in
development. Last but not the least, the group of Researchers and developers in the community
are constantly working to keep NS2 strong and versatile.

Tcl scripting
Tcl is a general purpose scripting language. [Interpreter]
 Tcl runs on most of the platforms such as Unix, Windows, and Mac.
 The strength of Tcl is its simplicity.
 It is not necessary to declare a data type for variable prior to the usage.

Basics of TCL
 Syntax: command arg1 arg2 arg3
Example : “Hello World!”
 Command : puts stdout{Hello, World!}
 Output : Hello, World!
 Variables Command Substitution
Steps :
1. Set a variable.
2. Command substitution with string length.
3. Using variables in expressions.
4. Combining expressions.
5. Example :
set a 5
set len [string length foobar]
set b $a
set len [expr [string length foobar] + 9]

Wired TCL Script Components


 Create the event scheduler
 Open new files & turn on the tracing Create the nodes
 Setup the links
 Configure the traffic type (e.g., TCP, UDP, etc) Set the time of traffic generation (e.g.,
CBR, FTP)
 Terminate the simulation.
NS Simulator Preliminaries.
1. Initialization and termination aspects of the ns simulator.
2. Definition of network nodes, links, queues and topology.
3. Definition of agents and of applications.
4. The nam visualization tool.
5. Tracing and random variables.

Initialization and Termination of TCL Script in NS-2


An ns simulation starts with command :
set ns [new Simulator]
,which is thus the first line in the tcl script. This line declares a new variable as using the set
command, you can call this variable as you wish, In general people declares it as ns because it is
an instance of the Simulator class, so an object the code[new Simulator] is indeed the
installation of the class Simulator using the reserved word new.

In order to have output files with data on the simulation (trace files) or files used for
visualization (nam files), we need to create the files using ―open command:

#Open the Trace file


set tracefile1 [open out.tr w]
$ns trace-all $tracefile1

#Open the NAM trace file


set namfile [open out.nam w]
$ns namtrace-all $namfile

The above creates a dta trace file called out.tr and a nam visualization trace file called out.nam.

Within the tcl script, these files are not called explicitly by their names, but instead by pointers
that are declared above and called ―tracefile1 and ―namfile respectively. Remark that they
begins with a # symbol.

The second line open the file ―out.tr to be used for writing, declared with the letter ―w. The
third line uses a simulator method called trace-all that have as parameter the name of the file
where the traces will go.

Define a “finish” procedure


 Proc finish { } {
global ns tracefile1 namfile
$ns flush-trace
Close $tracefile1
Close $namfile
Exec nam out.nam &
Exit 0
}
PRACTICAL -13

 Aim: To Simulate and to study stop and Wait protocol.

 Software Requirements: NS-2 Simulator

 Theory:
Stop and Wait is a reliable transmission flow control protocol. This protocol works only in
Connection Oriented (Point to Point) Transmission. The Source node has window size of ONE.
After transmission of a frame the transmitting (Source) node waits for an Acknowledgement from
the destination node. If the transmitted frame reaches the destination without error, the destination
transmits a positive acknowledgement. If the transmitted frame reaches the Destination with error,
the receiver destination does not transmit an acknowledgement. If the transmitter receives a positive
acknowledgement it transmits the next frame if any. Else if its acknowledgement receive timer
expires, it retransmits the same frame.
 Start with the window size of 1 from the transmitting (Source) node  After transmission
of a frame the transmitting (Source) node waits for a reply (Acknowledgement) from the
receiving (Destination) node.
 If the transmitted frame reaches the receiver (Destination) without error, the receiver
(Destination) transmits a Positive Acknowledgement.
 If the transmitted frame reaches the receiver (Destination) with error, the receiver
(Destination) do not transmit acknowledgement.
 If the transmitter receives a positive acknowledgement it transmits the next frame if any.
Else if the transmission timer expires, it retransmits the same frame again.
 If the transmitted acknowledgment reaches the Transmitter (Destination) without error, the
Transmitter (Destination) transmits the next frame if any.
 If the transmitted frame reaches the Transmitter (Destination) with error, the Transmitter
(Destination) transmits the same frame.
 This concept of the Transmitting (Source) node waiting after transmission for a reply from
the receiver is known as STOP and WAIT.
 Algorithm :
1. Create a simulator object
2. Define different colors for different data flows
3. Open a nam trace file and define finish procedure then close the trace file, and execute nam
on trace file.
4. Create two nodes that forms a network numbered 0 and 1
5. Create duplex links between the nodes to form a STAR Topology
6. Setup TCP Connection between n(1) and n(3)
7. Apply CBR Traffic over TCP
8. Schedule events and run the program.

 PROGRAM: (Stop and Wait Protocol)


# stop and wait protocol in normal situation
# features : labeling, annotation, nam-graph, and window size monitoring set ns
# Create Simulator object
set ns [new Simulator]

# Create Sender (n0) and Receiver (n1) nodes


set n0 [$ns node]
set n1 [$ns node]

# Label the nodes


$ns at 0.0 "$n0 label Sender"
$ns at 0.0 "$n1 label Receiver"

# Open NAM trace file


set nf [open stop.nam w]
$ns namtrace-all $nf ;# Enable NAM tracing

# Open Trace file for detailed output


set f [open stop.tr w]
$ns trace-all $f ;# Enable tracing for all agents

# Create a duplex link between n0 (Sender) and n1 (Receiver)


$ns duplex-link $n0 $n1 0.2Mb 200ms DropTail
$ns duplex-link-op $n0 $n1 orient right
$ns queue-limit $n0 $n1 10

# Enable NAM tracing for TCP


Agent/TCP set nam_tracevar_ true

# Create a new TCP agent and set window size


set tcp [new Agent/TCP]
$tcp set window_ 1
$tcp set maxcwnd_ 1

# Attach the TCP agent to the Sender (n0)


$ns attach-agent $n0 $tcp
# Create TCP Sink and attach it to the Receiver (n1)
set sink [new Agent/TCPSink]
$ns attach-agent $n1 $sink

# Connect the TCP agent (n0) to the TCP Sink (n1)


$ns connect $tcp $sink

# Create an FTP application and attach it to the TCP agent


set ftp [new Application/FTP]
$ftp attach-agent $tcp

# Add trace for TCP window size and monitor it


$ns add-agent-trace $tcp tcp
$ns monitor-agent-trace $tcp
$tcp tracevar cwnd_

# Start FTP application at 0.1 seconds


$ns at 0.1 "$ftp start"

# Detach agents after 3.0 seconds


$ns at 3.0 "$ns detach-agent $n0 $tcp ; $ns detach-agent $n1 $sink"

# Finish simulation at 3.5 seconds


$ns at 3.5 "finish"

# Trace annotations for different simulation events


$ns at 0.0 "$ns trace-annotate \"Stop and Wait with normal operation\""
$ns at 0.05 "$ns trace-annotate \"FTP starts at 0.1\""
$ns at 0.11 "$ns trace-annotate \"Send Packet_0\""
$ns at 0.35 "$ns trace-annotate \"Receive Ack_0\""
$ns at 0.56 "$ns trace-annotate \"Send Packet_1\""
$ns at 0.79 "$ns trace-annotate \"Receive Ack_1\""
$ns at 0.99 "$ns trace-annotate \"Send Packet_2\""
$ns at 1.23 "$ns trace-annotate \"Receive Ack_2\""
$ns at 1.43 "$ns trace-annotate \"Send Packet_3\""
$ns at 1.67 "$ns trace-annotate \"Receive Ack_3\""
$ns at 1.88 "$ns trace-annotate \"Send Packet_4\""
$ns at 2.11 "$ns trace-annotate \"Receive Ack_4\""
$ns at 2.32 "$ns trace-annotate \"Send Packet_5\""
$ns at 2.55 "$ns trace-annotate \"Receive Ack_5\""
$ns at 2.75 "$ns trace-annotate \"Send Packet_6\""
$ns at 2.99 "$ns trace-annotate \"Receive Ack_6\""
$ns at 3.1 "$ns trace-annotate \"FTP stops\""

proc finish {} {
global ns nf
$ns flush-trace
close $nf
puts "running nam..."
exec nam stop.nam &
exit 0
}

# Start the simulation


$ns run

 Output:
PRACTICAL -14

 Aim: To Simulate and to study Sliding Window protocol.

 PROGRAM: (Sliding Window Protocol)


#sliding window mechanism with some features
#such as labeling, annotation, nam-graph, and window size monitoring set ns #
#Create Simulator Object
set ns [new Simulator]

# Create Nodes
set n0 [$ns node] ;# Sender
set n1 [$ns node] ;# Receiver

# Label Nodes : n0 (Sender), n1 (Receiver)


$ns at 0.0 "$n0 label Sender"
$ns at 0.0 "$n1 label Receiver"

# Open Files for NAM and Trace Output


set nf [open stop.nam w] ;# NAM trace file
$ns namtrace-all $nf ;# Enable NAM tracing

set f [open stop.tr w] ;# Trace file for output


$ns trace-all $f ;# Enable tracing

# Set Duplex Link Between Nodes


$ns duplex-link $n0 $n1 0.2Mb 200ms DropTail

# Set Link Orientation and Queue Limit


$ns duplex-link-op $n0 $n1 orient right
$ns queue-limit $n0 $n1 10

# Create TCP Agent


Agent/TCP set nam_tracevar_ true
set tcp [new Agent/TCP]
$tcp set window_ 1
$tcp set maxcwnd_ 1

# Attach TCP Agent to Node n0


$ns attach-agent $n0 $tcp

# Create TCP Sink Agent


set sink [new Agent/TCPSink]

# Attach TCP Sink Agent to Node n1


$ns attach-agent $n1 $sink

# Connect TCP Agent to TCP Sink


$ns connect $tcp $sink
# Create and Attach FTP Application to TCP Agent
set ftp [new Application/FTP]
$ftp attach-agent $tcp

# Monitor TCP Window Size (cwnd)


$ns add-agent-trace $tcp tcp
$ns monitor-agent-trace $tcp
$tcp tracevar cwnd_

# Start FTP Application at Time 0.1


$ns at 0.1 "$ftp start"

# Detach Agents After 3.0 Seconds


$ns at 3.0 "$ns detach-agent $n0 $tcp ; $ns detach-agent $n1 $sink"

# Simulation End
$ns at 3.5 "finish"

# Trace Annotations
$ns at 0.0 "$ns trace-annotate \"Stop and Wait with normal operation\""
$ns at 0.05 "$ns trace-annotate \"FTP starts at 0.1\""
$ns at 0.11 "$ns trace-annotate \"Send Packet_0\""
$ns at 0.35 "$ns trace-annotate \"Receive Ack_0\""
$ns at 0.56 "$ns trace-annotate \"Send Packet_1\""
$ns at 0.79 "$ns trace-annotate \"Receive Ack_1\""
$ns at 0.99 "$ns trace-annotate \"Send Packet_2\""
$ns at 1.23 "$ns trace-annotate \"Receive Ack_2\""
$ns at 1.43 "$ns trace-annotate \"Send Packet_3\""
$ns at 1.67 "$ns trace-annotate \"Receive Ack_3\""
$ns at 1.88 "$ns trace-annotate \"Send Packet_4\""
$ns at 2.11 "$ns trace-annotate \"Receive Ack_4\""
$ns at 2.32 "$ns trace-annotate \"Send Packet_5\""
$ns at 2.55 "$ns trace-annotate \"Receive Ack_5\""
$ns at 2.75 "$ns trace-annotate \"Send Packet_6\""
$ns at 2.99 "$ns trace-annotate \"Receive Ack_6\""
$ns at 3.1 "$ns trace-annotate \"FTP stops\""

# Finish Procedure to End Simulation


proc finish {} {
global ns nf
$ns flush-trace
close $nf
puts "running nam..."
exec nam stop.nam &
exit 0
}

# Run Simulation
$ns run
 Output:
PRACTICAL -15
 Aim: To simulate and study the Distance Vector routing algorithm using simulation.

 Software Requirements: NS-2

 Theory:
Distance Vector Routing is one of the routing algorithm in a Wide Area Network for computing
shortest path between source and destination. The Router is one main devices used in a wide
area network. The main task of the router is Routing. It forms the routing table and delivers the
packets depending upon the routes in the table- either directly or via an intermediate devices.
Each router initially has information about its all neighbors. Then this information will be
shared among nodes.

 Algorithm:
1. Create a simulator object
2. Define different colors for different data flows
3. Open a nam trace file and define finish procedure then close the trace file, and execute nam
on trace file.
4. Create n number of nodes using for loop
5. Create duplex links between the nodes
6. Setup UDP Connection between n(0) and n(5)
7. Setup another UDP connection between n(1) and n(5)
8. Apply CBR Traffic over both UDP connections
9. Choose distance vector routing protocol to transmit data from sender to receiver.
10. Schedule events and run the program.

 PROGRAM:
# Create Simulator object
set ns [new Simulator]

# Open trace and NAM files


set nr [open thro.tr w]
$ns trace-all $nr
set nf [open thro.nam w]
$ns namtrace-all $nf

# Define finish procedure


proc finish { } {
global ns nr nf
$ns flush-trace
close $nf
close $nr
exec nam thro.nam &
exit 0
}

# Create 12 nodes
for {set i 0} {$i < 12} {incr i 1} {
set n($i) [$ns node]
}

# Create links between nodes


for {set i 0} {$i < 8} {incr i} {
$ns duplex-link $n($i) $n([expr $i+1]) 1Mb 10ms DropTail
}
$ns duplex-link $n(0) $n(8) 1Mb 10ms DropTail
$ns duplex-link $n(1) $n(10) 1Mb 10ms DropTail
$ns duplex-link $n(0) $n(9) 1Mb 10ms DropTail
$ns duplex-link $n(9) $n(11) 1Mb 10ms DropTail
$ns duplex-link $n(10) $n(11) 1Mb 10ms DropTail
$ns duplex-link $n(11) $n(5) 1Mb 10ms DropTail

# Create UDP agents and attach to nodes


set udp0 [new Agent/UDP]
$ns attach-agent $n(0) $udp0
set cbr0 [new Application/Traffic/CBR]
$cbr0 set packetSize_ 500
$cbr0 set interval_ 0.005
$cbr0 attach-agent $udp0

set null0 [new Agent/Null]


$ns attach-agent $n(5) $null0
$ns connect $udp0 $null0

set udp1 [new Agent/UDP]


$ns attach-agent $n(1) $udp1
set cbr1 [new Application/Traffic/CBR]
$cbr1 set packetSize_ 500
$cbr1 set interval_ 0.005
$cbr1 attach-agent $udp1

$ns attach-agent $n(5) $null0


$ns connect $udp1 $null0

# Enable Distance Vector routing protocol


$ns rtproto DV

# Define link failure and recovery events


$ns rtmodel-at 10.0 down $n(11) $n(5)
$ns rtmodel-at 15.0 down $n(7) $n(6)
$ns rtmodel-at 30.0 up $n(11) $n(5)
$ns rtmodel-at 20.0 up $n(7) $n(6)
# Set flow IDs and colors for tracing
$udp0 set fid_ 1
$udp1 set fid_ 2
$ns color 1 Red
$ns color 2 Green

# Start CBR traffic


$ns at 1.0 "$cbr0 start"
$ns at 2.0 "$cbr1 start"

# Schedule simulation finish


$ns at 45 "finish"

# Run simulation
$ns run

 Output:

You might also like