You are on page 1of 49

KARMAVEER BHAURAO PATIL,

COLLEGE OF ENGINEERING SATARA

Department Of Electronics Engineering

Laboratory Journal of

Computer Network

CLASS: B.E. (ELECTRONICS)


YEAR 2017-18
COMPUTER NETWORK

KARMAVEER BHAURAO PATIL COLLEGE OF


ENGINEERING, SATARA
COMPUTER NETWORKS

Name: ________________________________________________

Roll No: __________ Exam Seat No. _______________________

INDEX
Sr.No. Title Page No. Date Sign
1(A) Familiarization with Networking Components
and Devices: LAN Adapters, Hubs, Switches and
Routers etc.
1(B) Familiarization with Transmission media and
Tools: Co-axial cable, UTP cable, Crimping
Tool, Connectors
.
2 Practical Implementation of cross wired cable
and Straight through cable using crimping tool.

3 Study of various LAN topologies and their


creation using network devices, cables and
computers.
4 Study of Bit Stuffing and Byte Stuffing.
5 Implementation of different network
commands
6 Study, Design and Implementation of class A, B,
C, D, and E networks.
7 Demonstration on workgroup creation and File
sharing.
8 Study and Experimentation Router
Configuration
9 Experimentation to Insert Digital Signature to
Word Document
10 Study of TELNET

Teaching Staff Head of Department

1
COMPUTER NETWORK

EXPERIMENT NO: 1(A)

TITLE: Familiarization with Networking Components


and Devices: LAN Adapters, Hubs, Switches and
Routers etc.
Name:
Class: B.E. Electronics Div:
Roll No:
Subject:
Date:

2
COMPUTER NETWORK

EXPERIMENT NO. 1 (A)


Aim: Familiarization with Networking Components and devices: LAN
Adapters, Hubs, Switches, and Routers etc.
Resources: PC ,Hub, LAN adapter ,Router etc.
Theory :
LAN Adapter:-
An expansion board that is used to connect a computer or computing device to a network.
LAN adapter is the most common and generic alternate name for a Network Interface Card
(NIC). However, many similar products, such as a Wireless USB LAN Adapter is also called
a LAN adapter.

Wireless USB LAN adapter:-


A high-speed wireless network card that is used to access a network through a USB port on a
computer or laptop. Most wireless USB LAN adapters look like small USB flash drives and
usually are based on the 802.11g standard which provides a data rate up to 54-Mbps in a
wireless LAN environment. Some wireless USB LAN adapters may also support the 802.11b
standard. A wireless USB LAN adapter basically enables you to share files, folders, printers,
other network resources and Internet access.

Network Hub:-

Definition: In computer networking, a hub is a small, simple, inexpensive device that joins

3
COMPUTER NETWORK

multiple computers together. Many network hubs available today support the Ethernet
standard. Other types including USB hubs also exist, but Ethernet is the type traditionally
used in home networking. Technically speaking, two different types of hubs exist:
 passive
 active
Passive hubs do not amplify the electrical signal of incoming packets before broadcasting
them out to the network. Active hubs, on the other hand, do perform this amplification, as
does a different type of dedicated network device called a repeater. Some people use the
terms concentrator when referring to a passive hub and multiport repeater when referring
to an active hub.

Network switch:-
A network switch (sometimes known as a switching hub) is a computer networking device
that is used to connect devices together on a computer network. A switch is considered more
advanced than a hub because a switch will only send a message to the device that needs or
requests it, rather than broadcasting the same message out of each of its ports.[1]
A switch is a multi-port network bridge that processes and forwards data at the data link layer
(layer 2) of the OSI model. Some switches have additional features, including the ability to
route packets. These switches are commonly known as layer-3 or multilayer switches.

Router:-
Router: Routers are devices (computers) containing software that help in determining thebest
path out of the available paths, for a particular transmission. They consist of a combination of
hardware and software. The hardware includes the physical interfaces to the various networks
in the internet work. The two main pieces of software in a router are the operating system and
4
COMPUTER NETWORK

the routing protocol. Routers use logical and physical addressing to connect two or more
logically separate networks. They accomplish this connection by organizing the large
network into logical network segments or sub-networks. Each of these sub networks is given
a logical address. This allows the networks to be separate but still access each other and
exchange data when necessary. Data is grouped into packets, or blocks of data. Each packet,
in addition to having a physical device address, has a logical network address. Routers are
frequently used to interconnect identical networks as well as to interconnect networks with
different types of hardware.
How Routers Works
Routers are interconnectivity devices that are used to transfer the datum packets along
networks by visualizing the networks path. Routers visualizing the networks path to many
networks such as Electronic networks, Transport networks and phone networks. Two ways
are exist for routers operation using either control plane or forwarding plane. In control plane
the router sends the precise data packets to their specific location. On the other hand in
forwarding plane router does not remember the sending or receiving information about the
packets.
Advantages of Routers

Routers route the data in an organized way. Routers generate a reliable connection between
hosts. Routers is used for alternatively incase the main is fail to transfer data.

Conclusion:

5
COMPUTER NETWORK

EXPERIMENT NO: 1(B)

TITLE: Familiarization with Transmission media


and Tools: Co-axial cable, UTP cable, Crimping Tool,
Connectors.
Name:
Class: B.E. Electronics Div:
Roll No:
Subject:
Date:

6
COMPUTER NETWORK

EXPERIMENT NO. 1 (B)


Aim: Familiarization with Transmission media and Tools: Co-axial cable,
UTP Cable, Crimping Tool, Connectors etc.
Resources: PC ,Coaxial cable, UTP Cable, crimping tool etc.
Theory :
What is transmission media?
Transmission media is a pathway that carries the information from sender
toreceiver. We use different types of cables or waves to transmit data. Data is transmitted
normally through electrical or electromagnetic signals. An electrical signal is in the form of
current. An electromagnetic signal is series of electromagnetic energy pulses at various
frequencies. These signals can be transmitted through copper wires, optical fibers,
atmosphere, water and vacuum Different Medias have different properties like bandwidth,
delay, cost and ease of installation and maintenance. Transmission media is also called
Communication channel.
Types of Transmission Media
Wired or Guided Media or Bound Transmission Media
Wireless or Unguided Media or Unbound Transmission Media
Wired or Guided Media or Bound Transmission Media:
Bound transmission media are the cables that are tangible or have physical existence
and are limited by the physical geography. Popular bound transmission media in use are
twisted pair cable, co-axial cable and fiber optical cable. Each of them has its own
characteristics like transmission speed, effect of noise, physical appearance, cost etc.
Wireless or Unguided Media or Unbound Transmission Media:
Unbound transmission media are the ways of transmitting data without using any
cables. These media are not bounded by physical geography. This type of transmission is
called Wireless communication. Nowadays wireless communication is becoming popular.
Wireless LANs are being installed in office and college campuses. This transmission uses
Microwave, Radio wave, Infra red are some of popular unbound transmission media.

7
COMPUTER NETWORK

Guided Transmission Media


Types of Twisted Pair
The two types of twisted pairs are:
1. Unshielded twisted pair (UTP) ,
2. Shielded twisted pair (STP)
1. Unshielded Twisted Pair (UTP)
It consists of colour-coded copper wires, but does not include any foil or braiding as insulator
to protect against interference. Wire pairs within each cable have varied amounts of twists per
foot to produce cancellation. There are different categories of UTP. The following table
shows the UTP categories, the no. of pairs in each, and the grade of cable each uses and how
they are implemented.

2. Shielded Twisted Pair (STP)


STP is made up of pairs of copper wires that are twisted together. The pairs are covered in a
foil or braided mesh, as well as outer PVC jacket. This foil or mesh prevents the penetration

8
COMPUTER NETWORK

of electromagnetic noise and eliminate cross talk. This shielding must be grounded to prevent
the foil or braided mesh from becoming a magnet for electricity.

Advantage
Advantage of STP over UTP
STP is less susceptible to noise as compared to UTP and therefore reduces the cross talk and
interference.
Disadvantages of STP
1. It must be properly grounded.
2. It is more expensive than UTP.
3. It is difficult to terminate.
Advantages of Twisted pair cable
1. It can be used to carry both analog and digital data.
2. It is relatively easy to implement and terminate.
3. It is the least expensive media of transmission for short distances.
4. If portion of a twisted pair cable is damaged it does not effect the entire network.
Disadvantages of Twisted pair cable
1. It offers poor noise immunity as a result signal distortion is more.
2. Attenuation is very high.
3. It supports lower bandwidth as compared to other Medias. It supports 10 mbps upto a
distance of 100 meters on a 10BASE-T.
4. It offers very poor security and is relatively easy to tap.
5. Being thin in size, they are likely to break easily.
Coaxial Cable
Coaxial cable has two wires of copper. The core wire lies in center and is made of solid
conductor. Core is enclosed in an insulating sheath. Over the sheath the second wire is
wrapped around and that too in turn encased by insulator sheath. This all is covered by plastic
cover.
9
COMPUTER NETWORK

Because of its structure coax cables are capable of carrying high frequency signals than that
of twisted pair cables. The wrapped structure provides it a good shield against noise and
cross talk. Coaxial cables provide high bandwidth rates of up to 450 mbps. There are three
categories of Coax cables namely, RG-59 (Cable TV), RG-58 (Thin Ethernet) and RG-11
(Thick Ethernet. RG stands for Radio Government. Cables are connected using BNC
connector and BNC-T. BNC terminator is used to terminate the wire at the far ends.
Fiber-Optics Cable
A cable with central glass tube covered with protective shield which transmit data using
photons is fiber optics cable. These cables transmit data via concentrated bursts of
laserbeams which are carried through bundles of hair thin glass fibers. They have
advantagesover electronic cables in transmission speed and volume. This technology has
revolutionized telecommunication applications which used electronic cables. Fiber optics
cables as free from electro-magnetic interference as well as wire tapping. fiber optics cable
considered a broad-band communication channel

Unguided Transmission Media:- Unguided transmission media extend beyond


thelimiting confines of cabling. They provide an excellent Communication Networks
alternative for WANS. The lack of physical restrictions provides larger bandwidth as well as
wide area capabilities. Unbound media typically operate at very high frequencies. The three
types of unbound transmission media are:
Radio wave

Micro wave
Infrared
10
COMPUTER NETWORK

Radiowaves Transmission Although Radio waves are prevalent and well understood, we
arejust beginning to realize their enormous potential as a networking medium. Radio waves
can operate on a single or multiple frequency bands.

Radiowaves are Omni directional i.e. they travel in all the directions from the source.
Because of this property, transmitter and receiver need not to be aligned. Radiowaves can
penetrate buildings easily, so they are widely use for communication both indoors outdoors.
At high frequencies, radiowaves tends to travel in straight line and bounce off the obstacles.
They are also absorbed by rain. Radio wavesme widely used for AM and FM radio,
television, cordless telephone, cellular phones, paging and wireless LAN. Microwave
Transmission
Microwaves have been used in data communications for a long time. They have a higher
frequency than radio waves and therefore can handle larger amounts of data.
Microwave transmission is line of sight transmission. The transmit station must be in visible
contact with the receive station. This sets a limit on the distance between stations depending
on the local geography. Typically the line of sight due to the Earth's curvature is only 50 km
to the horizon! Repeater stations must be placed so the data signal can hop, skip and jump
across the
Conclusion :

11
COMPUTER NETWORK

EXPERIMENT NO: 2

TITLE: Practical Implementation of cross wired


cable and Straight through cable using crimping tool.
Name:
Class: B.E. Electronics Div:
Roll No:
Subject:
Date:

12
COMPUTER NETWORK

EXPERIMENT NO. 2
Aim: :Practical implementation of straight Through and cross-wired cable
crimping tool.

Resources: RJ-45 connector, Crimping Tool, Twisted pair Cable

Theory :To do these practical following steps should be done:

1.Start by stripping off about 2 inches of the plastic jacket off the end of the cable. Be very
careful at this point, as to not nick or cut into the wires, which are inside. Doing so could alter
the characteristics of your cable, or even worse render is useless. Check the wires, one
moretime for nicks or cuts. If there are any, just whack the whole end off, and start over.

2.Spread the wires apart, but be sure to hold onto the base of the jacket with your other hand.
You do not want the wires to become untwisted down inside the jacket. Category 5 cable
must only have 1/2 of an inch of 'untwisted' wire at the end; otherwise it will be 'out of spec'.
At this point, you obviously have ALOT more than 1/2 of an inch of un-twisted wire.

3. You have 2 end jacks, which must be installed on your cable. If you are using a pre-made
cable, with one of the ends whacked off, you only have one end to install - the crossed over
end. Below are two diagrams, which show how you need to arrange the cables for each type
of cable end. Decide at this point which end you are making and examine the associated
picture below.
Diagram shows you how to prepare Cross wired connection

Diagram shows you how to prepare straight through wired connection:

13
COMPUTER NETWORK

Conclusion:

14
COMPUTER NETWORK

EXPERIMENT NO: 3

TITLE: Study of various LAN topologies and their


creation using network devices, cables and
computers.
Name:
Class: B.E. Electronics Div:
Roll No:
Subject:
Date:

15
COMPUTER NETWORK

EXPERIMENT NO. 3
Aim: Study of various LAN topologies and their creation using network
devices, cables and computers.
Resources : PC, Cisco packet tracer software.
Theory :

Bus topology
Bus Topology is the simplest of network topologies. In this type of topology, all the nodes
(computers as well as servers) are connected to the single cable (called bus), by the help of
interface connectors. This central cable is the backbone of the network and is known as Bus
(thus the name). Every workstation communicates with the other device through this Bus

Advantages (benefits) of Bus Topology


It is easy to set-up and extend bus network.
Cable length required for this topology is the least compared to other networks.
3) Bus topology costs very less.
4) Linear Bus network is mostly used in small networks. Good for LAN.

Disadvantages (Drawbacks) of Bus Topology


1) There is a limit on central cable length and number of nodes that can be connected.

16
COMPUTER NETWORK

2) Dependency on central cable in this topology has its disadvantages. If the


main cable (i.e. bus ) encounters some problem, whole network breaks
down.

3) Proper termination is required to dump signals. Use of terminators is must.

4) It is difficult to detect and troubleshoot fault at individual station.

5) Maintenance costs can get higher with time.

6) Efficiency of Bus network reduces, as the number of devices connected to it increases.

7) It is not suitable for networks with heavy traffic.

8) Security is very low because all the computers receive the sent signal from the source.

Star topology
In Star topology, all the components of network are connected to the central device
called “hub”, where nodes were connected to central cable, here all the workstations are
connected to central device with a point-to-point connection. So it can be said that
every computer is indirectly connected to every other node by the help of”.“hub

Star Topology
Advantages of Star Topology
1) As compared to Bus topology it gives fast service to message to be transmitted to all the
workstations.

2) Easy to connect new nodes or devices. In star topology new nodes can be added easily
without affecting rest of the network. Similarly components can also be removed easily.
3) Centralized management. It helps in monitoring the network.
4) Failure of one node or link at the same time doesn’t affect the network.
Disadvantages of Star Topology
1) Too much dependency on central device has its own drawbacks. If it fails whole network

17
COMPUTER NETWORK

goes down.
3. The use of hub, a router or a switch as central device increases the overall cost of the
network.
4. Performance and as well number of nodes which can be added in such topology is
depended on capacity of central device.
Ring Topology
In Ring Topology, all the nodes are connected to each-other in such a way that they
make a closed loop. Each workstation is connected to two other components on either side,
and it communicates with these two adjacent neighbours. Data travels around the network, in
one direction. Sending and receiving of data takes place by the help of TOKEN.

Ring Topology

Advantages of Ring Topology


1) This type of network topology is very organized. Each node gets to send the data when it
receives an empty token. This helps to reduces chances of collision. Also in ring topology all
the traffic flows in only one direction at very high speed.
2) Even when the load on the network increases, its performance is better than that of Bus
topology.
3) There is no need for network server to control the connectivity between workstations.

4) Additional components do not affect the performance of network. 5) Each computer has
equal access to resources.
Disadvantages of Ring Topology
1) Each packet of data must pass through all the computers between source and destination.
This makes it slower than Star topology.
2) If one workstation or port goes down, the entire network gets affected.
3) Network is highly dependent on the wire which connects different components.
4) MAU’s and network cards are expensive as computer
18
COMPUTER NETWORK

Mesh Topology
In a mesh network topology, each of the network node, computer and other devices, are
interconnected with one another. Every node not only sends its own signals but also relays
data from other nodes. In fact a true mesh topology is the one where every node is connected
to every other node in the network. This type of topology is very expensive as there are many
redundant connections, thus it is not mostly used in computer networks. It is commonly used
in wireless networks. Flooding or routing technique is used in mesh topology.

Mesh Topology

Advantages of Mesh topology


1) Data can be transmitted from different devices simultaneously. This topology can
withstand high traffic.
2) Even if one of the components fails there is always an alternative present. So data transfer
doesn’t get affected.
3) Expansion and modification in topology can be done without disrupting other nodes.

Disadvantages of Mesh topology

1) There are high chances of redundancy in many of the network connections.

2) Overall cost of this network is way too high as compared to other network topologies.

3) Set-up and maintenance of this topology is very difficult. Even administration of the
network is tough.

Tree Topology

Tree Topology integrates the characteristics of Star and Bus Topology. Earlier we saw how in
Physical Star network Topology, computers (nodes) are connected by each other through
central hub. And we also saw in Bus Topology, work station devices are connected by the
common cable called Bus. After understanding these two network configurations, we can
19
COMPUTER NETWORK

understand tree topology better. In Tree Topology, the numbers of Star networks are
connected using Bus. This main cable seems like a main stem of a tree, and other star
networks as the branches. It is also called Expanded Star Topology. Ethernet protocol is
commonly used in this type of topology. The diagram below will make it clear.

Tree Topology

Advantages of Tree Topology


1. It is an extension of Star and bus Topologies, so in networks where these topologies
can'tbe implemented individually for reasons related to scalability, tree topology is the best
alternative.
2.Expansion of Network is possible and easy.

3. Here, we divide the whole network into segments (star networks), which can be easily
managed and maintained.

Disadvantages of Tree Topology

1. Because of its basic structure, tree topology, relies heavily on the main bus cable, if it
breaks whole network is crippled.

1 As more and more nodes and segments are added, the maintenance becomes difficult.

2 Scalability of the network depends on the type of cable used.

Hybrid Topology
Before starting about Hybrid topology, we saw that a network topology is a connection of
various links and nodes, communicating with each other for transfer of data. We also saw
various advantages and disadvantages of Star, Bus, Ring, Mesh and Tree topologies. Now
lets discuss what Hybrid Network topology is and why it finds its application in Wide Area
20
COMPUTER NETWORK

Networks. Hybrid, as the name suggests, is mixture of two different things. Similarly in this
type of topology we integrate two or more different topologies to form a resultant topology
which has good points (as well as weaknesses) of all the constituent basic topologies rather
than having characteristics of one specific topology. This combination of topologies is done
according to the requirements of the organization. For example, if there exists a ring topology
in one office department while a bus topology in another department, connecting these two
will result in Hybrid topology. Remember connecting two similar topologies cannot be
termed as Hybrid topology. Star-Ring and Star-Bus networks are most common examples of
hybrid network. Let's see the benefits and drawbacks of this networking architecture

Hybrid Network Topology

Advantages of Hybrid Network Topology


1) Reliable: Unlike other networks, fault detection and troubleshooting is easy in this type
of topology. The part in which fault is detected can be isolated from the rest of network
and required corrective measures can be taken, WITHOUT affecting the functioning of
rest of the network.
2) Scalable: Its easy to increase the size of network by adding new components,
withoutdisturbing existing architecture.
3) Flexible: Hybrid Network can be designed according to the requirements of
theorganization and by optimizing the available resources. Special care can be given to
nodes where traffic is high as well as where chances of fault are high.
4) Effective: Hybrid topology is the combination of two or more topologies, so we
candesign it in such a way that strengths of constituent topologies are maximized while
there weaknesses are neutralized. For example we saw Ring Topology has good data
reliability (achieved by use of tokens) and Star topology has high tolerance capability
21
COMPUTER NETWORK

(as each node is not directly connected to other but through central device), so these two
can be used effectively in hybrid star-ring topology.
Disadvantages of Hybrid Topology
1) Complexity of Design: One of the biggest drawback of hybrid topology is its design.
Itsnot easy to design this type of architecture and its a tough job for designers.
Configuration and installation process needs to be very efficient.
2) Costly Hub: The hubs used to connect two distinct networks, are very expensive.
Thesehubs are different from usual hubs as they need to be intelligent enough to work
with different architectures and should be function even if a part of network is down.
3) Costly Infrastructure: As hybrid architectures are usually larger in scale, they
require alot of cables, cooling systems, sophisticate network devices, etc.
PROCEDURE:

1. Double Click on cisco packet tracer icon on the desktop. The window opens.
2. Click on file  new
3. . Network connectors and devices are present in the toolbox at the bottom left corner of the
window.
4. Select the devices from the end device by clicking on it. In this experiment we select a
generic device. Take as many devices necessary.
5. We can connect the devices using connection icon by clicking on it. There is a variety of
cables select automatically choose connection type in it and connect the devices.
6. Click on the device a new window opens. Select desktop in it and type the following in IP
configuration.
 Select static.
 IP address: 192.168.10.2
 The subnet mask will be auto filled.
 Default gateway: 192.168.10.1
 Note that the LSB of IP address changes with each devices.

The figure shows the window.

22
COMPUTER NETWORK

Figure a

7. Select add simple PDU(P) from the toolbar to the right of window and select the
device from where to where the PDU(P) should be sent.
8. We get the report at the bottom right corner of the window of whether the PDU is
successful sent or not.
9. In order to have the simulation, select the simulation icon just above the report.
10. Now again select add simple PDU(P) from the toolbar to the right of window and
select the device from where to where the PDU(P) should be sent.
11. To Simulate click on Auto Capture/Play button in the play controls and observe the
process of s ending packets.
12. The event list in the simulation panel keeps a track of time required for each
transmission.

23
COMPUTER NETWORK

Star Topology

Tree topology

24
COMPUTER NETWORK

Ring Topology.

Conclusion:

25
COMPUTER NETWORK

EXPERIMENT NO: 4

TITLE: Study of Bit and Byte stuffing


Name:
Class: B.E. Electronics Div:
Roll No:
Subject:
Date:

26
COMPUTER NETWORK

EXPERIMENT NO. 4

Aim: Study of Bit Stuffing and Byte Stuffing.


Write a program to implement bit stuffing &Destuffing.
Write a program to implement character stuffing &Destuffing.

Resources: PC,Turbo C, C++.


Theory :
 Bit Stuffing and Byte(Character) Stuffing
While sending data over network, the data link layer divide into frames. Framing have
several advantages than send raw very large data. It reduces the probability of error and reduces
the amount of retransmission needed.
There exist two general methods for framing: fixed size framing and variable size framing. In
fixed size framing, the data divided into fixed size frames and send over the transmission media.
In fixed-size framing, there is no need for defining the boundaries of the frames; the size itself
can be used as a delimiter. ATM network use fixed size packets called cells.
In variable size framing, the data divided into variable size frames. Here the network system
needs a mechanism to distinguish the end of a packet and beginning of another one. Two
protocols are used for this purpose: character oriented protocol and bit oriented protocol.
 Character-Oriented Protocols
In character-oriented protocol, we add special characters (called flag) to distinguish
beginning and end of a frame. Usually flag has 8-bit length. The character-oriented protocols are
popular only with text data. While using character–oriented protocol another problem is arises,
pattern used for the flag may also part of the data to send. If this happens, the destination node,
when it encounters this pattern in the middle of the data, assumes it has reached the end of the
frame. To deal with this problem, a byte stuffing (also known ascharacter stuffing) approach
was included to character-oriented protocol. In byte stuffing aspecial byte is add to the data part,
this is known as escape character (ESC). The escape characters have a predefined pattern. The
receiver removes the escape character and keeps the data part. It cause to another problem, if the
text contains escape characters as part of data. To deal with this, an escape character is prefixed
with another escape character. The following figure explains everything we discussed about
character stuffing.

27
COMPUTER NETWORK

Bit-Oriented Protocols

In a bit-oriented protocol, the data to send is a series of bits. In order to distinguish


frames, most protocols use a bit pattern of 8-bit length (01111110) as flag at the beginning and
end of each frame. Here also cause the problem of appearance of flag in the data part to deal with
this an extra bit added. This method is called bit stuffing. In bit stuffing, if a 0 and five
successive 1 bits are encountered, an extra 0 is added. The receiver node removes the extra-added
zero. This process is illustrate below,

28
COMPUTER NETWORK

(1) Write a program to implement Bit stuffing &Destuffing.

Bit Stuffing and Destuffing


1. Include <iostream.h>,<conio.h>,<io.h> files both in transmitter & receiver programs.
2. During the transmission, attach a flag pattern (01111110) at the
start & end of data unit.
3. If transmitter sees five consecutive one’
4. At the receiving end, whenever in data it finds five consecutive one’s & zero then
the
receiver will de stuff that zero bit. e.g. If the Pattern to be transmitted is
00011110111111000,
then at the transmitter side will be 000111101111101000 because as 5 consecutive 1’s
should
be stuffed by ‘ 0 ‘and at the receiver detected side again as it will detect 1 after 5
one’s.
Code:
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
inti,j=0;
char a[20],b[20];
char flag[8]="01111110",esc='0';
clrscr();
printf("\n Enter any bit stream:");
fflush(stdin);
gets(a);
for(i=0;i<8;i++)
{

b[j]=flag[i];
j++;
29
COMPUTER NETWORK

} for(i=0;a[i]!='\0';i++)
{
if(a[i-1]=='1'&&a[i-2]=='1'&&a[i-3]=='1'&&a[i-4]=='1'&&a[i-5]=='1')
{
b[j]=esc;
j++;
b[j]=a[i];
j++;
a[i-1]=0;
}
Else
{
b[j]=a[i];
j++;
}} for(i=0;i<8;i++)
{

b[j]=flag[i];
j++;
}
b[j]='\0';
printf("\n Stuffed bit stream is:");
puts(b);
printf("\n Destuffed bit stream is:");
for(j=0,i=0;i<8;j++,i++)
{
if (b[j]==flag[i])
{ for (;b[j]!='\0';j++)
{
if(b[j]=='0'&&b[j+1]=='1'&&b[j+2]=='1'&&b[j+3]=='1'&&b[j+4]=='1'&&b[j+5]=='1'&&b[j+6]

=='1'&&b[j+7]=='0')
{
goto end;
}
else if(b[j]=='0'&&b[j-1]=='1'&&b[j-2]=='1'&&b[j-3]=='1'&&b[j-4]=='1'&&b[j-5]=='1')
{
Else
printf("\%c",b[j]);
}
end:
getch();
}

Output:

30
COMPUTER NETWORK

(2) Write a program to implement Character stuffing &Destuffing.

Character Stuffing and Destuffing


1. Include <iostream.h>,<conio.h>,<io.h> files both in transmitter & receiver programs.
2. This is type of Framing Method.
3. During the transmission attach a ASCII Code pattern DLE STX at the start &
DLE ETX end of data Unit.
4. If transmitter sees DLE stuff another DLE text in data.
5. At the receiving end, whenever the data it finds five consecutive DLE then
receiver will destuff One DLE.
Code:
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{inti,j=0;
charstr[100],str2[100],flag,esc;
clrscr();
printf("\n Enter the
string:"); gets(str);
printf("\n Enter the
flag:");
scanf("%c",&flag);
printf("\n Enter the stuffing
bit:"); fflush(stdin);
scanf("%c",&esc);
str2[j]=flag;
j++;
for(i=0;str[i]!='\0';i++)
{i
f(str[i]==flag)
{
str2[j]=esc;
j++;
}
else if(str[i]==esc)
{
str2[j]=esc;
j++;
}
str2[j]=str[i];
j++;
}
str2[j]=flag;
j++;
str2[j]='\0';
printf("\n Stuffed data is:
%s",str2); printf("\n\n Destuffed
data is:"); for(j=0;str2[j]!='\0';j++)
{
str2[0]='\0';
31
COMPUTER NETWORK

if(str2[j]==esc&&(str2[j+1]==flag||str2[j+1]==esc))
{
printf("%c",str2[j+1]);
j++;
}
else if(str2[j]==flag&&str2[j+1]=='\0')
{
goto end;
}
elseprintf("%c",str2
[j]);
}
end:
getch();
}

Output:

Conclusion:

32
COMPUTER NETWORK

EXPERIMENT NO: 5

TITLE: Study Of different Network Commands


Name:
Class: B.E. Electronics Div:
Roll No:
Subject:
Date:

33
COMPUTER NETWORK

EXPERIMENT NO. 5
Aim: Study of different network commands

Apparatus: PC, LAN cable & Switch

Theory:

Different network commands used are as follows:

ipconfig: The ipconfig command displays information about the host (the computer your sitting
at)computer TCP/IP configuration. To use the command, just type ipconfig at the Command Prompt.
A list of all the network connections will be displayed on the computer . This command is a fast way
of determining computer’s IP address being used and other information, such as the address of its
default gateway.

ping: Ping is the most basic TCP/IP command, and it’s the same as placing a phone call to your best
friend. You pick up your telephone and dial a number, expecting your best friend to reply with
“Hello” on the other end. Computers make phone calls to each other over a network by using a Ping
command.
The Ping commands main purpose is to place a phone call to another computer on the network, and
request an answer. Ping has 2 options it can use to place a phone call to another computer on the
network. It can use the computers name or IP address.

netstat: Netstat displays a variety of statistics about a computers active TCP/IP connections. This
tool is most useful when you’re having trouble with TCP/IP applications such as HTTP, and FTP.

sfc /scannow: Windows includes a system file checker tool that scans all the Windows system files
and looks for problems. If system files are missing or corrupted, the system file checker will repair
them. This may fix problems with some Windows systems.

nslookup: When a domain name is entered , computer looks up the IP address associated with that
domain name. nslookup command can be used to find that information out for yourself. For example,
inslookup www.google.com is entered at the Command Prompt to quickly find out our server’s
assigned IP address.

arp –a: is short for address resolution protocol, It will show the IP address of your computer along
with the IP address and MAC address of your router.

Observations: The above mentioned commands were performed and their output observed
is as below:

34
COMPUTER NETWORK

ipcongif:

ping:

netstat:

sfc /scannow:

35
COMPUTER NETWORK

nslookup:

arp –a:

Conclusion:

36
COMPUTER NETWORK

EXPERIMENT NO: 6

TITLE: Study, design and implementation of class A,


B, C, D and E
Name:
Class: B.E. Electronics Div:
Roll No:
Subject:
Date:

37
COMPUTER NETWORK

EXPERIMENT NO. 6
Aim: Study , Design and implementation of Class A, B, C,D and E
Networks.
Resources: PC,Turbo C, C++.
Theory :
IP Address Classes:-
• IP addressing supports five different address classes: A, B, C, D and E. Only classes A,
B and C are available for commercial use.
Class A addresses
1. Class A addresses are designed for large organizations with a large number of hosts or
routers.
2. In this the first octet of the address identifies the network and the next three octets are
used to identify the host.
The first bit of first octet is always 0 and the remaining 7 bits are used to identify
the network address.
The next three octets i.e. 24 bits are used to identify the host.
The class support addresses from 0.0.0.0 to 0.255.255.255

3.The first block of network address starts with 1.0.0.0 and the last block of network address
starts with 127.0.0.0.
4.As there are 7 bits in network address, 27 = 128 blocks of network address are possible. Out
of these two network blocks are reserved. Hence total 126 address blocks are used.

5.Each network blocks can have 224--- 2 hosts i.e. 16,777,214 host address. Two addresses
are less as one address is reserved for the broadcast address and one address is reserved for
the network.
6.A block in class A is too large for almost any organization. This means most of the
addresses in class A are wasted and are not used.
Class B address
1. The class B addresses are designed for medium sized organizations with tens of
thousands of attached hosts or routers.
2. In this, the first two octets of the address identify the network and the next two octets
identify the host within the network.
3. The first two bits (high order bits) of first octet are always 1, 0. Thus the remaining 14
bits identify the network

38
COMPUTER NETWORK

4. The third and fourth octet i.e. 6 bits are used to identify the host.
5. The first network block of this class covers the addresses from 128.0.0.0 to
128.0.255.255 (net id 128.0). The last network block of this class covers addresses from
191.255.255.255 (net id 191.255)
6. The maximum number of network blocks in class B is 214 = 16384. 7 Each network
block in class B can have 216--- 2 = 65,534 hosts. 8. A block in class B is also very large
and most of the address in class B is also wasted.

Class C address
1.The class C addresses is designed for small organizations with a small number of
attached hosts or routers.
2.In class C, the first three octets of address are used for network and the last octet is used
to identify the host.
3.The first three bits of first octet are always set to 1, 1, 0.
4.The remaining 24 - 3 = 21 bits are used for network identification and only 8 bits are
used for host.
5.In class C, 221 = 2,097,152 network blocks are possible.
6.Thus, each block in class C address can have 28 - 2 = 254 hosts.
7.The first block of network covers addresses from 192.0.0.0 to 192.0.0.255. The last
block of network covers the addresses form 223.255.255.0 to 223.255.255.255
8.The class C addresses are too less for many organizations as it supports only 254 hosts in
a network.
Following are the classes of IP:-
CLASSES Range
Class A 1.0.0.0 to 127.255.255.255
Class B 128.0.0.0 to 191.255.255.255
Class C 192.0.0.0 to 223.255.255.255
Class D 224.0.0.0 to 239.255.255.255
Class E 240.0.0.0 to 255.255.255.255

Class D address
1.Class D addresses are used for multicast groups (multicasting)
The concept of division of octets into network id and host id does not apply to class D

2.The first four bits of first octet in class D are always set to 1,1,1,0.
3.The address range is 224.0.0.0 to 239.255.255.255
39
COMPUTER NETWORK

Class E address
1. The Class E address is reserved for future use and is experimental.
2. The concept of network id and host id does not apply on class E also.
3. The first four bits of first octet are always set to 1,1,1,1.
The address range for class E is 240.0.0.0 to 255.255.255.255.

IP addresses for Class A,B,C,D,E

Summary Of Classes

Problem Statement
Write a C program to find the Class of IPv4 address.
Resources: Turbo C, C++.
Code:
(a) Implementation of IPV-4
#include<stdio.h>
#include<conio.h>
void main()
40
COMPUTER NETWORK

{
int IP1,IP2,IP3,IP4;
printf("enter IP address:");
scanf("%d\n",&IP1);
scanf("%d\n",&IP2);
scanf("%d\n",&IP3);
scanf("%d",&IP4);
printf("%d . %d . %d . %d\n",IP1,IP2,IP3,IP4);
if(IP1>255 || IP2>255 || IP3>255 || IP4>255)
{
printf("INVALID ");
}
else if(IP1>=0 && IP1<127)
{
printf("IP ADDRESS BELONGS TO CLASS A");
}
else if(IP1>=128 && IP1<191)
{
printf("IP ADDRESS BELONGS TO CLASS B");
}
else if(IP1>=192 && IP1<223)
{
printf("IP ADDRESS BELONGS TO CLASS C");
}
else if(IP1>=224 && IP1<239)

{
printf("IP ADDRESS BELONGS TO CLASS D");
}
else if(IP1>=240 && IP1<=255)
{
printf("IP ADDRESS BELONGS TO CLASS E");
}
else
{printf("INVALID IP ADDRESS");
}
41
COMPUTER NETWORK

getch();
}
Output:

Conclusion:

42
COMPUTER NETWORK

EXPERIMENT NO: 10

TITLE: To verify Telnet.


Name:
Class: B.E. Electronics Div:
Roll No:
Subject:
Date:

43
COMPUTER NETWORK

EXPERIMENT NO.7

Aim: Demonstration on Workgroup creation and File Sharing.

Apparatus: PC, LAN cable.

Theory:

This practical aims to educate students regarding the file sharing between 2 PC’s
through step by step procedure as explained below. The concept used in the procedure is
Workgroup. A workgroup is a collection of computers on a local area network (LAN) that
share common resources and responsibilities. The term is most commonly associated with
Microsoft Windows workgroups but also applies to other environments. Windows
workgroups can be found in homes, schools and small businesses. However, while all three
are similar, they don't function in the exact same way as domains and Home Groups.
Microsoft Windows workgroups organize PCs as peer-to-peer local networks that
facilitate easier sharing of files, internet access, printers and other local network resources.
Each computer that's a member of the group can access the resources being shared by the
others, and in turn, can share its own resources if configured to do so. Joining a workgroup
requires all participants to use a matching name. All Windows computers are automatically
assigned to a default group named WORKGROUP.
1. Right click on My computer, select properties and select Advance System settings. The window
will appear s shown below.

2. Select computer name and click on Change tab The window will appear s shown below.

44
COMPUTER NETWORK

3. If required change the name of workgroup and restart the PC.

4. Perform all above steps on the another PC.

5. To share a drive both the PCs should be in same workgroup.

6. After completing above steps, right click on the drive to be shared and select advance
settings

7. Enable the share check box and permit the user to access the drive in different modes.

45
COMPUTER NETWORK

8. On the other PC in select network option in which the shared drive icon will be visible and
the data can be accessed.

Observations: The observations are supported by the snaps mentioned above while
following the step wise procedure.

Conclusion:

46
COMPUTER NETWORK

EXPERIMENT NO. 10
Title: To verify Telnet.

Aim: To verify telnet using Different Telnet Commands.

Apparatus: Personal Computer.

Theory:

Telnet is an application layer protocol used on the Internet or local area networks to
provide a bidirectional interactive text-oriented communication facility using a
virtual terminal connection. User data is interspersed in-band with Telnet control information
in an 8-bit byte oriented data connection over the Transmission Control Protocol (TCP). The
term telnet is also used to refer to the software that implements the client part of the protocol.
Telnet client applications are available for virtually all computer platforms. Telnet is also
used as a verb. To telnet means to establish a connection with the Telnet protocol, either with
command line client or with a programmatic interface

Telnet, by default, does not encrypt any data sent over the connection (including
passwords), and so it is often feasible to eavesdrop on the communications and use the
password later for malicious purposes; anybody who has access to
a router, switch, hub or gateway located on the network between the two hosts where Telnet
is being used can intercept the packets passing by and obtain login, password and whatever
else is typed with a packet analyzer.

Most implementations of Telnet have no authentication that would ensure


communication is carried out between the two desired hosts and not intercepted in the
middle. Telnet client application may also be used to establish an interactive raw TCP
session.

Perform the following steps as directed.


Step 1: to set up Telnet Connection.
1) Click star, open command window and check connection between 2 PC using PING
command.
2) Enable TELNET:right click, on My computer, manage Services Applications,
services, enable the TELNET CLIENT & TELNET SERVER ,stop the services.
3) Double click on TELNET and change the mode to automatic start up.

Step 2: Start the services:

1) Open command window.


2) Enter the TELNET command and IP addresses of PC on either of the PC.
3) After establishing connection permission will be asked for the access in YES or No
format.
4) Enter y/n.
5) Enter login ID & Password of the PC.

47
COMPUTER NETWORK

Output:

Conclusion:

48

You might also like