0% found this document useful (0 votes)
20 views29 pages

Lab Manual

The document outlines a series of experiments focused on networking concepts, including the study of LAN equipment, network topologies, installations, error correction techniques, and programming for framing methods. It details specific aims, theories, and methodologies for each experiment, such as configuring TCP/IP, implementing error detection methods like CRC, and using Tool Command Language (Tcl) for scripting. The document serves as a comprehensive guide for practical applications in networking and programming.

Uploaded by

sumitdwivedi850
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views29 pages

Lab Manual

The document outlines a series of experiments focused on networking concepts, including the study of LAN equipment, network topologies, installations, error correction techniques, and programming for framing methods. It details specific aims, theories, and methodologies for each experiment, such as configuring TCP/IP, implementing error detection methods like CRC, and using Tool Command Language (Tcl) for scripting. The document serves as a comprehensive guide for practical applications in networking and programming.

Uploaded by

sumitdwivedi850
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 29

List of Experiments:

1. Study of Different Type of LAN& Network Equipments.

2. Study and Verification of standard Network topologies i.e. Star, Bus, Ring etc.

3. LAN installations and Configurations.

4. Write a program to implement various types of error correcting techniques.

5. Write a program to Implement various types of framing methods.

6. Study of Tool Command Language (TCL).

7. Study and Installation of Standard Network Simulator: N.S-2, N.S3.OpNet,QualNetetc .

8. Study & Installation of ONE (Opportunistic Network Environment) Simulator for High Mobility Networks .

9. Configure 802.11 WLAN.

10. Implement &Simulate various types of routing algorithm.

11. Study & Simulation of MAC Protocols like Aloha, CSMA, CSMA/CD and CSMA/CA using Standard
Network Simulators.

12. Study of Application layer protocols-DNS, HTTP, HTTPS, FTP and TelNet.
EXPERIMENT -1

Aim: Study of Different Type of LAN& Network Equipments.

1. Repeater
2. Hub
3. Switch
4. Bridge
5. Router
6. Gate Way

Theory

1. Repeater: Functioning at Physical Layer. A repeater is an electronic device that receives a signal and
retransmits it at a higher level and/or higher power, or onto the other side of an obstruction, so that the
signal can cover longer distances. Repeaters have two ports, so cannot be used to connect for more than two
devices

2. Hub: An Ethernet hub, active hub, network hub, repeater hub, hub or concentrator is a device for connecting
multiple twisted pair or fiber optic Ethernet devices together and making them act as a single network
segment. Hubs work at the physical layer of the OSI model. The device is a form of multiport repeater.
Repeater hubs also participate in collision detection, forwarding a jam signal to all ports if it detects a
collision.
Switch: A network switch or switching hub is a computer networking device that connects network segments.
The term commonly refers to a network bridge that processes and routes data at the data link layer of the OSI
model. Switch that additionally process data at the network layer are often referred to as layer 3 switches or
multilayer switches.

Bridge: A network bridge connects multiple network segments at the data link layer of the OSI model. In
Ethernet networks, the term bridge formally means a device that behaves according to the IEEE 802.1 D
standards. A bridge and switch are very much alike; a switch being a bridge with numerous ports. Switch of
layer 2 switch is often used interchangeably with bridge. Bridges can analyze incoming data packets to
determine if the bridge is able to send the given packet to another segment of the network.

Router: A router is an electronic device that interconnects two or more computer networks, and selectively
interchanges packets of data between them. Each data packet contains address information that a router can use
to determine if the source and destination are on the same network, or if the data packet must be transferred
from one network to another. Where multiple routers are used in a large collection of interconnected networks,
the routers exchange information about target system addresses, so that each router can build up a table showing
the preferred paths between any two systems on the interconnected networks.
Gate way: In a communications network, a network node equipped for interfacing with another network that
uses different protocols. A gateway may contain devices such as protocol translators, impedance matching
devices, rate converters, fault isolators, or signal translators as necessary to provide system interoperability. It
also requires the establishment of mutually acceptable administrative procedures between both networks. A
protocol translation/mapping gateway interconnects networks with different network protocol technologies by
performing the required protocol conversions.

Conclusions: Different Network Devices have been studied in detail.


EXPERIMENT -2

Aim: Study and Verification of standard Network topologies i.e. Star, Bus, Ring etc.

Theory

Network topology is the arrangement of the various elements (links, nodes, etc.) of a computer or biological
network. Essentially, it is the topological structure of a network, and may be depicted physically or logically.
Physical topology refers to the placement of the network's various components, including device location and
cable installation, while logical topology shows how data flows within a network, regardless of its physical
design. Distances between nodes, physical interconnections, transmission rates, and/or signal types may differ
between two networks, yet their topologies may be identical.

A good example is a local area network (LAN): Any given node in the LAN has one or more physical links to
other devices in the network; graphically mapping these links results in a geometric shape that can be used to
describe the physical topology of the network. Conversely, mapping the data flow between the components
determines the logical topology of the network

Topology

There are two basic categories of network topologies:

1. Physical topologies
2. Logical topologies

The shape of the cabling layout used to link devices is called the physical topology of the network. This refers to
the layout of cabling, the locations of nodes, and the interconnections between the nodes and the cabling The
physical topology of a network is determined by the capabilities of the network access devices and media, the
level of control or fault tolerance desired, and the cost associated with cabling or telecommunications circuits.

The logical topology, in contrast, is the way that the signals act on the network media, or the way that the data
passes through the network from one device to the next without regard to the physical interconnection of the
devices. A network's logical topology is not necessarily the same as its physical topology. For example, the
original twisted pair Ethernet using repeater hubs was a logical bus topology with a physical star topology
layout. Token Ring is a logical ring topology, but is wired a physical star from the Media Access Unit.

The logical classification of network topologies generally follows the same classifications as those in the
physical classifications of network topologies but describes the path that the data takes between nodes being
used as opposed to the actual physical connections between nodes. The logical topologies are generally
determined by network protocols as opposed to being determined by the physical layout of cables, wires, and
network devices or by the flow of the electrical signals, although in many cases the paths that the electrical
signals take between nodes may closely match the logical flow of data, hence the convention of using the terms
logical topology and signal topology interchangeably.

Logical topologies are often closely associated with Media Access Control methods and protocols. Logical
topologies are able to be dynamically reconfigured by special types of equipment such as routers and switches.
The study of network topology recognizes eight basic topologies:

 Point-to-point

 Bus

 Star

 Ring or circular
 Mesh

 Tree

 Hybrid

 Daisy chain
EXPERIMENT -3

Aim: LAN installations and their Configurations

Theory

Performance: Perform the following steps as directed Step

Step 1: To make a Direct Cable connection

1. Click Start, click Control Panel, and then double-click Network Connections.

2. Under Network Tasks, click Create a new connection, and then click next.

3. Click Set up an advanced connection, and then click next.

4. Click Connect directly to another computer, and click next.

5. Choose the role this machine will play in the communication. If this computer has the information to which
you need to gain access, click Host. If this computer will access information from the other computer, click
Guest.

Step 2: To Set Up the Host Computer

1. Click the connection device that you want to use for this connection (a parallel or serial port, or an infrared
port), and then click Next.

2. Grant access to the users who are allowed to connect by selecting the appropriate check boxes, and then click
Next.

3. Click Finish to end the configuration process.

Step 3: To Set up the Guest Computer

1. Type a name to identify this connection, and then click Next.

2. Click the connection device that you want to use for this connection (a parallel or serial port, or an infrared
port), and then click Next.

3. Decide whether this connection will be available for all users (click Anyone's use), or only for you (click my
use only), and then click Next.

4. Click Finish to end the setup process

Step 4: To create Windows Workgroup

1. In Windows XP, right click on My Computer, select System Properties.

2. Select the Computer Name tab, click on Change.

3. Enter the appropriate Computer name and Workgroup.

4. Make sure that every computer on your home network references the same workgroup.
Step 5:
To Configure TCP/IP
To assign IP address, gateway, subnet mask, DNS

Step 6:

To create domain Bring all the PC of Lab under a network using workgroup or domain.
Create client and server

Result/ Conclusions
Windows workgroup is established and used for sharing and transferring data between physically connected
PCs.
EXPERIMENT -4

Aim: To implement various types of error correcting techniques.

Theory
Error detection and correction are implemented either at the data link layer or the transport layer of the OSI
model.

Types of Error

Single bit errors are the least likely type of errors in serial data transmission because the noise must have a very
short duration which is very rare. However this kind of errors can happen in parallel transmission.

Example: If data is sent at 1Mbps then each bit lasts only 1/1,000,000 sec. or 1 μs.  For a single-bit error to
occur, the noise must have a duration of only 1 μs, which is very rare.
The term burst error means that two or more bits in the data unit have changed from 1 to 0 or from 0 to 1.

Burst errors do not necessarily mean that the errors occur in consecutive bits, the length of the burst is measured
from the first corrupted bit to the last corrupted bit. Some bits in between may not have been corrupted.

Burst error is most likely to happen in serial transmission since the duration of noise is normally longer than the
duration of a bit.

The number of bits affected depends on the data rate and duration of noise.

Example: If data is sent at rate = 1Kbps then a noise of 1/100 sec can affect 10 bits.(1/100*1000) If same data is
sent at rate = 1Mbps then a noise of 1/100 sec can affect 10,000 bits.(1/100*106 )

CYCLIC REDUNDANCY CHECK (CRC)

LOGIC:

1. Let r be the degree of G(x).Append r zero bits to the low-order end of the frame. So it now contains m+r bits
and corresponds to the polynomial x2 m(x).

2. Divide the bit string corresponding to G(x) into the bit string corresponding to x2 m(x) using modulo-2
division.

3. Subtract the remainder from the bit string corresponding to x2 m(x) using modulo-2 sub. The result is the
check summed frame to be transmi 琀琀 ed. We call it as a polynomial.
EXPERIMENT -5

Aim: Write a program to implement various types of framing methods.

a) CHARACTER COUNT

b) BIT STUFFING AND DE STUFFING

c) CHARACTER STUFFING AND DE STUFFING

CHARACTER COUNT

Implementation of data link framing methods for counting characters in a given frame

LOGIC: The header in the given frame is by default first frame size including the first field data bits are counted
and considered as the first frame and the next field contains the next frame size and so on. PSEUDO CODE:

1. At the sender side the user is asked to enter the number of frames he want to transmit.

2. Depending upon the input, that much number of frames are taken as input from the user and stored in a 2 by 2
matrix.

3. The length of each frame is calculated and stored in a new array.

4. While out putting the frame, the length of each frame is added to the each frame and finally all the frames are
appended and sent as a single string.

5. At the receiver side, the first number is treated as the length of the first frame and the string is extracted and
displayed.

6. The next number is treated as the length of the next frame and so on.

At Sender:

INPUT:

Enter the number of frames you want to send: 2

Enter the frame: 1234 Enter the frame: 678

OUTPUT The transmitted frame is: 512344678 At receiver:

INPUT: Enter data 512344678

OUTPUT:

Frame sizes are: 5 4

Frames are:

Frame 1: 1234

Frame 2: 678

BIT STUFFING
Implementation of the data link framing methods for the bit stuffing in a frame.

LOGIC: Stuffing a 0 bit in a data frame in order to differentiate the header, trailer and data.

PSEUDO CODE: /* For given data */

1. a flag “01111110” is embedded at the starting and the ending of the data. /* stuffing of data */

2. if data bit is 1 increment count else count is zero.

3. If count is five store a zero bit after the five 1‟s in the data array.

4. Repeat step 3 till the end of data. /* De stuffing of data */

5. If the data bit is 1 increment count else count is zero.

6. If the count is five and the next bit is zero then store the next bit after zero in the data array. /* transmit the
data */

7. De stuffed data is transmitted without flags.

At sender:

INPUT:

Enter the string 1111110101

OUTPUT:
Transmitted data is: 01111110111111010101111110

Stuffed data is: 011111101111101010101111110

At Receiver:

INPUT:

Enter the string 1111110101

OUTPUT:

De stuffed data is: 1111111010

CHARACTER STUFFING

Implementation of data link framing methods for character stuffing in a frame.

LOGIC: In a character data frame if a DLE is encountered between the data it is doubled and transmitted at the
receiver side it is de stuffed and original data is obtained.

PSEUDO CODE: /* Defining DLE characters */

1. As the DLE characters are non-printable characters. The ASCII values of the printable characters like *, #, $
are assigned to DLE, STX, ETX.

/*Stuffing the data */

2. If the ASCII value that is assigned to DLE occurs in the data array another DLE character is stuffed and
stored in the array and transmitted along with starting and ending flags
/* DE stuffing data */

3. If the ASCII value of DLE occurs in the data array, the next bit is stored in to the array and transmitted
without the flags.

4. Here whenever the program encounters characters like * the string DLE is added to the original string.

At Sender:
INPUT: Enter Data r*gm
OUTPUT:
Stuffed data DLESTXrDLEDLEgmDLEETX

At receiver:
OUTPUT: The message: r*gm
EXPERIMENT -6

Aim - Study of Tool Command Language (Tcl)

Tcl (originally from "Tool Command Language", but conventionally spelled "Tcl" rather than "TCL";
pronounced as "tickle" or "tee-see-ell") is a scripting language created by John Ouster out.Originally "born out
of frustration”, according to the author, with programmers devising their own languages intended to be
embedded into applications, Tcl gained acceptance on its own. It is commonly used for rapid prototyping,
scripted applications, GUIs and testing. Tcl is used on embedded systems platforms, both in its full form and in
several other smallfootprint versions.

The combination of Tcl and the TkGUI toolkit is referred to as Tcl/Tk.

Features

Tcl's features include All operations are commands, including language structures.
They are written in prefix notation.

 Commands are commonly variadic

. Everything can be dynamically redefined and overridden.

 All data types can be manipulated as strings, including source code

. Event-driven interface to sockets and files. Time-based and user-defined events are also possible

. Variable visibility restricted to lexical (static) scope by default, but uplevel and upvar allowing process to

 interact with the enclosing functions' scopes. All commands defined by Tcl itself generate error messages on
incorrect usage. Extensibility, via C, C++, Java, and Tcl.

 Interpreted language using byte code

 Full Unicode (3.1) support, first released 1999.

 Cross-platform: Windows API; UNIX, Linux, Macintosh, etc.

 Close integration with windowing (GUI) interface Tk.

 Multiple distribution mechanisms exist:

o Full development version (e.g., Active State Tcl)

o tclkit (kind of single-file runtime, only about 1 megabyte in size)

o starpack (single-file executable of a script/program, derived from the tclkit technology)

o FreewrapTCLSH turns TCL scripts into single-file binary executable programs.

o BSD licenses, freely distributable source.

Tcl did not originally have object oriented (OO) syntax (8.6 provides an OO system in Tcl core), so OO
functionality was provided by extension packages, such as incr Tcl and XOTcl. Even purely scripted OO
packages exist, such as Snit and STOOOP (simple Tcl-only object-oriented programming).

Safe-Tcl is a subset of TCL that has restricted features. File system access is limited and arbitrary system
commands are prevented from execution. It uses a dual interpreter model with the "untrusted interpreter"
running code in an untrusted script. It was designed by Nathaniel Bornstein and Marshall Rose to include active
messages in e-mail. Safe-Tcl can be included in e-mail when the application/safe-Tcl and multipart/enabled-
mail are supported. The functionality of Safe-Tcl has since been incorporated as part of the standard Tcl/Tk
releases.

Syntax and fundamental semantics

A Tcl script consists of several command invocations. A command invocation is a list of words separated by
whitespace and terminated by a newline or semicolon.

word0 word1 word2 ... wordN

The first word is the name of a command, which is not built into the language, but which is in the library. The
following words are arguments. So we have:

commandName argument1 argument2 ... argumentN

Practical example, using the puts command which outputs a string, adding a trailing newline, by default to the
stdout channel:

puts"Hello, world!"

Variables and the results of other commands can be substituted inside strings too, such as in this example where
we use set and expr to store a calculation result in a variable, and puts to print the result together with some
explanatory text:

# Good style would put the expression (1+2+3+4+5, in this case) inside {curly braces}

set sum [expr1+2+3+4+5]

puts"The sum of the numbers 1..5 is $sum."

#expr function will be evaluated faster if curly braces are added on the equation.

set sum [expr{1+2+3+4+5}]

puts"The sum of the numbers 1..5 is $sum."

There is one basic construct (the command) and a set of simple substitution rules.

Formally, words are either written as-is, with double-quotes around them (allowing whitespace characters to be
embedded), or with curly-brace characters around them, which suppresses all substitutions inside (except for
backslash-newline elimination). In bare and double-quoted words, three types of substitution occur (once, in a
single left-to-right scan through the word):

Command substitution replaces the contents of balanced square brackets with the result of evaluating the
script contained inside. For example, “[expr 1+2+3]” is replaced with the result of evaluating the contained
expression (i.e. 6) since that's what the expr command does.

Variable substitution replaces a dollar-sign followed by the name of a variable with the contents of the
variable. For example, “$foo” is replaced with the contents of the variable called “foo”. The variable name may
be surrounded in curly braces so as to delimit what is and isn't the variable name in otherwise ambiguous cases.

Backslash substitution replaces a backslash followed by a letter with another character. For example, “\n” is
replaced with a newline.
From Tcl 8.5 onwards, any word may be prefixed by “{*}” to cause that word to be split apart into its
constituent sub-words for the purposes of building the command invocation (similar to the “,@” sequence of
Lisp's quasiquote feature).

As a consequence of these rules, the result of any command may be used as an argument to any other command.
Also, there is no operator or command for string concatenation, as the language concatenates directly. Note that,
unlike in Unix command shells, Tcl does not reparse any string unless explicitly directed to do so, which makes
interactive use more cumbersome but scripted use more predictable (e.g. the presence of spaces in filenames
does not cause difficulties).

The single equality sign (=) for example is not used at all, and the double equality sign (==) is the test for
equality, and even then only in expression contexts such as the expr command or the first argument to if. (Both
of those commands are just part of the standard library; they have no particularly special place in the library and
can be replaced if so desired.)

The majority of Tcl commands, especially in the standard library, are variadic, and the proc (the constructor for
scripted command procedures) allows one to define default values for unspecified arguments and a catch-all
argument to allow the code to process arbitrary numbers of arguments.

Tcl is not statically typed: each variable may contain integers, floats, strings, lists, command names,
dictionaries, or any other value; values are reinterpreted (subject to syntactic constraints) as other types on
demand. However, values are immutable and operations that appear to change them actually just return a new
value instead.
EXPERIMENT -7

Aim: Study and Installation of Standard Network Simulator: N.S-2, N.S3.OpNet,QualNetetc .

Objectives:

Understand the architecture and usage of popular network simulators.


Install and run basic simulations using NS-2 and NS-3.
Study the interface and applications of OPNET and QualNet simulators

Theory:
1. NS-2 (Network Simulator Version 2):

A discrete event simulator used for simulating networking protocols (TCP, UDP, etc.).
Scripted in TCL with core functionalities in C++.
Suitable for both wired and wireless simulations.

Key Features:

Free and open-source


Visualization support via NAM
Good for academic and research use

Installation (Ubuntu):

sudo apt update


sudo apt install ns2

2. NS-3 (Network Simulator Version 3):

A modern, object-oriented network simulator.


Written in C++ with Python bindings.
Supports real network emulation, virtualization, and packet-level simulation.

Installation (Ubuntu):

sudo apt install git


git clone https://gitlab.com/nsnam/ns-3-allinone.git
cd ns-3-allinone
./download.py
./build.py --enable-examples --enable-tests

Run Simulation:

cd ns-3.*
./waf --run hello-simulator

3. OPNET (now Riverbed Modeler):

Commercial simulator used for enterprise-level network performance modeling.


GUI-based environment for building network topologies and simulations.

Key Features:

Rich protocol libraries


Realistic application modeling
Not open-source (requires license)
Installation:

Download from Riverbed (licensed software)


Available for Windows and Linux

4. QualNet:

High-performance simulator developed by Scalable Network Technologies.


Designed for large-scale wireless and mobile networks.

Key Features:

Real-time simulation and emulation


Highly scalable and efficient
Used in military and IoT research
Installation:
Requires license (educational or commercial)
GUI and command-line interfaces supported

Comparison Table:

Simulator Open Source Language GUI Support Applications


NS-2 Yes C++, TCL No Research, Education
NS-3 Yes C++, Python Limited Advanced Simulation
OPNET No GUI + C Yes Commercial Network Design
QualNet No C++ Yes Real-time Wireless Systems

Procedure:
1. Install Linux or use Ubuntu virtual machine.
2. For NS-2: Use apt install ns2 or compile from source.
3. For NS-3: Clone repository and compile using Python scripts.
4. For OPNET/QualNet: Download installers and follow license-based setup.
5. Run basic simulations to verify setup.
Conclusion:
 Network simulators play a key role in evaluating performance, scalability, and behavior of
network protocols.
 NS-2 and NS-3 are ideal for academic learning and research.
 OPNET and QualNet are preferred in enterprise and defense sectors due to advanced GUI and
real-time capabilities.
EXPERIMENT -8

Aim: Study & Installation of ONE (Opportunistic Network Environment) Simulator for High Mobility
Networks

Objectives:

Understand the architecture and working of the ONE Simulator.


Learn to install and configure ONE Simulator in a Linux/Windows environment.
Execute basic DTN simulation scenarios.

Theory:

What is ONE Simulator?

ONE (Opportunistic Network Environment) Simulator is a Java-based simulator specifically designed for:
Delay Tolerant Networks (DTNs)
Mobile Ad-hoc Networks (MANETs)
Vehicular Ad-hoc Networks (VANETs)
It allows modeling high-mobility environments like buses, cars, or pedestrians where end-to-end connectivity
may not always exist.

Key Features:
Java-based, platform-independent
Supports different routing protocols: Epidemic, Spray-and-Wait, Prophet, MaxProp, etc.
Built-in movement models: Random Waypoint, Map-based Movement
Visual GUI and log outputs (delivery reports, contact traces)

Installation Steps:
Prerequisites:
Java (JDK 8 or newer)
Linux or Windows OS
1 For Linux/Windows:
1. Install Java:

On Ubuntu/Debian:

sudo apt update


sudo apt install default-jdk

Check Version:

java –version

2 Download ONE Simulator:

Official GitHub: https://github.com/akeranen/the-one


Or use terminal:

git clone https://github.com/akeranen/the-one.git


cd the-one

3 Build ONE using Ant (optional but recommended):

sudo apt install ant


ant

4 Run the Simulator:


cd bin
./one.sh default_settings.txt

On Windows: Run one.bat from the bin folder.

Default Configuration Files:

Located in the default_settings.txt


Contains simulation parameters like node movement, routing, buffers, etc.

Basic Simulation Flow:

1. Define simulation parameters in default_settings.txt


2. Run simulation via ./one.sh default_settings.txt
3. Observe output logs in the reports/ folder:

oDeliveryReports.txt
oMessageStats.txt
oContactSummary.txt
Applications of ONE Simulator:

Disaster communication networks


Vehicular communication modeling
Mobile delay-tolerant apps
Testing new DTN routing algorithms

Conclusion:
The ONE Simulator is a powerful and open-source tool used to simulate high mobility and delay-tolerant
networks (DTNs). It provides a user-friendly platform to test and analyze different routing protocols in
disconnected network scenarios.
EXPERIMENT -9

Aim: Implement and simulate various types of routing algorithm.

THEORY:

Routing is the act of moving information across an inter-network from a source to a destination. Along the way,
at least one intermediate node typically is encountered. It’s also referred to as the process of choosing a path
over which to send the packets. Routing is often contrasted with bridging, which might seem to accomplish
precisely the same thing to the casual observer. Routing protocols use metrics to evaluate what path will be the
best for a packet to travel. A metric is a standard of measurement; such as path bandwidth, reliability, delay,
current load on that path etc; that is used by routing algorithms to determine the optimal path to a destination.
To aid the process of path determination, routing algorithms initialize and maintain routing tables, which
contain route information. Route information varies depending on the routing algorithm used.

Routing algorithm: For a packet to travel from source to destination it has to pass through multiple paths or
sometimes a single path. So when a packet finds multiple paths to reach the destination, it has no judging
methods available to find a right path. A router with the help of certain algorithms calculates the best path for
the packet to reach the destination. These algorithms are called routing algorithms. This is the way in which a
router finds the correct entry in its routing table. There are several algorithms available to find this best path but
here I am going to discuss only the two basic types of algorithms.
Two basic routing algorithms are,

1. Distance-vector algorithm.

2. Link state routing algorithm.

1. Distance-vector algorithm.

As from the name suggests it uses distance and direction to find the best path to reach the destination. The
distance here is the number of hops a packet crosses to reach the destination. Each hop refers to a router across
the path. The word vector refers to the direction of the packet to reach the destination. It has lesser convergence
time and knowledge about the whole network when compared to link state routing algorithm. Working of this
distance vector algorithm can be explained in three steps. The steps are as follows,

Step 1: In this algorithm, the information about every router connected directly and routing updates will be
gathered by every single router. This information about the whole network will be sent periodically to all the
neighboring routers connected to it. In this way every router updates the information in its routing table.

Step 2: All the information collected by a single router about the whole network will be sent only to its
neighbors and not to all other routers in the routing table. If there is any change in the hopcount or disabled
paths it will updated only to its neighbors which in turn after a period passes to its neighbors.

Step 3: The above explained sharing of information will take place in a period of 30 seconds. If there is a
change in the network like if a network fails or additionally a router is added to the network, the changed
information will be updated only after that time period.

2. Link state routing algorithm.

This is the most popular routing algorithm used in the real time networks. It uses three tables for the calculation
of the routing table entries. It is also called as ‘Shortest path first algorithm’. It has several advantages over
distance vector algorithm. Some of them include its faster convergence time, ability to handle very large
networks, reliable path prediction. It uses link state advertisements to find the information about the router. Here
in steps working of link state algorithm can be analyzed. The steps are,
Step 1: As from its name ‘Shortest path first algorithm’ it uses several calculations to find the shortest path to
reach the destination. This algorithm uses link state packets or advertisements to collect the information about
the neighboring routers. Only links that are connected directly are considered as neighbors. In contrast to
distance vector it sends info only about neighbors.

Step 2: In this algorithm instead of sending the routing table info only to the neighbors it sends to all the routers
in the network. In this algorithm totally three tables are maintained. One is for collecting info about neighbors,
one has info about the entire topology, final one is the actual routing table.

Step 3: In this algorithm there is no periodic updates involved. A router in the network will send updates to all
the routers and only if there is a change in the network. That is why it is called as event triggered updates. This
event triggered updates will help the router to find its path immediately without any errors.
EXPERIMENT -10

Aim: Configure 802.11 WLAN.

Objectives:

Understand the architecture of WLAN based on IEEE 802.11 standards.


Configure wireless devices such as Access Points and clients.
Set security parameters like WPA2, SSID, and MAC filtering.

Theory:

What is 802.11 WLAN?

IEEE 802.11 is a set of standards for implementing wireless local area network (WLAN) communication in
various frequency bands, including 2.4 GHz and 5 GHz. It forms the basis of Wi-Fi technology.

Key WLAN Components:


1. Access Point (AP): Device that connects wireless clients to a wired network.
2. Wireless Clients: Devices such as laptops, smartphones, etc.
3. SSID: Network name for identification.
4. Security Protocols: WPA2, WPA3 for secure communication.
5. MAC Filtering: Restrict network access to specific devices.

Tools Required:

 A wireless router or Access Point


 At least one Wi-Fi enabled client device (Laptop/PC)
 Admin access to router settings

Procedure:

Step 1: Access Router Configuration

Connect to the router via Wi-Fi or Ethernet.


Open a browser and enter router’s IP address (e.g., 192.168.0.1 or 192.168.1.1).
Log in using admin credentials.

Step 2: Configure SSID and Channel


Go to Wireless Settings.
Set:
SSID: e.g., Campus_WiFi
Channel: e.g., Auto or Channel 6 (2.4 GHz)
Mode: e.g., 802.11 b/g/n or a/b/g/n/ac

Step 3: Set Security Parameters


Choose Security Type: WPA2-PSK or WPA3
Set a strong password
Optionally enable MAC address filtering to restrict access.

Step 4: Connect Client Devices

On the client device:


o Search for the SSID
o Enter the password
o Verify connection and internet access
Step 5: Test Network

Use ping or browser to verify internet access.


Optionally use tools like:
o ipconfig or ifconfig to view IP details
o ping and traceroute to test connectivity
Expected Output:

Wireless clients should be able to connect to the Access Point using the configured SSID and security
credentials.

Client should receive an IP address from the router's DHCP.

Applications:

Home and campus wireless networks


Public Wi-Fi in airports, cafes
IoT and smart device connectivity

Conclusion:
The configuration of an 802.11 WLAN involves setting up the SSID, security, and channel parameters on the
Access Point. Understanding and properly configuring these parameters ensures a secure and reliable wireless
network.
EXPERIMENT -11

Aim: Study & Simulation of MAC Protocols like Aloha, CSMA, CSMA/CD and CSMA/CA using Standard
Network Simulators.

Objectives:

Understand the working of various MAC layer protocols.


Compare their efficiency and collision handling mechanisms.
Simulate these protocols using tools like NS-2 or NS-3.

Theory:

What is MAC?

MAC (Medium Access Control) is a sublayer of the Data Link Layer responsible for managing how multiple
devices share the communication medium without interference.

MAC Protocols Overview:

Protocol Type Description


Simple; transmits when data is ready, with retransmission on
ALOHA Random Access
collision.
Slotted Time is divided into slots; reduces collisions compared to
Random Access
ALOHA ALOHA.
CSMA Sensing Access Carrier sensing before transmission to avoid collisions.
Collision
CSMA/CD Used in wired Ethernet; detects collisions and retransmits.
Detection
Collision
CSMA/CA Used in wireless (Wi-Fi); avoids collisions using RTS/CTS.
Avoidance
Simulation Tools:
 NS-2 (Network Simulator 2) – suitable for ALOHA and CSMA/CD
 NS-3 – suitable for CSMA/CA (Wi-Fi networks)
 Python/Matlab (optional) for simplified logic implementation

Procedure (Example using NS-2 for CSMA/CD):

Step 1: Install NS-2

sudo apt install ns2

Step 2: Write TCL Script (csma.tcl)

Example setup with CSMA channel in NS-2:

set ns [new Simulator]


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

$ns duplex-link $n0 $n1 1Mb 10ms DropTail


$ns queue-limit $n0 $n1 10

set udp [new Agent/UDP]


$ns attach-agent $n0 $udp

set null [new Agent/Null]


$ns attach-agent $n1 $null

$ns connect $udp $null

set ftp [new Application/FTP]


$ftp attach-agent $udp

$ns at 0.5 "$ftp start"


$ns at 2.5 "$ftp stop"
$ns at 3.0 "finish"

proc finish {} {
global ns
$ns flush-trace
exit 0
}

$ns run

For CSMA/CA (Wi-Fi) using NS-3:

./waf --run "wifi-simple-infra"

Edit the .cc simulation file to configure parameters like contention window, RTS/CTS, etc.
Use NS-3’s inbuilt tracing to observe packet transmission and collision avoidance.

Expected Observations:

ALOHA: High collision probability, low efficiency (~18%).


Slotted ALOHA: Better than ALOHA (~36%).
CSMA: Fewer collisions due to sensing.
CSMA/CD: Efficient in wired media with collision detection.
CSMA/CA: Best suited for wireless; uses backoff and RTS/CTS.

Result Analysis Table:

Protocol Efficiency Medium Collision Handling


ALOHA Low (~18%) Any Retransmission
Slotted ALOHA Moderate Any Time slots + Retransmission
CSMA Moderate Wired Carrier sensing
CSMA/CD High Wired Detect + Backoff
CSMA/CA High Wireless Avoid + RTS/CTS
Conclusion:
Different MAC protocols offer varying levels of performance based on medium type and collision handling.
Simulating these protocols using NS-2/NS-3 helps understand their real-world behavior and efficiency under
various conditions.
EXPERIMENT -12
Aim: Study of Application layer protocols-DNS, HTTP, HTTPS, FTP and TelNet.

Objectives:

Understand the role of the application layer in the OSI and TCP/IP models.
Explore the functionality of various application protocols.
Use network tools to observe and analyze the behavior of these protocols

Theory:

What is the Application Layer?


The Application Layer is the top layer in the OSI and TCP/IP models, responsible for providing network
services directly to end users. It includes standard protocols that allow applications to interact with the network.

Application Layer Protocols:

1. DNS (Domain Name System):

Resolves domain names (e.g., www.google.com) to IP addresses.


Works over UDP port 53 (also TCP in some cases).
Involves recursive and iterative queries.

2. HTTP (HyperText Transfer Protocol):

Basis of web communication.


Works over TCP port 80.
Stateless and plain text-based.

3. HTTPS (HTTP Secure):

Secure version of HTTP.


Uses TLS/SSL encryption over TCP port 443.
Ensures confidentiality, integrity, and authentication.

4. FTP (File Transfer Protocol):

Transfers files between client and server.


Works over TCP ports 20 (data) and 21 (control).
Can be active or passive mode.

5. Telnet (Terminal Emulation Protocol):

Provides remote login to another host.


Works over TCP port 23.
Insecure; sends data in plain text (superseded by SSH).

Tools Used:

Terminal/Command Prompt
Web Browser
Wireshark (for packet analysis)
curl, ftp, telnet, nslookup, dig
Expected Observations:

Protocol Port Transport Function Secure?


DNS 53 UDP/TCP Name resolution ❌
HTTP 80 TCP Web content transfer ❌
HTTPS 443 TCP Secure web content ✅
FTP 20/21 TCP File transfer ❌ (FTPS/ SFTP is secure)
Telnet 23 TCP Remote login ❌ (use SSH)

Conclusion:
This experiment introduced essential application layer protocols that enable services like web browsing, file
transfer, name resolution, and remote access. Understanding their operations, ports, and use cases is vital for
modern networking and cyber security practices.

You might also like