Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

CN Lab Manual

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 55

Dept of MCA Computer Networking

GUJARAT TECHNOLOGICAL UNIVERSITY


Chandkheda, Ahmedabad

B. H. Gardi College of Engineering & Technology

Subject : Computer Networking (629404)

MCA, Semester - II.

LAB MANUAL

Prof. Rahul
Meghani (Faculty
Guide)

Prof. Jalpesh Ghumaliya


(Head of the Department)

Academic Year (2023-2024)


Dept of MCA Computer Networking

B. H. Gardi College of Engineering &


Technology

This is to certify that Mr./Ms. of semester

branch Enrolment no. has satisfactorily completed

his/her term work in the subject of for the

term ending in 2024.

Date:

Subject In-charge Head of Department


Dept of MCA Computer Networking

INDEX
Sr. Date Experiment/Practical Title Page Grade Sign
No.
1 Introduction to Networking Simulator Packet Tracer.

2
To Perform Simple Data Communication using
Switch with the help of Packet Tracer.

3
To Perform Router Port Configuration using Packet
Tracer.
4
To Configure Network using Static Routing with the
help
of Packet Tracer.
5
To Configure Network using Distance Vector Routing
Algorithm with the help of Packet Tracer(RIP
Protocol). .
6
To Configure Network using Link State Vector
Routing Algorithm with the help of Packet Tracer.
(IGRP Protocol).
7
To Configure Network using Open Shortest
Path First Protocol with the help of Packet
Tracer.
8
Configuration of Virtual LAN with help of Packet
Tracer.
9
To take backup of IOS (Internet Operating System)
image from a working CISCO router and to install the
same in a crashed CISCO router.
10
Introduction to Network Simulator 2(NS2).
11
Installation of NS2 in LINUX Operating System.
Dept of MCA Computer Networking

Experiment 1

AIM: Introduction to Networking Simulator Packet Tracer.

Objective:
1. To become familiar with the network simulator Packet Tracer.
2. To use the packet tracer to simulate a simple network.

What is Packet Tracer?

Packet Tracer is a protocol simulator developed by Dennis Frezzo and his team at Cisco Systems.
Packet Tracer (PT) is a powerful and dynamic tool that displays the various protocols used in
networking, in either Real Time or Simulation mode. This includes layer 2 protocols such as
Ethernet and PPP, layer 3 protocols such as IP, ICMP, and ARP, and layer 4 protocols such
as TCP and UDP. Routing protocols can also be traced.

Purpose:

The purpose of this lab is to become familiar with the Packet Tracer interface. Learn
how to use existing topologies and build your own.

Requisite knowledge:

This lab assumes some understanding of the Ethernet protocol. At this point we have not
discussed other protocols, but will use Packet Tracer in later labs to discuss those as
well.

Version:

This lab is based on Packet Tracer 4.0 Beta, Test1.


Dept of MCA Computer Networking

Introduction to the Packet Tracer Interface using a Hub

Topology Step 1: Start Packet Tracer and Entering Simulation

Mode

Step 2: Choosing Devices and Connections

We will begin building our network topology by selecting devices and the media in
which to connect them. Several types of devices and network connections can be used.
For
this lab we will keep it simple by using End Devices, Switches, Hubs, and Connections.
Single click on each group of devices and connections to display the various choices.
Dept of MCA Computer Networking

Step 3: Building the Topology – Adding Hosts Single click on the End Devices.

Move the cursor into topology area. You will notice it turns into a plus “+” sign.
Single click in the topology area and it copies the device.
Dept of MCA Computer Networking

Step 4: Building the Topology – Connecting the Hosts to Hubs and Switches.

Adding a Hub Select a hub, by clicking once on Hubs and once on a Generic hub.

Perform the following steps to connect PC0 to Hub0:


1. Click once on PC0
2. Choose FastEthernet
3. Drag the cursor to Hub0
4. Click once on Hub0 and choose Port 0
5. Notice the green link lights on both the PC0 Ethernet NIC and the Hub0 Port 0 showing
6. that the link is active.
Dept of MCA Computer Networking
Dept of MCA Computer Networking

Adding a Switch Select a switch, by clicking once on Switches and once on a 2950-24 switch.

Add the switch by moving the plus sign “+” below PC2 and PC3 and click once.

Click once Connect PC2 to Hub0 by first choosing Connections.


Dept of MCA Computer Networking

Perform the following steps to connect PC2 to Switch0:


1. Click once on PC2
2. Choose FastEthernet
3. Drag the cursor to Switch0
4. Click once on Switch0 and choose FastEthernet0/1
5. Notice the green link lights on PC2 Ethernet NIC and amber light Switch0 FastEthernet0/1
port. The switch port is temporarily not forwarding frames, while it goes through
the stages for the Spanning Tree Protocol (STP) process.
6. After a about 30 seconds the amber light will change to green indicating that the port
has entered the forwarding stage. Frames can now forwarded out the switch port.
Dept of MCA Computer Networking

Step 5: Configuring IP Addresses and Subnet Masks on the Hosts

Before we can communicate between the hosts we need to configure IP Addresses and Subnet
Masks on the devices. Click once on PC0.
Dept of MCA Computer Networking

Choose the Config tab. It is here that you can change the name of PC0. It is also here where
you would enter a Gateway IP Address, also known as the default gateway. We will discuss
this later, but this would be the IP address of the local router. If you want, you can enter the
IP Address 172.16.1.1, although it will not be used in this lab.

Click on FastEthernet. Although we have not yet discussed IP Addresses, add the IP
Address to 172.16.1.10. Click once in the Subnet Mask field to enter the default Subnet
Mask. You can leave this at 255.255.0.0. We will discuss this later.
Dept of MCA Computer Networking

Also, notice this is where you can change the Bandwidth (speed) and Duplex of the
Ethernet NIC (Network Interface Card). The default is Auto (autonegotiation), which means the
NIC will negotiate with the hub or switch. The bandwidth and/or duplex can be manually set by
removing the check from the Auto box and choosing the specific option.

Bandwidth - Auto

If the host is connected to a hub or switch port which can do 100 Mbps, then the Ethernet NIC
on the host will choose 100 Mbps (Fast Ethernet). Otherwise, if the hub or switch port can only
do 10 Mbps, then the Ethernet NIC on the host will choose 10 Mbps (Ethernet).

Duplex - Auto

Hub: If the host is connected to a hub, then the Ethernet NIC on the host will choose Half Duplex.

Switch: If the host is connected to a switch, and the switch port is configured as Full Duplex (or
Autonegotiation), then the Ethernet NIC on the host will choose Full Duplex. If the switch port is configured
as Half Duplex, then the Ethernet NIC on the host will choose Half Duplex. (Full Duplex is a much more
efficient option.)
The information is automatically saved when entered.
Dept of MCA Computer Networking

Repeat these steps for the other hosts. Use the information below for IP Addresses and Subnet Masks.
H IP Subnet Mask
o Address
s
t
P 172.16.1. 255.255.0.0
C 10
0
P 172.16.1. 255.255.0.0
C 11
1
P 172.16.1. 255.255.0.0
C 12
2
P 172.16.1. 255.255.0.0
C 13
3

Verify the information

To verify the information that you entered, move the Select tool (arrow) over each host.

Deleting a Device or Link

To delete a device or link, choose the Delete tool and click on the item you wish to delete.

Step 6: Connecting Hub0 to Switch0


To connect like-devices, like a Hub and a Switch, we will use a Cross-over cable. Click once the Cross-over
Cable from the Connections options.
Dept of MCA Computer Networking

Move the Connections cursor to Switch0.

Click once on Switch0 and choose FastEthernet0/4 (actual port does not matter).
Dept of MCA Computer Networking

The link light for switch port FastEthernet0/4 will begin as amber and eventually change to green as the
Spanning Tree Protocol transitions the port to forwarding.

Network Simulation

In this part, we are going to use the simulator to simulate traffic between hosts. For this scenario, delete the
switch and host PC3, then connect host PC2 to the hub.

Task 1 Observe the flow of data from PC0 to PC1 by creating network traffic.
Dept of MCA Computer Networking

a. Switch to Simulation Mode by selecting the tab that is partially hidden behind the Real Time tab in
the bottom right-hand corner. The tab has the icon of a stopwatch on it.

NOTE: When Simulation Mode is chosen, a Simulation Panel will appear on the right side of the screen.
This panel can be moved by moving the cursor at the top of the panel until it changes and then double-
clicking on it. The panel can be restored to the original location by double-clicking on the Title bar. If the
panel is closed, click on the Event List button.

b. Click on Edit Filters, and then select All/None to deselect every filter. Then choose ARP and ICMP
and click in the workspace to close the Edit Filters window.

c. Select a Simple PDU by clicking the closed envelope in the Common Tools Bar on the right.

Move to PC0 and click to establish the source. Move to PC1 and click to establish the destination. Notice that
two envelopes are now positioned beside PC0. This is referred to as a data traffic scenario. One envelope is
an ICMP packet, while the other is an ARP packet. The Event List in the Simulation Panel will identify
exactly which envelope represents ICMP and which represents an ARP.
Dept of MCA Computer Networking

A scenario may be deleted by clicking on the Delete button in the Scenario panel.

Multiple scenarios can be created by clicking on the New button in the Scenario panel. The scenarios can
then be toggled between without deleting.

d. Select Auto Capture / Play from the Simulation Panel Play Controls.

Below the Auto Capture / Play button is a horizontal bar, with a vertical button that controls the speed of the
simulation. Dragging the button to the right will speed up the simulation, while dragging is to the left will
slow down the simulation.

e. Choose the Reset Simulation button in the Simulation window.

Notice that the ARP envelope is no longer present. This has reset the simulation but has not cleared any
configuration changes or MAC / ARP table entries.

f. Choose the Capture / Forward button.


Dept of MCA Computer Networking

Notice that the ICMP envelope moved forward one device and stopped. The Capture / Forward button will
allow you to move the simulation one step at a time.

g. Choose the Power Cycle Devices button on the bottom left, above the device icons.
h. Choose yes

Notice that both the ICMP and ARP envelopes are now present. The Power Cycle Devices will clear any
configuration changes not saved and clear the MAC / ARP tables.

Task 2 View ARP Tables on each PC.

a. Choose the Auto Capture / Play button and allow the simulation to run completely.
b. Click on PC-0 and select the Desktop tab.

c. Select the Command Prompt and type the command arp -a.
d. Notice that the MAC address for PC2 is in the ARP table (to view the MAC address of PC2, click on
PC2 and select the Config tab).
e. To examine the ARP tables for PC1 and PC2in another way, click on the Inspect Tool.
Dept of MCA Computer Networking

Then click on PC1 and the ARP table will appear in a new window.

Note that PC2 does not have an entry in the ARP table yet. Close the ARP Table window.

f. Click on PC2 to view the ARP table. Then close the ARP Table window.

NOTE: To deactivate the Inspect Tool, click on the Select Tool

Task 3 Adding routers and installing modules

a. In the Network Component Box, click on the router.

b. Select an 1841 router.


Dept of MCA Computer Networking

c. Move the cursor to the Logical Workspace and click on the desired location.

NOTE: If multiple instances of the same device are needed press and hold the Ctrl button, click on the
desired device, and then release the Ctrl button. A copy of the device will be created and can now be move
to the desired location.

d. Click on the router to bring up the Configuration Window. This window has three modes.

Physical, Config, and CLI (Physical is the default mode).

The Physical mode is used to add modules to a device, such as a WAN Interface Card (WIC). The Config
mode is used for basic configuration. Commands are entered in a simple GUI format, with actual equivalent
IOS commands shown in the lower part of the window. The CLI mode allows for advanced configuration of
the device. This mode requires the user to enter the actual IOS commands just as they would on a live device.

e. In the Physical mode, click on the router power switch to turn the device off.

f. Select the WIC-2T module and drag it to Slot 0 on the router. Then drag a WIC Cover to Slot1.
Dept of MCA Computer Networking

g. Power the device back on.


h. Click on the Network Component Box and select Connections. Then select a Copper Straight-through
connection to connect the router to the hub.

NOTE: The Smart Connection can be used to automatically select the appropriate cable type. However, the
user will have no choice as to which interface the connection is assigned to; it will take the first available
appropriate interface.

i. Click on the hub and choose Port 3. Then click on the router and choose interface FastEthernet 0/0.

Task 4 Basic router configuration

a. Click on the Config mode tab of Router0 to begin configuring the device.
b. After the device has finished booting, change the display name of the router to CISCO_1. Changing
the display name does not affect the configuration.

NOTE: If the device hangs up in the booting process, save the activity. Then close the application and
reopen the file.

c. Click in the Hostname field and type CISCO_1, then press the TAB key. Note the equivalent IOS
command is entered in the lower portion of the window.
d. Click on interface FastEthernet 0/0 and assign the IP address 192.168.1.1, then press the TAB key.
Enter the subnet mask 255.255.255.0.
Dept of MCA Computer Networking

e. Click the Port Status to On to enable the port (no shutdown).

Task 5 Create a copy of the existing router complete with WIC modules already in place

a. Make sure that the existing router is selected (it will be grayed out).
b. In the Main Tool Bar click on the Copy tool.

c. Click on the Paste tool and the copied device will appear in the work area.

d. Drag the new device to the desired location.


e. Click on the Network Component Box and select Connections. Then select the Serial DCE
connection.

f. Click on the CISCO_1 router and connect to the Serial 0/0/0 interface.
g. Click on the new router (copy CISCO_1) and connect to the Serial 0/0/0 interface.
Dept of MCA Computer Networking

Task 6 Configuring the WAN link


a. Click on the CISCO_1 router and select the Config mode.
b. Select interface Serial 0/0/0.
c. Configure the interface Serial 0/0/0 with the IP address 192.168.2.1, then press the TAB key and
enter the subnet mask 255.255.255.0 on the interface.
d. Set the clock rate to 56000.
e. Click the Port Status to On to enable the port (no shutdown).
f. Click on the new router and select the Config mode.
g. Change the Display Name and Hostname to CISCO_2.
h. Configure the interface Serial 0/0/0 with the IP address 192.168.2.2, then press the TAB key and
enter the subnet mask 255.255.255.0 on the interface.
i. Click the Port Status to On to enable the port (no shutdown).
NOTE: The link lights on the serial link should change from red to green to indicate the link is active.

Task 7 Configure the routing protocol


a. Click on the CISCO_1 router and select the Config tab. Then click on RIP and add the network
address 192.168.1.0 and 192.168.2.0.
b. Click on the CISCO_2 router and select the Config tab. Then click on RIP and add the network
address 192.168.2.0.
c. Go to each PC and set the Default Gateway to 192.168.1.1.

Task 8 Set the default gateway on the PCs


a. Click on PC0 and select the Config tab. Enter the default gateway address 192.168.1.1.
b. Click on PC1 and select the Config tab. Enter the default gateway address 192.168.1.1.
c. Click on PC2 and select the Config tab. Enter the default gateway address 192.168.1.1.

Task 9 Test the connectivity of the network


a. Click on the Simulation mode.

b. Select a Simple PDU and click on PC-A as the source, then click on Cisco_2 as the destination. The
ping should be successful.
Dept of MCA Computer Networking

Task 10 Save the Packet Tracer file


a. Save the Packet Tracer file as PT Basic.

CONCLUSION:

The Practical activities provide using cisco Packet Tracer successfully helped students understand the basic
concepts of networking and improve student achievement as reported in CORR.
Dept of MCA Computer Networking

Experiment 2

AIM: To Perform Simple Data Communication using Switch with the help of
Packet Tracer.

Step 1: Forms Simple networks using end Devices, Switches and Cables.

Refers all steps of Experiment 1. By adding end devices and Switches, connecting though cable. Form
Simple Networks which will become like the below figure.

Step 2: Assign IP Address to each PC with Same Network Address.

H IP Subnet Mask
o Address
s
t
P 192.168. 255.255.255.0
C 10.1
0
P 192.168. 255.255.255.0
C 10.2
1
P 192.168. 255.255.255.0
C 10.3
2
Dept of MCA Computer Networking

P 192.168. 255.255.255.0
C 10.4
3
P 192.168. 255.255.255.0
C 10.5
4
P 192.168. 255.255.255.0
C 10.6
5
P 192.168. 255.255.255.0
C 10.7
6
P 192.168. 255.255.255.0
C 10.8
7
P 192.168. 255.255.255.0
C 10.9
8
P 192.168. 255.255.255.0
C 10.10
9
P 192.168. 255.255.255.0
C 10.11
1
0
P 192.168. 255.255.255.0
C 10.12
1
1
Dept of MCA Computer Networking

Step 3: Check connectivity by ping Command on Command Prompt.


PC>ping 192.168.10.1

Conclusion:

Cisco Packet Tracer is a tool built by Cisco and it Provides network simulation to practice simple and
complex network.
Dept of MCA Computer Networking

Experiment 3

AIM: To Perform Router Port Configuration using Packet Tracer.

Objectives:
● Connect a router/switch and computer using a console cable.
• Configure Packet Tracer Terminal to establish a console session with a Cisco IOS Router/Switch.
• Configure HyperTerminal to establish a console session with a Cisco IOS router/switch.
• Configure Cisco router global configuration settings.

Theory
Command Interface User Levels.
The following figure illustrates the different user levels provided by IOS.

Cisco IOS Command Modes


The following table contains the different IOS command modes, their roles and the shape of the command prompt that
illustrates the mode. Make sure to study this table carefully as it is essential for proper working with Cisco routers and
switches.
Dept of MCA Computer Networking

Router Configuration States


User Exec Mode
The user EXEC mode is entered when the router is accessed via a serial connection or when accessing the router via
telnet.
• The command prompt of the user EXEC mode is:
Router1>
• The user EXEC mode only offers a small set of commands, such as ping, telnet, and traceroute.
• Configuration parameters cannot be read or modified in this mode
• Logging the user off, type:
Router1> exit

Privileged EXEC Mode


• To change or view configuration information of a router, user must enter system administrator mode
called Privileged EXEC Mode
• The privileged EXEC mode is used to read configuration files, reboot the router, and set operating parameters.
• Entering the privileged EXEC mode requires to type a password, called the enable secret.
Dept of MCA Computer Networking

User Exec Mode


The user EXEC mode is entered when the router is accessed via a serial connection or when accessing the router via
telnet.
• The command prompt of the user EXEC mode is:
Router1>
• The user EXEC mode only offers a small set of commands, such as ping, telnet, and traceroute.
• Configuration parameters cannot be read or modified in this mode
• Logging the user off, type:
Router1> exit
Privileged EXEC Mode
• To change or view configuration information of a router, user must enter system administrator mode
called Privileged EXEC Mode
• The privileged EXEC mode is used to read configuration files, reboot the router, and set operating parameters.
• Entering the privileged EXEC mode requires to type a password, called the enable secret.

The privileged EXEC mode is entered by this command: Router1>enable If a password is set, then the system will
require it at this stage. Typing the password displays the following command prompt: Router1# For logging off, type:
Router1#disable

Global Configuration Mode


• The global configuration mode is used to modify system wide configuration parameters, such as routing
algorithms and routing tables.
• This is done by typing:

Router1#Configure terminal
Dept of MCA Computer Networking

• The argument terminal tells the router that the configuration commands will be entered from a terminal. The
alternatives are to issue configuration commands from a configuration file or from a remote machine via a file
transfer
• The command prompt in the global configuration mode is:
Router1(Config)#

Notes: Typing a question mark (?) in a given command mode generates a list of all available commands in the current
command mode Router1(config-if)#? This command helps to determine if a command can be executed in the current
mode The question mark can also be used to determine the list of available options of a command. Router1#configure ?

If a certain command enables a feature of a router than adding a “no” in front of that command disables the same
feature. Sometimes it is the other way around, that is, the command to enable a feature uses the command to disable the
feature preceded by a “no” Examples:

•Enable IP forwarding : ip routing


•Disable IP forwarding : no ip routing
•Add a routing table entry : ip route 10.0.2.0 255.255.255.0 10.0.3.1
•Delete a routing table entry: no ip route 10.0.2.0 255.255.255.0 10.0.3.1
•Disable a network interface: shutdown
•Enable a network interface : no shutdown

Procedure:

Part 1.1: Configure Packet Tracer Terminal to Establish a Console Session with a Cisco IOS Router/Switch.
PT Terminal is a simple emulation program for serial communication that can be used to connect to the console port on
Cisco IOS devices. A serial interface on a computer is connected to the Cisco device via a console cable. Using PT
Terminal is the most basic way to access a router for checking or changing its configuration.

Steps:
1- Select a PC and a router from the Network Component Box.
2- Connect the console (rollover) cable to the console port on the router. Connect the other cable end to the host
computer with a DB-9 or DB-25 adapter to the COM 1 port.
3- If not already powered on, enable power to the computer and router.
Dept of MCA Computer Networking

4- From the Windows taskbar, start the PT Terminal program by clicking PC0>Desktop Tab> Terminal
5- Use the following settings of the Terminal Session. Bits per second 9600, Data bits 8, Parity None, Stop bits 1, Flow
control None
6- You should see a response from the router on the screen (press enter several
times). 7- Power cycle the router and watch the reaction on the terminal.

Part 1.2: Establishing a Console Session with HyperTerminal


HyperTerminal is a simple Windows-based terminal emulation program for serial communication that can be used to
connect to the console port on Cisco IOS devices. A serial interface on a computer is connected to the Cisco device via
a rollover cable. Using HyperTerminal is the most basic way to access a router for checking or changing its
configuration. Each bench will be provided with one router, one switch and one console cable. Each student should try
the following procedure on his/her own PC. Please use care and caution when connecting the cables and operating the
equipment.
Steps:
1- Connect a Router and Computer with a Console Cable as explained to you by the lab supervisor.
2- From the Windows taskbar, start the HyperTerminal program by clicking Start > Programs >Accessories >
Communications > HyperTerminal.
3- At the Connection Description window, enter a session name in the Name field. Select an appropriate icon, or
leave the default. Click OK.
4- Enter the appropriate connection type, COM 1, in the Connect using field. Click OK.
5- Change port settings as in part1.When the HyperTerminal session window comes up, press the Enter key.
There should be a response from the router. This indicates that connection has been successfully
completed.
6- When finished, close the HyperTerminal session. Click File > Exit. When asked whether to save the session,
click Yes. Enter a name for the session.
7- To reconnect the HyperTerminal session; Reopen the HyperTerminal session as described above. This time,
when the Connection Description window opens click Cancel. Click File > Open. Select the saved session and
then click Open.

Part 2: Basic Cisco Device Configuration


Dept of MCA Computer Networking

Common configuration tasks include setting the hostname, access passwords, and (Message of the Day Banner) MOTD
banner. Interface configuration is extremely important. In addition to assigning a Layer 3 IP address, enter a
description that describes the destination connection speeds troubleshooting time. Configuration changes are effective
immediately. Configuration changes must be saved in NVRAM to be persistent across reboot. Configuration changes
may also be saved off-line in a text file for auditing or device replacement. Cisco IOS switch configuration is similar to
Cisco IOS router configuration.

Part 2.1: Configure Cisco Router Global Configuration Settings.

1- Physically connect devices.


Refer to Figure 1. Connect the console or rollover cable to the console port on the router. Connect the other end of the
cable to the host computer using a DB-9 or DB-25 adapter to the COM 1 port. Connect the crossover cable between the
host computer’s network interface card (NIC) and Router interface Fa0/0. Connect a straight-through cable between the
Router interface Fa0/1 and any of the switch’s interfaces (1-24). Ensure that power has been applied to the host
computer, switch and router.

2- Connect host computer to router through HyperTerminal.


Configure HyperTerminal with the proper settings as mentioned in previously in this experiment. When the
HyperTerminal session window comes up, press the Enter key until there is a response from the router.
If the router terminal is in the configuration mode, exit by typing NO. (see below) Would you like to enter the initial
configuration dialog? [yes/no]:no Press RETURN to get started! Router>
When in privileged exec command mode, any misspelled or unrecognized commands will attempt to be translated by
the router as a domain name. Since there is no domain server configured, there will be a delay while the request times
out. This can take between several seconds to several minutes. To terminate the wait, simultaneously hold down the
<CTRL><SHIFT>6 keys then release and press x: Router>enabel Translating "enabel"...domain server (255.255.255.255) %
Briefly hold down the keys <CTRL><SHIFT>6, release and press x Name lookup aborted Router> From the user exec
mode, enter privileged exec mode:
Router> enable Router# Verify a clean configuration file with the privileged exec command show running-config. If a
configuration file was previously saved, it will have to be removed.

3- Configure global configuration hostname setting.

From the global config mode, there are many different configuration modes that may be entered. Each of these modes
allows the configuration of a particular part or function of the IOS device. The list below shows a few of them:

• Interface mode - to configure one of the network interfaces (Fa0/0, S0/0/0,..)


• Line mode - to configure one of the lines (physical or virtual) (console, AUX, VTY,..)
• Router mode - to configure the parameters for one of the routing protocols

From the privileged exec mode, enter global configuration mode: Router# configure terminal Router(config)#
Set the device hostname to Router1: router(config)# hostname Router1 Router1(config)#

Part 2.2: Configure Cisco Router Interfaces.


All cabled interfaces should contain documentation about the connection. On newer Cisco IOS versions, the maximum
description is 240 characters. In the following use addresses from subnet 3 you have defined in the pre-lab.

1- Configure the router fa0/0 interface.


Router1(config)# interface fa0/0
Router1(config-if)# description Connection to Host1 with crossover cable Router1(config-if)# ip [insert max host
addr] [insert classful subnet mask] Router1(config-if)# no shutdown
Router1(config-if)# end Router1#
Dept of MCA Computer Networking

PROGRAM:
Router enable => Router #
Router # configure terminal
Router (config)# interface just ethernet 01Router (config .d) # no shut down.
Router (config.id) # exit
Router (config.id) #interface serial 01010
Router(config.id) # no shut down
Router (config.id) # clock router 64000.
Routes -> enable
Router #configure. terminal
Router #configure # interface just othernut ola
Router (config. id) # no shutdown
Router (config.id) #exit.
Router (config) # interface serial 01010
Router (config) # no shutdown.
Router (config.id) # clock router 64000
Router (config-id)#interface serial o1o11
router (config. id) # no shutdown
Router (config-id)# Clock router 64000
Router (config-id)# exit

Conclusion:
Router configuration is a fundamental Sicill for network administrators and engineers. a well configured
router ensure that data flow efficiently between difference network segment.
Experiment 4

AIM: To Configure Network using Static Routing with the help of Packet Tracer.

Program:
Program: Router - I

Router > enable

Router # configure terminal

router (config) # ip route 192.168.30.0


255, 255.255.0 192.168.20.2

router (config)#ip route 192.168.40.0


255.255.255.0 192.168.20.2

router (config) # ip route 192.168.50.0


255.255.255.0 192.168.20.2

routes (config) # ip route 192.168.60.0


255.255.255.0 192.1688.20.2

router (config)# ip route 192.168.70.0


255.255.255.0 192.168.20.2

Dept of MCA Computer Networking


Dept of MCA Computer Networking

Router 2-

router (config) #ip 192.168.10.0


255.255.255.255.0 192.168.20.1

router (config) # ip route 192.168.50.0

255.255.255.0 192.168.10.2

router (config) # ip route 192.168.60.0


255.255.255.0 192.168.40.2

router (config)# ip route 192.168.70.0


255.255.255.0 192.168.90.2

Router-3:

router (config) # ip route 192.168.10.0


255.255.255.0 192.168.40.1

router (config) # ip route 192.168.20.0


255.255.255.0. 192.168.40.1

router (config)# ip route 192.168.30.0


255.255.255.0 192.168.40.1

router (config)# ip route 192.168.70.0


255-255-255.0 192.168.60.2

Router-4:

router (config) #ip route 192.168.10.0


255.255.255.0 192.168.60.1

router (config) # ip route 192.168.20.0


255.255.255.0 192.168.60.1

router (config) # ip route 192.168. 30.0


255.255.255.0 192.168.60.1

router (config) # ip route 192.168. 40.0


255.255.255.0 192.168.60.1

router (config) #ip route 192.168.50.0


255.255.255.0 192.168.60.1

Conclusion:

Static routing is a routing protocol that help to keep your network, organized and to optimize routing
Performance.
Dept of MCA Computer Networking

Experiment 5

AIM: To Configure Network using Distance Vector Routing Algorithm with the help of
Packet Tracer. (RIP Protocol)

Program:
Router # configure terminal
router (config) # router RIP
router (Config-router) # network 192.168.10.0
router (config-router) # network 192.168.20.0
routing (config-router) # end

Router: 2

Router # config terminal


router # (config) router rip
router (config- router) # network 192.168.10.0
router (config- router) # network 192.168.40.0
router (config-router)# exit
Dept of MCA Computer Networking

Router: 3

router # config terminal


router (config)# router rip
router (config -router )#network 192.168.40.0
router (Config-router)# network 192.168.60.0
router (config-router)# network 192.168.80.0
router (Config-router)#exit

Router: 4

Router & config terminal


router (config)#router rip
router (config-router)# network 192.168.60.0
routes (config-router)# network 192.168.0.0.
router (config-router)t exit

Conclusion:

By this we learn about dynamic routing concept and striped with RIP distance vector.
Dept of MCA Computer Networking

Experiment 6

AIM: To Configure Network using Link State Vector Routing Algorithm with the help of
Packet Tracer. (IGRP Protocol)

Program:
Router-1:

router # configure terminal

router (config) router)# network 192.168.10.0


0.0.255. area o

router (config-router) # network 192.168.20.0


0.0.255. area o

router (config-router) exit.


Dept of MCA Computer Networking

Router 2:

router #config terminal

router (config) # router OSPF 10

router (config router) # network 192.168.20.0


0.0.0.2555 area o

router (config-router) # network 192.168.30.0

0.0.0.255 area o

router (config-router)# network 112.168.40.0

0.0.0.255 area O

router (config-router) exit

Router 3:

Router & config terminal

Router (config)# router OSPF of Router (config- router) # network 192.168.40.0


0.0.0.255 area O.

router (config) router) # network 192.168.60.0


0.0.0.255 area o

router (config) router)# netwo0k 192.168.60.0


0.0.0.255 area 0.

router (config-router) exit

Conclusion:

By this we learn about link state Routing is a Powerful and efficient routing algo. used in
computer networks.
Dept of MCA Computer Networking

Experiment 7

AIM: To Configure Network using Open Shortest Path First Protocol with the help of Packet
Tracer.

Program:
Commands to configure OSPF:

(config)# router OSPF < Process ID>

(config) router)# network <network ID> 1 wildcard mark > area < area ID>

Implementation program:

Router (config) # router OSPF 1

Router (config-router)# network 192.168.1.0

0.255.255. 255 area o

Router (config-router) # network 10.0.0.0


0.0.0.255 area o

Router(config) # router OSPF I Router (config-router) # network

0.0.0.255 area o
Dept of MCA Computer Networking

Router (config-router) network 20.0.0.0.


0.0.0.255 area o

Router (config-router) # network 192.168.2.0


0.255.255.255 area o

Router (config) # router OSPF 1

Router (config-router)# network 192.168.3.0


0.255.255.255 area O

Router (config. router) # network 255.0.0.0.


0.0.0.255 area o.

Conclusion:
In this OSPF is a widely used Jink-State routing porotocol that plays a crucial role in determining the
most efficient router for data transmission.
Dept of MCA Computer Networking

Experiment 8

AIM: Configuration of Virtual LAN with help of Packet Tracer.

OBJECTIVES:
The objective of this lab is to study how to divide a physical network into a number of separate logical networks
using virtual local area networks (VLANs) with the benefit of decreasing collision domain and adding more
security.

Theory:
Figure 9.1 illustrates the flat network architecture that used to be so typical for layer 2 switched networks. With
this configuration, every broadcast packet transmitted is seen by every device on the network regardless of
whether the device needs to receive that data or not.

Figure 9.1 Flat Network Structure


By default, routers allow broadcasts to occur only within the originating network, while switches forward
broadcasts to all segments. Oh, and by the way, the reason it’s called a flat network is because it’s one broadcast
domain, not because the actual design is physically flat. In Figure 9.1 we see Host A sending out a broadcast
and all ports on all switches forwarding It all except the port that originally received it.
Now check out Figure 9.2. It pictures a switched network and shows Host A sending a frame with Host D as its
destination. Clearly, the important factor here is that the frame is only forwarded out the port where Host D is
located.

Figure 9.2 Benefit of a Switched Network


This is a huge improvement over the old hub networks, unless having one collision domain by default is what
you really want for some reason!
Okay—you already know that the biggest benefit gained by having a layer 2 switched networks are that it
creates individual collision domain segments for each device plugged into each port on the switch. This scenario
frees us from the old Ethernet density constraints and makes us able to build larger networks. But too often, each
new
Dept of MCA Computer Networking

advance comes with new issues. For instance, the more users and devices that populates and uses a network, the
more broadcasts and packets each switch must handle.
And there’s another big issue—security! This one is real trouble because within the typical layer 2 switched
internetworks, all users can see all devices by default. And you can’t stop devices from broadcasting, plus
you can’t stop users from trying to respond to broadcasts. This means your security options are dismally
limited to placing passwords on your servers and other devices.
But wait—there’s hope if you create a virtual LAN (VLAN)! You can solve many of the problems associated with
layer 2 switching with VLANs, as you’ll soon see. VLANs work like this: Figure 9.3 shows all hosts in this very
small company connected to one switch, meaning all hosts will receive all frames, which is the default behavior of
all switches.

Figure 9.3 One switch, one LAN: Before VLANs, there were no separations between hosts

If we want to separate the host’s data, we could either buy another switch or create virtual LANs, as shown in
Figure 9.4.

Figure 9.4 One switch, two virtual LANs (logical separation between hosts): Still physically one switch, but this switch
acts as many separate devices.
In Figure 9.4, I configured the switch to be two separate LANs, two subnets, two broadcast domains, two VLANs
—they all mean the same thing—without buying another switch. We can do this 1,000 times on most Cisco
switches, which save thousands of dollars and more!
Notice that even though the separation is virtual and the hosts are all still connected to the same switch, the LANs
can’t send data to each other by default. This is because they are still separate networks.

Here’s a short list of ways VLANs simplify network management:


● Network adds, moves, and changes are achieved with ease by just configuring a port into the appropriate
VLAN.
● A group of users that need an unusually high level of security can be put into its own VLAN so that users
outside of that VLAN can’t communicate with it.
● As a logical grouping of users by function, VLANs can be considered independent from their physical or
geographic locations.
● VLANs greatly enhance network security if implemented correctly.
● VLANs increase the number of broadcast domains while decreasing their size.

Coming up, we’ll thoroughly explore the world of switching, and you learn exactly how and why switches
provide us with much better network services than hubs can in our networks today.
Dept of MCA Computer Networking

Figure 9.5 Vlan Structure

Program:
Switch (config)# interface range fast element 0/4-12

Switch (config) switch port access vlan

switch (config-IF)# exit

Switch (config) # interface range fast ethernet 0/13-16

Switch (config)-it) # Switch Port access vlan-5

Switch (Config-if)#end

Switch #show VLAN

Switch # Configure terminal

Switch (config) # VLAN

Switch (config-VLAN) # Name network


Dept of MCA Computer Networking

Switch (config. VLAN) # exit

Switch (config) # VLAN3

switch (config - VLAN) # Name network 2

switch (config-VLAN) # exit

switch (config)# VLAN4

Switch (config- VLAN) # name network3

Switch (config-VLAN) # exit

Conclusion:
The effective implement of VLAN and to enhance network security by keeping. devices that operate
with sensitive information on a separate VLAN.
Dept of MCA Computer Networking

Experiment 9

AIM: To take backup of IOS (Internet Operating System) image from working CISCO router
and to install the same in a crashed CISCO router.

Program:
Dept of MCA Computer Networking

Conclusion:

In this cisco IOS allow devices within a network to communicate with each other,meaning sure that
from one device gets sent to the right destination device.
Dept of MCA Computer Networking

Experiment 10

AIM: Introduction to Network Simulator 2(NS2).


The Network Simulator version 2 (NS-2) is a deterministic discrete event network simulator, initiated at the
Lawrence Berkeley National Laboratory (LBNL) through the DARPA funded Virtual Internetwork Test bed
(VINT) project. The VINT project is collaboration between the Information Sciences Institute (ISI) at the
University of Southern California (USC), Xerox's Palo Alto Research Centre (Xerox PARC), University of
California at Berkeley (UCB) and LBNL. NS-2 was initially created in 1989 as an alternative to the REAL
Network Simulator. Since then there is significant growth in uses and width of NS project.
Although there are several different network simulators available today, ns-2 is one of the most common.
NS-2 differs from most of the others by being open source software, supplying the source code for free to
anyone that wants it. Whereas most commercial network simulators will offer support and a guarantee but
keeping the moneymaking source code for themselves.

The Structure of NS2


NS-2 is made up of hundreds of smaller programs, separated to help the user sort through and find
what he or she is looking for. Every separate protocol, as well as variations of the same, sometimes
has separate files. Though some are simple, but still dependent on the parental class.

Fig: The basic Structure of NS2

C++
C++ is the predominant programming language in ns-2. It is the language used for all the small programs
that make up the ns-2 hierarchy. C++, being one of the most common programming languages and specially
designed for object- oriented coding, was therefore a logical choice what language to be used. This helps
when the user wants to either understand the code or do some alterations to the code. There are several
books about C++ and hundreds, if not thousands, of pages on the Internet about C++ simplifying the search
for help or answers concerning the ns-2 code.
OTcl
Object Tcl (OTcl) is object-oriented version of the command and syntax driven
programming language Tool Command Language (Tcl). This is the second of the two
programming languages that NS-2 uses. The front-end interpreter in NS-2 is OTcl which
link the script type language of Tcl to the C++ backbone of NS-2. Together these two
different languages create a script controlled C++ environment. This helps when creating a
simulation, simply writing a script that will be carried out when running the simulation.
These scripts will be the formula for a simulation and is needed for setting the specifications
of the simulation itself. Without a script properly defining a network topology as well as the
data-rows, both type and location, nothing will happen.

Nodes
A node is exactly what it sounds like, a node in the network. A node can be either an end
connection or an intermediate point in the network. All agents and links must be connected
to a node to work. There are also different kinds of nodes based on the kind of network that
is to be simulated. The main types are node and mobile node, where node is used in most
wired networks and the mobile node for wireless networks. There are several different
commands for setting the node protocols to be used, for instance what kind of routing is to
be used or if there is a desire to specify a route that differs from the shortest one. Most of the
commands for node and mobile node can be easily found in the ns documentation. Nodes
and the closely connected link creating commands, like simplex link and duplex link, could
be considered to simulate the behavior of both the Link Layer.

Agents
An agent is the collective name for most of the protocols you can find in the transport layer.
In the ns-2 documentation agents are defined as the endpoints where packets are created and
consumed. All the agents defined in ns-2, like tcp, udp etc., are all connected to their parent
class, simply called Agent. This is where their general behavior is set and the offspring
classes are mostly based on some alterations to the inherent functions in the parent class.
The modified functions will overwrite the old and thereby change the performance in order
to simulate the wanted protocol.

Applications
The applications in ns-2 are related to the Application Layer in the TCP/IP suite. The
hierarchy here works in the similar way as in the agent’s case. To simulate some of the most
important higher functions in network communication, the ns-2 applications are used. Since
the purpose of ns-2 is not to simulate software, the applications only represent some
different aspects of the higher functions. Only a few of the higher layer protocols has been
implemented, since some are quite similar when it comes to using the lower functions of the
TCP/IP stack. For instance there is no use adding both a SMTP and a HTTP application
since they both use TCP to transfer small amounts of data in a similar way. The only
applications incorporated in the release version of ns-2 are a number of different traffic
generators for use with UDP and telnet and FTP for using TCP. All the applications are
script controlled and when concerning the traffic generators, you set the interval and
54
Dept of MCA Computer Networking

packet-size of the traffic. FTP can be requested to send a data packet whenever the user
wants to, or to start a transfer of a file of arbitrary size. If starting an FTP transmission and
not setting a file-size the transmission will go on until someone calls a stop.

NAM
The Network Animator NAM is a graphic tool to use with ns-2. It requires a nam-tracefile
recorded during the simulation and will then show a visual representation of the simulation.
This will give the user the possibility to view the traffic packet by packet as they move along
the different links in the network. NAM offers the possibility of tracing a single packet
during its travel and the possibility to move the nodes around for a user to draw up his
network topology according to his own wishes.

Fig: Ns2 visualization tool

Since the simulation has already been performed there is no possibility for the user to change
the links or any other aspect of the simulation except the representation. The existence of an
Xserver allows NAM to be able to open a graphical window. Therefore if NAM is to work,
there must be a version of X-server running.

Conclusion:

In this NS2 Provide substational support for simulation of difference. Protocols over wired and
wireless network.
Dept of MCA Computer Networking

Experiment 11
AIM: Installation of NS2 in LINUX Operating System.
(1) Download ns2.34
http://sourceforge.net/projects/nsnam/files/allinone/ns-allinone-2.34/ns-allinone-
2.34.tar.gz/download or from anywhere else.
(2) Unzip the ns-allinone-2.34.tar.gz to any place where you want to install your ns. In
my case I want to unzip it in /home/gz/ (note that my zipped folder of ns2 was in
/home/gz) $ cd /home/gz $ tar -xzvf ns-allinone-2.34.tar.gz
(3) $cd ns-allinone-2.34
(4) $sudo apt-get install build-essential autoconf automake libxmudev
(5) $./install

Errors: It will take some time. After this step you may encounter some errors like
the following Snapshot

If you get the errors as above, follow the steps from 5.1 to 5.6, otherwise go to step (6) 5.1
$gedit otcl-1.13/Makefile.in 5.2 edit the file as follows: old file snapshot

5.3 $sudo apt-get install g++-4.3


Dept of MCA Computer Networking

5.4 $cd ns-allinone-2.34


5.5 ns-allinone-2.34$CC=gcc-4.3 CXX=g++-4.3 ./install
5.6 You are done if you get the following screen

(6) $ gedit ~/.bashrc It will open the file shown below. Edit the lines that are
highlighted according to your path of ns2. I installed my ns2 in /home/gz/ns-
allinone-2.34
Dept of MCA Computer Networking

(7) $ source ~/.bashrc


(8) $cd ns2.34
(9) $./validate It will take long time to finish (longer than the install) If you get this screen
shot, you are successful.

(10) Create a symlink, so that ns can be called from everywhere $ sudo ln -s


/home/gz/ns-allinone-2.33/ns-2.33/ns /usr/bin/ns
(11) $reboot To restart the system.
(12) To check whether ns is installed successfully or not, test it by entering $ns.
If you are prompted with %, it means your installation is successful otherwise check your
environment variables,specifically compare the versions of otcl, nam etc in ./bashrc with
those in your ns-allinone-2.34. press exit to go back from %.

Conclusion:

In this NS2 Provide substational support for simulation of difference. Protocols over wired and
wireless network.

You might also like