0% found this document useful (0 votes)
33 views64 pages

Labmanual CN Cs602 A

This lab manual for the Computer Network course (CS 602) outlines the program details, faculty information, and the vision and mission of both the institute and the department. It includes a comprehensive index, program outcomes, specific outcomes, educational objectives, a list of experiments, and course outcomes, along with a mapping of these outcomes. The manual serves as a guide for students in the 6th semester of the B.Tech Computer Science & Engineering program at Shri Ram Institute of Technology, Jabalpur.

Uploaded by

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

Labmanual CN Cs602 A

This lab manual for the Computer Network course (CS 602) outlines the program details, faculty information, and the vision and mission of both the institute and the department. It includes a comprehensive index, program outcomes, specific outcomes, educational objectives, a list of experiments, and course outcomes, along with a mapping of these outcomes. The manual serves as a guide for students in the 6th semester of the B.Tech Computer Science & Engineering program at Shri Ram Institute of Technology, Jabalpur.

Uploaded by

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

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

LAB MANUAL
Computer Network - CS 602

6th Sem

Batch 2021-2022
Shri Ram Institute of Technology, Jabalpur (M.P.)
Near ITI, Madhotal , Jabalpur, M.P., 482001
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

INDEX
S.NO TOPIC Page No.
1. Course & Faculty details 1
2. Vision & Mission of the Institute 2
3. Vision & Mission of the Department 3
4. Program Outcomes (PO) 4
5. Program Specific Outcome (PSO) 5
6. Program Educational Objectives (PEOs) 6
7. Scheme 7
8. List of Experiments 8
9. Course Outcome (CO) 9
10. Mapping 10
11. Time Table 11
12. Date of Execution 12
13. Experiments 13-59
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

COURSE & FACULTY DETAILS

Faculty Details

Name of the Faculty:

Designation:

Department: Department of Computer Science & Engineering

Course Details:

Name of the Programme: B.Tech Batch: 2021-2022

Branch: Computer Science & Engineering Semester: 6th A

Name of Subject: Computer Network Subject Code: CS 602

Category of Course: Departmental Core

1
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

VISION & MISSION OF THE INSTITUTE

VISION

To provide quality education and to inculcate professional skills in students so that they
hold competitive edge in the healthy environment and excel in their profession with
sound ethical basis for betterment of the society.

MISSION

To progressively develop an efficiently functioning engineering/technological institution


that will produce world class engineering graduates and post graduates committed to the
spirit of integrity, equity, professional ethics and social harmony.

2
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

VISION & MISSION OF THE DEPARTMENT

VISION

Creating ethical leaders in the field of computational sciences by quality vocational


education with an emphasis on comprehensive learning and excellence.

MISSION

M1. To provide qualitative education and generate new knowledge through effective
teaching learning methodologies, resulting in careers as computer and IT professionals
in the widely diversified fields of business, government and academia.

M2. To transform lives of the students by imparting ethical values, sustainable skills,
creativity, and uniqueness in them, allowing them to become entrepreneurs and start
businesses.

M3. To encourage students to learn about emerging technologies in order to continue


higher education and lifelong learning.

3
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

PROGRAM OUTCOMES
PO1 Engineering knowledge: Apply the knowledge of mathematics, science, engineering fund
amentals, and an engineering specialization
to the solution of complex engineering problems
PO2 Problem analysis: Identify, formulate review research literature and analyze
complex engineering problems reaching substantiated conclusions using first principle of
mathematics, natural science and engineering science.
PO3 Design/development of solutions: 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.
PO4 Conduct investigations of complex problems: Use research-based knowledge
and research methods including design of experiments, analysis and interpretation of data,
and synthesis of the information to provide valid conclusions

PO5 Modern tool usage: Create, select, and apply appropriate


techniques, resources, and modern engineering and IT tools including prediction and mod
eling to complex engineering activities with an understanding of the limitations.
PO6 The engineer and society: Apply reasoning informed by the contextual
knowledge to assess societal, health, safety, legal and cultural issues and the consequent re
sponsibilities relevant to the professional engineering practice.
PO7 Environment and sustainability: Understand the impact of the professional
engineering solutions in societal and environmental contexts, and demonstrate the knowle
dge of, and need for sustainable development
PO8 Ethics: Apply ethical principles and commit to professional ethics and responsibilities a
nd 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 on complex engineering activities with the
engineering community and with society at large, such as, being able to comprehend and
write effective reports and design documentation, make effective presentations, and give a
nd 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 membe
r and leader in a team, to manage projects and 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
4
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
technological change.

PROGRAM SPECIFIC OUTCOMES:

PSO1 Professional Skills: Acquire practical knowledge of emerging trends, programming


languages, and development-tools.

PSO2 Successful Career and Entrepreneurship: Gain expertise in a variety of fields of computer
science and experience an environment that fosters the development of abilities for a
successful profession, entrepreneurship, and higher learning.

5
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)

PEO 1 To impart fundamental theoretical and practical knowledge in computer


science and engineering in order to pursue a successful career in industry,
higher education, or entrepreneurial endeavors.
Build the ability to think logically, evaluate, and make decisions ethically in
PEO 2 order to provide a techno-commercially viable and socially acceptable
solution to real-world computing challenges
Participate in continuous learning to promote sustainable growth in the area
PEO 3 of modern computer technological domains.

6
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

SCHEME

7
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

LIST OF EXPERIMENT
S.N List of Experiment CO PO PSO Page
o No.
01. Study of Different Type of LAN. 1 1,2,5 1, 2 14-17
02. Study and Verification of standard 1 1,2,3,4,5 1 18-21
Network topologies i.e. Star, Bus,
Ring etc.
03. LAN installations and 1, 2, 3 1,2,5 1, 2 22
Configurations.
04. Write a program to implement 4 1,2,3,4,5,1 1 23-26
various types of error correcting 2
techniques.
05. To Implement the data link layer 5 1,2,3,4,5,1 1 27-28
framing methods such as and bit 2
stuffing
06. Study of Tool Command Language 1, 5 1,5,12 1 29-30
(TCL).
07. Study and Installation of Standard 1, 2, 6 1,2,3,5,12 1, 2 31-32
Network Simulator: N.S-2,
N.S3.OpNet, QualNetetc .
08. Study & Installation of ONE 1, 2, 6 1,2,3,5,12 1, 2 33-34
(Opportunistic Network
Environment) Simulator for High
Mobility Networks.
09. Configure 802.11 WLAN. 1, 2, 5 1,2,5 1 35-37
10. Implement & simulate various 5, 6 1,2,3,4,5,1 1, 2 38-39
types of routing algorithm. 2
11. Study & Simulation of MAC 2, 5 1,2,3,4,5,1 1, 2 40-43
Protocols like Aloha, CSMA, 2
CSMA/CD and CSMA/CA using
Standard Network Simulators.
12. Study of Application layer 1, 2, 5 1,2,3,4,5,1 1, 2 44-45
protocols-DNS, HTTP, HTTPS, 2
FTP and TelNet.
8
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
13. Demonstrate the steps to configure 2, 5 1,2,3,4,5,1 1, 2 46-56
static NAT on Cisco devices 2
through CLI.
14. Demonstrate the uses of Omnet++. 1,2,5 1,2,3,5 1 57-59

COURSE OUTCOME (CO)

CS602[P].1. Apply basic commands ipconig, ifconfig, netstat, ping, arp, telnet,ftp,finger,traceroute,
whois of LINUX platform.
CS602[P].2. Implement Client-Server Socket based programs using TCP,and UDP sockets
CS602[P].3. Evaluate the DNS client server for resolving the hostname.
CS602[P].4. Analyze packet filtering and capturing using raw sockets.
CS602[P].5. Implement sliding window protocol, Address Resolution Protocol for resolving MAC or
Physical address, border gateway protocol(BGP), RPC and Distance Vector Routing Algorithm
CS602[P].6. Implement open shortest path first for finding the shortest path between source and
destination.

9
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

Mapping
Mapping of Course Outcomes and Program Outcomes:
*H= High (3) *M= Medium (2) *L=Low (1)

COs PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12
CS602[P]. 2 2 2 0 3 0 0 0 2 0 0 2
1
CS602[P]. 3 3 3 2 3 2 0 0 2 0 2 2
2
CS602[P]. 2 3 2 2 3 2 0 0 2 0 0 2
3
CS602[P]. 2 3 2 2 3 2 0 0 2 0 0 2
4
CS602[P]. 3 3 3 2 3 2 0 0 2 0 0 3
5
CS602[P]. 3 3 3 2 3 2 0 0 2 0 0 3
6

Mapping of Program Specific Outcomes and Course Outcomes


Program Specific Course Outcomes
Outcomes 1 2 3 4 5 6
1 2 3 1 2 3 2
2 1 2 1 1 3 2

10
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

TIME TABLE

11
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

12
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
DATE OF EXECUTION

S.N List of Experiment Date of Execution


o Batch Remark Batch Remark
A B
01. Study of Different Type of LAN.
02. Study and Verification of standard
Network topologies i.e. Star, Bus,
Ring etc.
03. LAN installations and
Configurations.
04. Write a program to implement
various types of error correcting
techniques.
05. To Implement the data link layer
framing methods such as and bit
stuffing
06. Study of Tool Command Language
(TCL).
07. Study and Installation of Standard
Network Simulator: N.S-2,
N.S3.OpNet, QualNetetc .
08. Study & Installation of ONE
(Opportunistic Network
Environment) Simulator for High
Mobility Networks.
09. Configure 802.11 WLAN.
10. Implement & simulate various types
of routing algorithm.
11. Study & Simulation of MAC
Protocols like Aloha, CSMA,
CSMA/CD and CSMA/CA using
Standard Network Simulators.
12. Study of Application layer
protocols-DNS, HTTP, HTTPS,
FTP and TelNet.

13
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
EXPERIMENT NO. 01

Aim: Study of Different Type of LAN.

Theory:

LANs are classified as below according to the methods used for sharing data:

1. Ethernet

 It is a network protocol that controls how data is transferred over a local area
network.
 In this type of LAN, the user is able to transfer data at a rate of more than 10
megabits per second.
 Firstly, the system checks the medium used for the transfer of data; if the medium
is available, then only the data transmission is done.
 It is used in wired local area networks.

14
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
 When a machine or machines want to communicate with each other on a network,
they detect the main wire connecting all the devices which will be used to carry the
data. If the main wire, which is referred to as the carrier, is available and free,
which means no other machine on the network is transmitting any data, then the
sender machine initiates sending the packets of data on the network.
 Whenever a packet is transmitted, the sender has to wait if there is already a data
packet in the queue. After that, all the devices on the network check that packet to
see if they are the recipients of that packet. The actual recipient then receives the
packet.

2. Token Ring

 It is a type of local area network in which all devices are connected in a ring
arrangement.
 All the devices are connected in a circle, and they receive a token as per their
requirements. A token keeps on rotating in the circular ring.
 A token is used to avoid collisions of data. It is of 3 bytes and keeps on traveling in
the ring of servers or workstations.

The details of three 1-byte fields of a free token frame are:

1. Starting Delimiter (SD): It signals the beginning of the token frame.


2. Access Control (AC): Contains the priority field, reservation field, a token bit, and
a monitor bit.
3. Ending Delimiter (ED): It refers to the end of the token frame.

 A station can send data frames only if it has a token. After the data frame is
received successfully, the tokens are made free or released.
 The computers are connected by a ring or also called as a star topology.
15
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
 The token is passed over the physical ring, which is formed by the circular
arrangement of stations and the coaxial cable network.
 In this type of LAN, it is possible to calculate the maximum time for a token to
reach a station.
 It was developed to solve a collision problem, i.e. when two stations transmit
simultaneously at the same time.
 A newer version called Fast Token Ring has been developed, which can transfer
data up to a rate of 100Mbps.

3. Token Bus

 This is also a type of Local Area Network developed by IBM.


 Token Bus standard uses copper cables which are coaxial for connecting multiple
devices to the main large computers or workstations. The coaxial cable acts as the
common communication bus.
 In this protocol, also a token is created by this protocol to manage access for
communication.
 Any computer that holds the token can transfer the data. The token is released when
the station completes its data transmission or when a higher priority device needs to
transmit (such as the mainframe).
 Due to the token freeing mechanism, there is no collision, i.e. two or more devices
can easily transmit information on the bus at the same time, and the transmitted
data is also saved from being destroying.
 It is similar to the token-ring network, but the difference is that the ends of the
network do not meet each other to form a ring. But the network gets terminated at
both ends.

16
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
 In this protocol, the token or a small message which circulates among the devices
of a computer network is passed along the virtual ring of stations connected to a
LAN.
 The topology which is used is a bus or tree type that connects the stations.
 Each and every device is aware of the address of its preceding and succeeding
device to transmit token to.
 Data transmission cannot be performed without a token.
 In this type of LAN topology, it is not possible to calculate the time for the token
transfer. The working procedure of this token bus is the same as the token ring
topology.
 These are used for industrial purposes like manufacturing etc.

4. Fiber Distributed Data Interface (FDDI)

 It is a LAN standard used for data transmission via optical media.


 Used for long-distance networks.
 Uses optical fiber and copper cable.
 It provides communication with fiber optic cables up to 200 kilometers at a speed
of 100 Mbps.
 FDDI has two token rings, primary and secondary communication rings. One ring
is for backup in the case when the primary one fails.
 The primary ring works, and the second one remains free and is available for
backup.
 It is extended to FDDI-2 for long-distance voice and multimedia communication.
 It is used for huge and fast data transfer, such as in voice and video conferences,
online lectures, news, etc.

17
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
 It was displaced by fast Ethernet, which is cheaper and has a faster data transfer
rate.
 It is used in a large geographical scenario with thousands of end-users.

18
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

EXPERIMENT NO. 02

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

Theory: - Star Topology:


In star topology, all the devices are connected to a single hub through a cable. This
hub is the central node and all other nodes are connected to the central node. The
hub can be passive in nature i.e., not an intelligent hub such as broadcasting
devices, at the same time the hub can be intelligent known as an active hub. Active
hubs have repeaters in them. Coaxial cable or RJ-45 cables are used to connect the
computers. In Star Topology, many popular Ethernet LAN protocols are used as
CD(Collision Detection), CSMA (Carrier Sense Multiple Access), etc.

Figure A star topology having four systems connected to a single point of


connection i.e. hub.
Advantages of this topology:
 If N devices are connected to each other in a star topology, then the number
of cables required to connect them is N. So, it is easy to set up.
 Each device requires only 1 port i.e. to connect to the hub, therefore the total
number of ports required is N.
 It is Robust. If one link fails only that link will affect and not other than that.
 Easy to fault identification and fault isolation.
 Star topology is cost-effective as it uses inexpensive coaxial cable.

Bus Topology:

19
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
Bus topology is a network type in which every computer and network device is
connected to a single cable. It transmits the data from one end to another in a single
direction. No bi-directional feature is in bus topology. It is a multi-point connection
and a non-robust topology because if the backbone fails the topology crashes. In
Bus Topology, various MAC (Media Access Control) protocols are followed by
LAN ethernet connections like TDMA, Pure Aloha, CDMA, Slotted Aloha, etc.

Figure: A bus topology with shared backbone cable. The nodes are connected to
the channel via drop lines.
Advantages of this topology:
 If N devices are connected to each other in a bus topology, then the number
of cables required to connect them is 1, which is known as backbone cable, and
N drop lines are required.
 Coaxial or twisted pair cables are mainly used in bus based networks that
support up to 10 Mbps.
 The cost of the cable is less compared to other topologies, but it is used to
build small networks.
 Bus topology is familiar technology as installation and troubleshooting
techniques are well known.

Ring Topology:
In this topology, it forms a ring connecting devices with exactly two neighboring
devices.
A number of repeaters are used for Ring topology with a large number of nodes,
because if someone wants to send some data to the last node in the ring topology
with 100 nodes, then the data will have to pass through 99 nodes to reach the 100th
node. Hence to prevent data loss repeaters are used in the network.
The data flows in one direction, i.e.., it is unidirectional, but it can be made
bidirectional by having 2 connections between each Network Node, it is called Dual

20
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
Ring Topology. In-Ring Topology, the Token Ring Passing protocol is used by the
workstations to transmit the data.

Figure: A ring topology comprises 4 stations connected with each forming a ring.
The most common access method of ring topology is token passing.
 Token passing: It is network access method in which token is passed from
one node ton another node.
 Token: It is a frame that circulates around network.
The following operations take place in ring topology are :
1. One station is known as a monitor station which takes all the responsibility
to perform the operations.
2. To transmit the data, the station has to hold the token. After the transmission
is done, the token is to be released for other stations to use.
3. When no station is transmitting the data, then the token will circulate in the
ring.
4. There are two types of token release techniques: Early token release releases
the token just after transmitting the data and Delay token release releases the
token after the acknowledgment is received from the receiver.
Advantages of this topology:
 The data transmission is high-speed.
 The possibility of collision is minimum in this type of topology.
 Cheap to install and expand.
 It is less costly than a star topology.
21
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
Problems with this topology:
 The failure of a single node in the network can cause the entire network to
fail.
 Troubleshooting is difficult in this topology.
 The addition of stations in between or removal of stations can disturb the
whole topology.
 Less secure.

22
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

EXPERIMENT NO. 03

Aim: LAN installations and Configurations.

Theory: A LAN topology demonstrates how the nodes are linked in a network. It
defines the physical configuration of devices in a geographical area or the logical
process by which the system is set up. In the LAN network, the type of topology
will decide how data is being transmitted through.

LAN Configuration Procedure


 Select the "I/O" menu. Press [System] > I/O Config.
 Select the LAN Settings menu. Press the LAN Settings softkey. ...
 Press Modify Settings. To access most items on this screen, use the first softkey
to switch from DHCP to Manual. ...
 Establish an "IP Setup."
 Configure the "DNS Setup"

LAN, How to Set Up LAN Network?


 Identify the local services that you want available on the network. ...
 Identify how many devices will have to connect to the network. ...
 Run cables to workstations where possible. ...
 Select and purchase a switch or cable router. ...
 Configure the WAN port of the cable router.

23
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

EXPERIMENT NO.4

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

Theory: Error Correction codes are used to detect and correct the errors when data is
transmitted from the sender to the receiver.

Error Correction can be handled in two ways:

o Backward error correction: Once the error is discovered, the receiver


requests the sender to retransmit the entire data unit.
o Forward error correction: In this case, the receiver uses the error-correcting code which
automatically corrects the errors.

// C program for the above approach

#include <math.h>
#include <stdio.h>

// Store input bits


int input[32];

// Store hamming code


int code[32];

int ham_calc(int, int);


void solve(int input[], int);

// Function to calculate bit for


// ith position
int ham_calc(int position, int c_l)
{
int count = 0, i, j;
i = position - 1;

24
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

// Traverse to store Hamming Code


while (i < c_l) {

for (j = i; j < i + position; j++) {

// If current boit is 1
if (code[j] == 1)
count++;
}

// Update i
i = i + 2 * position;
}

if (count % 2 == 0)
return 0;
else
return 1;
}

// Function to calculate hamming code


void solve(int input[], int n)
{
int i, p_n = 0, c_l, j, k;
i = 0;

// Find msg bits having set bit


// at x'th position of number
while (n > (int)pow(2, i) - (i + 1)) {
p_n++;
i++;
}

c_l = p_n + n;

j = k = 0;

// Traverse the msgBits


25
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

for (i = 0; i < c_l; i++) {

// Update the code


if (i == ((int)pow(2, k) - 1)) {
code[i] = 0;
k++;
}

// Update the code[i] to the


// input character at index j
else {
code[i] = input[j];
j++;
}
}

// Traverse and update the


// hamming code
for (i = 0; i < p_n; i++) {

// Find current position


int position = (int)pow(2, i);

// Find value at current position


int value = ham_calc(position, c_l);

// Update the code


code[position - 1] = value;
}

// Print the Hamming Code


printf("\nThe generated Code Word is: ");
for (i = 0; i < c_l; i++) {
printf("%d", code[i]);
}
}

// Driver Code
26
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

void main()
{
// Given input message Bit
input[0] = 0;
input[1] = 1;
input[2] = 1;
input[3] = 1;

int N = 4;

// Function Call
solve(input, N);
}

Output:
The generated Code Word is: 0001111

27
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
EXPERIMENT NO. 05

Aim: Implement the data link layer framing methods such as and bit stuffing.

Theory: Program Code:


#include<stdio.h>
#include<string.h>
void main()
{
int a[20],b[30],i,j,k,count,n;
printf("Enter frame length:");
scanf("%d",&n);
printf("Enter input frame (0's & 1's only):");
for(i=0;i<n;i++)
scanf("%d",&a[i]);
i=0; count=1; j=0;
while(i<n)
{
if(a[i]==1)
{
b[j]=a[i];
for(k=i+1;a[k]==1 && k<n && count<5;k++)
{
j++;
b[j]=a[k];
count++;
if(count==5)
{
j++;
b[j]=0;
}
i=k;
}}
else
{
b[j]=a[i];
}
i++;
28
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
j++;
}
printf("After stuffing the frame is:");
for(i=0;i<j;i++)
printf("%d",b[i]);
}

Program Output:
Enter frame length:5
Enter input frame (0's & 1's only):
1
1
1
1
1
After stuffing the frame is:111110

29
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

EXPERIMENT NO. 06

Aim: Study of Tool Command Language (TCL).

Theory: Tool command language (Tcl) is a powerful scripting language with


programming features. It is available across Unix, Windows and Mac OS platforms.
Tcl is used for Web and desktop applications, networking, administration, testing,
rapid prototyping, scripted applications and graphical user interfaces (GUI).

Tcl features include:

 Complete Unicode and cross-platform usage


 Extensibility through Java and C++
 Integration with Windows GUI toolkit
 Data types, including source code, may be manipulated as strings.
 Event-driven interface to sockets and files
 Variadic function commands and interpreted language with bytecode
 Error message generation on incorrect usage by Tcl commands.
 FreeWrap TCLSH
 Berkeley Software Distribution (BSD) license
 Full development version

Tcl interfaces with the C language. Arrays of values that describe command
arguments are passed to the command implementation functions. Digital logic
simulators also include a Tcl scripting interface for Verilog, VHSIC hardware
description language (VHDL) and SystemVerilog hardware language
simulation. Tools like Simplified Wrapper and Interface Generator (SWIG) and
ffidl automatically generate the code required to connect arbitrary C functions
and Tcl runtime. Tcl scripts house command invocations as a list of words
separated by whitespace and terminated by a newline or semicolon.

Major substitutions supported by Tcl are command substitution, variable


substitution and backslash substitution. Additionally, there is a database access
interface for Tcl scripts that supports access drivers for MySQL, Open
30
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
Database Connectivity (ODBC), PostgreSQL and SQLite databases.

Tcl supports extension packages for additional functionality, including GUI,


terminal-based application automation and database access.

31
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

EXPERIMENT NO. 07

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


QualNetetc.

Theory: Network Simulator (Version 2), widely known as NS2, is


simply an event driven simulation tool that has proved useful in
studying the dynamic nature of communication networks. Simulation
of wired as well as wireless network functions and protocols (e.g.,
routing algorithms, TCP, UDP) can be done using NS2. In general,
NS2 provides users with a way of specifying such network protocols
and simulating their corresponding behaviors. Due to its flexibility and
modular nature, NS2 has gained constant popularity in the networking
research community since its birth in 1989. Basic Architecture of NS2:
The above figure shows the basic architecture of NS2. NS2 provides
users with an executable command ns which takes on input argument,
the name of a Tcl simulation scripting file. Users are feeding the name
of a Tcl simulation script (which sets up a simulation) as an input
argument of an NS2 executable command ns.
In most cases, a simulation trace file is created, and is used to plot
graph and/or to create animation. NS2 consists of two key languages:
C++ and Object-oriented Tool Command Language (OTcl). While the
C++ defines the internal mechanism (i.e., a backend) of the simulation
objects, the OTcl sets up simulation by assembling and configuring the
objects as well as scheduling discrete events (i.e., a frontend). The C+
+ and the OTcl are linked together using TclCL.
32
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
Mapped to a C++ object, variables in the OTcl domains are sometimes
referred to as handles. Conceptually, a handle (e.g., n as a Node
handle) is just a string (e.g.,_o10) in the OTcl domain, and does not
contain any functionality. instead, the functionality (e.g., receiving a
packet) is defined in the mapped C++ object (e.g., of class Connector).
In the OTcl domain, a handle acts as a frontend which interacts with
users and other OTcl objects.
It may defines its own procedures and variables to facilitate the
interaction. Note that the member procedures and variables in the
OTcl domain are called instance procedures (instprocs) and instance
variables (instvars), respectively

NS Simulator Preliminaries.
1. Initialization and termination aspects of the ns
simulator.
2. Definition of network nodes, links, queues and topology.
3. Definition of agents and of applications.
4. The nam visualization tool.
5. Tracing and random variables.

33
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

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

Theory:- The ONE is a simulation environment that is capable of

generating node movement using different movement models


routing messages between nodes with various DTN routing algorithms and sender and
receiver types
visualizing both mobility and message passing in real time in its graphical user
interface.
ONE can import mobility data from real-world traces or other mobility generators. It
can also produce a variety of reports from node movement to message passing and
general statistics.

The ONE is a simulation environment that is capable of

 generating node movement using different movement models

34
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
 routing messages between nodes with various DTN routing algorithms and
sender and receiver types
 visualizing both mobility and message passing in real time in its graphical user
interface.

To be equipped with the skills to do hands-on development and research with the
ONE, it is mandatory for the reader to understand how the ONE works internally. The
ONE Simulator is a simulation tool widely used by researchers working on research
related to Delay-Tolerant Networks and Opportunistic Networks. The
default_settings.txt file is essential for running the simulation. It is provided as default
with the ONE source code folder and contains some parameters with default values
initially. The code starts with initModel() which does initializations for the ONE. It
runs completely to set up a lot of the parameters and events. After initModel(),
runSim() is run which handles the running of the simulation.

35
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

EXPERIMENT NO. 09

Aim: - Configure 802.11 WLAN.

Theory: - WLAN Configuration Example


1. On the Navigation pane, click Configuration > Network > Network to visit the
Network page.
2. Select the ethernet0/1 interface and then click Edit. ...
3. Click OK to save the settings.
4. Select the wlan1 interface and then click Edit. ...
5. Select the Enable DNS checkbox.
6. Click DHCP. ...
7. Click Add.

Configure the 802.11b Interface Unit settings related to communication.

 This page is displayed when an 802.11b Interface Unit is installed.

IEEE 802.11b (Wireless LAN):


Shows whether the 802.11b Interface Unit is enabled or disabled.

36
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
Communication Mode:
Select a communication mode for the 802.11b Interface Unit from the drop-down
menu.

 802.11 Ad hoc mode:


A method to communicate with other computers from peer to peer without
having an access point. The same communication channel and SSID must be
used for all computers.
 Ad hoc mode:
A method to communicate with other computers from peer to peer without
having an access point. The same communication channel must be used for all
computers.
 Infrastructure mode:
A method to communicate with other computers via an access point. The SSID
must be the same as the one set for the access point.

Current SSID:
Shows the current SSID(Service Set ID).
This is called a Service Set ID and is used in the connection between the wireless
LAN client and the access point. Only a wireless LAN client and an access point that
have the same SSID can transmit to each other.

 This information appears if [802.11 Ad hoc mode] or [Infrastructure mode] is


selected in the [Communication Mode] list.

Selected SSID:
Input an SSID using alphanumeric characters. Up to 32 characters can be used.

37
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
If the SSID is not set and the transmission mode is "802.11 Ad hoc mode", the string
ASSID is used as the default SSID.

Channel:
If [Ad hoc mode] and [802.11 Ad hoc mode] is selected in the [Communication
Mode] list, select a communication channel from the drop-down menu.
The channel is a classification of radio frequency used for the wireless LAN.
Computers using the same channel can communicate with each other.

WEP Setting:
Drop Down Title that controls WEP Setting Status Either "Enable" or "Disable" is
displayed.
WEP is an encryption method that protects wireless data communication. To
communicate by encrypting data, both computers that are transmitting and receiving
the data must be set with the same WEP Key.
If you want to enable WEB encryption, select [Enable], and then make the [WEP
Key] settings as below.

WEP Key Status:


Displays WEP Key Status. Either "Not set" or "64 bit Key" or "128 bit Key" is
displayed.

WEP (Encryption) Key and Confirm WEP (Encryption) Key:


To enter the WEP Key against for confirmation. WEP Key cannot be set without
entering rhis item.

 64 bit Key:
To set 64 bit Key, entry of a 10-digit hexadecimal number required. Avoid

38
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
starting each WEP Key with "0x". The number entered will be shown like
"**********".
 128 bit Key:
To set 64 bit Key, entry of a 26-digit hexadecimal number required. The
security is stronger than the security with 64 bit Key. Avoid starting each WEP
Key with "0x". The number entered will be shown like "**********".

EXPERIMENT NO. 10

Aim: - Implement & simulate various types of routing algorithm.

Theory: - A routing algorithm is a procedure that lays down the route or path to
transfer data packets from source to the destination. They help in directing Internet
traffic efficiently. After a data packet leaves its source, it can choose among the many
different paths to reach its destination. Routing algorithm mathematically computes
the best path, i.e. “least – cost path” that the packet can be routed through.
Types of Routing Algorithms
Routing algorithms can be broadly categorized into two types, adaptive and
nonadaptive routing algorithms. They can be further categorized as shown in the
following diagram −

39
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

Adaptive Routing Algorithms


Adaptive routing algorithms, also known as dynamic routing algorithms, makes
routing decisions dynamically depending on the network conditions. It constructs the
routing table depending upon the network traffic and topology. They try to compute
the optimized route depending upon the hop count, transit time and distance.
The three popular types of adaptive routing algorithms are −
 Centralized algorithm − It finds the least-cost path between source and
destination nodes by using global knowledge about the network. So, it is also
known as global routing algorithm.
 Isolated algorithm − This algorithm procures the routing information by using
local information instead of gathering information from other nodes.
 Distributed algorithm − This is a decentralized algorithm that computes the
least-cost path between source and destination iteratively in a distributed
manner.
Non – Adaptive Routing Algorithms
Non-adaptive Routing algorithms, also known as static routing algorithms, construct
a static routing table to determine the path through which packets are to be sent. The

40
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
static routing table is constructed based upon the routing information stored in the
routers when the network is booted up.
The two types of non – adaptive routing algorithms are −
 Flooding − In flooding, when a data packet arrives at a router, it is sent to all
the outgoing links except the one it has arrived on. Flooding may be
uncontrolled, controlled or selective flooding.
 Random walks − This is a probabilistic algorithm where a data packet is sent
by the router to any one of its neighbours randomly.

EXPERIMENT NO. 11

Aim: - Simulation of MAC Protocols like Aloha, CSMA, CSMA/CD and CSMA/CA
using Standard Network Simulators.
Theory:- Data Link Layer
is used in a computer network to transmit the data between two devices or nodes. It
divides the layer into parts such as data link control and the multiple access
resolution/protocol. The upper layer has the responsibility to flow control and the
error control in the data link layer, and hence it is termed as logical of data link

41
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
control. Whereas the lower sub-layer is used to handle and reduce the collision or
multiple access on a channel. Hence it is termed as media access control
or the multiple access resolutions.
Data Link Control

A data link layer is a reliable channel for transmitting data over a dedicated link using
various techniques such as framing, error control and flow control of data packets in
the computer network.

multiple access protocol

When a sender and receiver have a dedicated link to transmit data packets, the data
link control is enough to handle the channel. Suppose there is no dedicated path to
communicate or transfer the data between two devices. In that case, multiple stations
access the channel and simultaneously transmits the data over the channel. It may
create collision and cross talk. Hence, the multiple access protocol is required to
reduce the collision and avoid crosstalk between the channels.

For example, suppose that there is a classroom full of students. When a teacher asks a
question, all the students (small channels) in the class start answering the question at
the same time (transferring the data simultaneously). All the students respond at the
same time due to which data is overlap or data lost. Therefore it is the responsibility
of a teacher (multiple access protocol) to manage the students and make them one
answer.

224.2K Vodafone has launches Pro II - The UK’s fastest WiFi tech

Following are the types of multiple access protocol that is subdivided into the
different process as:

42
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

A. Random Access Protocol

In this protocol, all the station has the equal priority to send the data over a channel.
In random access protocol, one or more stations cannot depend on another station nor
any station control another station. Depending on the channel's state (idle or busy),
each station transmits the data frame. However, if more than one station sends the
data over a channel, there may be a collision or data conflict. Due to the collision, the
data frame packets may be lost or changed. And hence, it does not receive by the
receiver end.

Following are the different methods of random-access protocols for broadcasting


frames on the channel.

o Aloha
o CSMA
o CSMA/CD
o CSMA/CA

ALOHA Random Access Protocol

It is designed for wireless LAN (Local Area Network) but can also be used in a
shared medium to transmit data. Using this method, any station can transmit data
across a network simultaneously when a data frameset is available for transmission.
43
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
Aloha Rules

1. Any station can transmit data to a channel at any time.


2. It does not require any carrier sensing.
3. Collision and data frames may be lost during the transmission of data through
multiple stations.
4. Acknowledgment of the frames exists in Aloha. Hence, there is no collision
detection.
5. It requires retransmission of data after some random amount of time.

Pure Aloha

Whenever data is available for sending over a channel at stations, we use Pure Aloha.
In pure Aloha, when each station transmits data to a channel without checking
whether the channel is idle or not, the chances of collision may occur, and the data
frame can be lost. When any station transmits the data frame to a channel, the pure
Aloha waits for the receiver's acknowledgment. If it does not acknowledge the
receiver end within the specified time, the station waits for a random amount of time,
called the backoff time (Tb). And the station may assume the frame has been lost or
destroyed. Therefore, it retransmits the frame until all the data are successfully
transmitted to the receiver.

1. The total vulnerable time of pure Aloha is 2 * Tfr.


2. Maximum throughput occurs when G = 1/ 2 that is 18.4%.
3. Successful transmission of data frame is S = G * e ^ - 2 G.

44
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

EXPERIMENT NO. 12

Aim: - Study of Application layer protocols-DNS, HTTP, HTTPS, FTP and TelNet.

Theory:- Application layer protocols define how application processes (clients and
servers), running on different end systems, pass messages to each other. In particular,
an application layer is an abstract layer that handles the sharing protocol of the
45
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
TCP/IP and OSI model.

The application layer protocols used to make communication between sender and
receiver faster, more efficient, reliable, and secure. These protocols will be discussed
further below.

 SMTP
 TELNET
 FTP
 MIME
 POP
 HTTP
 DNS

Terminal Network(TELNET)

TELNET is an application layer protocol in which a client-server application allows a


user to log onto a remote machine and lets the user access any application program on
a remote computer. TELNET uses the NVT (Network Virtual Terminal) system to
encode characters on the local system.
46
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
File Transfer Protocol(FTP)

FTP is the standard mechanism provided by TCP/IP for copying a file from one host
to another. FTP differs from other client-server applications because it establishes 2
connections between hosts. Two connections are Data Connection and Control
Connection.

Hypertext Transfer Protocol(HTTP)

Hypertext Transfer Protocol(HTTP) is used mainly to access World Wide Web


(www) data. The Hypertext Transfer Protocol (HTTP) is the Web's main application-
layer protocol, although current browsers can access other types of servers. A
repository of information spread all over the world and linked together.

Domain Name System(DNS)

In Domain Name System(DNS), TCP/IP protocol uses the IP address that uniquely
identifies a host's connection to the Internet to identify an entity. DNS is a hierarchical
system based on a distributed database that uses a hierarchy of Name Servers to
resolve Internet host names into the corresponding IP addresses required for packet
routing by issuing a DNS query to a name server.

DNS in the Internet: DNS is a protocol that can be used on different platforms.

Domain name space is divided into three categories.

 Generic Domain: The generic domain defines registered hosts according to


their generic behavior. Each node in the tree defines a domain which is an
index to the domain name space database.

47
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
 Country Domain: The country domain section follows the same format as the
generic domain but uses 2 characters of country abbreviations (e.g., the US for
the United States) instead of 3 characters.
 Inverse Domain: The inverse domain maps an address to a name.

EXPERIMENT NO. 13

Aim: - Demonstrate the steps to configure static NAT on Cisco devices through CLI.

This tutorial explains Static NAT configuration in detail. Learn how configure static NAT, map
address (inside local address, outside local address, inside global address and outside global
address), debug and verify Static NAT translation step by step with practical examples in packet
tracer.

48
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
In order to configure NAT we have to understand four basic terms; inside local, inside global,
outside local and outside global. These terms define which address will be mapped with which
address.

Term Description
Inside Local IP Address Before translation source IP address located inside the local network.
Inside Global IP Address After translation source IP address located outside the local network.
Outside Global IP Address Before translation destination IP address located outside the remote network.
Outside Local IP Address After translation destination IP address located inside the remote network.

Static NAT Practice LAB Setup


To explain Static NAT Configuration, I will use packet tracer network simulator software. You can
use any network simulator software or can use real Cisco devices to follow this guide. There is no
difference in output as long as your selected software contains the commands explained in this
tutorial.

Create a practice lab as shown in following figure or download this pre-created practice lab and load
in packet tracer

If require, you can download the latest as well as earlier version of Packet Tracer from here. Download Packet Tracer

Initial IP Configuration
Device / Interface IP Address Connected With
Laotop0 10.0.0.10/8 Fa0/0 of R0
Laptop1 10.0.0.20/8 Fa0/0 of R0
Laptop2 10.0.0.30/8 Fa0/0 of R0
Server0 192.168.1.10/24 Fa0/0 of R1

49
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
Device / Interface IP Address Connected With
Serial 0/0/0 of R1 100.0.0.1/8 Serial 0/0/0 of R2
Serial 0/0/0 of R2 100.0.0.2/8 Serial 0/0/0 of R2

To assign IP address in Laptop click Laptop and click Desktop and IP configuration and
Select Static and set IP address as given in above table.

Following same way configure IP address in Server.

50
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

To configure IP address in Router1 click Router1 and select CLI and press Enter key.

Two interfaces of Router1 are used in topology; FastEthernet0/0 and Serial 0/0/0.

By default interfaces on router are remain administratively down during the start up. We need to
configure IP address and other parameters on interfaces before we could actually use them for
routing. Interface mode is used to assign the IP address and other parameters. Interface mode can be
accessed from global configuration mode. Following commands are used to access the global
configuration mode.

Router>enable
Router# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#
Before we configure IP address in interfaces let’s assign a unique descriptive name to router.

Router(config)#hostname R1
51
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
R1#
Now execute the following commands to set IP address in FastEthernet 0/0 interface.

R1(config)#interface FastEthernet0/0
R1(config-if)#ip address 10.0.0.1 255.0.0.0
R1(config-if)#no shutdown
R1(config-if)#exit
interface FastEthernet 0/0 command is used to enter in interface mode.

ip address 10.0.0.1 255.0.0.0 command assigns IP address to interface.

no shutdown command is used to bring the interface up.

exit command is used to return in global configuration mode.

Serial interface needs two additional parameters clock rate and bandwidth. Every serial cable has
two ends DTE and DCE. These parameters are always configured at DCE end.

We can use show controllers interface command from privilege mode to check the cable’s end.

R1(config)#exit
R1#show controllers serial 0/0/0
Interface Serial0/0/0
Hardware is PowerQUICC MPC860
DCE V.35, clock rate 2000000
[Output omitted]
Fourth line of output confirms that DCE end of serial cable is attached. If you see DTE here instead
of DCE skip these parameters.

Now we have necessary information let’s assign IP address to serial interface.

R1#configure terminal
R1(config)#interface Serial0/0/0
R1(config-if)#ip address 100.0.0.1 255.0.0.0
R1(config-if)#clock rate 64000
R1(config-if)#bandwidth 64
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#
Router#configure terminal Command is used to enter in global configuration mode.

Router(config)#interface serial 0/0/0 Command is used to enter in interface mode.

Router(config-if)#ip address 100.0.0.1 255.0.0.0 Command assigns IP address to interface.

52
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
Router(config-if)#clock rate 64000

In real life environment this parameter controls the data flow between serial links and need to be set
at service provider’s end. In lab environment we need not to worry about this value. We can use any
valid rate here.

Router(config-if)#bandwidth 64

Bandwidth works as an influencer. It is used to influence the metric calculation of EIGRP or any
other routing protocol which uses bandwidth parameter in route selection process.

Router(config-if)#no shutdown Command brings interface up.

Router(config-if)#exit Command is used to return in global configuration mode.

We will use same commands to assign IP addresses on interfaces of Router2. We need to provided
clock rate and bandwidth only on DCE side of serial interface. Following command will assign IP
addresses on interface of Router2.

Initial IP configuration in R2
Router>enable
Router#configure terminal
Router(config)#hostname R2
R2(config)#interface FastEthernet0/0
R2(config-if)#ip address 192.168.1.1 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface Serial0/0/0
R2(config-if)#ip address 100.0.0.2 255.0.0.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#
That’s all initial IP configuration we need. Now this topology is ready for the practice of static nat.

Configure Static NAT


Static NAT configuration requires three steps: -

1. Define IP address mapping


2. Define inside local interface
3. Define inside global interface

Since static NAT use manual translation, we have to map each inside local IP address (which needs
a translation) with inside global IP address. Following command is used to map the inside local IP
address with inside global IP address.

53
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
Router(config)#ip nat inside source static [inside local ip address] [inside global IP address]
For example in our lab Laptop1 is configured with IP address 10.0.0.10. To map it with 50.0.0.10 IP
address we will use following command

Router(config)#ip nat inside source static 10.0.0.10 50.0.0.10


In second step we have to define which interface is connected with local the network. On both
routers interface Fa0/0 is connected with the local network which need IP translation.

Following command will define interface Fa0/0 as inside local.

Router(config-if)#ip nat inside


In third step we have to define which interface is connected with the global network. On both
routers serial 0/0/0 interface is connected with the global network. Following command will define
interface Serial0/0/0 as inside global.

Router(config-if)#ip nat outside


Following figure illustrates these terms.

Let’s implement all these commands together and configure the static NAT.

R1 Static NAT Configuration


R1(config)#ip nat inside source static 10.0.0.10 50.0.0.10
R1(config)#interface FastEthernet 0/0
R1(config-if)#ip nat inside
R1(config-if)#exit
R1(config)#
R1(config)#interface Serial 0/0/0
R1(config-if)#ip nat outside
R1(config-if)#exit
54
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
For testing purpose I configured only one static translation. You may use following commands to
configure the translation for remaining address.

R1(config)#ip nat inside source static 10.0.0.20 50.0.0.20


R1(config)#ip nat inside source static 10.0.0.30 50.0.0.30

R2 Static NAT Configuration


R2(config)#ip nat inside source static 192.168.1.10 200.0.0.10
R2(config)#interface FastEthernet 0/0
R2(config-if)#ip nat inside
R2(config-if)#exit
R2(config)#
R2(config)#interface Serial 0/0/0
R2(config-if)#ip nat outside
R2(config-if)#exit
Before we test this lab we need to configure the IP routing. IP routing is the process which allows
router to route the packet between different networks. Following tutorial explain routing in detail
with examples

Configure static routing in R1


R1(config)#ip route 200.0.0.0 255.255.255.0 100.0.0.2
Configure static routing in R2
R2(config)#ip route 50.0.0.0 255.0.0.0 100.0.0.1

Testing Static NAT Configuration


In this lab we configured static NAT on R1 and R2. On R1 we mapped inside local IP address
10.0.0.10 with inside global address 50.0.0.10 while on R2 we mapped inside local IP address
192.168.1.10 with inside global IP address 200.0.0.10.

Device Inside Local IP Address Inside Global IP Address


Laptop0 10.0.0.10 50.0.0.10
Server 192.168.1.10 200.0.0.10
To test this setup click Laptop0 and Desktop and click Command Prompt.

 Run ipconfig command.


 Run ping 200.0.0.10 command.
 Run ping 192.168.1.10 command.

55
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

First command verifies that we are testing from correct NAT device.

Second command checks whether we are able to access the remote device or not. A ping reply
confirms that we are able to connect with remote device on this IP address.

Third command checks whether we are able to access the remote device on its actual IP address or
not. A ping error confirms that we are not able to connect with remote device on this IP address.

Let’s do one more testing. Click Laptop0 and click Desktop and click Web Browser and access
200.0.0.10.

56
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

Above figure confirms that host 10.0.0.10 is able to access the 200.0.0.10.

Now run ping 200.0.0.10 command from Laptop1.

Why we are not able to connect with the remote device from this host?

Because we configured NAT only for one host (Laptop0) which IP address is 10.0.0.10. So only the
host 10.0.0.10 will be able to access the remote device.

To confirm it again, let’s try to access web service from this host.

57
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

If you followed this tutorial step by step, you should get the same output of testing. Although it’s
very rare but some time you may get different output. To figure out what went wrong you can use my
practice topology with all above configuration. Download my practice topology

We can also verify this translation on router with show ip nat translation command.

Following figure illustrate this translation on router R1.

Following figure illustrate this translation on router R2

Pay a little bit extra attention on outside local address filed. Have you noticed one interesting
feature of NAT in above output? Why actual outside local IP address is not listed in this filed?
58
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
The actual IP address is not listed here because router is receiving packets after the translation. From
R1’s point of view remote device’s IP address is 200.0.0.10 while from R2’s point of view end
device’s IP address is 50.0.0.10.

This way if NAT is enabled we would not be able to trace the actual end device.

59
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

EXPERIMENT NO. 14

Aim: - Demonstrate the uses of Omnet++.

2.1 Supported Windows Versions


OMNeT++ is supported only on 64-bit versions of Windows.
Note: 32-bit Windows versions are no longer supported. If you need 32-bit builds on
Windows, we recommend using OMNeT++ 5.0

2.2 Installing OMNeT++


Download the OMNeT++ source code from https://omnetpp.org. Make sure you select the
Windows-specific archive, named omnetpp-6.0-windows-x86_64.zip.
The package is self-contained: in addition to OMNeT++ files it includes a C++ compiler, a
command-line build environment, and all libraries and programs required by OMNeT++.
Copy the OMNeT++ archive to the directory where you want to install it. Choose a directory
whose full path does not contain any space; for example, do not put OMNeT++ under
Program Files.
Extract the zip file. To do so, right-click the zip file in Windows Explorer, and select Extract
All from the menu. You can also use external programs like Winzip or 7zip.
When you look into the new omnetpp-6.0 directory, should see directories named doc,
images, include, tools, etc., and files named mingwenv.cmd, configure, Makefile, and
others.

2.3 Configuring and Building OMNeT++


Start mingwenv.cmd in the omnetpp-6.0 directory by double-clicking it in Windows Explorer.
It will bring up a console with the MSYS bash shell, where the path is already set to include
the omnetpp-6.0/bin directory. On the first start of the shell, you may need to wait for the
extraction of the tools directory.
Note: If you want to start simulations from outside the shell as well (for example from
Explorer), you need to add OMNeT++’s bin directory and also the bin directories in the tools
folder to the path; instructions are provided later.
First, check the contents of the configure.user file to make sure it contains the settings
you need. In most cases you don’t need to change anything.
3
Installation Guide, Release 6.0
notepad configure.user
Then enter the following commands:
$ ./configure
$ make
The build process will create both debug and release binaries.

2.4 Verifying the Installation


You should now test all samples and check they run correctly. As an example, the aloha
example is started by entering the following commands:
$ cd samples/aloha
$ ./aloha
By default, the samples will run using the graphical Qtenv environment. You should see GUI
60
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
windows and dialogs.
2.5 Starting the IDE
OMNeT++ comes with an Eclipse-based Simulation IDE. You should be able to start the IDE
by typing:
$ omnetpp
We recommend that you start the IDE from the command-line. You can also create a shortcut
for starting the IDE. To do so, locate the opp_ide.exe program in the omnetpp-6.0/ide
directory in Windows Explorer, right-click it, and choose Send To > Desktop (create shortcut)
from the menu. You can right-click the taskbar icon while the IDE is running, and select Pin
this program to taskbar from the context menu.

2.6 Environment Variables


In general OMNeT++ requires that certain environment variables are set. Always use the the
provided shell window to start the IDE or your simulations.

2.7 Reconfiguring the Libraries


If you need to recompile the OMNeT++ components with different flags (e.g. different optimization),
then change the top-level OMNeT++ directory, edit configure.user accordingly,
then type:
$ ./configure
$ make clean
$ make
If you want to recompile just a single library, then change to the directory of the library (e.g.
cd src/sim) and type:
4 Chapter 2. Windows - Using the MinGW64 Compiler Toolchain
Installation Guide, Release 6.0
$ make clean
$ make
By default, libraries are compiled in both debug and release mode. If you want to make
release or debug builds only, use:
$ make MODE=release
or
$ make MODE=debug
By default, shared libraries will be created. If you want to build static libraries, set
SHARED_LIBS=no in configure.user and re-configure your project.
Note: The built libraries and programs are immediately copied to the lib/ and bin/ subdirs.

2.8 Portability Issues


OMNeT++ has been tested with both the gcc and the clang compiler from the MinGW-w64
package.
Microsoft Visual C++ is not supported in the Academic Edition.

2.9 Additional Packages


2.9.1 MPI
MPI is only needed if you would like to run parallel simulations.
There are several MPI implementations for Windows, and OMNeT++ does not mandate any
specific one. We recommend DeinoMPI, which can be downloaded from http://mpi.deino.net.
After installing DeinoMPI, adjust the MPI_DIR setting in OMNeT++’s configure.user, and
reconfigure and recompile OMNeT++:

61
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
$ ./configure
$ make cleanall
$ make
Note: In general, if you would like to run parallel simulations, we recommend that you use
Linux, macOS, or another unix-like platform.
2.8. Portability Issues 5
Installation Guide, Release 6.0
2.9.2 Akaroa
Akaroa 2.7.9, which is the latest version at the time of writing, does not support Windows.
You may try to port it using the porting guide from the Akaroa distribution.
6

62

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy