You are on page 1of 23

MAHATMA GANDHI MISSION’S

COLLEGE OF ENGINEERING, NANDED


DEPARTEMENT OF COMPUTER SCIENCE & ENGINEERING

LAB MANUAL

COURSE: DATA COMMUNICATION LAB

by

Dr. Manisha Y. Joshi


CONTENTS
Sr.no. Topics Page no.

1 Course objectives 3
2 Syllabus and Marking Scheme 4
3 List of practical 5
4 Study of Switches and hubs in your campus. 6

5 Study of LAN /WAN of your college/ institute campus.

6 Study of Guided media,

7 Connect two or three computers using wired media (available in your Lab).

8 Implement in C linear block codes./CRC codes

9 Implement in C checksum.

10 Implement simplest protocol for noiseless channel


11 Implement stop and wait ARQ for noisy channel

12 Implement Go-Back-N ARQ sender algorithm


13 Implement Go-Back-N ARQ receiver algorithm

14 Implement Selective Reject (SR) ARQ

2
COURSE OBJECTIVES

 Course Objectives

1. To understand basics of Ethernet, LAN, network topologies in the college campus


2. To study the transmission media used in computer laboratories in campus
3. To learn the implementation of various error detecting algorithms
4. To implement various data transfer algorithm in data link layer

 Mapping of Course objectives(CO) with Practical(P)

CO Practical
P1 P2 P3 P4 P5 P6 P7 P8 P9 P10
1 √ √
2 √
3 √ √
4 √ √ √ √ √

3
SYLLABUS AND MARKING SCHEME

Swami Ramanand Teerth Marathwada University, Nanded

Third Year U.G. Program in Computer Science & Engineering


Effective from 2016-17

DATA COMMUNICATION LAB


Teaching Scheme P: 2

Evaluation Continuous Evaluation ESE Minimum Passing Marks


Scheme 30 Marks 70 Marks 40%

Term Work:
1. The instructor will frame programming assignments based on the suggested list of
assignments.
2. Instructors are expected to incorporate variations in list.
3. Students will submit term work in the form of a journal that will include at least 08-10
practical assignments. Each programming assignment will consists of pseudo-algorithm,
program listing with proper documentation and a printout of the output.
4. Practical examination will consist of performance and viva-voce examination based on
the term work.
The assessment will be based on the following –
1. Performance in the practical examination.
2. Record of programs submitted by the candidate.
3. Setting goals higher than expected from the problem statement.
4. Innovation & Creativity.
5. Team building skills.
6. Technical writing skills.
Suggested List of Practical
1. Study of Switches and hubs in your campus.
2. Study of LAN /WAN of your college/ institute campus.
3. Connect two or three computers using wired media (available in your Lab).
4. Data transfer using stop and wait protocol
5. Implement Go-Back-N sender algorithm
6. Implement Go-Back-N receiver algorithm
7. Implement in C linear block codes.
8. Implement in C cyclic codes.
9. Implement in C checksum.
10. Study of Ethernet card.
11. Study of IEEE 802.3 and IEEE 802.11 standards.
12. Study of Fast Ethernet (for ex. 1000Base-CX)
13. Study of the gigabit Ethernet. (1000Base-Sx)
14. Study of Guided media,

4
LIST OF PRACTICAL

Sr.no. Practical

1 Study of Switches and hubs in your campus.

2 Study of LAN /WAN of your college/ institute campus.

3 Study of Guided media

4 Connect two or three computers using wired media (available in


your Lab).

5 Implement in C linear block codes./CRC codes.

6 Implement in C checksum.

7 Implement simplest protocol for noiseless channel

8 Implement stop and wait ARQ for noisy channel

9 Implement Go-Back-N ARQ sender algorithm

10 Implement Go-Back-N ARQ receiver algorithm

11 Implement Selective Reject (SR) ARQ

5
1. STUDY OF SWITCHES AND HUBS IN YOUR CAMPUS

Aim: To study Switches/hubs in the laboratory

Theory

A Hub is a networking device that allows one to connect multiple PCs to a single
network. Hubs may be based on Ethernet, Firewire, or USB connections.
A switch is a control unit that turns the flow of electricity on or off in a circuit. It may
also be used to route information patterns in streaming electronic data sent over networks.
In the context of a network, a switch is a computer networking device that connects
network segments.

Difference between switches and Hub

Hub Switch

Layer Physical layer. Hubs are Data Link Layer. Network


classified as Layer 1 switches operate at Layer 2 of the
devices per the OSI OSI model.
model.

Function To connect a network of Allow connections to multiple


personal computers devices, manage ports, manage
together, they can be VLAN security settings
joined through a central
hub.

Data Transmission form Electrical signal or bits Frame (L2 Switch) Frame &
Packet (L3 switch)

Transmission Type Hubs always perform First broadcast; then unicast &
frame flooding; may be multicast as needed.
unicast, multicast or
broadcast

Ports 4/12 ports Switch is multi port Bridge. 24/48


ports

Device Type Passive Device (Without Active Device (With Software) &
Software) Networking device

6
Hub Switch

Used in (LAN, MAN, WAN) LAN LAN

Table A network hub cannot Switches use content accessible


learn or store MAC memory CAM table which is
address. typically accessed by ASIC
(Application Specific integrated
chips).

Transmission Mode Half duplex Half/Full duplex

Broadcast Domain Hub has one Broadcast Switch has one broadcast domain
Domain. [unless VLAN implemented]

Definition An electronic device that A network switch is a computer


connects many network networking device that is used to
device together so that connect many devices together on
devices can exchange data a computer network. A switch is
considered more advanced than a
hub because a switch will on send
msg to device that needs or
request it

Speed 10Mbps 10/100 Mbps, 1 Gbps

Address used for data Uses MAC address Uses MAC address
tramsmission

Device Category non intelligent device Intelligent Device

Collisions Collisions occur No collisions occur in a full-


commonly in setups using duplex switch.
hubs.

Spanning-Tree No Spanning-Tree Many Spanning-tree Possible

Necessary for Internet No. No


Connection?

Manufacturers Sun Systems, Oracle and Cisco and D-link Juniper


Cisco

7
Similarities

Switch
Hub

Used in (LAN, MAN, WAN) LAN LAN

Address used for data tramsmission Uses MAC address Uses MAC address

8
2. STUDY OF LAN /WAN IN COLLEGE/ INSTITUTE
CAMPUS
Aim

A computer network consists of two or more computers that are interconnected with each other
and share resources such as printers, servers, and hardware and exchange the data in the form
of files, facilitating electronic communication. Computers on a network can be connected
through twisted pair cables, telephone lines, radio waves, satellites or optical fiber cables. The
first computer network designed was the ‘Advanced Research Projects Agency Network
(ARPANET)’ by the United States Department of Defense. Since then, myriads of new
computer networking technologies have been designed. This tutorial only covers the first three
network technologies i.e LAN, WAN and MAN. However, currently there are multiple
networking technologies in use which have been enlisted below.

 Local Area Network (LAN)


 Wide Area Network (WAN)
 Metropolitan Area Network (MAN)
 Wireless Local Area Network (WLAN)
 Storage Area Network (SAN)
 Controller Area Network (CAN)
 Personal Area Network (PAN)
 Global Area Network (GAN)
 Internet Area Network (IAN)

Local Area Network (LAN)


A local area network, or LAN, consists of a computer network at a single site, typically an
individual office building. A LAN is very useful for sharing resources, such as data storage and
printers. LANs can be built with relatively inexpensive hardware, such as hubs, network adapters
and Ethernet cables.

9
The smallest LAN may only use two computers, while larger LANs can accommodate thousands
of computers. A LAN typically relies mostly on wired connections for increased speed and
security, but wireless connections can also be part of a LAN. High speed and relatively low cost
are the defining characteristics of LANs.

LANs are typically used for single sites where people need to share resources among themselves
but not with the rest of the outside world. Think of an office building where everybody should be
able to access files on a central server or be able to print a document to one or more central
printers. Those tasks should be easy for everybody working in the same office, but you would
not want somebody just walking outside to be able to send a document to the printer from their
cell phone! If a local area network, or LAN, is entirely wireless, it is referred to as a wireless
local area network, or WLAN.

A Local Area Network (LAN) is a network that is restricted to smaller physical areas e.g. a
local office, school, or house. Approximately all current LANs whether wired or wireless are
based on Ethernet. On a ‘Local Area Network’ data transfer speeds are higher than WAN and
MAN that can extend to a 10.0 Mbps (Ethernet network) and 1.0 Gbps (Gigabit Ethernet).

LAN networks can be implemented in multiple ways, for example twisted pair cables and a
wireless Wi-Fi with the IEEE 802.11 standard can be used for this purpose. One end of the
twisted pair cable is plugged into switches using ‘RJ-45 connectors’ whereas the other end is
plugged to a computer or in another network. All new routers use the b/g/n IEEE 802.11
standards. The ‘b’ and ‘g’ operate in the 2.4 GHz spectrum, and ‘n’ operates in 2.4 and 5.0
GHz which allows better performance and less interference.

Computers and servers (provides services to other computers like printing, file storage and
sharing) can connect to each other via cables or wirelessly in a same LAN. Wireless access in
conjunction with wired network is made possible by Wireless Access Point (WAP). Devices
with WAP functionality provide a bridge between computers and networks. A WAP is able to
connect hundreds or even more of wireless users to a network. Servers in a LAN are mostly
connected by a wire since it is still the fastest medium for network communication. But for
workstations (Desktop, laptops, etc.) wireless medium is a more suitable choice, since at some

10
point it is difficult and expensive to add new workstations into an existing system already
having complex network wiring.

Wide Area Network


A wide area network, or WAN, occupies a very large area, such as an entire country or the entire
world. A WAN can contain multiple smaller networks, such as LANs or MANs. The Internet is
the best-known example of a public WAN.

Wide Area Network is a computer network that covers relatively larger geographical area such
as a state, province or country. It provides a solution to companies or organizations operating
from distant geographical locations who want to communicate with each other for sharing and
managing central data or for general communication.

WAN is made up of two or more Local Area Networks (LANs) or Metropolitan Area
Networks (MANs) that are interconnected with each other, thus users and computers in one
location can communicate with users and computers in other locations.

In ‘Wide Area Network’, Computers are connected through public networks, such as the
telephone systems, fiber-optic cables, and satellite links or leased lines. The ‘Internet’ is the
largest WAN in a world. WANs are mostly private and arebuild for a particular organization
by ‘Internet Service Providers (ISPs)’ which connects the LAN of the organization to the
internet. WANs are frequently built using expensive leased lines where with each end of the
leased line a router is connected to extend the network capability across sites. For low cost
solutions, WAP is also built using a ‘circuit switching’ or ‘packet switching’ methods.

11
3. STUDY OF GUIDED MEDIA

Guided media, which are those that provide a conduit from one device to another, include
twisted-pair cable, coaxial cable, and fiber-optic cable. A signal traveling along any of these
media is directed and contained by the physical limits of the medium. Twisted-pair and coaxial
cable use metallic (copper) conductors that accept and transport signals in the form of electric
current. Optical fiber is a cable that accepts and transports signals in the form of light.

1. Twisted-Pair Cable

A twisted pair consists of two conductors (normally copper), each with its own plastic insulation,
twisted together.

One of the wires is used to carry signals to the receiver, and the other is used only as a ground
reference.

Unshielded Versus Shielded Twisted-Pair Cable

The most common twisted-pair cable used in communications is referred to as unshielded


twisted-pair (UTP). IBM has also produced a version of twisted-pair cable for its use called
shielded twisted-pair (STP). STP cable has a metal foil or braidedmesh covering that encases
each pair of insulated conductors. Although metal casing improves the quality of cable by
preventing the penetration of noise or crosstalk, it is bulkier and more expensive. Figure 7.4
shows the difference between UTP and STP.

12
Connectors

The most common UTP connector is RJ45 (RJ stands for registered jack), as shown in Figure
1.36. The RJ45 is a keyed connector, meaning the connector can be inserted in only one way.

Applications
1. Twisted-pair cables are used in telephone lines.
2. TP used in telephone network.
3. In LAN, TP wires are mainly used for low cost, low performance applications.

2. Coaxial cable:
Coaxial cable (or coax) carries signals of higher frequency ranges than those in twisted pair
cable. It has a central core conductor of solid or stranded wire (usually copper) enclosed in an
insulating sheath, which is, in turn, encased in an outer conductor of metal foil, braid, or a

13
combination of the two. The outer conductor is also enclosed in an insulating sheath, and the
whole cable is protected by a plastic cover (see Figure 1.31).

Coaxial Cable Standards

Coaxial cables are categorized by their radio government (RG) ratings. Each RG number denotes
a unique set of physical specifications, including the wire gauge of the inner conductor, the
thickness and type of the inner insulator, the construction of the shield, and the size and type of
the outer casing. Each cable defined by an RG rating is adapted for a specialized function.

Coaxial Cable Connectors

The most common type of connector used today is the Bayone-Neill-Concelman (BNe),
connector. Figure 1.32 shows three popular types of these connectors: the BNC connector, the
BNC T connector, and the BNC terminator. The BNC connector is used to connect the end of the
cable to a device, such as a TV set. The BNC T connector is used in Ethernet networks to branch
out to a connection to a computer or other device. The BNC terminator is used at the end of the
cable to prevent the reflection of the signal.

14
Applications

· Coaxial cable was widely used for both analog and digital data transmission.

· It has higher bandwidth.

· Inexpensive when compared to fiber optical cables.

· It uses for longer distances at higher data rates.

· Excellent noise immunity

· Used in LAN and Television distribution.

3. Fiber-Optic Cable:
A fiber-optic cable is made of glass or plastic and transmits signals in the form of light. Light
travels in a straight line as long as it is moving through a single uniform substance. If a ray of
light traveling through one substance suddenly enters another substance, then the ray changes
direction. Figure 1.33 shows how a ray of light changes direction when going from a denser to a
less dense substance.

15
As the figure shows, if the angle of incidence I (the angle the ray makes with the line
perpendicular to the interface between the two substances) is less than the critical angle, the ray
refracts and moves closer to the surface. If the angle of incidence is equal to the critical angle,
the light bends along the interface. If the angle is greater than the critical angle, the ray reflects
(makes a turn) and travels again in the denser substance. Note that the critical angle is a property
of the substance, and its value differs from one substance to another.

Optical fibers use reflection to guide light through a channel. A glass or plastic core is
surrounded by a cladding of less dense glass or plastic. The difference in density of the two
materials must be such that a beam of light moving through the core is reflected off the cladding
instead of being refracted into it. See Figure 1.34

Propagation Modes

Current technology supports two modes (multimode and single mode) for propagating light
along optical channels, each requiring fiber with different physical characteristics. Multimode
can be implemented in two forms: step-index or graded-index.

16
a. Multimode:

Multimode beams from a light source move through the core in different paths. How these beams
move within the cable depends on the structure of the core.

In multimode step-index fiber, the density of the core remains constant from the center to the
edges. A beam of light moves through this constant density in a straight line until it reaches the
interface of the core and the cladding. At the interface, there is an abrupt change due to a lower
density; this alters the angle of the beam's motion. The term step index refers to the suddenness
of this change, which contributes to the distortion of the signal as it passes through the fiber.

A second type of fiber, called multimode graded-index fiber, decreases this distortion of the
signal through the cable. The word index here refers to the index of refraction. A graded-index
fiber, therefore, is one with varying densities. Density is highest at the center of the core and
decreases gradually to its lowest at the edge. Figure 1.36 shows the impact of this variable
density on the propagation of light beams.

b. Single-Mode:

Single-mode uses step-index fiber and a highly focused source of light that limits beams to a
small range of angles, all close to the horizontal. The single mode fiber is manufactured with a
much smaller diameter. The decrease in density results in a critical angle that is close enough to
90° to make the propagation of beams almost horizontal. In this case, propagation of different
beams is almost identical, and delays are negligible.

17
Fiber Sizes

Optical fibers are defined by the ratio of the diameter of their core to the diameter of their
cladding, both expressed in micrometers. The common sizes are shown in Table 1.2.

Note that the last size listed is for single-mode only.

Cable Composition

The outer jacket is made of either PVC or Teflon. Inside the jacket are Kevlar strands to
strengthen the cable. Kevlar is a strong material used in the fabrication of bulletproof vests.
Below the Kevlar is another plastic coating to cushion the fiber. The fiber is at the center of the
cable, and it consists of cladding and core.

Fiber-Optic Cable Connectors

There are three types of connectors for fiber-optic cables.

18
Fiber-Optic Cable Connectors

The subscriber channel (SC) connector is used for cable TV. It uses a push/pull locking system.
The straight-tip (ST) connector is used for connecting cable to networking devices. It uses a
bayonet locking system and is more reliable than SC. MT-RJ is a connector that is the same size
as RJ45.

Applications

Fiber-optic cable is often found in backbone networks because its wide bandwidth is cost-
effective. Today, with wavelength-division multiplexing (WDM), we can transfer data at a rate
of 1600 Gbps.

Some cable TV companies use a combination of optical fiber and coaxial cable, thus creating a
hybrid network. Optical fiber provides the backbone structure while coaxial cable provides the
connection to the user premises. This is a cost-effective configuration since the narrow
bandwidth requirement at the user end does not justify the use of optical fiber. Local-area
networks such as 100Base-FX network (Fast Ethernet) and 1000Base-X also use fiber-optic
cable.

Advantages of Optical Fiber:

Fiber-optic cable has several advantages over metallic cable (twisted pair or coaxial).

19
· Higher bandwidth.

· Less signal attenuation.

· Immunity to electromagnetic interference.

· Resistance to corrosive materials.

· Light weight.

· Greater immunity to tapping.

Disadvantages of Optical Fiber:

There are some disadvantages in the use of optical fiber.

· Installation and maintenance.

· Unidirectional light propagation.

· Cost.

20
4. Connect two or three computers using wired media
(available in your Lab).

In order to physically connect three or more computers, you should use crossover Ethernet
cable. You must be able to plug the Ethernet cables into a device that will allow signals to be
transmitted to one another. There are several devices that will allow you to do this: a hub, a
switch, or a router.

Connecting Two Computers Directly With Cable

The traditional method to network two computers involves making a dedicated link by
plugging one cable into the two systems.

Several alternatives exist for networking two computers in this manner:

 Ethernet crossover cable

 Null modem serial cable or parallel peripheral cable

 Special-purpose USB cables

1. Ethernet: Ethernet method is the preferred choice as it supports a reliable, high-speed


connection with minimal configuration required. Additionally, Ethernet technology offers the
most general-purpose solution, allowing networks with more than two computers to be built
fairly easily later. If one of your computers possesses an Ethernet adapter but the other has
USB, an Ethernet crossover cable can still be used by first plugging a USB-to-Ethernet
converter unit into the computer's USB port.

See also: Ethernet crossover cables

2. Serial and parallel: This type of cabling, called Direct Cable Connection (DCC)when
using Microsoft Windows, offers lower performance but offers the same basic functionality
as Ethernet cables.

You may prefer this option if you have such cables readily available and network speed is not
a concern. Serial and parallel cables are never used to network more than two computers.

21
3. USB: Ordinary USB cables must not be used to connect two computers directly to each
other. Attempting to do so can electrically damage the computers!

However, special USB cables designed for direct connection exist that can be used safely.
You may prefer this option over others if your computers lack functional Ethernet network
adapters.

To make dedicated connections with Ethernet, USB, serial or parallel cables requires that:

1. each computer has a functioning network interface with an external jack for the cable,
and

2. the network settings on each computer are appropriately configured

One phone line or power cord cannot be used to directly connect two computers to each other
for networking.

Connecting Two Computers With Cable Through Central Infrastructure

Rather than cable two computers directly, the computers may instead be joined indirectly
through a central network fixture. This method requires two network cables, one connecting
each computer to the fixture. Several types of fixtures exist for home networking:

 Ethernet hubs, switches, and routers

 USB hubs

 Phoneline and powerline wall outlets

Implementing this method often entails additional up-front cost to purchase more cables
and network infrastructure. However, it's a general-purpose solution accommodating any
reasonable number of devices (e.g, ten or more). You will likely prefer this approach if you
intend to expand your network in the future.

Most cabled networks utilize Ethernet technology. Alternatively, USB hubs can be
employed, while powerline and phoneline home networks each offer their own unique form

22
of central infrastructure. The traditional Ethernet solutions are generally very reliable and
offer high performance.

23