0% found this document useful (0 votes)
919 views25 pages

r23 Computer Networks Lab

The document is a laboratory manual for a Computer Networks course at KKR & KSR Institute of Technology and Sciences, outlining the vision, mission, and educational objectives of the program. It includes detailed instructions for lab conduct, course outcomes, and a list of experiments related to networking protocols and devices. The manual emphasizes practical learning and ethical professional behavior in engineering practices.

Uploaded by

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

r23 Computer Networks Lab

The document is a laboratory manual for a Computer Networks course at KKR & KSR Institute of Technology and Sciences, outlining the vision, mission, and educational objectives of the program. It includes detailed instructions for lab conduct, course outcomes, and a list of experiments related to networking protocols and devices. The manual emphasizes practical learning and ethical professional behavior in engineering practices.

Uploaded by

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

COMPUTER NETWORKS

LAB
(23_______)

LABORATORY
MANUAL

B. TECH (R23)
(III YEAR-I SEM)

Department of
COMPUTER SCIENCE AND ENGINEERING

KKR & KSR INSTITUTE OF TECHNOLOGY AND SCIENCES


(Autonomous Institution – UGC, Govt. of India)
(Affiliated to JNTUK, Kakinada, Approved by AICTE - Accredited by NBA & NAAC – ‘A’ Grade)
Vinjanampadu, Vatticherukuru (Mandal), Guntur – 522017, Andhra Pradesh, India
INSTITUTE VISION AND MISSION

Vision

To produce eminent and ethical Engineers and Managers for society by


imparting quality professional education with emphasis on human values and
holistic excellence.

Mission

• To incorporate benchmarked teaching and learning pedagogies in curriculum.


• To ensure all round development of students through judicious blend of
curricular,
co-curricular and extra-curricular activities.
• To support cross-cultural exchange of knowledge between industry and
academy.
• To provide higher/continued education and research opportunities to the
employees of
the institution.
Department Vision and Mission

Vision:

To become a reputed Centre in computer Science and systems engineering


for quality, competency and social responsibility

Mission:

DM1: Strengthen the Core Competence with Vibrant Technological


Education in a congenial Environment.
DM2: Promote innovative research and development for the Economic,
Social and Environment.
DM3: Inculcate professional behaviour, strong ethical values to meet the
challenges in collaboration and lifelong learning.
PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)

Graduate of Computer Science and Engineering shall,

PEO 1: Have a strong foundation in areas like mathematics, science and engineering
fundamentals so as to enable them to solve and analyse engineering problems and
prepare them to careers, R&D and studies of higher level.

PEO 2: Have an ability to analyse and understand the requirements of software,


technical specifications required and provide novel engineering solutions to the
problems associated with hardware and software.

PEO 3: Have exposure to cutting edge technologies thereby making them to achieve
excellence in the areas of their studies.

PEO 4: Work in teams on multi-disciplinary projects with effective communication


skills and leadership qualities.

PEO 5: Have a successful career wherein they strike a balance between ethical values
and commercial values.
Program Outcomes (POs)

Engineering Graduates will be able to:


1. Engineering knowledge: Apply the knowledge of mathematics, science,
engineering fundamentals, and an engineering specialization to the solution of
complex engineering problems.
2. Problem analysis: Identify, formulate, review research literature, and analyze
complex engineering problems reaching substantiated conclusions using first
principles of mathematics, natural sciences, and engineering sciences.
3. 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.
4. 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.
5. Modern tool usage: Create, select, and apply appropriate techniques,
resources, and modern engineering and IT tools including prediction and
modeling to complex engineering activities with an understanding of the
limitations.
6. The engineer and society: Apply reasoning informed by the contextual
knowledge to assess societal, health, safety, legal and cultural issues and the
consequent responsibilities relevant to the professional engineering practice.
7. Environment and sustainability: Understand the impact of the professional
engineering solutions in societal and environmental contexts, and demonstrate
the knowledge of, and need for sustainable development.
8. Ethics: Apply ethical principles and commit to professional ethics and
responsibilities and norms of the engineering practice.
9. Individual and team work: Function effectively as an individual, and as a
member or leader in diverse teams, and in multidisciplinary settings.
10. 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 and receive clear instructions.
11. Project management and finance: Demonstrate knowledge and understanding
of the engineering and management principles and apply these to one’s own
work, as a member and leader in a team, to manage projects and in multi
disciplinary environments.
12. Life- long learning: Recognize the need for, and have the preparation and
ability to engage in independent and life-long learning in the broadest context
of technological change.
Program Specific Outcomes (PSO’s)

After completion of the course, B. Tech in Computer Science and Engineering, the
graduates will have the following Program Specific Outcomes:

PSO1: Application Development: Able to develop the business solutions through


latest Software Techniques and tools for real time Applications.

PSO2: Professional and Leadership: Able to practice the profession with ethical
leadership as an entrepreneur through participation in various events like Ideathon,
Hackathon, project expos and workshops.

PSO3: Computing Paradigms: Ability to identify the evolutionary changes in


computing using advanced Technologies.
GENERAL LABORATORY INSTRUCTIONS

1. Students are advised to come to the laboratory at least 5 minutes


before (to the starting time), those who come after 5 minutes will
not be allowed into the lab.
2. Plan your task properly much before to the commencement, come
prepared to the lab with the synopsis / program / experiment
details.
3. Student should enter into the laboratory with:
 Laboratory observation notes with all the details (Problem
statement, Aim, Algorithm, Procedure, Program, Expected
Output, etc.,) filled in for the lab session.
 Laboratory Record updated up to the last session experiments
and other utensils (if any) needed in the lab.
 Proper Dress code and Identity card.
4. Sign in the laboratory login register, write the TIME-IN, and occupy
the computer system allotted to you by the faculty.
5. Execute your task in the laboratory, and record the results / output
in the lab observation note book, and get certified by the concerned
faculty.
6. All the students should be polite and cooperative with the
laboratory staff, must maintain the discipline and decency in the
laboratory.
7. Computer labs are established with sophisticated and high-end
branded systems, which should be utilized properly.
8. Faculty must keep their mobile phones in SWITCHED OFF mode
during the lab sessions. Misuse of the equipment, misbehaviors with
the staff and systems etc., will attract severe punishment.
9. Students must take the permission of the faculty in case of any
urgency to go out ,if anybody found loitering outside the lab / class
without permission during working hours will be treated seriously
and punished appropriately.
10. Students should LOG OFF/ SHUT DOWN the computer system before
he/she leaves the lab after completing the task (experiment) in all
aspects. He/she must ensure the system / seat is kept properly.
Head of the Department Principal

Course Outcomes

Course Outcomes:

At the end of the course, the student will be able to :

 CO 1: To understand the working principle of various communication protocols

 CO 2: To analyze the various routing algorithms.

 CO 3: To analyze different networking functions and features for implementing

optimal solutions

 CO 4: Apply different networking concepts for implementing network solution

Implement different network protocols

CO-PO-PSO Mapping
PO PO PO PO PO PO PO PO PO PO1 PO1 PO1 PSO PSO PSO
1 2 3 4 5 6 7 8 9 0 1 2 1 2 3

CO 3 3 3 1 2 1 3
1
CO 3 3 3 2 1 1 3 3
2
CO 3 3 3 2 3 1 2 1 3
3
CO 2 2 3 3 1 1 1 3 3 3
4
Syllabus :

Course Code Course Name L T P C


Computer Networks Lab 0 0 3 1.5

Course Objectives:

The main objectives of the course are to:

 Learn basic concepts of computer networking and acquire practical


notions of protocols with the emphasis on TCP/IP.

 A lab provides a practical approach to Ethernet/Internet networking

 Networks are assembled, and experiments are made to understand


the layered architecture and how do some important protocols work

Course Outcomes:
At the end of the course, the student will be able to

At the end of the course, the student will be able to :

 CO1: To understand the working principle of various communication

protocols

 CO 2: To analyze the various routing algorithms.

 CO3: To analyze different networking functions and features for

implementing optimal solutions

 CO4: Apply different networking concepts for implementing network

solution Implement different network protocols


List of Experiments:

1. Study of Network devices in detail and connect the computers in Local


Area Network.

2. Write a Program to implement the data link layer farming methods such
as
i)Character stuffing ii) bit stuffing.

3. Write a Program to implement data link layer farming method


checksum.

4. Write a program for Hamming Code generation for error detection and
correction.

5. Write a Program to implement on a data set of characters the three CRC


polynomials – CRC 12, CRC 16 and CRC CCIP.

6. Write a Program to implement Sliding window protocol for Goback N.

7. Write a Program to implement Sliding window protocol for Selective


repeat.

8. Write a Program to implement Stop and Wait Protocol.

9. Write a program for congestion control using leaky bucket algorithm

10. Write a Program to implement Dijkstra‘s algorithm to compute the


Shortest path through a graph.

11. Write a Program to implement Distance vector routing algorithm by


obtaining routing table at each node (Take an example subnet graph
with weights indicating delay between nodes).

12. Write a Program to implement Broadcast tree by taking subnet of


hosts.

13. Wireshark
i. Packet Capture Using Wire shark
ii. Starting Wire shark
iii. Viewing Captured Traffic
iv. Analysis and Statistics & Filters.
14. How to run Nmap scan

15. Operating System Detection using Nmap

16. Do the following using NS2 Simulator


i. NS2 Simulator-Introduction
ii. Simulate to Find the Number of Packets Dropped
iii. Simulate to Find the Number of Packets Dropped by TCP/UDP
iv. Simulate to Find the Number of Packets Dropped due to
Congestion
v. Simulate to Compare Data Rate& Throughput.
INDEX

1 Study of Network devices in detail and connect the


computers in Local Area Network.

2 Write a Program to implement the data link layer farming


methods such as
i)Character stuffing ii) bit stuffing.

Write a Program to implement data link layer farming


3 method checksum
Write a program for Hamming Code generation for error
4 detection and correction.

Write a Program to implement on a data set of characters


5 the three CRC polynomials – CRC 12, CRC 16 and CRC CCIP.

6 Write a Program to implement Sliding window protocol for


Goback N.
7 Write a Program to implement Sliding window protocol for
Selective repeat
8 Write a Program to implement Stop and Wait Protocol.

9 Write a program for congestion control using leaky bucket


algorithm

10 Write a Program to implement Dijkstra‘s algorithm to


compute the Shortest path through a graph.

11 Write a Program to implement Distance vector routing


algorithm by obtaining routing table at each node (Take an
example subnet graph with weights indicating delay
between nodes).

12 Write a Program to implement Broadcast tree by taking


subnet of hosts.

13 Wireshark
i. Packet Capture Using Wire shark
ii. Starting Wire shark
iii. Viewing Captured Traffic
iv. Analysis and Statistics & Filters.

14 How to run Nmap scan

15 Operating System Detection using Nmap

16 Do the following using NS2 Simulator


i. NS2 Simulator-Introduction
ii. Simulate to Find the Number of Packets Dropped
iii. Simulate to Find the Number of Packets Dropped
by TCP/UDP
iv. Simulate to Find the Number of Packets Dropped
due to Congestion
v. Simulate to Compare Data Rate& Throughput.
INTERNAL ASSESSMENT FOR LABORATORY: 15 Marks

S.No Description Mark

1. Day to Day Evaluation 05

2. Laboratory Record 05

3. Internal Lab Exam 05

Total 15

Evaluation Procedure for External Lab Exam

S.No Description Mark

1 Aim & Procedure 10

2 Experimental Work 10

3 Output & Result 10

4 Viva voce 05

Total 35

Exp -1:
Study of Network devices in detail and connect the computers in Local Area Network.

Network devices are physical devices that allow hardware on a computer network to
communicate and interact with each other. Network devices like hubs, repeaters, bridges,
switches, routers, gateways, and router help manage and direct data flow in a network. They
ensure efficient communication between connected devices by controlling data transfer,
boosting signals, and linking different networks. Each device serves a specific role, from
simple data forwarding to complex routing between networks

Functions of Network Devices

 Network devices help to send and receive data between different devices.

 Network devices allow devices to connect to the network efficiently and securely.

 Network devices improves network speed and manage data flow better.

 It protects the network by controlling access and preventing threats.

 Expand the network range and solve signal problems.

Network devices work as a mediator between two devices for transmission of data, and thus
play a very important role in the functioning of a computer network. Below are some
common network devices used in modern networks:

 Access Point
 Modems

 Firewalls

 Repeater

 Hub

 Bridge

 Switch

 Routers

 Gateway

 Brouter

 NIC

Access Point
An Access point in networking is a device that allows wireless devices, like smartphones and
laptops, to connect to a wired network. It creates a Wi-Fi network that lets wireless devices
communicate with the internet or other devices on the network. Access points are used to
extend the range of a network or provide Wi-Fi in areas that do not have it. They are
commonly found in homes, offices, and public places to provide wireless internet access.

Modems

Modem is also known as modulator/demodulator is a network device that is used to convert


digital signal into analog signals of different frequencies and transmits these signals to a
modem at the receiving location. These converted signals can be transmitted over the cable
systems, telephone lines, and other communication mediums. A modem is also used to
convert an analog signal back into digital signal. Modems are generally used to access the
internet by customers of an Internet Service Provider (ISP).

Types of Modems

There are four main types of modems:

 DSL Modem: Uses regular phone lines to connect to the internet but it is slower
compared to other types.

 Cable Modem: Sends data through TV cables, providing faster internet than DSL.

 Wireless Modem: Connects devices to the internet using Wi-Fi relying on nearby
Wi-Fi signals.
 Cellular Modem: Connects to the internet using mobile data from a cellular network
not Wi-Fi or fixed cables.

Firewalls

A firewall is a network security device that monitors and controls the flow of data between
your computer or network and the internet. It acts as a barrier, blocking unauthorized access
while allowing trusted data to pass through. Firewalls help protect your network from
hackers, viruses, and other online threats by filtering traffic based on security rules. Firewalls
can be physical devices (hardware), programs (software), or even cloud-based services,
which can be offered as SaaS, through public clouds, or private virtual clouds.

Repeater

A repeater operates at the physical layer. Its main function is to amplify (i.e., regenerate) the
signal over the same network before the signal becomes too weak or corrupted to extend the
length to which the signal can be transmitted over the same network. When the signal
becomes weak, they copy it bit by bit and regenerate it at its star topology connectors
connecting following the original strength. It is a 2-port device.

Hub

A hub is a multiport repeater. A hub connects multiple wires coming from different branches,
for example, the connector in star topology which connects different stations. Hubs cannot
filter data, so data packets are sent to all connected devices. In other words, the collision
domain of all hosts connected through Hub remains one. Also, they do not have the
intelligence to find out the best path for data packets which leads to inefficiencies and
wastage.

Types of Hub

 Active Hub: These are the hubs that have their power supply and can clean, boost,
and relay the signal along with the network. It serves both as a repeater as well as a
wiring center. These are used to extend the maximum distance between nodes.
 Passive Hub: These are the hubs that collect wiring from nodes and power supply
from the active hub. These hubs relay signals onto the network without cleaning and
boosting them and can't be used to extend the distance between nodes.

 Intelligent Hub: It works like an active hub and includes remote management
capabilities. They also provide flexible data rates to network devices. It also enables
an administrator to monitor the traffic passing through the hub and to configure each
port in the hub.

Bridge

A bridge operates at the data link layer. A bridge is a repeater, with add on the functionality
of filtering content by reading the MAC addresses of the source and destination. It is also
used for interconnecting two LANs working on the same protocol. It typically connects
multiple network segments and each port is connected to different segment. A bridge is not
strictly limited to two ports, it can have multiple ports to connect and manage multiple
network segments. Modern multi-port bridges are often called Layer 2 switches because they
perform similar functions.

Types of Bridges

 Transparent Bridges: These are the bridge in which the stations are completely
unaware of the bridge's existence i.e. whether or not a bridge is added or deleted from
the network, reconfiguration of the stations is unnecessary. These bridges make use of
two processes i.e. bridge forwarding and bridge learning.

 Source Routing Bridges: In these bridges, routing operations is performed by the


source station and the frame specifies which route to follow. The host can discover
the frame by sending a special frame called the discovery frame, which spreads
through the entire network using all possible paths to the destination.

Switch

A switch is a multiport bridge with a buffer designed that can boost its efficiency(a large
number of ports imply less traffic) and performance. A switch is a data link layer device. The
switch can perform error checking before forwarding data, which makes it very efficient as it
does not forward packets that have errors and forward good packets selectively to the correct
port only. In other words, the switch divides the collision domain of hosts, but the broadcast
domain remains the same.

Types of Switch

 Unmanaged Switches: These switches have a simple plug-and-play design and do


not offer advanced configuration options. They are suitable for small networks or for
use as an expansion to a larger network.

 Managed Switches: These switches offer advanced configuration options such as


VLANs, QoS, and link aggregation. They are suitable for larger, more complex
networks and allow for centralized management.

 Smart Switches: These switches have features similar to managed switches but are
typically easier to set up and manage. They are suitable for small- to medium-sized
networks.

 Layer 2 Switches: These switches operate at the Data Link layer of the OSI model
and are responsible for forwarding data between devices on the same network
segment.

 Layer 3 switches: These switches operate at the Network layer of the OSI model and
can route data between different network segments. They are more advanced than
Layer 2 switches and are often used in larger, more complex networks.

 PoE Switches: These switches have Power over Ethernet capabilities, which allows
them to supply power to network devices over the same cable that carries data.

 Gigabit switches: These switches support Gigabit Ethernet speeds, which are faster
than traditional Ethernet speeds.

 Rack-Mounted Switches: These switches are designed to be mounted in a server


rack and are suitable for use in data centers or other large networks.

 Desktop Switches: These switches are designed for use on a desktop or in a small
office environment and are typically smaller in size than rack-mounted switches.
 Modular Switches: These switches have modular design that allows for easy
expansion or customization. They are suitable for large networks and data centers.

Router

A router is a device like a switch that routes data packets based on their IP addresses. The
router is mainly a Network Layer device. Routers normally connect LANs and WANs and
have a dynamically updating routing table based on which they make decisions on routing the
data packets. The router divides the broadcast domains of hosts connected through it.

Gateway

A gateway, as the name suggests, is a passage to connect two networks that may work upon
different networking models. They work as messenger agents that take data from one system,
interpret it, and transfer it to another system. Gateways are also called protocol converters
and can operate at any network layer. Gateways are generally more complex than switches or
routers.

Brouter

It is also known as the bridging router is a device that combines features of both bridge and
router. It can work either at the data link layer or a network layer. Working as a router, it is
capable of routing packets across networks and working as a bridge, it is capable of filtering
local area network traffic.

NIC

NIC or network interface card is a network adapter that is used to connect the computer to the
network. It is installed in the computer to establish a LAN. It has a unique ID that is written
on the chip, and it has a connector to connect the cable to it. The cable acts as an interface
between the computer and the router or modem. NIC is a layer 2 device which means that it
works on both the physical and data link layers of the network model.

Exp-2
Write a Program to implement the data link layer farming
methods such as
i)Character stuffing ii) bit stuffing.

In Data Link layer, the stream of bits from the physical layer is divided into data frames. The
data frames can be of fixed length or variable length. In variable – length framing, the size of
each frame to be transmitted may be different. So, a pattern of bits is used as a delimiter to
mark the end of one frame and the beginning of the next frame. However, if the pattern
occurs in the message, then mechanisms need to be incorporated so that this situation is
avoided.

#include<stdio.h>

#include<string.h>

void main()

int i=0,j=0,n,pos; char a[20],b[50],ch;

printf("Enter string\n");

scanf("%s",&a);

n=strlen(a);

printf("Enter position\n");

scanf("%d",&pos); if(pos>n)

printf("invalid position, Enter again :");

scanf("%d",&pos);}

printf("Enter the character\n");


ch=getchar();

b[0]='d';

b[1]='l';

b[2]='e';

b[3]='s';

b[4]='t';

b[5]='x'; j=6;

while(i<n)

if(i==pos-1)

b[j]='d';

b[j+1]='l';

b[j+2]='e';

b[j+3]=ch;

b[j+4]='d';

b[j+5]='l';

b[j+6]='e';

j=j+7;
}

if(a[i]=='d' && a[i+1]=='l' && a[i+2]=='e')

b[j]='d';

b[j+1]='l';

b[j+2]='e';

j=j+3;

b[j]=a[i]; i++;

j++;

b[j]='d';

b[j+1]='l';

b[j+2]='e';

b[j+3]='e';

b[j+4]='t';

b[j+5]='x';

b[j+6]='\0';

printf("\nframe after stuffing:\n"); printf("%s",b);

}
Output:

Enter string

HariKrishna

Enter position

Enter the character

frame after stuffing:

dlestxHardle

dleiKrishnadleetx
3. Write a Program to implement data link layer farming method
checksum.

You might also like