0% found this document useful (0 votes)
36 views50 pages

CN - 200303105838 5 54

The document outlines practical experiments for a Computer Network course, focusing on various network topologies including ring, mesh, star, bus, tree, and hybrid. It also covers the use of simulation tools like Cisco Packet Tracer and Wireshark for monitoring network packets and understanding device behavior. Additionally, it provides a comparison between network devices such as switches and hubs, along with their functionalities and applications.
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)
36 views50 pages

CN - 200303105838 5 54

The document outlines practical experiments for a Computer Network course, focusing on various network topologies including ring, mesh, star, bus, tree, and hybrid. It also covers the use of simulation tools like Cisco Packet Tracer and Wireshark for monitoring network packets and understanding device behavior. Additionally, it provides a comparison between network devices such as switches and hubs, along with their functionalities and applications.
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/ 50

Faculty of Engineering & Technology

Subject Name: Computer Network


Subject Code: 303105255
B.Tech: CSE 2nd Year 4th Semester
Annexure No :
PRACTICAL: 1
Aim: Experiments on Simulation Tools (Cisco Packet Tracer):
TOPOLOGIES:
1. RING
A ring topology is a network configuration where device connections create a circular data path.
Each networked device is connected to two others, like points on a circle. Together, devices in a ring
topology are referred to as a ring network.

Figure 1.1: RING TOPOLOGY

303105255 Page 5
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code:303105255
B.Tech: CSE 2nd Year 4th Semester
Annexure No :
Step1: Select pcs and switches(29050-24) then connect pcs to switches with straight-through(straight
wire) and switches to switches with crossover(dashed wired) .
Step2: Connect them as shown in the image above. Also give them a proper IP address.
Step3: Pass a message and check simulation.

2. MESH
A mesh topology is a network setup where each computer and network device is interconnected
with one another. This topology setup allows for most transmissions to be distributed even if one of the
connections goes down. It is a topology commonly used for wireless networks.

Figure 1.2: MESH TOPOLOGY

303105255 Page6
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code: 303105255
B.Tech: CSE 2nd Year 4th Semester
Annexure No :

Step1: Connect the pcs and switches to one another as shown in image above. Make sure to connect
the switches to switches with crossover wires and pc to switches withstraight-through.
Step2: Connect them as shown in the image above. Also give them a proper IP address.
Step3: Pass a message and check simulation.

3. Star
A star topology is a topology for a Local Area Network (LAN) in which all nodes are individually
connected to a central connection point, like a hub or a switch. A star takes more cable than e.g. a bus,
but the benefit is that if a cable fails, only one node will be brought down.

303105255 Page 7
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code: 303105255
B.Tech: CSE 2nd Year 4th Semester
Annexure No :

Figure 1.3: STAR TOPOLOGY

Step1: Connect the pcs and switches to one another as shown in image above. Make sure to connect
pcs to switch with straight through wires.
Step2: Connect them as shown in the image above. Also give them a proper IP address.
Step3: Pass a message and check simulation.
3. BUS
A bus topology is a topology for a Local Area Network (LAN) in which all the nodes are connected
to a single cable. The cable to which the nodes connect is called a "backbone". If the backbone is

303105255 Page 8
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code: 303105255
B.Tech: CSE 2nd Year 4th Semester
Annexure No :
broken, the entire segment fails.

Figure 1.4: BUS TOPOLOGY

Step1: Connect the pcs and switches to one another as shown in image above. Make sure to connect pcs
to switch with straight through wires and switches to one another with crossover.
Step2: Connect them as shown in the image above. Also give them a proper IP address.
Step3: Pass a message and check simulation.
4. TREE
A tree topology is a special type of structure where many connected elements are arranged like the
branches of a tree. For example, tree topologies are frequently used to organize the computers in a
corporate network, or the information in a database.

303105255 Page 9
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code: 303105255
B.Tech: CSE 2nd Year 4th Semester
Annexure No :

Figure 1.5: TREE TOPOLOGY

Step1: Connect the pcs and switches to one another as shown in image above. Make sure to connect pcs
to switch with straight through wires and switches to one another with crossover.
Step2: Connect them as shown in the image above. Also give them a proper IP address.

Step3: Pass a message and check simulation.

5. HYBRID
A hybrid topology is a type of network topology that uses two or more differing network
topologies. These topologies can include a mix of bus topology, mesh topology, ring topology,
star topology, and tree topology.

303105255 Page10
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code:303105255
B.Tech: CSE 2nd Year 4th Semester
Annexure No :

Figure 1.6: HYBIRD TOPOLOGY

Step1: Connect the pcs and switches to one another as shown in image above. Make sure to connect the
switches to switches with crossover wires and pc to switches with straight-through.

Step2: Give them a proper IP address.

Step3: Pass a message and check simulation.

303105255 Page11
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code:303105255
B.Tech: CSE 2nd Year 4th Semester
Annexure No :

PRACTICAL: 2
AIM: To understand the features of wireshark as a packet capture tool and understand encapsulation of
information. Also study effect of few network commands
2.1 Purpose:
The main objective of the proposed experiment is to give exposure of wire-shark tool to students so can learn
to monitor transmission packets being sent in Wi-Fi and LAN environments.
2.3 TOOLS/SOFTWARE:
Wireshark

303105255 Page 12
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code:303105255
B.Tech: CSE 2nd Year 4th Semester
Annexure No :

PRACTICAL: 3
AIM: To study behavior of generic devices used for networking: (Cisco packet tracer)
DESCRIPTION:
Web server in Cisco packet trace

Figure 3.1
 In this lesson we will learn about how to create first web server on cisco packet tracer that can be
apply on real time web server.
 So we are taking few PCs and one web server and one switch for connecting all devices. Make sure
all devices should be connected by straight through cable because for connecting different devices,
straight through cable is required. Assign IPs to each end device (server and PCs) of single network
with subnet mask It can different as per your choice.
 Then go in server>services>http in that enable http and https modes.In that go to index.html and edit
.In that write the message you want… At the end click on save.and close it .
 Then we go PC1 and in that we select desktop and we write the IP address of server and click on
enter.You can see the message which you wrote in server message.

303105255 Page 13
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code:303105255
B.Tech: CSE 2nd Year 4th Semester
Annexure No :
Figure 3.2

 If you want to see that your connection is proper or not then you want to click on your pc then
desktop>command prompt and in that you need to write ping 190.0.0.1(IT_address). And give enter.

Figure 3.3

Use of switch
A switch is used in a wired network to connect to other devices using Ethernet cables. The switch allows each
connected device to talk to the others. Wireless-only networks do not use switches because devices such as
wireless routers and adapters communicate directly with one another.

303105255 Page14
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code:303105255
B.Tech: CSE 2nd Year 4th Semester
Annexure No :

Figure 3.4

 Connect multiple hosts: Normally, a switch provides a large number of ports for cable connections,
allowing for star topology routing. It is usually used to connect multiple PCs to the network.
 Forwards a message to a specific host: Like a bridge, a switch uses the same forwarding or filtering
logic on each port. When any host on the network or a switch sends a message to another host on
the same network or the
 ame switch, the switch receives and decodes the frames to read the physical (MAC) address portion
of the message.
 Manage traffic: A switch in networking can manage traffic either coming into or exiting the network
and can connect devices like computers and access points with ease.
 Keep electrical signal undistorted: When a switch forwards a frame, it regenerates an undistorted
square electrical signal.
 Increase LAN bandwidth: A switch divides a LAN into multiple collision domains with independent
broadband, thus greatly increasing the bandwidth of the LAN.

Use of hub
A hub is a physical layer networking device which is used to connect multiple devices in a network. They are
generally used to connect computers in a LAN.

303105255 Page15
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code:303105255
B.Tech: CSE 2nd Year 4th Semester
Annexure No :

Figure 3.5

A hub has many ports in it. A computer which intends to be connected to the network is plugged in to one of
these ports. When a data frame arrives at a port, it is broadcast to every other port, without considering
whether it is destined for a particular destination or not.

When a Hub receives data from one of the connected devices, it passes data to all the other ports without
checking for the destination device except the port through which it receives the data. Below figure, shows
the working of a HUB.

Figure 3.6
Consider, Device A want to send data to device D. When device A sends data, the hub receives it through
one port and transfer the data to all the other connected devices instead of passing it to only
device D. This feature of hub leads to congestion and extends the collision domain. So, it is considered as an
inefficient device and needs more bandwidth for working.

Difference between switch and hub

303105255 Page16
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code:303105255
B.Tech: CSE 2nd Year 4th Semester
Annexure No :

Figure 3.7

HUB SWITCH
 A hub operates on the physical  A switch operates on the data link layer.
layer.
 Hubs perform frame floodingthat  It performs broadcast, then the unicast and
can be unicast, multicast, or multicast as needed.
broadcast.
 Just a singular domain ofcollision  Varied ports have separate collision
is present in a hub. domains.
 Transmission mode is Half-duplex.  Transmission mode is Full duplex.
 Hubs operates as a Layer 1 devices  Network switches help you to operate at
per the OSI model. Layer 2 of the OSImodel.
 To connect a network ofpersonal  Allow connecting multiple devices and
computers should be joined ports.
through a central hub.
 Uses electrical signal orbits.  Uses frame & packet
  Does not offer Spanning-Tree.   Multiple Spanning-Tree is possible
 Collisions occur mostly in setups  No collisions occur in a full-duplex switch.
using hubs.
 Hub is a passive device.  A switch is an active device
 A network hub can't store MAC  Switches use CAM (Content Accessible
addresses. Memory) that can be accessed by ASIC
(Application Specific Integrated Chips).
  Not an intelligent device.  Intelligent device.
 Its speed is up to 10 Mbps.  10/100 Mbps, 1 Gbps, 10 Gbps
  Does not use software.   Has software for administration

303105255 Page 17
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code:303105255
B.Tech: CSE 2nd Year 4th Semester
Annexure No :

Summary of devices we use:


Switch 2950-54:
The Cisco Catalyst 2950C 24 and Catalyst 2950T 24 Switches belong to the Cisco Catalyst 2950 series of
high-performance, standalone, 10/100 autosensing Fast Ethernet and Gigabit Ethernet switches. Both
products bring intelligent services to the network edge to accommodate the needs of growing workgroups and
server connectivity. Embedded in the Cisco Catalyst 2950 Series is Cisco Device Manager software, which
allows users to configure and troubleshoot a Cisco Catalyst fixed-configuration switch using a standard Web
browser.
Router 4321:
The Cisco 4000 Series Integrated Services Routers (ISR) revolutionize WAN communications in the
enterprise branch. With new levels of built-in intelligent network capabilities and convergence, the routers
specifically address the growing need for application-aware networking in distributed enterprise sites.
Hub-pt:
Hub is a very simple network device that is used in LANs. It is basicall a multiport repeater. Hubs do not
decide anything and forwards any traffic to all of the ports. So, they are not smart devices. They have
multiple ports that connects different network equimpments in the same network. But this devices the
network bandwith.
Server:
Servers are an entirely different breed when compared to other end devices. They have various functionalities
and also have space for two network interfaces. The modules available for servers are the same as PC
modules, except that the servers do not have the PC-HOST-NM-1AM module.
Meraki server:
The Meraki cloud solution is a centralized management service that allows users to manage all of their Meraki
network devices via a single simple and secure platform. Users are able to deploy, monitor and configure their
Meraki devices via the Meraki dashboard web interface or via APIs.
Ip phone:
IP telephony refers to any phone system that uses an internet connection to send and receive voice data.
Unlike a regular telephone that uses landlines to transmit analog signals, IP phones connect to the internet via
a router and modem.
Voip device:
A VoIP phone or IP phone uses voice over IP technologies for placing and transmitting telephone calls over
an IP network, such as the Internet, instead of the traditional public switched telephone network (PSTN).

303105255 Page 18
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code:303105255
B.Tech: CSE 2nd Year 4th Semester
Annexure No :
Copper straight through wire:
This is a standard Ethernet cable that is used to connect two devices that operate in different layers of the OSI
model (such as hub to router and switch to PC). It can be used with Ethernet, Fast Ethernet and Gigabit
Ethernet port types.
Copper cross over wire:
This Ethernet cable connects devices operating in the same OSI layer (such as hub to hub, PC to PC, PC to
router, and PC to printer). This cable can also be used with Ethernet, Fast Ethernet and Gigabit Ethernet port .
Phone:-
The mobile phone network enables wireless communication using mobile devices, such as mobile phones,
smart phones or tablets. Mobile phone networks provide the necessary infrastructure and are operated by
mobile phone providers.
Automatically choose connection wire:
Connections can be made automatically by choosing the connection type shown below. Router links will be
red or not active until you correctly configure the interfaces.
Coaxial wire:
The coaxial cable used to connect the Cisco uBR7200 series universal broadband routers at the headend
should be very high-quality cable because imperfections that do not visibly affect video transmissions can
significantly affect digital data transmissions. In particular, poor insulation, improperly installed additional
outlets, the condition and length of the cable’s center conductor, and the quality of the cable can negatively
affect the connectivity and performance of the cable access router for digital data transmission
Sniffer:
I have assignment that i need to create full "Network", using all device like switch, hub, server ..etc.The problem
that i force that i need to use "Sniffer" its first time to me using that device. I need help how can i configure or
connect the Sniffer with my network, Because i search on internet i don't find anythings about configure or
connect sniffer on packet tracer.
Smart device:
A smart device is an electronic device, generally connected to other devices or networks via different
wireless protocols such as Bluetooth, Zigbee, NFC, Wi-Fi, LiFi, 5G, etc., that can operate to some extent
interactively and autonomously.
Mcu-pt board:
Components are physical objects that connect to microcontroller (MCU-PT) or single boarded computers
(SBC-PT). They typically does not have a network interface and rely on the MCU-PT or SBC-PT for
network access. These are simple devices that only communicate through their analog or digital slots.

303105255 Page19
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code:303105255
B.Tech: CSE 2nd Year 4th Semester
Annexure No :

PRACTICAL 4
AIM : Data link layer (error detection).

#include<stdio.h>

void main(){ int


data[10];

int dataatrec[10],c,c1,c2,c3,i;

printf("Enter 4 bits of data one by one\n");

scanf("%d",&data[0]);

scanf("%d",&data[1]);
scanf("%d",&data[2]);

scanf("%d",&data[4]);

//Calculation of even parity


data[6]=data[0]^data[2]^data[4];
data[5]=data[0]^data[1]^data[4];
data[3]=data[0]^data[1]^data[2];

printf("\nEncoded data is\n"); for(i=0;i<7;i++)

printf("%d",data[i]);

303105255 Page20
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code:303105255
B.Tech: CSE 2nd Year 4th Semester
Annexure No :
printf("\n\nEnter received data bits one by one\n");

for(i=0;i<7;i++)
scanf("%d",&dataatrec[i]);

c1=dataatrec[6]^dataatrec[4]^dataatrec[2]^dataatrec[0];

c2=dataatrec[5]^dataatrec[4]^dataatrec[1]^dataatrec[0];

c3=dataatrec[3]^dataatrec[2]^dataatrec[1]^dataatrec[0];

c=c3*4+c2*2+c1 ;

if(c==0) {

printf("\nNo error while transmission of data\n");

else {

printf("\nError on position %d",c);

printf("\nData sent : ");

for(i=0;i<7;i++)

printf("%d",data[i]);

printf("\nData received : ");

for(i=0;i<7;i++)
printf("%d",dataatrec[i]);

printf("\nCorrect message is\n");

//if errorneous bit is 0 we complement it else vice versa

303105255 Page21
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code: 203105256
B.Tech: CSE 2nd Year 4th Semester
Annexure No :
if(dataatrec[7-c]==0)

dataatrec[7-c]=1;
else

dataatrec[7-c]=0;

for (i=0;i<7;i++) {
printf("%d",dataatrec[i]);

}
}

OUTPUT :

303105255 Page 22
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code:303105255
B.Tech: CSE 2nd Year 4th Semester
Annexure No :

PRACTICAL: 5
DESCRIPTION:
STEP 1: Make a network
 Connect the pcs and switches shown in the below figure.Give IP address.
 Connect pcs to switches with copper straight through and connect switches to one another with copper
cross over.

STEP 2: Configure VLAN on all switches.


 Go to switch0 CLI, enter ENA command toenable switch.

303105255 Page23
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code: 203105256
B.Tech: CSE 2nd Year 4th Semester
Annexure No :


 Write the foll. commands conf t>vlan 10> name yellow>exit as shown below.

 Do the same for second Vlan 20 and name it orange.


 Repeat the process for switch1.

To see the vlan the command used is >show vlan brief. The output of the command is below,

303105255 Page 24
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code: 203105256
B.Tech: CSE 2nd Year 4th Semester
Annexure No :

Figure 5.3
STEP 3: Configure TRUNK MODE.

 To enable trunk mode the first go to switch CLI


 The command ena>conf t>interface fa0/7>switchport mode trunk.
 This is to be done for every switches ports.
 The below figure shows the command.

303105255 Page 25
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code: 203105256
B.Tech: CSE 2nd Year 4th Semester
Annexure No :

Figure 5.4

STEP 4: Configure ACCESS MODE.


 ACCESS MODE is configued for all the pcs who are connect to the switch
 To configure access mode for pc command ena>conf t>interface fa0/1>switchport mode
access>switchport access vlan10>exit.

303105255 Page 26
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code: 203105256
B.Tech: CSE 2nd Year 4th Semester
Annexure No :

Figure 5.5

 This is to be done with each pc connected to switch.

Communication in same and different vlans with two switches.

Figure 5.6

303105255 Page 27
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code: 203105256
B.Tech: CSE 2nd Year 4th Semester
Annexure No :

 Communication in same vlan with three switches.

Figure 5.7

Communication in different vlan with three switches.

303105255 Page 28
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code: 203105256
B.Tech: CSE 2nd Year 4th Semester
Annexure No :

303105255 Page 29
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code:303105255
B.Tech: CSE 2nd Year 4th Semester
Annexure No :
PRACTICAL: 6
AIM: TO STUDY ABOUT Wireless LAN.

WLAN: - A wireless LAN (WLAN) is a wireless computer network that links two or more devices using
wireless communication to form a local area network (LAN) within a limited area such as a home, school,
computer laboratory, campus, or office building. This gives users the ability to move around within the area
and remain connected to the network. Through a gateway, a WLAN can also provide a connection to the
wider Internet.

First create a wired topology between router, switch and pc to send message by wired communication. As
Shown below. Provide IP address to pc and to router also.

303105255 Page30
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code: 203105256
B.Tech: CSE 2nd Year 4th Semester
Annexure No :

Go to Router configuration and then to the fast Ethernet port on which switch is connected then provide
their IP address to it and turn on the port status as shown below.

We need access point to connect the other devices wirelessely and give WEP key and SSID to access point to
secure the network.

303105255 Page 31
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code: 203105256
B.Tech: CSE 2nd Year 4th Semester
Annexure No :

Take another pc then go the physical device view. First turn off the computer then change the existing
module with WMP300N which is used to connect device wireless.

Provide IP address and set default gateway as same of router’s IP address.

303105255 Page 32
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code: 203105256
B.Tech: CSE 2nd Year 4th Semester
Annexure No :

Now go to PC Wireless setting then click on connect tab and select the SSID which you provided to access
point after that provide WEP key and then connect it.

303105255 Page 33
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code: 203105256
B.Tech: CSE 2nd Year 4th Semester
Annexure No :

Take Tablet go to IP configuration and provide IP address and default gateway.

303105255 Page 34
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code: 203105256
B.Tech: CSE 2nd Year 4th Semester
Annexure No :

Now go to wireless configuration give WEP key and SSID then close it.

303105255 Page 35
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code: 203105256
B.Tech: CSE 2nd Year 4th Semester
Annexure No :

Take smartphone to go IP configuration and provide IP address to it and set router’s IP as the default
gateway of smartphone.

303105255 Page 36
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code: 203105256
B.Tech: CSE 2nd Year 4th Semester
Annexure No :

Then go to Wireless Configuration setting give WEP key and SSID of access point then close it.

303105255 Page 37
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code: 203105256
B.Tech: CSE 2nd Year 4th Semester
Annexure No :

Take a laptop and follow same step as pc

303105255 Page 38
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code: 203105256
B.Tech: CSE 2nd Year 4th Semester
Annexure No :

303105255 Page 39
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code: 203105256
B.Tech: CSE 2nd Year 4th Semester
Annexure No :

303105255 Page 40
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code: 203105256
B.Tech: CSE 2nd Year 4th Semester
Annexure No :
Take a Printer and go to physical device view change existing module with WMP300N.

303105255 Page 41
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code: 203105256
B.Tech: CSE 2nd Year 4th Semester
Annexure No :

303105255 Page 42
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code: 203105256
B.Tech: CSE 2nd Year 4th Semester
Annexure No :

Checking connection :

303105255 Page 43
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code: 203105256
B.Tech: CSE 2nd Year 4th Semester
Annexure No :

303105255 Page 44
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code:303105255
B.Tech: CSE 2nd Year 4th Semester
Annexure No :

Practical 7
AIM: Internetworking with routers: Design a three or four simple networks (with 3 to 4 hosts) and connect via
Router. Perform simulation and trace how routing is done in packet transmission

1: Experiment on same subnet


2: Perform Experiment across the subnet and observe functioning of Router via selectingsuitable pair of Source
and destination.
7.1 Purpose:
The main objective of the proposed experiment is to connect multiple networks using a router. It alsogives an
opportunity to students to learn router configuration in multiple network environments.

7.2 Logical Flow of Practical

OUTPUT

303105255 Page45
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code:303105255
B.Tech: CSE 2nd Year 4th Semester
Annexure No :

Practical 8
AIM: Implementation of SUBNETTING:
Design multiple subnet with suitable number of hosts.
Make a plan to assign static IP addressing across all subnet to explain implementation of SUBNETTING .
A subnetwork or subnet is a logical subdivision of an IP network.
The practice of dividing a network into two or more networks is called subnetting.
Subnetting is the process of stealing bits from the HOST part of an IP address in order to divide the larger
network into smaller sub-networks called subnets. After subnetting, we end up with
NETWORK SUBNET HOST fields.

8.1 Purpose:
The main objective of the proposed experiment is to divide multiple networks using the concept ofsubnetting and
super-netting.

Output:

303105255 Page46
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code:303105255
B.Tech: CSE 2nd Year 4th Semester
Annexure No :

Practical 9
AIM: Routing at Network Layer: Simulate Static and Dynamic Routing Protocol
Configuration using CISCO Packet Tracer.

9.1 Purpose:
The main objective of the proposed experiment is to implement static and dynamic routing protocolusing serial
and parallel routing connections. It also gives an opportunity to students to learn serialand parallel router
configuration in multiple network environment
FLOWCHART

Static
Static routing is a form of routing that occurs when a router uses a manually-configured routing entry,
rather than information from dynamic routing traffic

303105255 Page47
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code:303105255
B.Tech: CSE 2nd Year 4th Semester
Annexure No :

Dynamic
Dynamic routing, static routes are fixed and do not change if the network is changed or reconfigured.

303105255 Page 48
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code:303105255
B.Tech: CSE 2nd Year 4th Semester
Annexure No :
Practical-10
AIM: Experiment on Transport Layer: Implement echo client server using TCP/UDP sockets.
10.1 Purpose:
The main objective of the proposed experiment is to initiate communication between client and server
nodes using echo client and echo server. Utilize both TCP and UDP sockets in the proposed
experiment.

10.2 Logical Flow of Practical:

10.3 TCP Socket Program :


TCP Server Program :
#include<stdio.h>
#include<netinet/in.h>
#include<sys/socket.h> int
main()
{ int listenfd,connfd;

303105255 Page49
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code:303105255
B.Tech: CSE 2nd Year 4th Semester
Annexure No :
int n;
char msg[50];
socklen_t clen;

struct sockaddr_in servaddr,cliaddr;


listenfd=socket(AF_INET,SOCK_STREAM,0);

bzero(&servaddr, sizeof(servaddr));

servaddr.sin_family = AF_INET; servaddr.sin_port = htons(8888);


servaddr.sin_addr.s_addr = htonl(INADDR_ANY);

bind(listenfd,(struct sockaddr *) &servaddr, sizeof(servaddr));

listen(listenfd,5);

clen=sizeof(cliaddr); printf("\nThe Server is in listening mode...\n");


connfd=accept(listenfd,(struct sockaddr * ) &cliaddr, &clen); n=read(connfd,msg,50);
msg[n]='\0'; printf("\nThe received string from the client is '%s'\n\n",msg);
write(connfd,msg,n); exit(0);
return 0;
}

TCP Client Program:

#include<stdio.h>
303105255 Page 50
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code:303105255
B.Tech: CSE 2nd Year 4th Semester
Annexure No :
#include<netinet/in.h>
#include<sys/socket.h> int
main() { int sockfd,n; char
msg[50],msg1[50];
socklen_t slen,len;
struct sockaddr_in servaddr;

bzero(&servaddr,sizeof(servaddr));
servaddr.sin_family = AF_INET;
servaddr.sin_port = htons(8888);
inet_pton(AF_INET,"127.0.0.1", &servaddr.sin_addr);

sockfd=socket(AF_INET,SOCK_STREAM,0);
slen = sizeof(servaddr);
connect(sockfd,(struct sockaddr *) &servaddr, slen);
printf("\nEnter the string that u wanna send to server:");
scanf("%s",&msg);

write(sockfd,msg,50); n=read(sockfd,msg1,50); msg1[n]='\0';


printf("\nThe received string from the server is '%s'\n\n",msg1); exit(0);
}

OUTPUT:-

303105255 Page51
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code:303105255
B.Tech: CSE 2nd Year 4th Semester
Annexure No :

10.4 UDP Socket Program :


UDP Server Program :
#include<stdio.h> #include<netinet/in.h>
#include<sys/socket.h>

int main()
{
int sockfd,n; char msg[50]; socklen_t len; struct sockaddr_in
servaddr,cliaddr;

sockfd=socket(AF_INET,SOCK_DGRAM,0);

bzero(&servaddr, sizeof(servaddr)); servaddr.sin_family = AF_INET;


servaddr.sin_port = htons(9600); servaddr.sin_addr.s_addr =
htonl(INADDR_ANY);

bind(sockfd,(struct sockaddr *) &servaddr, sizeof(servaddr)); len= sizeof(cliaddr);

n=recvfrom(sockfd,msg,50,0,(struct sockaddr *) &cliaddr, &len); msg[n]='\0'; printf("\nThe


received string from the client is '%s'\n",msg); sendto(sockfd,msg,n,0,(struct

303105255 Page52
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code:303105255
B.Tech: CSE 2nd Year 4th Semester
Annexure No :
sockaddr *) &cliaddr,len); exit(0);
return 0;
}

UDP Client Program :


#include<stdio.h> #include<netinet/in.h>
#include<sys/socket.h>

int main() { int sockfd,n; char msg[50],msg1[51];


socklen_t len; struct sockaddr_in servaddr;
bzero(&servaddr,sizeof(servaddr));
servaddr.sin_family = AF_INET; servaddr.sin_port
= htons(9600); inet_pton(AF_INET,"127.0.0.1",
&servaddr.sin_addr);

sockfd=socket(AF_INET,SOCK_DGRAM,0); len
= sizeof(servaddr);
printf("\nEnter the string that u wanna send to server:"); scanf("%s",msg);

sendto(sockfd,msg,strlen(msg),0,(struct sockaddr *) &servaddr, len);


n=recvfrom(sockfd,msg1,51,0,NULL,NULL);

msg1[n]='\0'; printf("\nThe received string from the server is '%s'\n\n",msg1); exit(0); return
0;
}

303105255 Page53
Faculty of Engineering & Technology
Subject Name: Computer Network
Subject Code:303105255
B.Tech: CSE 2nd Year 4th Semester
Annexure No :

303105255 Page 54

You might also like