r23 Computer Networks Lab
r23 Computer Networks Lab
LAB
(23_______)
LABORATORY
MANUAL
B. TECH (R23)
(III YEAR-I SEM)
Department of
COMPUTER SCIENCE AND ENGINEERING
Vision
Mission
Vision:
Mission:
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 3: Have exposure to cutting edge technologies thereby making them to achieve
excellence in the areas of their studies.
PEO 5: Have a successful career wherein they strike a balance between ethical values
and commercial values.
Program Outcomes (POs)
After completion of the course, B. Tech in Computer Science and Engineering, the
graduates will have the following Program Specific Outcomes:
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.
Course Outcomes
Course Outcomes:
optimal solutions
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 Objectives:
Course Outcomes:
At the end of the course, the student will be able to
protocols
2. Write a Program to implement the data link layer farming methods such
as
i)Character stuffing ii) bit stuffing.
4. Write a program for Hamming Code generation for error detection and
correction.
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
13 Wireshark
i. Packet Capture Using Wire shark
ii. Starting Wire shark
iii. Viewing Captured Traffic
iv. Analysis and Statistics & Filters.
2. Laboratory Record 05
Total 15
2 Experimental Work 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
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.
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
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.
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
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.
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()
printf("Enter string\n");
scanf("%s",&a);
n=strlen(a);
printf("Enter position\n");
scanf("%d",&pos); if(pos>n)
scanf("%d",&pos);}
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;
}
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';
}
Output:
Enter string
HariKrishna
Enter position
dlestxHardle
dleiKrishnadleetx
3. Write a Program to implement data link layer farming method
checksum.