0% found this document useful (0 votes)
88 views43 pages

Practical CN

This practical file outlines various experiments related to computer networks, including generating random numbers, configuring different network topologies, and studying network devices. It covers protocols such as Stop and Wait and Sliding Window, as well as multilayer switching and routing protocols like RIP. The document includes aims, apparatus required, theoretical explanations, and configurations for each experiment conducted.

Uploaded by

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

Practical CN

This practical file outlines various experiments related to computer networks, including generating random numbers, configuring different network topologies, and studying network devices. It covers protocols such as Stop and Wait and Sliding Window, as well as multilayer switching and routing protocols like RIP. The document includes aims, apparatus required, theoretical explanations, and configurations for each experiment conducted.

Uploaded by

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

COMPUTER

NETWORKS
PRACTICAL FILE
SUBJECT CODE-ECECC19

Submitted to: Dr. Amit Singhal

Name- Arshnoor Kaur


Roll No.- 2022UEC4592
index
S. No. Experiment Teacher’s
Signature
1 To Generate Exponential distributed random
numbers from uniformly distributed random
numbers.
2 Configure and analyze bus, ring, star, mesh,
and hybrid network topology with wired vs
wireless networks.
3 Connect the computers in Local Area
Network, and study basic network command
and Network configuration commands.
4 Study of following Network Devices in Detail:
Repeater, Hub, Switch, Bridge, Router,
Gateway
5 To simulate STOP and WAIT protocol and
evaluate its performance
6 To simulate SLIDING WINDOW protocol and
evaluate its performance with variation of
window size.
7 To perform multilayer switching in a computer
network.
8 Analyze Distance Vector Routing Protocol
using Routing Information Protocol to
configure a computer network
9 Performing an Initial Switch Configuration,
and Initial Router Configuration using packet
tracer
10 Configuring and Troubleshooting a Switched
Network using packet tracer.
EXPERIMENT - 1
• AIM:-
• To Generate Exponential distributed random number from uniformly
distributed random number.

• APPARATUS/SOFTWARE REQUIRED:- MATLAB

• THEORY:-
The probability density function for exponential distribution is:

• CODE:-
• OUTPUT:-
EXPERIMENT - 2
• AIM:-
• Configure and analyze bus, ring, star, mesh, and hybrid network topology
with wired vs wireless networks.

• APPARATUS/SOFTWARE REQUIRED:- MATLAB

1. BUS TOPOLOGY:-
Bus topology is a network architecture where all devices are connected to a single
central cable, known as the bus or backbone. This cable serves as a shared
communication medium, and all data transmitted by a device is available to all
other devices on the network.

Structure

•A single central cable acts as the main communication channel.


•Devices (computers, printers, etc.) are connected to the cable via T-connectors or
drop lines.
•Terminators are placed at both ends of the cable to prevent signal reflection
2. RING TOPOLOGY:-

Ring topology is a network structure in which each device (node) is connected to


exactly two other devices, forming a closed loop or ring. Data travels in one or
both directions through the ring until it reaches its destination.
Structure
•Each device is connected to two neighboring devices.
•There is no central hub or switch; data passes through each node.
•Can be unidirectional (data moves in one direction) or bidirectional (data moves
in both directions using dual rings).
3. MESH TOPOLOGY:-
Mesh topology is a network structure where each device (node) is connected to
multiple or all other nodes, ensuring high redundancy and fault tolerance. It can be
fully connected (every node connects to every other node) or partially connected
(some nodes have multiple connections but not all).

Types of Mesh Topology

1.Full Mesh – Every node is connected to every other node.


2.Partial Mesh – Some nodes are connected to multiple nodes, but not all.

Working Principle

•Data can take multiple paths to reach its destination.


•Routing protocols determine the best path dynamically.
•Eliminates a single point of failure, ensuring reliability
4. STAR TOPOLOGY:-

Star topology is a network structure where all devices (nodes) are


individually connected to a central hub or switch. The central device acts
as a communication point, managing data transmission between nodes.

Structure

•Each device has a dedicated connection to the central hub/switch.


•The central hub/switch controls network traffic.
•Data is sent from one node to another through the hub/switch.
5. HYBRID TOPOLOGY:-

Star topology is a network structure where all devices (nodes) are


individually connected to a central hub or switch. The central device acts
as a communication point, managing data transmission between nodes.

Structure

•Each device has a dedicated connection to the central hub/switch.


•The central hub/switch controls network traffic.
•Data is sent from one node to another through the hub/switch.
EXPERIMENT - 3
• Aim:-
• Connect the computers in Local Area Network, and Study basic network
command and Network configuration commands.

Tools Required:
Cisco Packet Tracer and Command Prompt
Configuration:

Schematic:
IP CONFIG

Basic Commands:

ipconfig (Check the ip


configuration of the computer)

ping {host} (To check the connection between source and destination
nodes)
nslookup:
Displays information from Domain Name System (DNS) name servers.
NOTE :If you write the command as above it shows as default your pc's server
name firstly.

pathping:
A better version of tracert that gives you statics about packet lost and latency.
ping:
ping(8) sends an ICMP ECHO_REQUEST packet to the specified host. If the host
responds,
you get an ICMP packet back. Sound strange? Well, you can “ping” an IP
address to see if a
machine is alive. If there is no response, you know something is wrong.

Traceroute:
Tracert is a command which can show you the path a packet of information
takes from your
computer to one you specify. It will list all the routers it passes through until
it reaches its
destination, or fails to and is discarded. In addition to this, it will tell you how
long each 'hop'
from router to router takes.
nslookup (Displays information from Domain Name
System (DNS) name servers)

CONCLUSION: Connect the


computers in Local Area
Network, and Study of basic
network command and
Network configuration
commands has been done
successfully.
EXPERIMENT - 4
• AIM:-
• Study of following Network Devices in Detail: Repeater, Hub, Switch,
Bridge, Router, Gateway

a. REPEATER:-

1) It operates at the physical layer.


2) It is a 2-port device.
3) Its job is to regenerate the signal over the same network before the
signal becomes too weak or corrupted so as to extend the length to which the
signal can be transmitted over the same network.

b. HUB:-
1) Hubs are networking devices operating at a physical layer of the OSI
model
2) It is a multiport device.
3) A hub cannot filter data. It is a non-intelligent network device that sends
messages to all ports.
4) It primarily broadcasts messages.

c. SWITCH:-

1) A switch is a data link layer device.


2) It is a multiport device.
3) When a data frame arrives at any port of a network switch, it examines
the destination address, performs necessary checks and sends the frame to
the corresponding device.
4) It uses MAC addresses (addresses of medium access control sub layer) to
send data packets to selected destination ports.

d. BRIDGE:-
1) A bridge operates at the data link layer.
2) Bridges are used to connect two sub networks
3) It is a 2-port device.
4) A bridge is a repeater; which add on the functionality of filtering content
by reading the MAC addresses of source and destination.

e. ROUTER:-

1) It operates at network layer of the OSI model


2) It connects different networks together and sends data packets from one
network to another.
3) They are responsible for receiving, analyzing, and forwarding data
packets among the connected computer networks.
4) When a data packet arrives, the router inspects the destination address,
consults its routing tables to decide the optimal route and then transfers the
packet along this route.

f. GATEWAY:-

1) It can operate at any layer of the OSI model.


2) Gateway is located at the boundary of a network and manages all data
that inflows or outflows from that network.
3) A gateway operates as a protocol converter, providing compatibility
between the different protocols used in the two different networks.
EXPERIMENT - 5
• AIM:-
• To simulate STOP and WAIT protocol and evaluate its performance.

• APPARATUS/SOFTWARE REQUIRED:- MATLAB

• THEORY:-

Stop and Wait is a reliable transmission flow control protocol. This protocol
works only in Connection Oriented (Point to Point) Transmission. The Source
node has a window size of ONE. After transmission of a frame the transmitting
(Source) node waits for an Acknowledgement from the destination node. If the
transmitted frame reaches the destination without error, the destination
transmits a positive acknowledgement. If the transmitted frame reaches the
Destination with error, the receiver destination does not transmit an
acknowledgement. If the transmitter receives a positive acknowledgement it
transmits the next frame if any. Else if its acknowledgement receive timer
expires, it retransmits the same frame.
1. Start with the window size of 1 from the transmitting (Source) node
2. After transmission of a frame the transmitting (Source)node waits for a
reply (Acknowledgement) from the receiving (Destination) node.
3. If the transmitted frame reaches the receiver (Destination) without error,
the receiver (Destination) transmits a Positive Acknowledgement.
4. If the transmitted frame reaches the receiver (Destination) with error,
the receiver (Destination) does not transmit acknowledgement.
5. If the transmitter receives a positive acknowledgement it transmits the
next frame if any. Else if the transmission timer expires, it retransmits the
same frame again.
6. If the transmitted acknowledgment reaches the Transmitter (Destination)
without error, the Transmitter (Destination) transmits the next frame if any.
7. If the transmitted frame reaches the Transmitter (Destination) with error,
the Transmitter (Destination) transmits the same frame.
8. This concept of the Transmitting (Source) node waiting after transmission
for a reply from the receiver is known as STOP and WAIT.
• CODE:-
• OUTPUT:-
EXPERIMENT - 6
• AIM:-
• To simulate the SLIDING window protocol and evaluate its performance
with variation of window size

• APPARATUS/SOFTWARE REQUIRED:- MATLAB

• THEORY:-

A sliding window protocol is a feature of packet-based data transmission protocols. Sliding


window protocols are used where reliable in-order delivery of packets is required, such as in the
Data Link Layer (OSI model) as well as in the Transmission Control Protocol (TCP).
Conceptually, each portion of the transmission (packets in most data link layers, but bytes in
TCP) is assigned a unique consecutive sequence number, and the receiver uses the numbers to
place received packets in the correct order, discarding duplicate packets and identifying missing
ones.
The problem with this is that there is no limit on the size of the sequence number that can be
required. By placing limits on the number of packets that can be transmitted or received at any
given time, a sliding window protocol allows an unlimited number of packets to be
communicated using fixed-size sequence numbers.
The term "window" on the transmitter side represents the logical boundary of the total number
of packets yet to be acknowledged by the receiver. The receiver informs the transmitter in each
acknowledgment packet the current maximum receiver buffer size (window boundary).
The TCP header uses a 16 bit field to report the received window size to the sender. Therefore,
the largest window that can be used is 216 = 64 kilobytes. In slow-start mode, the transmitter
starts with low packet count and increases the number of packets in each transmission after
receiving acknowledgment packets from the receiver.
For every ack packet received, the window slides by one packet (logically) to transmit one new
packet. When the window
threshold is reached, the transmitter sends one packet for one ack packet received. In this
simulation we have used the Go Back-N sliding window protocol.
In Go-Back-N ARQ, N is the sender's window size. Suppose we say that Go-Back-3, which means
that the three frames can be sent at a time before expecting the acknowledgment from the
receiver.

It uses the principle of protocol pipelining in which multiple frames can be sent before receiving
the acknowledgment of the first frame. If we have five frames and the concept is Go-Back-3,
which means that the three frames can be sent, i.e., frame no 1, frame no 2, frame no 3 can be
sent before expecting the acknowledgment of frame no 1.

In Go-Back-N ARQ, the frames are numbered sequentially as Go-Back-N ARQ sends the multiple
frames at a time that requires the numbering approach to distinguish the frame from another
frame, and these numbers are known as the sequential numbers.
• CODE:-
• OUTPUT:-
EXPERIMENT - 7
• AIM:-
• To perform multilayer switching in a computer network.

• APPARATUS/SOFTWARE REQUIRED:- CISCO PACKET TRACER

• TOPOLOGY:-

• CONFIGURATION:-
SWITCH MLS_1:

Adding VLAN-
MLS_1(config)#vlan 10
MLS_1(config-vlan)#vlan 20
MLS_1(config-vlan)#vlan 30
Configuring Trunk-
MLS_1(config)#interface fastEthernet 0/1
MLS_1(config-if)#switchport trunk encapsulation dot1q
MLS_1(config-if)#switchport mode trunk

MLS_1(config-if)#interface fastEthernet 0/2


MLS_1(config-if)#switchport trunk encapsulation dot1q
MLS_1(config-if)#switchport mode trunk

MLS_1(config-if)#interface fastEthernet 0/3


MLS_1(config-if)#switchport trunk encapsulation dot1q
MLS_1(config-if)#switchport mode trunk

Assign VLAN to interfaces-


MLS_1(config)#interface vlan 10
MLS_1(config-if)#ip address 192.168.1.1 255.255.255.0

MLS_1(config-if)#interface vlan 20
MLS_1(config-if)#ip address 192.168.2.1 255.255.255.0

MLS_1(config-if)#interface vlan 30
MLS_1(config-if)#ip address 192.168.3.1 255.255.255.0

Enable Routing on Multilayer switch-


MLS_1(config-if)#ip routing
SWITCH SW_1:
Configuring Trunk-
SW_1(config)#interface fastEthernet 0/1
SW_1(config-if)#switchport mode trunk

Adding VLAN-
SW_1(config)#vlan 10
SW_1(config-vlan)#vlan 20
SW_1(config-vlan)#vlan 30

Assign VLAN to interfaces-


SW_1(config)#interface fastEthernet 0/2
SW_1(config-if)#switchport mode access
SW_1(config-if)#switchport access vlan 20

SW_1(config-if)#interface fastEthernet 0/3


SW_1(config-if)#switchport mode access
SW_1(config-if)#switchport access vlan 30

SWITCH SW_2:
Configuring Trunk-
SW_2(config)#interface fastEthernet 0/1
SW_2(config-if)#switchport mode trunk

Adding VLAN-
SW_2(config)#vlan 10
SW_2(config-vlan)#vlan 20
SW_2(config-vlan)#vlan 30

Assign VLAN to interfaces-


SW_2(config)#interface fastEthernet 0/2
SW_2(config-if)#switchport mode access
SW_2(config-if)#switchport access vlan 20

SW_2(config-if)#interface fastEthernet 0/3


SW_2(config-if)#switchport mode access
SW_2(config-if)#switchport access vlan 30
SWITCH SW_3:
Configuring Trunk-
SW_3(config)#interface fastEthernet 0/1
SW_3(config-if)#switchport mode trunk

Adding VLAN-
SW_3(config)#vlan 10
SW_3(config-vlan)#vlan 20
SW_3(config-vlan)#vlan 30

Assign VLAN to interfaces-


SW_3(config)#interface fastEthernet 0/2
SW_3(config-if)#switchport mode access
SW_3(config-if)#switchport access vlan 20

SW_3(config-if)#interface fastEthernet 0/3


SW_3(config-if)#switchport mode access
SW_3(config-if)#switchport access vlan 30

• RESULTS:-
Ping from PC0 (VLAN 20) to PC1 (VLAN 30):
EXPERIMENT - 8
• AIM:-
• Analyze Distance Vector Routing Protocol using Routing Information
Protocol to configure a computer network.

• APPARATUS/SOFTWARE REQUIRED:- CISCO PACKET TRACER

• TOPOLOGY:-
• ROUTER 0:-

• ROUTER 1:-
• ROUTER 2:-

• RESULT:-
Routes successfully established using RIP Protocol.
EXPERIMENT - 9
• AIM:-
• Performing an Initial Switch Configuration, and Initial Router. Configuration
using packet tracer.

• APPARATUS/SOFTWARE REQUIRED:- CISCO PACKET TRACER

1. Configuring Initial Switch Settings:-

TOPOLOGY:-
• Verify the Default Switch Configuration:-
• Create a Basic Switch Configuration:-
• Configure a MOTD Banner:-

• Save Configuration Files to NVRAM


1. Configuring Initial Router Settings:-

TOPOLOGY:-

• Verify the Default Router Configuration:

• Configure and Verify the Initial Router Configuration:


• Save the Running Configuration File:

• RESULT: Switch and Router Successfully configured.


EXPERIMENT - 10
• AIM:-
• Configuring and Troubleshooting a Switched Network using packet tracer.

• APPARATUS/SOFTWARE REQUIRED:- CISCO PACKET TRACER

1. Configuring Initial Switch Settings:-

TOPOLOGY:-
• RESULT: Configuring and Troubleshooting a Switched Network
done successfully.

You might also like