0% found this document useful (0 votes)
11 views77 pages

CN Lab Manual PDF

The Communication Networks Laboratory at Sri Venkateswara Engineering College includes a series of experiments aimed at simulating various networking protocols and performance metrics, such as telnet, ftp, and queueing disciplines. Students are required to complete at least 10 experiments using Omnet++ software, adhering to specific laboratory instructions and maintaining a dress code. The document also outlines the institute's vision, mission, and educational objectives, emphasizing the importance of technical education and ethical standards in the field of Electronics and Communication Engineering.

Uploaded by

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

CN Lab Manual PDF

The Communication Networks Laboratory at Sri Venkateswara Engineering College includes a series of experiments aimed at simulating various networking protocols and performance metrics, such as telnet, ftp, and queueing disciplines. Students are required to complete at least 10 experiments using Omnet++ software, adhering to specific laboratory instructions and maintaining a dress code. The document also outlines the institute's vision, mission, and educational objectives, emphasizing the importance of technical education and ethical standards in the field of Electronics and Communication Engineering.

Uploaded by

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

Communication Networks Laboratory III B.

Tech II SEM

SRI VENKATESWARA ENGINEERING COLLEGE


B.Tech. III-II Sem L T P C
0 0 3 1.5

COMMUNICATION NETWORKS LABORATORY (20A04603P)

List of Experiments:

1. Simulate telnet and ftp between N sources - N sinks (N = 1, 2, 3).


Evaluate the effect of increasing data rate on congestion.
2. Simulating the effect of queueing disciplines on network performance - Random Early
Detection/Weighted RED / Adaptive RED (This can be used as a lead up to DiffServ / IntServ
later).
3. Simulate http, ftp and DBMS access in networks
4. Effect of VLAN on network performance –i) multiple VLANs and single router ii) multiple
VLANs with separate multiple routers
5. Implementation of IP address configuration.
6. To create scenario and study the performance of network with CSMA / CA protocol and compare
with CSMA/CD protocols.
7. Implementation of a routing algorithm
8. Simulation of Congestion Control Algorithms
9. Simulating the effect of DiffServ / IntServ in routers on throughput enhancement.
10. Simulating the performance of wireless networks
11. Case Study I: Evaluating the effect of Network Components on Network Performance To Design
and Implement LAN With Various Topologies and To Evaluate Network Performance Parameters
for DBMS etc)
12. Case Study II: Evaluating the effect of Network Components on Network Performance To Design
and Implement LAN Using Switch/Hub/Router As Interconnecting Devices For Two Different
LANs and To Evaluate Network Performance Parameters.
NOTE: At least 10 Experiments out of the list must be done in the semester.

Equipment Required:
1. PC with Omnet++ Software Installed

References:
1. Behrouz A. Forouzan, ―Data Communications and Networking‖, Tata McGraw-Hill, 4th Ed
2. Online learning resources/virtual labs: https://doc.omnetpp.org/omnetpp/manual

Department of ECE Page 1


Communication Networks Laboratory III B. Tech II SEM

LABORATORY INSTRUCTIONS

1. While entering the Laboratory, the students should follow the dress code. (Wear shoes and
White apron, Female Students should tie their hair back).

2. The students should bring their observation book, record, calculator, necessary stationery items
and graph sheets if any for the lab classes without which the students will not be allowed for
doing the experiment.

3. All the equipment and components should be handled with utmost care. Any breakage or
damage will be charged.

4. If any damage or breakage is noticed, it should be reported to the concerned in-charge


immediately.

5. The theoretical calculations and the updated register values should be noted down in the
observation book and should be corrected by the lab in-charge on the same day of the
laboratory session.

6. Each experiment should be written in the record note book only after getting signature from the
lab in-charge in the observation notebook.

7. Record book must be submitted in the successive lab session after completion of experiment.

8. 100% attendance should be maintained for the laboratory classes.

Department of ECE Page 2


Communication Networks Laboratory III B. Tech II SEM

VISION OF THE INSTITUTE

To be a center of excellence focusing on high quality technical education, research and technical services
with global leadership competence to succeed in employment and higher education with ethical, social,
entrepreneurial aspects updating to the real time requirements

MISSSION OF THE INSTITUTE

M1: To impart high quality technical education by providing the state of the art infrastructure, core
instruction.

M2: Advanced research and technical consultancy services with qualified and senior faculty.

M3: To prepare the students professionally deft and intellectually adept possessing excellent skill,
knowledge and behavior with global competence.

VISION OF THE DEPARTMENT

To be a focal centre for academic excellence in competing global standards and dynamics in the field of
Electronics and Communication Engineering with research and services focusing on effective
communication skills, entrepreneurial, ethical and social concern.

MISSSION OF THE DEPARTMENT

M1: To impart quality technical education in Electronics and Communication Engineering with well-
established infrastructure, state-of-the art laboratories, core instructions and cognizant faculty.

M2: To prepare the young and dynamic Electronics and Communication Engineers professionally deft and
intellectually adept with knowledge, behavior and information competency.

M3: To enable the learners for changing trends in the field of Electronics and Communication Engineering
with a focus on career guidance, placements and higher education by Industry-Institute relationship.

Department of ECE Page 3


Communication Networks Laboratory III B. Tech II SEM

PROGRAM EDUCATIONAL OBJECTIVES

PEO1: Graduates should be cognizant in basic science, fundamental engineering stream along with core
related domains in ECE and Allied fields.

PEO2: Graduates should understand issues related to design, problem solving, and intellectually adept
with knowledge, behavior and information competency.

PEO3: Graduates should demonstrate their technical, communication, research, aptitudes along with
leadership skills in professional environment to empower employability, higher education and
entrepreneurs successfully through industry-institute interaction.

PEO4: Graduates should be motivated with high ethical, human values and team work towards
development of the society.

PROGRAM SPECIFIC OUTCOMES

PSO1: An ability to get an employment in Electronics and Communication Engineering field and related
industries and to participate & succeed in competitive examinations like GRE, GATE,TOEFL, PSUs, etc.

PSO2: Should be able to design and test various electronic systems that perform analog and digital
processing functions.

PROGRAM OUTCOMES

PO1. Engineering Knowledge: An ability to apply the knowledge of mathematics, science, engineering
fundamentals, and an engineering specialization to the solution of complex engineering problems as
appropriate to the field of electronics & communication engineering practice.

PO2. Problem Analysis: Ability to Identify, formulates, review research literature, and analyze complex
Engineering problems reaching substantiated conclusions using first principles of mathematics, natural
sciences, and engineering sciences.

PO3. Design/development of solutions: Ability to Design solutions for complex engineering problems and
design system components or processes that meet the specified needs with appropriate consideration for
the public health and safety, and the cultural, societal, and environmental considerations.

Department of ECE Page 4


Communication Networks Laboratory III B. Tech II SEM

PO4. Conduct investigations of complex problems: Apply research-based knowledge and research
methods including design of experiments, analysis and interpretation of data pertaining to Electronics &
Communication Engineering problems and arrive valid conclusions.

PO5. Modern tool usage: An ability to use the techniques, resources and modern engineering tools
necessary for modeling the complex system design in Electronics and Communication Engineering.

PO6. The engineer and society: Apply reasoning informed by the contextual knowledge to assess societal,
health, safety, legal and cultural issues and the consequent responsibilities relevant to the professional
engineering practice.

PO7. Environment and sustainability: An Ability to understand the impact of the professional engineering
solutions in societal and environmental contexts, and demonstrate the knowledge of need for sustainable
development.

PO8. Ethics: Apply ethical principles and commit to professional ethics and responsibilities and norms of
the engineering practice.

PO9. Individual and team work: Function effectively as an individual, and as a member or leader in
diverse teams, and in multidisciplinary settings.

PO10. Communication: Communicate effectively in both verbal and written forms such as, being able to
comprehend and write effective reports and design documentation, make effective presentations, and give
and receive clear instructions.

PO11. Project management and finance: Demonstrate knowledge and understanding of the engineering and
management principles and apply these to one’s own work, as a member or a leader in a team, to manage
projects in multidisciplinary environments.

PO12. Life-long learning: Recognize the need for, and have the preparation and ability to engage in
independent and life-long learning in the broadest context of technological change.

Department of ECE Page 5


Communication Networks Laboratory III B. Tech II SEM

Department of ECE Page 6


Communication Networks Laboratory III B. Tech II SEM

Department of ECE Page 7


Communication Networks Laboratory III B. Tech II SEM

EXP. NO. 1 SIMULATE TELNET AND FTP BETWEEN N SOURCES & N SINKS

Aim

To Simulate telnet and ftp between N sources - N sinks (N = 1, 2, 3) and to evaluate the effect of
increasing data rate on congestion.
Apparatus

PC installed with Omnet++ Software


Theory

This example demonstrates a telnet client (TelnetClientTraffic) and a telnet server


(TelnetServerTraffic) module built using queueing components.
These two modules are created by copying the TelnetClientApp and TelnetServerApp modules
available in INET, and omitting the IApp interface. As such, the telnet traffic apps can be
connected to each other directly, without any sockets or protocols.

Programs:
network TelnetTutorialStep
{
@display("bgb=400,200");
submodules:
client: TelnetClientTraffic {
@display("p=100,100");
}
server: TelnetServerTraffic {
@display("p=300,100");
}
connections:
client.out --> server.in;
client.in <-- server.out;
}

module TelnetClientTraffic
{
parameters:
@display("i=block/app");
gates:
input in;
output out;
submodules:
characterProducer: <default("ActivePacketSource")> like IActivePacketSource {

Department of ECE Page 8


Communication Networks Laboratory III B. Tech II SEM

parameters:
packetLength = 1B;
packetData = intuniform(97, 122); // lower case ASCII characters
productionInterval = uniform(0.1s, 0.2s); // typing speed between 5 and 10 characters per
second
@display("p=100,100");
}
enterProducer: <default("ActivePacketSource")> like IActivePacketSource {
parameters:
packetLength = 1B;
packetData = 13; // enter character
productionInterval = 0.1s;
@display("p=300,100");
}
emptyProducer: <default("EmptyPacketSource")> like IActivePacketSource {
parameters:
@display("p=500,100");
}
scheduler: <default("MarkovScheduler")> like IPacketScheduler {
parameters:
transitionProbabilities = "0 1 0 0 0 1 1 0 0"; // character -> enter -> wait -> character
waitIntervals = "uniform(0,3) 0 uniform(10,30)";
@display("p=300,200");
}
consumer: <default("PassivePacketSink")> like IPassivePacketSink {
parameters:
@display("p=100,200");
}
connections:
characterProducer.out --> scheduler.in++;
enterProducer.out --> scheduler.in++;
emptyProducer.out --> scheduler.in++;
scheduler.out --> { @display("m=s"); } --> out;
in --> { @display("m=s"); } --> consumer.in;
}
module TelnetServerTraffic
{
parameters:
@display("i=block/app");
gates:
input in;
output out;
submodules:
cloner: PacketCloner {
parameters:
@display("p=300,225");
}

Department of ECE Page 9


Communication Networks Laboratory III B. Tech II SEM

responseProvider: <default("PassivePacketSource")> like IPassivePacketSource {


parameters:
@display("p=100,100");
}
responseServer: <default("TokenBasedServer")> like IPacketServer {
parameters:
@display("p=100,225");
}
multiplexer: PacketMultiplexer {
parameters:
@display("p=200,350");
}
classifier: <default("PacketClassifier")> like IPacketClassifier {
parameters:
classifierClass = default("inet::queueing::PacketCharacterOrEnterClassifier");
@display("p=500,225");
}
characterConsumer: <default("PassivePacketSink")> like IPassivePacketSink {
parameters:
@display("p=400,350");
}
enterTokenGenerator: PacketBasedTokenGenerator {
parameters:
storageModule = default("^.responseServer");
@display("p=600,350");
}
connections:
in --> { @display("m=s"); } --> cloner.in;
cloner.out++ --> classifier.in;
cloner.out++ --> multiplexer.in++;
responseProvider.out --> responseServer.in;
responseServer.out --> multiplexer.in++;
classifier.out++ --> characterConsumer.in;
classifier.out++ --> enterTokenGenerator.in;
multiplexer.out --> { @display("m=s"); } --> out;
}
[Config Telnet]
network = TelnetTutorialStep
sim-time-limit = 100s

**.server.enterTokenGenerator.numTokensPerPacket = intuniform(0, 10)


**.server.responseProvider.packetLength = intuniform(100B, 1000B)
**.server.responseProvider.providingInterval = uniform(0s, 0.1s)

Department of ECE Page 10


Communication Networks Laboratory III B. Tech II SEM

Procedure

1. Create a New project.


2. Create .NED files defining Telnet/FTP Server and Telnet/FTP Client modules.
3. Create omnetpp.ini files.
4. Create source files defining the functionality.
5. Build the project.
6. Run the Project with different configurations and observe the results.
7. Obtain the results from results file.
Result

Thus the simulation of Telnet and ftp on links established between source and sink nodes is performed
using Omnet++ IDE.

Viva Questions

1. What is the purpose of Telnet?


2. What is the abbreviation of FTP and its purpose?
3. In which OSI layer these protocols will work?
4. What is the NED file in Omnet++ software?
5. What is the purpose of .ini files in Omnet++ software?
6. In which language we can write the source code?
7. What is congestion?
8. What is data rate?
9. What is the effect of increased data rate on congestion.

Reference: https://inet.omnetpp.org/docs/tutorials/queueing/doc/Telnet.html

Department of ECE Page 11


Communication Networks Laboratory III B. Tech II SEM

Department of ECE Page 12


Communication Networks Laboratory III B. Tech II SEM

THE EFFECT OF VARIOUS QUEUEING DISCIPLINES


EXP. NO. 2 (RED /Weighted RED / Adaptive RED) ON NETWORK
PERFORMANCE

Aim

To Simulate the effect of queueing disciplines on network performance - Random Early


Detection/Weighted RED / Adaptive RED
Apparatus

PC installed with Omnet++ Software


Theory

Queue Management is defined as the algorithm that manage the length of the packet queues by
dropping packets when necessary. From the point of packet dropping, Queue management can be
classified into 2 types

1. Passive Queue Management: In Passive Queue Management the packet drop occurs only
when the buffer gets full. Ex: Drop Tail.
2. Active Queue Management: Active Queue Management employs preventive packet drops. It
provides implicit feedback mechanism to notify senders of the onset of congestion. Arriving
packets are randomly dropped. Ex: RED.
Drop Tail: In this packets are dropped from the tail of the queue. Once buffer gets full, all arriving
packets are discarded. Packets already in the queue are not affected.

Figure 2.1: Drop Tail mechanism


As shown in figure 2.1, the arriving packet gets dropped from the tail when the queue is filled.

Random Early Detection: RED accepts all packets until the queue reaches minth, after which it
drops a packet with a linear probability distribution function. When the queue length reaches maxth
all packets are dropped with probability of one.

Department of ECE Page 13


Communication Networks Laboratory III B. Tech II SEM

Figure 2.2: Random Early Detection:


Weighted random early detection (WRED)It is a queueing discipline for a network scheduler suited for
congestion avoidance. It is an extension to random early detection (RED) where a single queue may have
several different sets of queue thresholds. Each threshold set is associated to a particular traffic class.

For example, a queue may have lower thresholds for lower priority packet. A queue buildup will
cause the lower priority packets to be dropped, hence protecting the higher priority packets in the
same queue. In this way quality of service prioritization is made possible for important packets from a
pool of packets using the same buffer.

It is more likely that standard traffic will be dropped instead of higher prioritized traffic.
WRED proceeds in this order when a packet arrives:

● Calculation of the average queue size.


● The arriving packet is queued immediately if the average queue size is below the minimum
queue threshold.
● Depending on the packet drop probability the packet is either dropped or queued if the
average queue size is between the minimum and maximum queue threshold.
● The packet is automatically dropped if the average queue size is greater than the maximum
threshold.
Adaptive RED Queue Discipline:
The motivation of Adaptive RED is the same as self-configuring RED. Self-configuring RED tries to
keep the average queue size with minimum and maximum threshold values. But Sally Floyd says that
why don’t keep the average queue size in a tight range just in the center of mi nimum and maximum
threshold values. Also, Adaptive RED removes the kns and automatically sets them. Maximum drop
probability is adapted based on the network availability, it is no longer a knob just like previous
versions of RED.

Main contributions in Adaptive RED


● Automatic setting of minimum threshold (minth). It is set as a function of the link capacity
(C) and target queue delay.

● Automatic setting of maximum threshold (maxth). It is set depending on the value of minth.
● Automatic setting of wq. It is set as a function of the link capacity (C).
● The adaptive setting of maxp. It is adapted according to the current average queue length.
Department of ECE Page 14
Communication Networks Laboratory III B. Tech II SEM

Fifo.ned File:

network FifoNet
{
submodules:
gen: Source {
parameters:
@display("p=89,100");
}
fifo: Fifo {
parameters:
@display("p=209,100");
}
sink: Sink {
parameters:
@display("p=329,100");
}
connections:
gen.out --> fifo.in;
fifo.out --> sink.in;
}

Omnetpp.ini:

[General]
network = FifoNet
sim-time-limit = 100h
cpu-time-limit = 300s
#debug-on-errors = true
#record-eventlog = true

[Config Fifo1]
description = "low job arrival rate"
**.gen.sendIaTime = exponential(0.2s)
**.fifo.serviceTime = 0.01s

[Config Fifo2]
description = "high job arrival rate"
**.gen.sendIaTime = exponential(0.01s)
**.fifo.serviceTime = 0.01s

Department of ECE Page 15


Communication Networks Laboratory III B. Tech II SEM

Procedure

1. Create a New project.


2. Create .NED files.
3. Create omnetpp.ini files.
4. Create source files defining the functionality.
5. Build the project.
6. Run the Project with different configurations and observe the results.
7. Obtain the results from results file.

Result

Thus various queue management schemes were simulated and studied

Viva Questions

1. What is RED?
2. What is adaptive RED ?
3. What is weighted RED ?
4. What is the difference between RED, Adaptive and Weighted RED ?

Department of ECE Page 16


Communication Networks Laboratory III B. Tech II SEM

EXP. NO. 3 Simulate HTTP, FTP and DBMS access in networks

Aim

To Simulate HTTP, FTP and DBMS access in networks.

Apparatus

PC installed with Omnet++ Software


Theory

HTTP:

o HTTP stands for Hyper Text Transfer Protocol.


o It is a protocol used to access the data on the World Wide Web (www).
o The HTTP protocol can be used to transfer the data in the form of plain text, hypertext, audio,
video, and so on.
o This protocol is known as HyperText Transfer Protocol because of its efficiency that allows us
to use in a hypertext environment where there are rapid jumps from one document to another
document.
o HTTP is similar to the FTP as it also transfers the files from one host to another host. But,
HTTP is simpler than FTP as HTTP uses only one connection, i.e., no control connection to
transfer the files.
o HTTP is used to carry the data in the form of MIME-like format.

Features of HTTP:
o Connectionless protocol: HTTP is a connectionless protocol. HTTP client initiates a request
and waits for a response from the server. When the server receives the request, the server
processes the request and sends back the response to the HTTP client after which the client
disconnects the connection. The connection between client and server exist only during the
current request and response time only.
o Media independent: HTTP protocol is a media independent as data can be sent as long as
both the client and server know how to handle the data content. It is required for both the
client and server to specify the content type in MIME-type header.
o Stateless: HTTP is a stateless protocol as both the client and server know each other only
Department of ECE Page 17
Communication Networks Laboratory III B. Tech II SEM

during the current request. Due to this nature of the protocol, both the client and server do not
retain the information between various requests of the web pages.

HTTP Transactions

FTP

 FTP stands for File transfer protocol.


 FTP is a standard internet protocol provided by TCP/IP used for transmitting the files from one
host to another.
 It is mainly used for transferring the web page files from their creator to the computer that acts as
a server for other computers on the internet.
 It is also used for downloading the files to computer from other servers.

Objectives of FTP

● It provides the sharing of files.

Department of ECE Page 18


Communication Networks Laboratory III B. Tech II SEM

● It is used to encourage the use of remote computers.


● It transfers the data more reliably and efficiently.

Although transferring files from one system to another is very simple and straightforward, but
sometimes it can cause problems. For example, two systems may have different file conventions.
Two systems may have different ways to represent text and data. Two systems may have different
directory structures. FTP protocol overcomes these problems by establishing two connections
between hosts. One connection is used for data transfer, and another connection is used for the control
connection.

Mechanism of FTP

The above figure shows the basic model of the FTP. The FTP client has three components: the user
interface, control process, and data transfer process. The server has two components: the server
control process and the server data transfer process.

There are two types of connections in FTP:

Control Connection: The control connection uses very simple rules for communication. Through
control connection, we can transfer a line of command or line of response at a time. The control
connection is made between the control processes. The control connection remains connected during
the entire interactive FTP session.

Department of ECE Page 19


Communication Networks Laboratory III B. Tech II SEM

Data Connection: The Data Connection uses very complex rules as data types may vary. The data
connection is made between data transfer processes. The data connection opens when a command
comes for transferring the files and closes when the file is transferred.

FTP Clients

o FTP client is a program that implements a file transfer protocol which allows you to transfer
files between two hosts on the internet.
o It allows a user to connect to a remote host and upload or download the files.
o It has a set of commands that we can use to connect to a host, transfer the files between you
and your host and close the connection.
o The FTP program is also available as a built-in component in a Web browser. This GUI based
FTP client makes the file transfer very easy and also does not require to remember the FTP
commands.

DBMS:

Data is the cornerstone of any modern software application, and databases are the most
common way to store and manage data used by applications. With the explosion of web and cloud
technologies, databases have evolved from traditional relational databases to more advanced types of
databases such as NoSQL, columnar, key-value, hierarchical, and distributed databases. Each type
has the ability to handle structured, semi-structured, and even unstructured data.

On top of that, databases are continuously handling mission-critical and sensitive data. When this is
coupled with compliance requirements and the distributed nature of most data sets, managing
databases has become highly complex. As a result, organizations require robust, secure, and user-
friendly tools to maintain these databases. This is where database management systems come into
play—by offering a platform to manage databases. Let’s take a look.

A database management system (DBMS) is a software tool that enables users to manage a
database easily. It allows users to access and interact with the underlying data in the database. These
actions can range from simply querying data to defining database schemas that fundamentally affect
the database structure. Furthermore, DBMS allow users to interact with a database securely and
concurrently without interfering with each user and while maintaining data integrity.

Database tasks in a DBMS


The typical database administrative tasks that can be performed using a DBMS include:

 Configuring authentication and authorization.


Easily configure user accounts, define access policies, modify restrictions, and access scopes.
These operations allow administrators to limit access to underlying data, control user actions, and
manage users in databases.

Department of ECE Page 20


Communication Networks Laboratory III B. Tech II SEM

 Providing data backups and snapshots.


DBMS can simplify the backup process of databases by providing a simpler and straightforward
interface to manage backups and snapshots. They can even move these backups to third-party
locations such as cloud storage for safekeeping.

 Performance tuning.
DBMS can monitor the performance of databases using integrated tools and enable users to tune
databases by creating optimized indexes. It reduces I/O usage to optimize SQL queries, enabling
the best performance from the database.

 Data recovery.
In a recovery operation, DBMS provides a recovery platform with the necessary tools to fully or
partially restore databases to their previous state—effortlessly.

All these administrative tasks are facilitated using a single management interface. Most modern
DBMS support handling multiple database workloads from a centralized DBMS software, even in a
distributed database scenario. Furthermore, they allow organizations to have a governable top- down
view of all the data, users, groups, locations, etc., in an organized manner. The following diagram
illustrates the schematic of a DBMS system:

Department of ECE Page 21


Communication Networks Laboratory III B. Tech II SEM

Components of a database management system

All DBMS comes with various integrated components and tools necessary to carry out almost
all database management tasks. Some DBMS software even provides the ability to extend beyond the
core functionality by integrating with third-party tools and services, directly or via plugins.

In this section, we will look at the common components that are universal across all DBMS software,
including:

 Storage engine
 Query language
 Query processor
 Optimization engine
 Metadata catalog
 Log manager
 Reporting and monitoring tools
 Data utilities

Department of ECE Page 22


Communication Networks Laboratory III B. Tech II SEM

Storage engine
The storage engine is the core component of the DBMS that interacts with the file system at an OS
level to store data. All SQL queries which interact with the underlying data go through the storage
engine.

Query language
A database access language is required for interacting with a database, from creating databases to
simply inserting or retrieving data. A proper DBMS must support one or multiple query languages
and language dialects. Structured query language (SQL) and MongoDB Query Language (MQL) are
two query languages that are used to interact with the databases.

In many query languages, the query language functionality can be further categorized according to
specific tasks:

 Data Definition Language (DDL). This consists of commands that can be used to define
database schemas or modify the structure of database objects.
 Data Manipulation Language (DML). Commands that directly deal with the data in the
database. All CRUD operations come under DML.
 Data Control Language (DCL). This deals with the permissions and other access controls of
the database.
 Transaction Control Language (TCL). Command which deals with internal database
transactions.

Query processor
This is the intermediary between the user queries and the database. The query processor interprets the
queries of users and makes them actionable commands that can be understood by the database to
perform the appropriate functionality.

Optimization engine
The optimization Engine allows the DBMS to provide insights into the performance of the database
in terms of optimizing the database itself and queries. When coupled with database monitoring tools,
it can provide a powerful toolset to gain the best performance out of the database.

Metadata catalog
This is the centralized catalog of all the objects within the database. When an object is created, the
DBMS keeps a record of that object with some metadata about it using the metadata catalog. Then,
this record can be used to:

 Verify user requests to the appropriate database objects


 Provide an overview of the complete database structure

Department of ECE Page 23


Communication Networks Laboratory III B. Tech II SEM

Log manager
This component will keep all the logs of the DBMS. These logs will consist of user logins and
activity, database functions, backups and restore functions, etc. The log manager ensures all these
logs are properly recorded and easily accessible.

(Compare logs to monitoring.)

Reporting & monitoring tools


Reporting and monitoring tools are another standard component that comes with a DBMS. Reporting
tools will enable users to generate reports while monitoring tools enable monitoring the databases for
resource consumption, user activity, etc.

Data utilities
In addition to all the above, most DBMS software comes with additional inbuilt utilities to provide
functionality such as:

 Data integrity checks


 Backup and restore
 Simple database repair
 Data validations

Types of database management systems


There are many different types of DBMS, yet we can categorize the most commonly used DBMS into
three types.

Relational database management systems (RDBMS)


This is the most common type of DBMS. They are used to interact with databases that contain
structured data in a table format with predefined relationships. Moreover, they use structured query
language (SQL) to interact with databases. Microsoft SQL, MySQL, and Oracle Database are some
popular DBMS that come under this category.

Document database management systems (DoDBMS)


These DoDBMS are used to manage databases that contain data stored in JSON-like structures with
limited or no relationship structure. They are powered by query languages such as MongoDB query
language (MQL) for database operations. MongoDB, Azure Cosmos DB are some prominent
examples of DoDBMS.

Columnar database management systems (CDBMS)


As the name suggests, this type of DBMS is used to manage columnar databases that store data in
columns instead of rows, emphasizing high performance. Some databases that use columnar format
are Apache Cassandra, Apache HBase, etc.

Department of ECE Page 24


Communication Networks Laboratory III B. Tech II SEM

Source Code:

Httpnet.ned File:

network HTTPNet
{
parameters:
int numClients @prompt("Number of clients:") = default(3);
submodules:
server: HTTPServer {
parameters:
@display("p=426,178");
}
cloud: Cloud {
parameters:
@display("p=274,182");
gates:
g[numClients+2];
}
extClient: ExtHTTPClient {
parameters:
addr = 1;
srvAddr = 0;
@display("p=102,92;t=Run the simulation\\, then\nenter into your
browser:\nhttp://localhost:4242");
}
client[numClients]: HTTPClient {
parameters:
addr = 2+index;
srvAddr = 0;
@display("p=102,162,col");
}
connections:
server.g <--> cloud.g[0];
extClient.g <--> cloud.g[1];
client[i].g <--> cloud.g[i+2] for i=0..numClients-1;
}

Omnetpp.ini File:
[General]
scheduler-class = "cSocketRTScheduler"

[Config HTTPExample]
description = "HTTP model"
network = HTTPNet
**.numClients = 5

Department of ECE Page 25


Communication Networks Laboratory III B. Tech II SEM

**.cloud.propDelay = 0.1s
**.server.serviceTime = 0.1s
**.client[*].sendIaTime = exponential(15s)

[Config TelnetExample]
description = "Telnet model"
network = TelnetNet
**.numClients = 5
**.cloud.propDelay = 0.1s
**.server.serviceTime = 0.1s
**.client[*].sendIaTime = exponential(3s)

Department of ECE Page 26


Communication Networks Laboratory III B. Tech II SEM

Procedure

1. Create a New project.


2. Create .NED files.
3. Create omnetpp.ini files.
4. Create source files defining the functionality.
5. Build the project.
6. Run the Project with different configurations and observe the results.
7. Obtain the results from results file.

Result

Thus the simulation of HTTP, FTP and DBMS access in networks is performed.

Viva Questions

1. What is HTTP and its applications?


2. What is DBMS and its applications?
3. What is FTP and its applications?

Department of ECE Page 27


Communication Networks Laboratory III B. Tech II SEM

Effect of VLAN on network performance –i) multiple VLANs and


EXP. NO. 4 single router ii) multiple VLANs with separate multiple routers

Aim

To determine the effect of VLAN on network performance –i) multiple VLANs and single router ii)
multiple VLANs with separate multiple routers.
.
Apparatus

PC installed with Omnet++ Software


Theory

VLAN is a custom network which is created from one or more local area networks. It enables a group of
devices available in multiple networks to be combined into one logical network. The result becomes a
virtual LAN that is administered like a physical LAN. The full form of VLAN is defined as Virtual
Local Area Network.

The below topology depicts a network having all hosts inside the same virtual LAN:

Without VLANs, a broadcast sent from a host can easily reach all network devices. Each and every
device will process broadcast received frames. It can increase the CPU overhead on each device and
reduce the overall network security.

In case if you place interfaces on both switches into separate VLAN, a broadcast from host A can
reach only devices available inside the same VLAN. Hosts of VLANs will not even be aware that the
communication took place. This is shown in the below picture:

Department of ECE Page 28


Communication Networks Laboratory III B. Tech II SEM

VLAN in networking is a virtual extension of LAN. A LAN is a group of computer and peripheral
devices which are connected in a limited area such as school, laboratory, home, and office building. It
is a widely useful network for sharing resources like files, printers, games, and other applications.

Here are step by step details of how VLAN works:

 VLANs in networking are identified by a number.


 A Valid range is 1-4094. On a VLAN switch, you assign ports with the proper VLAN number.
 The switch then allows data which needs to be sent between various ports having the same
VLAN.
 Since almost all networks are larger than a single switch, there should be a way to send traffic
between two switches.
 One simple and easy way to do this is to assign a port on each network switch with a VLAN
and run a cable between them.

Difference between LAN and VLAN

LAN can be defined as a group of computer A VLAN can be defined as a custom


and peripheral devices which are connected in network which is created from one or more
a limited area. local area networks.

The latency of LAN is high. The latency of VLAN is less.

In LAN, the network packet is advertised to In VLAN, the network packet is sent to only a
each and every device. specific broadcast domain.

MULTIPLE VLANS AND SINGLE ROUTER


If you have a router that supports virtual LANs (VLANs), you can create multiple VLANs from that
single router. This can be useful if you want to segment your network traffic for security or
performance reasons.

A VLAN is a logical grouping of devices on a network. VLANs are used to segment a network into
smaller, more manageable pieces. VLANs are created by configuring a router or switch to divide a
physical network into multiple logical networks.

Creating a VLAN is a two-step process. First, you must create the VLAN itself. This is done by
configuring a router or switch to create a new logical network. Second, you must add devices to the
VLAN. This is done by configuring the router or switch to add devices to the VLAN.

Department of ECE Page 29


Communication Networks Laboratory III B. Tech II SEM

Adding devices to a VLAN is a simple process. First, you must determine which devices you want to
add to the VLAN. Second, you must configure the router or switch to add those devices to the VLAN.

Switches generate a VLAN as a broadcast domain. You, the administrator, set up some switch ports
in a different VLAN than the default VLAN for the sake of convenience. VLANs are enabled in
Cisco switches by default, and ALL devices are already connected to VLAN 1. If there were no
additional configuration required, these devices would be unable to communicate. All devices on a
switch can communicate with one another using the same ports as a single switch. Consider using
VLANs if you’re having difficulty connecting to the Internet. A trunk port is one that is shared by
multiple switches or routers and is used to route traffic between them.

VLANs can be configured in a variety of Cisco switches, even if they are in different models. To
communicate with other trunks, a trunk port must use a special trunk trunk protocol. Because VLANs
limit the number of broadcasts, they provide a higher level of performance to large and medium
LANs. As a result, they also provide security because you effectively have one group of devices
connected to a VLAN.

MULTIPLE VLANS WITH SEPARATE MULTIPLE ROUTERS

It is possible to use multi-VLAN ports to conduct networking. These switches and routers can be used
to separate groups of users, departments, and functions from one another without the need for
separate switches or routers. There is a significant cost savings, improved network security and
performance, and simplified management associated with this model.

Procedure

1. Create a New project.


2. Create .NED files.
3. Create omnetpp.ini files.
4. Create source files defining the functionality.
5. Build the project.
6. Run the Project with different configurations and observe the results.
7. Obtain the results from results file.

Result

Thus the simulation of VLANs with single and multiple routers are performed.

Department of ECE Page 30


Communication Networks Laboratory III B. Tech II SEM

Viva Questions

1. What is VLAN and its need?


2. What is the effect of VLAN on network performance?
3. What is the functionality of Router?
4. In which layer VLAN and Routers function?

EXP. NO. 5 Implementation of IP address configuration.

Aim

Department of ECE Page 31


Communication Networks Laboratory III B. Tech II SEM

To implement IP address configuration.


Apparatus

PC installed with Omnet++ Software


Theory

An IP address is a unique address that identifies a device on the internet or a local


network. IP stands for "Internet Protocol," which is the set of rules governing the format of
data sent via the internet or local network.

An IP address is a 32-bit number. It uniquely identifies a host (computer or other


device, such as a printer or router) on a TCP/IP network. IP addresses are normally
expressed in dotted-decimal format, with four numbers separated by periods, such as
192.168. 123.132

Types of IP address

An internet protocol (IP) address allows computers to send and receive information. There
are four types of IP addresses: Static and Dynamic.

Static IP addressing:
We assign a specific IP address to any system manually. Static IP addresses remain in effect
until you modify or remove them or you change the method of IP addressing for the
Ethernet port to DHCP.

Automatic IP Addressing (Dynamic)


The IP addresses for your PCs and other devices are probably assigned automatically by
your router using a protocol known as Dynamic Host Configuration Protocol (DHCP). It’s a
handy way for devices to connect to your network more easily, because you don’t have to
configure IP addressing for each new device yourself.

Department of ECE Page 32


Communication Networks Laboratory III B. Tech II SEM

Source Code:

ConfiguratorA.ned File

package inet.examples.inet.configurator;

import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
import inet.node.ethernet.Eth100M;
import inet.node.ethernet.Eth10M;
import inet.node.ethernet.EtherSwitch;
import inet.node.inet.Router;
import inet.node.inet.StandardHost;
import inet.visualizer.integrated.IntegratedCanvasVisualizer;

network ConfiguratorA
{
@display("bgb=1610.5125,874.96497");
submodules:
configurator: IPv4NetworkConfigurator {
@display("p=100,100");
}
host0: StandardHost {

Department of ECE Page 33


Communication Networks Laboratory III B. Tech II SEM

@display("p=268.32748,417.6225");
}
host1: StandardHost {
@display("p=227.9775,542.7075");
}
host2: StandardHost {
@display("p=268.32748,736.3875");
}
host3: StandardHost {
@display("p=667.7925,98.8575");
}
router0: Router {
@display("p=667.7925,574.9875");
}
router2: Router {
@display("p=972.435,574.9875");
}
router1: Router {
@display("p=821.1225,369.20248");
}
host4: StandardHost {
@display("p=843.315,70.612495");
}
host5: StandardHost {
@display("p=972.435,98.8575");
}
host6: StandardHost {
@display("p=1430.4075,417.6225");
}
host7: StandardHost {
@display("p=1472.775,542.7075");
}
host8: StandardHost {
@display("p=1430.4075,736.3875");
}
switch0: EtherSwitch {
@display("p=518.4975,574.9875");
}
switch2: EtherSwitch {
@display("p=1162.08,574.9875");
}
switch1: EtherSwitch {
@display("p=821.1225,225.95999");
}
visualizer: IntegratedCanvasVisualizer {
@display("p=98.8575,209.81999");

Department of ECE Page 34


Communication Networks Laboratory III B. Tech II SEM

}
connections:
host2.ethg++ <--> Eth100M <--> switch0.ethg++;
host1.ethg++ <--> Eth100M <--> switch0.ethg++;
host0.ethg++ <--> Eth100M <--> switch0.ethg++;
switch0.ethg++ <--> Eth100M <--> router0.ethg++;
router0.ethg++ <--> Eth100M <--> router1.ethg++;
router1.ethg++ <--> Eth100M <--> switch1.ethg++;
switch1.ethg++ <--> Eth100M <--> host3.ethg++;
switch1.ethg++ <--> Eth100M <--> host4.ethg++;
switch1.ethg++ <--> Eth100M <--> host5.ethg++;
router1.ethg++ <--> Eth100M <--> router2.ethg++;
router2.ethg++ <--> Eth100M <--> switch2.ethg++;
switch2.ethg++ <--> Eth100M <--> host6.ethg++;
switch2.ethg++ <--> Eth100M <--> host7.ethg++;
switch2.ethg++ <--> Eth100M <--> host8.ethg++;
router0.ethg++ <--> Eth10M <--> router2.ethg++;
}

Omnetpp.ini File
[General]
description = "(abstract)"

# Configurator settings
*.configurator.dumpAddresses = true
*.configurator.dumpTopology = true
*.configurator.dumpLinks = true
*.configurator.dumpRoutes = true
# Routing settings
*.*.ipv4.arp.typename = "GlobalArp"
#*.*.ipv4.routingTable.netmaskRoutes = ""

# Visualizer settings
#*.visualizer.interfaceTableVisualizer.displayInterfaceTables = true
#*.visualizer.interfaceTableVisualizer.nodeFilter = "not (*switch* or *Switch* or *AP*)"
[Config Step1]
network = ConfiguratorA
description = "Fully automatic IP address assignment"
[Config Step2]
network = ConfiguratorA
description = "Manually overriding individual IP addresses"
# Using inline XML configuration
*.configurator.config = xml("<config> \
<interface hosts='host3' names='eth0' address='10.0.0.100'/> \
<interface hosts='host1' names='eth0' address='10.0.0.50'/> \
<interface hosts='**' address='10.x.x.x' netmask='255.x.x.x'/> \
Department of ECE Page 35
Communication Networks Laboratory III B. Tech II SEM

</config>")

[Config Step3]
network = ConfiguratorA
description = "Automatically assigning IP addresses to a subnet from a given range"

*.configurator.config = xmldoc("step3.xml")

##############################################################################
########################
[Config Step4]
network = ConfiguratorA
description = "Fully automatic static routing table configuration"

#*.host1.numApps = 1
*.host1.app[0].typename = "PingApp"
#*.host1.app[0].destAddr = "host7"

.destinationFilter = "host7"

[Config Step5A]
extends = Step4
description = "Manually overriding individual routes - route to a specific host"

*.configurator.config = xml("<config> \
<interface hosts='**' address='10.x.x.x' netmask='255.x.x.x'/> \
<route hosts='router0' destination='10.0.0.35' netmask='255.255.255.255'
gateway='10.0.0.18' interface='eth1' metric='0'/> \
</config>")
#*.host0.numApps = 1
*.host0.app[0].typename = "PingApp"
#*.host0.app[*].destAddr = "host6"
#*.host0.app[*].startTime = 0.6s

[Config Step5B]
extends = Step4
description = "Manually overriding individual routes - route to a set of hosts"

*.configurator.config = xml("<config> \
<interface hosts='**' address='10.x.x.x' netmask='255.x.x.x'/> \
<route hosts='router0' destination='10.0.0.32' netmask='255.255.255.248'
gateway='10.0.0.18' interface='eth1'/> \
</config>")
*.configurator.optimizeRoutes = false #! TODO: this shouldn't be here, it's here because
of an error in the optimizer

Department of ECE Page 36


Communication Networks Laboratory III B. Tech II SEM

#*.host0.numApps = 1
*.host0.app[0].typename = "PingApp"
#*.host0.app[*].destAddr = "host6"
#*.host0.app[*].startTime = 0.6s

[Config Step6A]
extends = Step4
description = "Setting different metric for automatic routing table configuration - using dataRate
metric"

*.configurator.config = xml("<config> \
<interface hosts='**' address='10.x.x.x' netmask='255.x.x.x'/> \
<autoroute sourceHosts='**' metric='dataRate'/> \
</config>")

#*.visualizer.routingTableVisualizer.destinationFilter = "host1"
[Config Step6B]
extends = Step4
description = "Setting different metric for automatic routing table configuration - manually
specifying link cost"

*.configurator.config = xml("<config> \
<interface hosts='**' address='10.x.x.x' netmask='255.x.x.x'/> \
<autoroute metric='hopCount'> \
<link interfaces='*.router0.eth2' cost='infinite'/> \
</autoroute> \
</config>")

#*.visualizer.routingTableVisualizer.destinationFilter = "host1"

Department of ECE Page 37


Communication Networks Laboratory III B. Tech II SEM

Step 1 Output:

Step 2 Output:

Department of ECE Page 38


Communication Networks Laboratory III B. Tech II SEM

Step 3 Output:

Step3.xml File:

<config>
<interface hosts="host0" address="10.0.0.x"/>
<interface hosts="host3" address="10.0.1.x"/>
<interface hosts="host6" address="10.0.2.x"/>
<interface among="router*" address="10.1.x.x"/>
<interface hosts='**' address='10.x.x.x' netmask='255.x.x.x'/>
</config>

Procedure

1. Create a New project.


2. Create .NED files.
3. Create omnetpp.ini files.
4. Create source files defining the functionality.
5. Build the project.
6. Run the Project with different configurations and observe the results.
7. Obtain the results from results file.
Department of ECE Page 39
Communication Networks Laboratory III B. Tech II SEM

Result

Hence successfully assigned the IP addresses for the given network configuration.

Viva Questions

1. What is IP address?
2. How many bits are used for IPv4 and IPv6?
3. What are the advantages of using IPv6.
4. What is super netting and sub netting?
5. What is the range of addresses in Class A address?
6. What is the range of addresses in Class B address?
7. What is the range of addresses in Class C address?
8. What is broadcasting address?
9. What are the different mechanisms used for ip addressing?
10. What is the difference between MAC address and IP address?

Department of ECE Page 40


Communication Networks Laboratory III B. Tech II SEM

To create scenario and study the performance of network with CSMA /


EXP. NO. 6 CA protocol and compare with CSMA/CD protocols.

Aim

To create scenario and study the performance of network with CSMA / CA protocol and
compare with CSMA/CD protocols.

Apparatus

PC installed with Omnet++ Software


Theory

CSMA is a mechanism that senses the state of the shared channel to prevent or recover data
packets from a collision. It is also used to control the flow of data packets over the network
so that the packets are not get lost, and data integrity is maintained. In CSMA, when two or
more data packets are sent at the same time on a shared channel, the chances of collision
occurred. Due to the collision, the receiver does not get any information regarding the
sender's data packets. And the lost information needs to be resented so that the receiver can
get it. Therefore we need to sense the channel before transmitting data packets on a network.
It is divided into two parts, CSMA CA (Collision Avoidance) and CSMA CD (Collision
Detection).

CSMA/CD
CSMA/CD stands for Carrier Sense Multiple Access / Collision Detection is a network
protocol for carrier transmission. It is operated in the medium access control layer. It senses
of the shared channel is busy for broadcasting and interrupts the broadcast until the channel
is free. In CSMA/CD collision is detected by broadcast sensing from the other stations.
Upon collision detection in CSMA/CD, the transmission is stopped and a jam signal is sent
by the stations and then the station waits for a random time context before retransmission.

Disadvantage of CSMA CD
1. It is not suitable for long-distance networks because as the distance increases,
CSMA CD' efficiency decreases.
2. It can detect collision only up to 2500 meters, and beyond this range, it cannot detect
collisions.
3. When multiple devices are added to a CSMA CD, collision detection performance is
reduced.

Department of ECE Page 41


Communication Networks Laboratory III B. Tech II SEM

CSMA/CA
CSMA/CA stands for Carrier Sense Multiple Access / Collision Avoidance is a network
protocol for carrier transmission. Like CSMA/CD it is also operated in the medium access
control layer. Unlike CSMA/CD (that is effective after a collision) CSMA / CA is effective
before a collision.

Carrier Sense Multiple Access with Collision Avoidance means that it is a network
protocol that uses to avoid a collision rather than allowing it to occur, and it does not deal
with the recovery of packets after a collision. It is similar to the CSMA/CD protocol that
operates in the media access control layer. In CSMA CA, whenever a station sends a data
frame to a channel, it checks whether it is in use. If the shared channel is busy, the station
waits until the channel enters idle mode. Hence, we can say that it reduces the chances of
collisions and makes better use of the medium to send data packets more efficiently.

Difference between CSMA CA and CSMA CD

S.No. CSMA/CD CSMA/ CA

1. It is the type of CSMA to detect the It is the type of CSMA to avoid collision
collision on a shared channel. on a shared channel.

2. It is the collision detection protocol. It is the collision avoidance protocol.

3. It is used in 802.3 Ethernet network It is used in the 802.11 Ethernet network.


cable.

4. It works in wired networks. It works in wireless networks.

5. It is effective after collision It is effective before collision detection on


detection on a network. a network.

6. Whenever a data packet conflicts in Whereas the CSMA CA waits until the
a shared channel, it resends the data channel is busy and does not recover after
frame. a collision.

7. It minimizes the recovery time. It minimizes the risk of collision.

8. The efficiency of CSMA/ CD is The efficiency of CSMA/ CA is similar to


high as compared to CSMA. CSMA.

9. It is more popular than the CSMA/ It is less popular than CSMA/ CD.
CA protocol.

Department of ECE Page 42


Communication Networks Laboratory III B. Tech II SEM

Source Code:

Aloha.ned File:

network Aloha
{
parameters:
int numHosts; // number of hosts
double txRate @unit(bps); // transmission rate
double slotTime @unit(ms); // zero means no slots (pure Aloha)
@display("bgi=background/terrain,s");
submodules:
server: Server;
host[numHosts]: Host {
txRate = txRate;
slotTime = slotTime;
}
}

Omnetpp.ini File:

[General]
network = Aloha
#debug-on-errors = true
#record-eventlog = true

Aloha.numHosts = 20
Aloha.slotTime = 0 # no slots
Aloha.txRate = 9.6kbps
Aloha.host[*].pkLenBits = 952b #=119 bytes, so that (with +1 byte guard) slotTime is a nice
round number
Aloha.host[*].radioDelay = 10ms

[Config PureAloha1]
description = "pure Aloha, overloaded"
# too frequent transmissions result in high collision rate and low channel utilization
Aloha.host[*].iaTime = exponential(2s)

[Config PureAloha2]
description = "pure Aloha, optimal load"
# near optimal load, channel utilization is near theoretical maximum 1/2e
Aloha.host[*].iaTime = exponential(6s)

[Config PureAloha3]
description = "pure Aloha, low traffic"
# very low traffic results in channel being idle most of the time

Department of ECE Page 43


Communication Networks Laboratory III B. Tech II SEM

Aloha.host[*].iaTime = exponential(30s)

[Config PureAlohaExperiment]
description = "Channel utilization in the function of packet generation frequency"
repeat = 2
sim-time-limit = 90min
**.vector-recording = false
Aloha.numHosts = ${numHosts=10,15,20}
Aloha.host[*].iaTime = exponential(${mean=1,2,3,4,5..9 step 2}s)

[Config SlottedAloha1]
description = "slotted Aloha, overloaded"
# slotTime = pkLen/txRate = 960/9600 = 0.1s
Aloha.slotTime = 100ms
# too frequent transmissions result in high collision rate and low channel utilization
Aloha.host[*].iaTime = exponential(0.5s)

[Config SlottedAloha2]
description = "slotted Aloha, optimal load"
# slotTime = pkLen/txRate = 960/9600 = 0.1s
Aloha.slotTime = 100ms
# near optimal load, channel utilization is near theoretical maximum 1/e
Aloha.host[*].iaTime = exponential(2s)

[Config SlottedAloha3]
description = "slotted Aloha, low traffic"
# slotTime = pkLen/txRate = 960/9600 = 0.1s
Aloha.slotTime = 100ms
# very low traffic results in channel being idle most of the time
Aloha.host[*].iaTime = exponential(20s)

Department of ECE Page 44


Communication Networks Laboratory III B. Tech II SEM

Procedure

1. Create a New project.


2. Create .NED files.
3. Create omnetpp.ini files.
4. Create source files defining the functionality.
5. Build the project.
6. Run the Project with different configurations and observe the results.
7. Obtain the results from results file.
Result

Hence successfully implemented the Random access protocol.

Viva Questions

1. What is CSMA/CA?
2. What is CSMA/CD?

Department of ECE Page 45


Communication Networks Laboratory III B. Tech II SEM

EXP. NO. 7 Implementation of a routing algorithm

Aim

To implement a routing algorithm

Apparatus

PC installed with Omnet++ Software


Theory

Source Code:

SimpleTest.ned File:

package inet.examples.ospfv2.simpletest;

import inet.common.lifecycle.LifecycleController;
import inet.common.misc.ThruputMeteringChannel;
import inet.common.scenario.ScenarioManager;
import inet.linklayer.ethernet.EtherHub;
import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
import inet.node.inet.StandardHost;
import inet.node.ospfv2.OSPFRouter;

network SimpleTest
{
parameters:
@display("p=10,10;b=712,152");
types:
channel C extends ThruputMeteringChannel
{
delay = 0.1us;
datarate = 100Mbps;
thruputDisplayFormat = "#N";
}
submodules:
H1: StandardHost {
parameters:
@display("p=56,92;i=device/laptop");
Department of ECE Page 46
Communication Networks Laboratory III B. Tech II SEM

gates:
ethg[1];
}
N1: EtherHub {
parameters:
@display("p=184,92");
gates:
ethg[2];
}
R1: OSPFRouter {
parameters:
@display("p=296,92");
hasStatus = true;
gates:
ethg[2];
}
R2: OSPFRouter {
parameters:
@display("p=416,92");
hasStatus = true;
gates:
ethg[2];
}
N2: EtherHub {
parameters:
@display("p=532,92");
gates:
ethg[2];
}
H2: StandardHost {
parameters:
@display("p=660,92;i=device/laptop");
gates:
ethg[1];
}
configurator: IPv4NetworkConfigurator {
parameters:
config = xml("<config>"+
"<interface among='H1 R1' address='192.168.1.x' netmask='255.255.255.0'
/>"+
"<interface among='H2 R2' address='192.168.2.x' netmask='255.255.255.0'
/>"+
"<interface among='R1 R2' address='192.168.60.x' netmask='255.255.255.0'
/>"+
"<route hosts='H1 H2' destination='*' netmask='0.0.0.0' interface='eth0' />"+
"</config>");

Department of ECE Page 47


Communication Networks Laboratory III B. Tech II SEM

addStaticRoutes = false;
addDefaultRoutes = false;
@display("p=75,43");
}
scenarioManager: ScenarioManager {
@display("p=75,43");
}
lifecycleController: LifecycleController {
@display("p=208,43");
}
connections:
H1.ethg[0] <--> C <--> N1.ethg[0];
N1.ethg[1] <--> C <--> R1.ethg[0];
R1.ethg[1] <--> C <--> R2.ethg[0];
R2.ethg[1] <--> C <--> N2.ethg[0];
N2.ethg[1] <--> C <--> H2.ethg[0];
}

Omnetpp.ini File:

[General]
network = SimpleTest
tkenv-plugin-path = ../../../etc/plugins

**.ospf.ospfConfig = xmldoc("ASConfig.xml")

**.numUdpApps = 2
**.udpApp[0].typename = "UDPBasicApp"
**.udpApp[0].destPort = 1234
**.udpApp[0].messageLength = 32 bytes
**.udpApp[0].sendInterval = 0.1s
**.udpApp[0].startTime = 4s
**.H2.udpApp[0].destAddresses = "H1"
**.H1.udpApp[0].destAddresses = "H2"
**.udpApp[1].typename = "UDPEchoApp"
**.udpApp[1].localPort = 1234

**.arp.cacheTimeout = 1s

[Config AlwaysUp]
**.scenarioManager.script = xml("<empty/>")

[Config ShutdownAndRestart]
**.scenarioManager.script = xml( \
"<script>\n" + \

Department of ECE Page 48


Communication Networks Laboratory III B. Tech II SEM

"<at t='3s'><tell module='lifecycleController' operation='NodeShutdownOperation'


target='R1'/></at>\n" + \
"<at t='6s'><tell module='lifecycleController' operation='NodeStartOperation'
target='R1'/></at>\n" + \
"<at t='10s'><tell module='lifecycleController' operation='NodeShutdownOperation'
target='R1'/></at>\n" + \
"<at t='11'><tell module='lifecycleController' operation='NodeShutdownOperation'
target='R2'/></at>\n" + \
"<at t='20s'><tell module='lifecycleController' operation='NodeStartOperation'
target='R1'/></at>\n" + \
"<at t='21s'><tell module='lifecycleController' operation='NodeStartOperation'
target='R2'/></at>\n" + \
"</script>")

[Config CrashAndReboot]
**.scenarioManager.script = xml( \
"<script>\n" + \
"<at t='3s'><tell module='lifecycleController' operation='NodeCrashOperation'
target='R1'/></at>\n" + \
"<at t='6s'><tell module='lifecycleController' operation='NodeStartOperation'
target='R1'/></at>\n" + \
"<at t='10s'><tell module='lifecycleController' operation='NodeCrashOperation'
target='R1'/></at>\n" + \
"<at t='11'><tell module='lifecycleController' operation='NodeCrashOperation'
target='R2'/></at>\n" + \
"<at t='20s'><tell module='lifecycleController' operation='NodeStartOperation'
target='R1'/></at>\n" + \
"<at t='21s'><tell module='lifecycleController' operation='NodeStartOperation'
target='R2'/></at>\n" + \
"</script>")

Department of ECE Page 49


Communication Networks Laboratory III B. Tech II SEM

Procedure

1. Create a New project.


2. Create .NED files.
3. Create omnetpp.ini files.
4. Create source files defining the functionality.
5. Build the project.
6. Run the Project with different configurations and observe the results.
7. Obtain the results from results file.

Result

Hence successfully implemented the OSPF routing protocol.

Viva Questions

1. What is meant by routing?


2. What is the classification of routing algorithms?
3. What are the metrics used for evaluating the routing algorithm?

Department of ECE Page 50


Communication Networks Laboratory III B. Tech II SEM

EXP. NO. 8 Simulation of Congestion Control Algorithms

Aim

To simulate Congestion Control Algorithms.


.
Apparatus

PC installed with Omnet++ Software


Theory

The main concept of the leaky bucket algorithm is that the output data flow
remains constant despite the variant input traffic, such as the water flow in a bucket
with a small hole at the bottom. In case the bucket contains water (or packets) then the
output flow follows a constant rate, while if the bucket is full any additional load will
be lost because of spillover. In a similar way if the bucket is empty the output will be
zero. From network perspective, leaky bucket consists of a finite queue (bucket)
where all the incoming packets are stored in case there is space in the queue,
otherwise the packets are discarded. In order to regulate the output flow, leaky bucket
transmits one packet from the queue in a fixed time (e.g. at every clock tick). In the
following figure we can notice the main rationale of leaky bucket algorithm, for both

Department of ECE Page 51


Communication Networks Laboratory III B. Tech II SEM

the two approaches (e.g. leaky bucket with water (a) and with packets (b)).

While leaky bucket eliminates completely bursty traffic by regulating the incoming data
flow its main drawback is that it drops packets if the bucket is full. Also, it doesn’t take
into account the idle process of the sender which means that if the host doesn’t transmit
data for some time the bucket becomes empty without permitting the transmission of
any packet.

Procedure

1. Create a New project.


2. Create .NED files.
3. Create omnetpp.ini files.
4. Create source files defining the functionality.
5. Build the project.
6. Run the Project with different configurations and observe the results.
7. Obtain the results from results file.
Result

Hence successfully implemented the leaky bucket congestion control algorithm.

Viva Questions

1. What is meant by congestion?


2. What are the different congestion control algorithms available?

Department of ECE Page 52


Communication Networks Laboratory III B. Tech II SEM

EXP. NO. 9 Simulating the effect of DiffServ / IntServ in routers on throughput


enhancement.

Aim

To simulate the effect of DiffServ / IntServ in routers on throughput enhancement.

Apparatus

PC installed with Omnet++ Software


Theory

Source Code:

DiffServnetwork.ned File:

package inet.examples.diffserv.simple_;

import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
import inet.node.ethernet.EtherSwitch;
import inet.node.inet.Router;
import inet.node.inet.StandardHost;
import ned.DatarateChannel;

// This network contains a router with an 10Mbps Ethernet interface,


// and with a 128kbps dialup connection to a server.
//
// The dialup connection is the bottleneck of the traffic from the clients
// to the server. Without QoS, high traffic can cause random packet drops
// at the router PPP interface.
//
network DiffservNetwork
{
parameters:
int numClients = default(1);
types:
channel dialup extends DatarateChannel
{
delay = normal(0.004s, 0.0018s);
datarate = 128kbps;
}
channel ethernetline extends DatarateChannel

Department of ECE Page 53


Communication Networks Laboratory III B. Tech II SEM

{
delay = 0.1us;
datarate = 10Mbps;
}
submodules:
router: Router {
@display("p=318,108");
}
client[numClients]: StandardHost;
server: StandardHost {
@display("p=436,108");
}
configurator: IPv4NetworkConfigurator {
@display("p=181,21");
}
etherSwitch: EtherSwitch {
@display("p=198,107");
}
connections:
router.pppg++ <--> dialup <--> server.pppg++;
etherSwitch.ethg++ <--> ethernetline <--> router.ethg++;
for i=0..numClients-1 {
client[i].ethg++ <--> ethernetline <--> etherSwitch.ethg++;
}
}

Omnetpp.ini File:

[General]
network = DiffservNetwork
sim-time-limit = 50s

# client applications
**.numClients = 1
**.client[*].numUdpApps = 2
**.client[*].udpApp[*].typename = "UDPBasicApp"
**.client[*].udpApp[*].destAddresses = "server"
**.client[*].udpApp[*].messageLength = 1000B
**.client[*].udpApp[*].startTime = uniform(0s,0.1s)
**.client[*].udpApp[*].sendInterval = 100ms
**.client[*].udpApp[0].destPort = 5001
**.client[*].udpApp[1].destPort = 5002

# server applications
**.server.numUdpApps = 2
Department of ECE Page 54
Communication Networks Laboratory III B. Tech II SEM

**.server.udpApp[0].typename = "UDPSink"
**.server.udpApp[0].localPort = 5001
**.server.udpApp[1].typename = "UDPSink"
**.server.udpApp[1].localPort = 5002

# default router queue


**.router.ppp[*].queueType = "DropTailQueue"
**.router.ppp[*].queue.frameCapacity = 100

[Config VoIP]
description = "client[0] executes a VoIP application"
**.numClients = 2
**.client[0].numUdpApps = 1
**.client[0].udpApp[0].typename = "VoIPStreamSender"
**.client[0].udpApp[0].packetTimeLength = 20ms
**.client[0].udpApp[0].voipHeaderSize = 4B

**.client[0].udpApp[0].voipSilenceThreshold = 100
**.client[0].udpApp[0].repeatCount = 1
**.client[0].udpApp[0].soundFile = "../../voipstream/soundFiles/ria_44100_stereo.mp3"

**.client[0].udpApp[0].codec = "pcm_mulaw"
**.client[0].udpApp[0].bitsPerSample = 8
**.client[0].udpApp[0].samplingRate = 8000Hz
**.client[0].udpApp[0].compressedBitRate = 64000bps

**.client[0].udpApp[0].localPort = 1000
**.client[0].udpApp[0].destPort = 1000
**.client[0].udpApp[0].srcAddress = ""
**.client[0].udpApp[0].destAddress = "server"

**.server.numUdpApps = 3
**.server.udpApp[2].typename = "VoIPStreamReceiver"
**.server.udpApp[2].localPort = 1000
**.server.udpApp[2].resultFile = "results/${configname}_results.wav"

[Config WithoutQoS]
description = "Diffserv traffic conditioning and queueing is turn off"

[Config WithPolicing]
description = "Diffserv traffic conditioning is turned on in the ppp[0] interface of the router"
**.router.ppp[0].egressTCType = "TrafficConditioner"
**.efMeter.cir = "70%"
**.efMeter.cbs = 50KiB
**.defaultMeter.cir = "30%"
**.defaultMeter.cbs = 2KiB

Department of ECE Page 55


Communication Networks Laboratory III B. Tech II SEM

**.defaultMeter.ebs = 4KiB

[Config WithQueueing]
description = "A DiffservQueue is added to the ppp[0] interface of the router"
**.router.ppp[*].queueType = "DiffservQueue"
**.router.ppp[*].queue.efMeter.cir = "70%" # reserved bandwith for EF packets
**.router.ppp[*].queue.efMeter.cbs = 5000B

[Config VoIP_WithoutQoS]
description = "VoIP application, without QoS"
extends = VoIP, WithoutQoS

[Config VoIP_WithPolicing]
description = "VoIP application, traffic policing at the router allocates bandwidth for voice
packets"
extends = VoIP, WithPolicing

[Config VoIP_WithPolicingAndQueueing]
description = "VoIP application, traffic policing at the router allocates bandwidth for voice
packets, and voice packets are prioritized in router's queue"
extends = VoIP, WithPolicing, WithQueueing

Department of ECE Page 56


Communication Networks Laboratory III B. Tech II SEM

Procedure

1. Create a New project.


2. Create .NED files.
3. Create omnetpp.ini files.
4. Create source files defining the functionality.
5. Build the project.
6. Run the Project with different configurations and observe the results.
7. Obtain the results from results file.

Result

Hence successfully implemented the Diffserv configuration.

Viva Questions

1. What is the effect of DiffServ / IntServ in routers on throughput enhancement?

Department of ECE Page 57


Communication Networks Laboratory III B. Tech II SEM

EXP. NO. 10 Simulating the performance of wireless networks

Aim

To simulate the performance of wireless networks.

Apparatus

PC installed with Omnet++ Software


Theory
Wireless Network

A wireless network is type of computer network that uses wireless data connections for
connecting network nodes. Wireless networking is a method by which homes,
telecommunications networks and enterprise installations avoid the costly process of
introducing cables and other networking devices into building.

Wireless telecommunication networks are generally implemented and administered using


radio communication. This implementation takes place at the physical layer of the OSI
model network structure. Example of wireless network includes cell phone networks, Wi-Fi

local networks and terrestrial microwave networks.

Department of ECE Page 58


Communication Networks Laboratory III B. Tech II SEM

Wireless personal area Network


Wireless personal area network (WPAN) interconnect devices within a relatively small area
that is generally within a person’s reach. For example, both Bluetooth radio and invisible
infrared light provides a WPAN for interconnecting a headset to a laptop.

Wireless Ad-hoc network:

A wireless ad hoc network is decentralized type of wireless network. The network is ad-hoc
because it does not rely on preexisting infrastructure, such as routers in wired networks or
access points in managed wireless networks. In ad hoc wireless network each node
participates in routing by forwarding data for other nodes. Determination of which nodes
forward data is made dynamically on the basis of network connectivity. In addition to the
classic routing, ad hoc networks can use flooding for forwarding data. The physical size of
the network is determined by the maximum reliable propagation range of the radio signals.
Ad-hoc wireless network are suited for temporary situations such as meetings and
correctness.

Wireless network adapter

A wireless network adapter allows a computing device to join a wireless LAN. Wireless
network adapter Contain a built- in radio transmitter and receiver. Each adapter supports
one or more of the Wi-Fi standards.

Wireless access point:

A wireless access point is a device that allows wireless devices to connect to a wired
network using Wi-Fi or related standards. The Wireless access point usually connects to a
router (via a wired network) as a standalone device. It can also be an integral component of
the router itself. The access point (AP) can also act as a repeater for wireless nodes,
effectively doubling the maximum possible distance between nodes.

Source Code:
Omnetpp.ini file

[General]
network = Lan80211
#cmdenv-output-file = omnetpp.log
#debug-on-errors = true
tkenv-plugin-path = ../../../etc/plugins
#record-eventlog = true

**.constraintAreaMinX = 0m
**.constraintAreaMinY = 0m

Department of ECE Page 59


Communication Networks Laboratory III B. Tech II SEM

**.constraintAreaMinZ = 0m
**.constraintAreaMaxX = 600m
**.constraintAreaMaxY = 400m
**.constraintAreaMaxZ = 0m

# access point
**.ap.wlan[*].mac.address = "10:00:00:00:00:00"
**.host[*].**.mgmt.accessPointAddress = "10:00:00:00:00:00"
**.mgmt.frameCapacity = 10
# mobility
**.host[*].mobilityType = "MassMobility"
**.host[*].mobility.changeInterval = truncnormal(2ms, 0.5ms)
**.host[*].mobility.changeAngleBy = normal(0deg, 30deg)
**.host[*].mobility.speed = truncnormal(20mps, 8mps)
**.host[*].mobility.updateInterval = 100ms

# ping app (host[0] pinged by others)


**.numPingApps = 1
*.host[0].pingApp[0].destAddr = ""
*.host[*].pingApp[0].destAddr = "host[0]"
*.host[*].pingApp[0].sendInterval = 10ms

# nic settings
**.wlan*.bitrate = 2Mbps

**.mac.address = "auto"
**.mac.maxQueueSize = 14
**.mac.rtsThresholdBytes = 3000B
**.wlan[*].mac.retryLimit = 7
**.wlan[*].mac.cwMinData = 7
**.wlan[*].mac.cwMinBroadcast = 31

**.wlan[*].radio.transmitter.power = 2mW
**.wlan[*].radio.transmitter.bitrate = 2Mbps
**.wlan[*].radio.transmitter.headerBitLength = 100b
**.wlan[*].radio.transmitter.carrierFrequency = 2.4GHz
**.wlan[*].radio.transmitter.bandwidth = 2MHz
**.wlan[*].radio.receiver.sensitivity = -85dBm
**.wlan[*].radio.receiver.snirThreshold = 4dB

[Config Ping1]
description = "host1 pinging host0"
*.numHosts = 2

[Config Ping2] # __interactive__


description = "n hosts"

Department of ECE Page 60


Communication Networks Laboratory III B. Tech II SEM

# leave numHosts undefined here

Lan80211.ned file

package inet.examples.wireless.lan80211;

import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
import inet.node.inet.WirelessHost;
import inet.node.wireless.AccessPoint;
import inet.physicallayer.ieee80211.packetlevel.Ieee80211ScalarRadioMedium;
import inet.visualizer.integrated.IntegratedCanvasVisualizer;

network Lan80211
{
parameters:
int numHosts;
**.mgmt.numChannels = 2;
submodules:
visualizer: IntegratedCanvasVisualizer {
parameters:
@display("p=100,50");
}
configurator: IPv4NetworkConfigurator {
parameters:
@display("p=100,150");
config = xml("<config><interface hosts='*' address='145.236.x.x'
netmask='255.255.0.0'/></config>");
}
radioMedium: Ieee80211ScalarRadioMedium {
parameters:
@display("p=100,250");
}
host[numHosts]: WirelessHost {
@display("r=,,#707070");
wlan[*].mgmtType = "Ieee80211MgmtSTASimplified";
}
ap: AccessPoint {
@display("p=213,174;r=,,#707070");
wlan[*].mgmtType = "Ieee80211MgmtAPSimplified";
}
}

Department of ECE Page 61


Communication Networks Laboratory III B. Tech II SEM

Procedure

1. Create a New project.


2. Create .NED files.
3. Create omnetpp.ini files.
4. Create source files defining the functionality.
5. Build the project.
6. Run the Project with different configurations and observe the results.
7. Obtain the results from results file.

Result

Hence successfully simulated the wireless LAN.

Department of ECE Page 62


Communication Networks Laboratory III B. Tech II SEM

Viva Questions

1. What is wireless network?


2. What is ad-hoc network?
3. What is flooding?
4. Compare wireless network with wired network?
5. List the advantages of wireless networking?
6. What is wireless network adapter?
7. What is wireless network adapter?
8. Explain how cellular networking works? What is wireless access point?
9. What is WPAN?
10. What are the advantages of wireless network?
11. What is wireless network standard?

Department of ECE Page 63


Communication Networks Laboratory III B. Tech II SEM

EXP. NO. 11 LAN With Various Topologies

Aim

To Design and Implement LAN with various Topologies and evaluate the network performance
parameters.
Apparatus

PC installed with Omnet++ Software


Theory

Topology types:
Following are different types of topology which mainly used to connect computers with each
other to form a network.

Bus topology:
❖ A bus topology consists of main System Bus with a terminator at each end in
which all computers (node) are connected to the cable.
❖ A signal from the source travels in both directions to all computers connected on the bus
cable until it finds the intended recipient. If the computer address does not match the
intended address for the data, the computer ignores the data.
Concept structure:

Department of ECE Page 64


Communication Networks Laboratory III B. Tech II SEM

Ring topology:

❖ In this all the computers (nodes) are connected to each-other in such a way that they
make a closed loop.
❖ Each computer is connected to two other components on either side, and it
communicated with these two adjacent neighbors. Data is sent around the ring until it
reaches its final destination.
Concept structure:

Mesh topology :

❖ This topology employs either or two schemes, called full mesh and partial mesh.
❖ In the full mesh topology, each computer is connected directly to each of the others. In
the partial mesh topology. some computers are connected to all the others, and some are
connected only to those other nodes with which they exchange the most data.
❖ If there are n computers, there will be (n x (n-1)) ¸ 2 cables in the network. For examples,
if you have five computers in a mesh network, it will use 5 x (5 - 1) ¸ 2, which equals 10
cables.
Concept structure:

Department of ECE Page 65


Communication Networks Laboratory III B. Tech II SEM

Star topology:

❖ In this every node (computer workstation or any other peripheral) is connected to central
node or device called hub or switch)
❖ All the data on the star topology passes through the central device before reaching the
intended destination.
❖ A hub forwards data packets to all the ports. A switch is more intelligent. It recognizes
which computer is connected to which port based on the MAC address and saves this
information in a table. When a switch receives a data packet, it determines the recipient
and forwards the packet to the correct computer.
❖ An advantage of the star topology is the simplicity of adding additional nodes. The
primary disadvantage of the star topology is that the hub/switch represents a single
point of failure.
❖ Extended Star topology uses the star topology to be created. It links individual stars
together by linking the hubs/switches. This will extend the length of the network.
Concept structure:

Department of ECE Page 66


Communication Networks Laboratory III B. Tech II SEM

Bus.ini File:

[General]
sim-time-limit = 120s
tkenv-plugin-path = ../../../etc/plugins
**.vector-recording = false
[Config BusLAN]
network = BusLAN
**.hostA.cli.destAddress = ""
**.cli.destAddress = "hostA"
**.cli.sendInterval = exponential(1s)
**.host*.mac.duplexMode = false
include defaults.ini

switch.ini File:

[General]
#sim-time-limit = 120s
tkenv-plugin-path = ../../../etc/plugins
**.vector-recording = false

[Config SwitchedLAN1]
network = SwitchedLAN
**.hostA.cli.destAddress = ""
**.cli.destAddress = "hostA"
**.cli.sendInterval = exponential(1s)

include defaults.ini

Department of ECE Page 67


Communication Networks Laboratory III B. Tech II SEM

Procedure

1. Create a New project.


2. Create .NED files.
3. Create omnetpp.ini files.
4. Create source files defining the functionality.
5. Build the project.
6. Run the Project with different configurations and observe the results.
7. Obtain the results from results file.
Result

Hence successfully implemented LAN with Various Topologies and evaluated the network
performance parameters.
Viva Questions

1. What is Network topology?


2. What is use of physical and logical topology?
3. Which topology required terminator at both the ends of cable?
4. State why topology required in laboratory.
5. List out names of transmission media and network devices required to form star topology.
6. Give advantage and disadvantage of bus topology.

Department of ECE Page 68


Communication Networks Laboratory III B. Tech II SEM

7. Give advantage and disadvantage of ring topology.


8. Give advantage and disadvantage of star topology.
9. Give advantage and disadvantage of mesh topology.
10. Give the meaning of extended star topology.
11. What is difference between hub and witch?
12. Give the use of NIC card. Is it required to connect computers in star topology.
13. Give the command name which checks whatever computer is connected in network or not.
14. Which is the best topology to be implemented in laboratory of 20 computers in
terms of cables, money and failure of computer?
15. Write a formula to calculate how many cables are required to connect n computers in
mesh topology?
16. What is the different topologies in which we can connect the network?
17. What is the drawback of bus topology?

18. Compare various topologies in terms of delay, complexity and reliability.

Department of ECE Page 69


Communication Networks Laboratory III B. Tech II SEM

EXP. NO. 12 Implement LAN Using Switch/Hub/Router as Interconnecting Devices

Aim

To Design and Implement LAN Using Switch/Hub/Router as Interconnecting Devices


For Two Different LANs and To Evaluate Network Performance Parameters.

Apparatus

PC installed with Omnet++ Software


Theory

Hub:

A Hub is just a connector that connects the wires coming from different sides.
There is no signal processing or regeneration. It is an electronic device that
operates only on physical layers of the OSI model.

It is also known as a repeater as it transmits signal to every port except the port
from where signal is received. Also, hubs are not that intelligent in communication
and processing information for 2nd and 3rd layer.

Switch:

Switch is a point to point communication device. It operates at the data link layer of
OSI model. It uses switching table to find out the correct destination.

Basically, it is a kind of bridge that provides better connections. It is a kind of


device that set up and stop the connections according to the requirements needed at
that time. It comes up with many features such as flooding, filtering and frame
transmission.

Router:

Routers are the multiport devices and more sophisticated as compared to


repeaters and bridges. It contains a routing table that enables it to make decision
about the route i.e. to determine which of several possible paths between the
source and destination is the best for a particular transmission.

Hub.ini File:
[General]
network = HubLAN
sim-time-limit = 120s
Department of ECE Page 70
Communication Networks Laboratory III B. Tech II SEM

tkenv-plugin-path = ../../../etc/plugins
**.vector-recording = false

[Config Hub1]
**.hostA.cli.destAddress = ""
**.cli.destAddress = "hostA"
**.cli.sendInterval = exponential(1s)

[Config Hub2]
# bigger load, frequent collisions
**.hostA.cli.destAddress = ""
**.cli.destAddress = "hostA"
**.cli.sendInterval = exponential(2ms)

[Config Hub3]
# manual address assignment
**.hostA.mac.address = "001122334455"
**.hostA.cli.destAddress = ""
**.cli.destAddress = "001122334455"
**.cli.sendInterval = exponential(1s)

[Config Hub4]
# one station can only support 10Mb/s
**.hostC.mac.txrate = 10Mbps
**.hostA.cli.destAddress = ""
**.cli.destAddress = "hostA"
**.cli.sendInterval = exponential(1s)

include defaults.ini

switch.ini File:
[General]
#sim-time-limit = 120s
tkenv-plugin-path = ../../../etc/plugins
**.vector-recording = false

Department of ECE Page 71


Communication Networks Laboratory III B. Tech II SEM

[Config SwitchedLAN1]
network = SwitchedLAN
**.hostA.cli.destAddress = ""
**.cli.destAddress = "hostA"
**.cli.sendInterval = exponential(1s)

include defaults.ini

Procedure

1. Create a New project.


2. Create .NED files.
3. Create omnetpp.ini files.
4. Create source files defining the functionality.
5. Build the project.
6. Run the Project with different configurations and observe the results.
7. Obtain the results from results file.
Result

Hence successfully implemented LAN using Switch/Hub/Router as interconnecting


devices for two different LANs and evaluated Network Performance Parameters.
Viva Questions

1. What is the difference between Hub, Switch and Router?

Department of ECE Page 72


Communication Networks Laboratory III B. Tech II SEM

LIST OF NETWORK SIMULATORS


There are various simulators available for simulations each with their
own purpose. However there are limited simulators that support wide range of
protocols, routing metrics, etc. Here is the list of simulators that support huge
number of protocols and network entities.

Network Simulator 2 [NS2]

Network simulator 2[3] is one of the oldest simulator available for


simulation of wired, wireless, satellite networks, etc. For more than a decade, it
satisfies most of the researchers/students across the globe in simulating the
networks. It has a strong community that helps developers, researchers across the
internet. NS2 was criticized because of the complex architecture it has (OTcl and
C++), but it supports the oldest to latest the protocol that were available for the
wired or wireless networks. NS2 is completely open source and free.

Network Simulator 3 [NS3]

NS3 [14] is another simulator available for less than a decade and it
supports network components of recent developments, unlike NS2, the
architecture of ns3 is simpler and one can simulate a network using either C++ or
python scripts. NS3 is evolving these days to a greater extent and will come with
new protocols, new networks, etc in each of their releases. NS3 is completely
open source and free.

OMNeT++

OMNeT++[15] another tool that supports many protocols, network


entities using the framework INET which is coming as a third party interface.
OMNeT++ is built on the eclipse framework and the development and
deployment is very easy as it as a richer GUI that supports the developers to
form a network very easy. It is built over C++ and most of the developmental
modules are developed in C++ and there is a configuration file (omnetpp.ini)
which solves the purpose of forming a network either in a text mode or in a
graphical mode. All these things available at a free cost. OMNEST is the
commercial version.

OPNET

This is expensive commercial software available for network simulation


and is available with source codes for unrestricted protocols. Trial version is
available on request. It contains excellent manual. It has a full-fledged GUI with
XML based support for scenario generation. Because of its heavy weight
components, this is a slow simulator.

Department of ECE Page 73


Communication Networks Laboratory III B. Tech II SEM

There are various other simulators too in the market that solves the
purpose of narrow network research. So, the developers once identified a
network, there are choices available for them to select the perfect simulator for
their research. The following table will list some of the key comparisons between
the simulators

Name OPNET NS2 NS3 OMNeT+

Highly Free and Open Free and Open Academic


Cost expensive. Source Source Version is Fre
Good
Proper Proper Documentat
Support manual
documentation documentation ion is
with
available
source
codes
GUI
Topology/Scenario GUI OTcl C++ or Python
with
omnetpp
.ini
Languages/scripts
C++ OTcl and C++ C++ and Python C++
used
Forum
Less Best Good Good
/Community Help
Expensive Need for a
and highly third party
commercial, Best for latest Best for latest framework
Overall Rating simulation is and faster and faster for a given
also slow, simulations simulations network.
suited best Also issue
for the with version
industries compatibility

Time driven and Event Driven Simulations

Usually network simulations carried out either in time driven or event driven.
Each of them have their own pros and cons. This topic will show you the
difference between these simulations.

Department of ECE Page 74


Communication Networks Laboratory III B. Tech II SEM

Time driven Simulation

Time driven simulation is also called as discrete time simulation. The simulation
is carried out on a fixed time interval. The time interval in which a task is
running is assumed to be running before the end of the interval though the task
would have arrived at the beginning of the interval.

Basic Networking Commands


Networking Commands: The following commands are essentially used for
network management.
1.1 hostname
This command is used for finding host/domain name and IP address.

Example:
hostname with no options displays the
machines host name hostname –d displays
the domain name the machine belongs to
hostname –f displays the fully qualified host
and domain name hostname –i displays the IP
address for the current machine

1.2 ifconfig
This command will display the assigned IP address of ETHERNET adapter.

Ubuntu :
ifconfig |
grep inet
Windows :
ipconfig

1.3 ping
This command is used for checking the network connectivity. Ping verifies IP-
level connectivity to another TCP/IP device by sending Internet Control Message
Protocol (ICMP) Echo Request messages. If received, the corresponding Echo
Reply messages are displayed, along with round- trip times. Otherwise, a timed-
out request or an ICMP unreachable message is displayed. (i.e. You can “ping”
an IP address to see if a machine is alive. If there is no response, you know
something is wrong)

1.4 host

Department of ECE Page 75


Communication Networks Laboratory III B. Tech II SEM

This command is used for mapping name to IP addresses

Example: host www.google.com

www.google.com has address


74.125.200.147 www.google.com has
address 74.125.200.106 www.google.com
has address 74.125.200.103
www.google.com has address
74.125.200.104 www.google.com has
address 74.125.200.105 www.google.com
has address 74.125.200.99
www.google.com has IPv6 address
2404:6800:4003:c00:: 69

1.5 telnet
This command is used for connecting to a host on a particular port. Example:
telnet osou.ac.in telnet command is also used to make a connection to a remote
machine and execute programs as if one were physically present. telnet (data are
travelled without encryption; not secured)

1.6 ftp
This command allows you to send and receive files between two computers.

1.7 net
net command is used for checking/starting/stopping networking services, users,
messaging, configuration and so on... ?

1.8 arp
This command is used for displaying or manipulating the ARP (Address
Resolution Protocol) information on a network device or computer.

Explanation: The ARP protocol maps Layer 3 IP addresses to Layer 2 MAC


addresses. If a packet must move across networks, the Layer 2 MAC address
changes with each hop across a router, but the Layer 3 address never changes.
ARP cache stores ARP address mappings. If the entry was learned dynamically,
it will eventually be deleted from cache. If the entry was manually inserted in
ARP cache, it is a static entry and will remain until the computer is turned off or
the ARP cache is manually flushed.

On Windows, arp displays and modifies entries in the Address Resolution


Protocol (ARP) cache, which contains one or more tables that are used to store
IP addresses and their resolved Ethernet or Token Ring physical addresses.
There is a separate table for each Ethernet or Token Ring network adapter
installed on your computer. Used without parameters, arp displays help

Department of ECE Page 76


Communication Networks Laboratory III B. Tech II SEM

1.9 Winipcg
This command is used to know the IP configuration of the PC in a graphical
form. It shows the following in the windows command prompt.

 IP Address
 Subnet Mask
 Type of H/W used for communication & it’s address
1.10 nslookup
This command displays information from Domain Name System (DNS)
name servers. NOTE: If you write the command as above it shows as
default your pc's server name firstly.

1.11 netstat
This command is used for finding connection to and from the host. Netstat is a
common command line TCP/IP networking utility available in most versions of
Windows, Linux, UNIX and

other operating systems. Netstat provides information and statistics about


protocols in use and current TCP/IP network connections.

Example:
netstat nap| grep port will display process id of application which
is using that port netstat a or netstat –all will display all
connections including TCP and UDP netstat tcp or netstat –t will
display only TCP connection

netstat udp or netstat –u will display only UDP connection

netstat g will display all multicast network subscribed by this h

1.12 tracert
The tracert command is a Command Prompt command that's used to show
several details about the path that a packet takes from the computer or device
you're on to whatever destination you specify. It will list all the routers it passes
through until it reaches its destination, or fails to and is discarded.

Department of ECE Page 77

You might also like