Lab Manual
Lab Manual
2. Study and Verification of standard Network topologies i.e. Star, Bus, Ring etc.
8. Study & Installation of ONE (Opportunistic Network Environment) Simulator for High Mobility Networks .
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
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.
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
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
Theory
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.
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.
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.
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. 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
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 )
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
a) CHARACTER COUNT
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.
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:
OUTPUT:
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.
1. a flag “01111110” is embedded at the starting and the ending of the data. /* stuffing of data */
3. If count is five store a zero bit after the five 1‟s in the data array.
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 */
At sender:
INPUT:
OUTPUT:
Transmitted data is: 01111110111111010101111110
At Receiver:
INPUT:
OUTPUT:
CHARACTER STUFFING
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.
1. As the DLE characters are non-printable characters. The ASCII values of the printable characters like *, #, $
are assigned to DLE, STX, ETX.
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
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.
Features
Tcl's features include All operations are commands, including language structures.
They are written in prefix notation.
. 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.
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.
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.
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:
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}
#expr function will be evaluated faster if curly braces are added on the equation.
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
Objectives:
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:
Installation (Ubuntu):
Installation (Ubuntu):
Run Simulation:
cd ns-3.*
./waf --run hello-simulator
Key Features:
4. QualNet:
Key Features:
Comparison Table:
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:
Theory:
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:
Check Version:
java –version
oDeliveryReports.txt
oMessageStats.txt
oContactSummary.txt
Applications of ONE Simulator:
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
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.
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.
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
Objectives:
Theory:
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.
Tools Required:
Procedure:
Wireless clients should be able to connect to the Access Point using the configured SSID and security
credentials.
Applications:
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:
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.
proc finish {} {
global ns
$ns flush-trace
exit 0
}
$ns run
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:
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:
Tools Used:
Terminal/Command Prompt
Web Browser
Wireshark (for packet analysis)
curl, ftp, telnet, nslookup, dig
Expected Observations:
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.