Computer networks
Computer networks
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.
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.
4.) Bridge :
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 classified into two types based on the direction of flow --
Unidirectional Gateways & Bidirectional Gateways.
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.
Optical Modem
Digital Modem
Acoustic Modem
Smart Modem
Short Haul Modem
PRACTICAL - 2
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.
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.
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.
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.
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:
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.
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
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.
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.
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.
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.
PRACTICAL - 5
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.
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 :
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.
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.
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.
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 :
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.
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]
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:
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.
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.
proc finish {} {
global ns nf
$ns flush-trace
close $nf
puts "running nam..."
exec nam stop.nam &
exit 0
}
Output:
PRACTICAL -14
# Create Nodes
set n0 [$ns node] ;# Sender
set n1 [$ns node] ;# Receiver
# 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\""
# Run Simulation
$ns run
Output:
PRACTICAL -15
Aim: To simulate and study the Distance Vector routing algorithm using simulation.
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]
# Create 12 nodes
for {set i 0} {$i < 12} {incr i 1} {
set n($i) [$ns node]
}
# Run simulation
$ns run
Output: