0% found this document useful (0 votes)
54 views56 pages

Com Lab-2 Jvit JBK Manual

Uploaded by

pooja T.L
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)
54 views56 pages

Com Lab-2 Jvit JBK Manual

Uploaded by

pooja T.L
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/ 56

COMMUNICATION LABORATORY-II 2023-24

VISVESVARAYA TECHNOLOGICAL UNIVERSITY, BELAGAVI


B.E: Electronics & Communication Engineering / B.E: Electronics & Telecommunication Engineering
NEP, Outcome Based Education (OBE) and Choice Based Credit System (CBCS)
(Effective from the academic year 2021 – 22)

V Semester
Communication Lab II
Course Code 21ECL55 CIE Marks 50

Teaching Hours/Week (L: T: P: S) 0:0:2:0 SEE Marks 50

Credits 1 Exam Hours 3

Course objectives:
This laboratory course enables students to
⚫ Design and demonstrate communication circuits for different digital modulation
techniques.
⚫ To simulate Source coding Algorithms using C/C++/ MATLAB code.
⚫ To simulate Error correcting and detecting codes using C/C++/ MATLAB code.
⚫ Simulate the networking concepts and protocols using C/C++/ Network simulation tool.
⚫ Understand entropies and mutual information of different communication channels.

Sl.No. Experiments

Implement the following using discrete components

1 FSK generation and detection


2 PSK generation and detection
3 DPSK Transmitter and receiver
4 QPSK Transmitter and Receiver
Implement the following in C/C++/MATLAB/Scilab/Python or any other
Suitable software
5 Write a program to encode binary data using Huffman code and decode it.

6 Write a program to encode binary data using a (7,4) Hamming code and decode it.
7 Write a program to encode binary data using a ((3,1,2)/suitably designed)
Convolution code and
decode it.

8 For a given data, use CRC-CCITT polynomial to obtain the CRC code. Verify the
program for the
cases a) Without error b) With error

Implement the following algorithms in C/C++/MATLAB/Network simulator


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

10 Write a program for distance vector algorithm to find suitable path for transmission.
11 Write a program for flow control using sliding window protocols.

8
COMMUNICATION LABORATORY-II 2023-24

12 Configure a simple network (Bus/star) topology using simulation software OR


Configure a simple network (Ring/Mesh) topology using simulation software.

Demonstration Experiments (For CIE)

13 Configure and simulate simple Wireless Local Area network.

14 Simulate the BER performance of (2, 1, 3) binary convolutional code with generator
sequences
g(1) =(1 0 1 1) and g(2) =(1 1 1 1) on AWGN channel. Use QPSK modulation
scheme. Channel
decoding is to be performed through Viterbi decoding. Plot the bit error rate versus
SNR (dB), i.e.
Pe,b versus Eb/N0. Consider binary input vector of size 3 lakh bits. Also find the
coding gain.
15 Simulate the BER performance of (7, 4) Hamming code on AWGN channel. Use
QPSK modulation scheme. Channel decoding is to be performed through
maximum-likelihood decoding. Plot the bit error rate versus SNR (dB), i.e. Pe,b
versus Eb/N0. Consider binary input vector of size 5 lakh bits. Use the following
parity check matrix for the (7, 4) Hamming code. Also find the coding gain.

1001110
H= [0 1 0 0 1 1 1]
0011101

16 Simulate the BER performance of rate 1/3 Turbo code. Turbo encoder uses
two recursive systematic encoders with

1+𝐷 4
G(D) = [1, 1+𝐷+𝐷2+𝐷3+𝐷4 ]

and pseudo-random interleaver. Use QPSK modulation scheme. Channel decoding


is to be performed through maximum a-posteriori (MAP) decoding algorithm. Plot
the bit error rate versus SNR (dB), i.e. Pe,b versus Eb/N0. Consider binary input
vector of size of around 3 lakh bits and the block length as 10384 bits. Also find the
coding gain.

Course outcomes (Course Skill Set):


On the completion of this laboratory course, the students will be able to:
1. Design and test the digital modulation circuits and display the waveforms.
2. To Implement the source coding algorithm using C/C++/ MATLAB code.
3. To Implement the Error Control coding algorithms using C/C++/ MATLAB code.
4. Illustrate the operations of networking concepts and protocols using C programming and
network simulators.
Assessment Details (both CIE and SEE)
The weightage of Continuous Internal Evaluation (CIE) is 50% and for Semester End Exam
(SEE) is 50%. The minimum passing mark for the CIE is 40% of the maximum marks (20
marks). A student shall be deemed to have satisfied the academic requirements and earned the

9
COMMUNICATION LABORATORY-II 2023-24

credits allotted to each course. The student has to secure not less than 35% (18 Marks out of
50) in the semester-end examination (SEE).
Continuous Internal Evaluation (CIE):
CIE marks for the practical course is 50 Marks.
The split-up of CIE marks for record/ journal and test are in the ratio 60:40.
⚫ Each experiment to be evaluated for conduction with observation sheet and record write-
up. Rubrics for the evaluation of the journal/write-up for hardware/software experiments
designed by the faculty who is handling the laboratory session and is made known to
students at the beginning of the practical session.
⚫ Record should contain all the specified experiments in the syllabus and each experiment
write-up will be evaluated for 10 marks.
⚫ Total marks scored by the students are scaled downed to 30 marks (60% of maximum
marks).
⚫ Weightage to be given for neatness and submission of record/write-up on time.
⚫ Department shall conduct 02 tests for 100 marks, the first test shall be conducted after
the 8th week of the semester and the second test shall be conducted after the 14th week
of the semester.
⚫ In each test, test write-up, conduction of experiment, acceptable result, and procedural
knowledge will carry a weightage of 60% and the rest 40% for viva-voce.
⚫ The suitable rubrics can be designed to evaluate each student’s performance and learning
ability. Rubrics suggested in Annexure-II of Regulation book
⚫ The average of 02 tests is scaled down to 20 marks (40% of the maximum marks).

The Sum of scaled-down marks scored in the report write-up/journal and average marks of
two tests is the total CIE marks scored by the student.
Semester End Evaluation (SEE):
SEE marks for the practical course is 50 Marks.
SEE shall be conducted jointly by the two examiners of the same institute, examiners are
appointed by the University
All laboratory experiments are to be included for practical examination. (Rubrics) Breakup of
marks and the instructions printed on the cover page of the answer script to be strictly
adhered to by the examiners. OR based on the course requirement evaluation rubrics shall be
decided jointly by examiners.

Students can pick one question (experiment) from the questions lot prepared by the internal
/external examiners jointly.
Evaluation of test write-up/ conduction procedure and result/viva will be conducted jointly
by examiners.
General rubrics suggested for SEE are mentioned here, writeup-20%, Conduction procedure
and result in -60%, Viva-voce 20% of maximum marks. SEE for practical shall be evaluated
for 100 marks and scored marks shall be scaled down to 50 marks (however, based on course
type, rubrics shall be decided by the examiners).
Change of experiment is allowed only once and 15% Marks allotted to the procedure part to
be made zero.
The duration of SEE is 03 hours.

10
COMMUNICATION LABORATORY-II 2023-24

INTRODUCTION

Communication means the transfer of information from a sender to a


receiver. It can be between human beings or computer systems. Information is
the knowledge or intelligence. The source of information can be in analog form
or in digital form. Information that has been processed, organized, and stored is
called Data. Data communications is the process of transforming digital
information between two or more points. The communications nowadays is
mostly digital due to highly reliability, operating speed, miniaturization, and
precise data handling.

This manual typically contains practical/lab sessions related to Computer


networks, implemented in Network Simulator (Packet Tracer) and C/C++ code
covering various aspects related to the subject for in depth understanding.

Network simulation is an important tool in developing, testing and


evaluating network protocols. Simulation can be used without the target physical
hardware, making it economical and practical for almost any scale of network
topology and setup. It is possible to simulate a link of any bandwidth and delay,
even if such a link is currently impossible in the real world. With simulation, it
is possible to set each simulated node to use any desired software. This means
that meaning deploying software is not an issue. Results are also easier to obtain
and analyze, because extracting information from important points in the
simulated network is as done by simply parsing the generated trace files.

Network Simulation Experience

The Network Simulator offers a simplified and complete network simulation


experience. The following diagram depicts this functionality offered by the
Network Simulator.

11
COMMUNICATION LABORATORY-II 2023-24

The Network Simulator can design and simulate a network with SNMP, TL1,
TFTF, FTP, Telnet and IOS devices, in four simple steps:

1. Add devices to the Device tree: Add devices with the required configuration
to the device tree in the Network Designer. Preconfigured devices are also
bundled with the toolkit.

2. Create the Network: Create and add bulk devices to the network, at one shot.

3. Configure the Network devices: Configure the devices in the network, if


required.

4. Start the Network: Start the network or start individual agents in the network.
The MIB Browser and TL1 Craft Interface test tools, can be used as the
manager tools for testing.

Packet Tracer is a protocol simulator developed at Cisco Systems. Packet


Tracer (PT) is a powerful and dynamic tool that displays the various protocols
used in networking, in either Real Time or Simulation mode. This includes layer
2 protocols such as Ethernet and PPP, layer 3 protocols such as IP, ICMP, and
12
COMMUNICATION LABORATORY-II 2023-24

ARP, and layer 4 protocols such as TCP and UDP. Routing protocols can also be
traced. Packet Tracer is a supplement to and not a replacement for experience
with real equipment. Students are encouraged to compare the results obtained
from Packet Tracer network models with the behavior of real equipment.
Cisco® Packet Tracer is a powerful network simulation program that
allows students to experiment with network behavior and ask “what if” questions.
As an integral part of the Networking Academy comprehensive learning
experience, Packet Tracer provides simulation, visualization, authoring,
assessment, and collaboration capabilities to facilitate the teaching and learning
of complex technology concepts.

Packet Tracer helps instructors teach complex networking concepts in the


following ways:

• Provides a visual demonstration of complex technologies and configurations


• Allows instructors to author customized, guided activities that provide
immediate feedback using the Activity Wizard
• Facilitates numerous learning activities such as lectures, individual and group
lab activities, homework, assessments, games, network design, troubleshooting,
modeling tasks, case studies, and competitions
• Enables visualization, animation, and detailed modeling for exploration,
experimentation, and explanation
• Supports self-paced learning outside the classroom
• Supports social learning processes by enabling collaboration and competition

The Student Experience


STUDENTS WHO SPEND MORE TIME IN A HANDS-ON MODE OF LEARNING, WITH SIMULATION AND
INTERACTIVE CAPABILITIES, WILL BE BETTER EQUIPPED TO APPLY CONCEPTS AND
CONFIGURATION FUNDAMENTALS WHEN EXPOSED TO REAL EQUIPMENT. AS STUDENTS GAIN
PRACTICAL EXPERIENCE WITH TASKS SUCH AS CONFIGURATION AND TROUBLESHOOTING, THEY
BECOME MORE CONFIDENT IN THEIR ABILITIES. CISCO PACKET TRACER’S MULTIUSER
FUNCTIONALITY ALSO PROVIDES AN OPPORTUNITY FOR SOCIAL LEARNING, ALLOWING STUDENTS
TO COLLABORATE AND COMPETE WITH EACH OTHER AND PLAY GAMES THAT ENHANCE THE
LEARNING EXPERIENCE.

Key Features

Packet Tracer Workspaces: Cisco Packet Tracer has two workspaces—logical


and physical. The logical workspace allows users to build logical network
topologies by placing, connecting, and clustering virtual network devices. The
physical workspace provides a graphical physical dimension of the logical
13
COMMUNICATION LABORATORY-II 2023-24

network, giving a sense of scale and placement in how network devices such as
routers, switches, and hosts would look in a real environment. The physical view
also provides geographic representations of networks, including multiple cities,
buildings, and wiring closets.

14
COMMUNICATION LABORATORY-II 2023-24

EXPERIMENT NO – 1

AIM: FSK generation and detection.


APPARATUS: Transistor SL100 and SK100, resistors, capacitors, op amp, 0A79 diode,
power supply, CRO.
CIRCUIT DIAGRAM:

FSK MODULATOR:

15
COMMUNICATION LABORATORY-II 2023-24

DESIGN:
Ic = 2.5mA
VRE = 2.5V
RE = VRE / IE = 2.5 / 2.5mA = RE = 1KΩ
VRB = Vm(t)p-p / 2 –VBE(sat) – VRE(sat)
= 3.5 – 0.7 – 2.5
VRB = 0.3V
Ib = Ic / hfe = 2.5 / 100 = 2.5µA
Ib(sat) = 1.2Ib
Ibsat = 30µA
RB = Vrb / Ibsat = 0.3 / 30 = Rb = 10KΩ
FSK DEMODULATOR:

fm = 1 / 2RC, C = 0.1µF, R = 15.9KΩ, fm = 100Hz, fc1 = 1 / 2R1C1


fc1 = 1 KHz, R1 = 1.59 KΩ, C1 = 0.1µF
PROCEDURE:

1. Connection is made as shown in circuit diagram.

16
COMMUNICATION LABORATORY-II 2023-24

2. The modulating signal m(t) is chosen to be low freq (50 Hz to 300Hz) square wave.
3. The 10K pot is varied so as to get proper FSK output.
4. Record the wave and calculate the 2 frequencies of operation of 555 Astable
multivibrator. Compare these two frequencies calculate theoretically.
MODULATION WAVEFORMS:

DEMODULATION WAVEFORM:

17
COMMUNICATION LABORATORY-II 2023-24

EXPERIMENT NO. 2
PHASE SHIFT KEYING GENERATION AND DETECTION

AIM: To study Phase Shift keying generation and detection.


APPARATUS: Transistor SL100, resistor, capacitor, OP Amp, µA 741, signal generator,
diode.
CIRCUIT DIAGRAM:
PSK MODULATOR:

PROCEDURE:

1. Connect the circuit as shown in the figure above.


2. Give square wave signal frequency 200 to 500Hz and 5V peak-to-peak amplitude as
the binary digital data input.
3. The carrier signal of frequency 2 to 5KHz sine wave is applied
4. Observe the PSK output waveform obtained on the CRO.
5. Connect the PSK signal to the PSK demodulator circuit shown in figure below and also
the carrier.
6. Observe the demodulated output of the decision logic on the CRO. Compare this with
the original modulating signal used in the PSK modulator. Record the results.
18
COMMUNICATION LABORATORY-II 2023-24

PSK DEMODULATOR:

WAVEFORMS:

19
COMMUNICATION LABORATORY-II 2023-24

EXPERIMENT NO. 3
DIFFERENTIAL PHASE SHIFT KEYING (DPSK) GENERATION AND
DERECTION

AIM: To study Differential phase shift keying Encoder & Decoder.


APPARATUS: 8-bit data generator, Modulator trainer kit (ST2106), Demodulator trainer kit
(ST2107), connecting cables, CRO.
CIRCUIT DIAGRAM:
Differential phase shift keying Encoder Circuit:

Figure 1: Differential phase shift keying Decoder Circuit:

PROCEDURE:

1. The experiment makes use of two trainers namely, ST2106 & ST2107. ST2111 serves
as a 8-bit data source. ST2106 serves as data formatting (conditioning) device while
ST2107 reformats (recondition) the data.
2. ST2111 & ST2106 Trainers serves as transmitter for our system & ST2107 trainer
serves as receiver.
3. Ensure that all trainers are switched OFF, until the complete connections are made.
4. Make the following connections between ST2111 and ST2106 trainers as shown in
figure 1.
a. Carrier input of modulator 1 (tp26) to 960 KHz (1) carrier (tp17)

20
COMMUNICATION LABORATORY-II 2023-24

b. NRZ (M) output (tp6) to unipolar-bipolar converter input (tp20)


c. Unipolar-bipolar converter output (tp21) to modulator 1 input (tp27)
5. Connection between ST2106 & ST2107 trainers is done as show in figure 2.
a. Modulator 1 output (tp28) to DPSK demodulator input (tp10) in ST2107
trainer. DPSK demodulator output (tp15) to low pass filter 1 input (tp23)
b. Low pass filter 1 output (tp24) to comparator 1 input (tp46)
c. Comparator 1 output (tp 47) bit decoder input (tp39)
6. Switch 'ON' the trainers.
7. Monitor the modulator 1 output (tp28) in ST2106 trainer with reference to its input
(tp27) by using a dual trace oscilloscope. The three controls in modulator block may
require some settings
a. Gain: This controls the amplitude of the modulator output signal. Vary it until
the amplitude of the output is 2Vpp.
b. Modulation off set: This controls the peak to peak amplitudes of 0° & 180°
phases relative to each other. Vary it till the amplitudes for both faces become
equal.
c. Carrier off set: This control the DC offsets of two phases namely 0° & 180°
phases, relative to each other. Vary the control till the DC off set for them is
reduced to as close as zero volts.
8. Displaying the NRZ (M) input with the PSK modulated waveform helps to understand
the PSK modulation concept. Notice that every time the NRZ (M) waveform level
changes, PSK modulated waveform undergoes a 180 phase change.

Figure: 2
9. To see the PSK demodulation process, examine the input of PSK demodulator (tp10)
on ST2107 trainer with the demodulator's output (tp15). Adjust the phase adjust control
& see its effect on the demodulator's output. Check the various test points provided at

21
COMMUNICATION LABORATORY-II 2023-24

the output of the functional blocks of the PSK demodulator. This will help you fully
grasp the PSK demodulation technique.
10. The output of the demodulator goes to the low pass filter 1's input. Monitor the filter's
output (tp24) with reference to its input (tp28) Notice that the filter has extracted the
average information from the demodulator output. Adjust the PSK demodulator's phase
adjust control until the amplitude of filter's output is maximum.
11. The low pass filter's output rounded & cannot be used for digital processing. In order
to 'square up' the waveform comparator's are used (data squaring circuit). The bias
control is adjusted so that the comparator's output pulse width at tp 47 is same as the
NRZ (M) pulse width which is observed in CRO

WAVEFORMS:

22
COMMUNICATION LABORATORY-II 2023-24

EXPERIMENT NO. 4
QUADRATURE PHASE SHIFT KEYING (QPSK) GENERATION AND
DETECTION

AIM: To study Quadrature phase shift keying (QPSK) Encoder & Decoder.

THEORY: Quadrature Phase Shift Keying (QPSK):


In quardrature Phase Shift keying each pair of consecutive data bit is treated as a two
bit (or dibit) code which is used to switch the phase of the carrier sine wave between one of
four phases 90° apart. The four possible combination of dibit code are 00, 01, 10 and 11. Each
code represents either a phase of 45°, 135°, 225°, and 315° lagging, relative to the phase of the
original un-modulated carrier. The choice of these phases is arbitrary as it is convenient to
produce them. Quadrature phase shift keying offers an advantage over PSK, in a manner that
now each phase represents a two bit code rather than a single bit. This means now either we
can change phase per second or the same amount of data can be transmitted with half as many
phase changes per second. The second choice results in a lowering of bandwidth requirement.
The four phases are produced by adding two carrier waves of same frequency but 90° out of
phases. The 0° phase carrier is called In-phase carrier and is labeled 1 The other is 90° (lagging)
phase carrier termed as the quadrature carrier and is labeled Q.
Similarly, the phase shifts for the combinations would be as shown table below

23
COMMUNICATION LABORATORY-II 2023-24

Phasor Diagram

It can be appreciated from the above phasor diagram that each phasor switches its phase
depending on the data level exactly in the same way as the same way as the PSK modulator
does. The only difference is that QPSK is sum of two such PSK modulators.

BLOCK DIAGRAM:
QPSK TRANSMITTER:

Figure: 1

24
COMMUNICATION LABORATORY-II 2023-24

QPSK RECEIVER:

Figure: 2

PROCEDURE:

1. The experiment makes use of two trainers namely, ST2106 & ST2107. ST2111 serves
as a 8-bit data source. ST2106 serves as data formatting (conditioning) device while
ST2107 reformats (recondition) the data.
2. ST2111 & ST2106 Trainers serves as transmitter for our system & ST2107 trainer
serves as receiver.
3. Ensure that all trainers are switched OFF, until the complete connections are made.
4. Make the additional connections as shown in figure 1 as shown in following steps.
On ST2106 trainer:
a. Differentially encoded dibit MSB (tp10) to unipolar bipolar converter 1 input
(tp20)
b. Unipolar-Bipolar converter 1 output (tp21) to modulator 1 input (tp27).

25
COMMUNICATION LABORATORY-II 2023-24

c. Differentially encoded dibit LSB (tp11) to unipolar -bipolar 2 input (tp23).


d. Unipolar-Bipolar converter 2 output (tp24 to modulator 2 input (tp30).
e. 960KHz (1) output (tp17) to modulator 1 carrier input (tp26).
f. 960 KHz (Q) output (tp18) to modulator 2 carrier input (tp29)
g. Modulator 1 output (tp28) to summing amplifier's input A (tp34).
h. Modulator 2 output (tp31) to summing amplifier's input B (tp35).
Between ST2106 & ST2107:
a. Summing amplifier's output (tp36) to QPSK demodulator input (tp1).
On ST2107 trainer:
a. QPSK demodulator output 1 (tp8) to low pass filter 1 input (tp23).
b. QPSK demodulator's Q output (tp9) to low pass filter 2 input (tp23).
c. Low pass filter 1 output (tp24) to comparator 1 input (tp46).
d. Low pass filter 2 output (tp28) to comparator 2 input (tp49).
e. Data squaring circuit comparator 1 output (tp47) to differential decoder MSB
input (tp42).
f. Data squaring circuit comparator 2 output (tp50) to differential decoder LSB
input (tp43).
Between ST2107 & ST2104 Trainers:
a. Comparator 1 output (tp47) to clock regeneration circuit input (tp3).
b. Dibit decoder output (tp47) to PCM data input (tp3)
c. Dibit decoder clock input (tp41) to clock regeneration circuit output (tp8).
5. Monitor the output of modulator 1 (tp28) in ST2106 trainer. Adjust the scope's trigger
level manually to obtain a stable display Use the controls provided in the modulator as
shown in followings steps.
a. Gain: This controls the overall amplitude of the modulated waveform. Adjust it
till you obtain a 2VPP signal.
b. Modulation off set: This controls the peak to peak amplitude of the 0 &
180 phases, relative to each other. Adjust this pot such that the amplitudes of
the two phases are equal.
6. Make the same adjustments for modulator 2's output (tp31) by monitoring its outputs
on the oscilloscope.

26
COMMUNICATION LABORATORY-II 2023-24

7. Monitor the output of the summing amplifier (tp36). The output is a QPSK Signal with
0, 90, 180 & 270 phase shifts clearly visible.
8. To observe the QPSK demodulation process, monitor each output (tp8 & 9) of the
QPSK demodulator with reference to input signal (tp1) on ST2107. Also monitor the
test points provided at various block outputs, to understand the process of demodulation
clearly.
9. Observe the two low pass filter's outputs (tp24 & 28). Adjust the phase adjust control
provided on QPSK demodulator block until you obtain two levels only at low pass
filter's outputs. The incorrect placement of phase adjust control produces multilevel
output at filter output.
10. Monitor both the comparator's output (tp47 & 50). Adjust the bias level control of both
comparators till their output doesn’t have the correct pulse width. Now that the filter's
output is balanced around 0 Volts. Adjustment of bias level to produce 0 V terminal of
the comparator help achieving 'Squared up' version of the filter's output signal. This
can be compared by simultaneously displaying the filter's output & the comparator's
output on the oscilloscope.
11. Temporarily disconnect & then reconnect the QPSK input to the QPSK demodulator.
Observe that after some trial you will obtain four different combinations at
comparator's outputs (tp47 & 50). This explains the phase ambiguity in QPSK system.

27
COMMUNICATION LABORATORY-II 2023-24

Experiment -5
Huffmann Coding and Decoding

Aim: To encode binary data using Huffman code and decode it


Software: MATLAB
Theory: Huffman Coding is a technique of compressing data to reduce its size without losing
any of the details. It was first developed by David Huffman.
Huffman Coding is generally useful to compress the data in which there are frequently
occurring characters. Huffman coding is widely used in applications where compression is
essential, such as file compression algorithms (e.g., ZIP) and image compression (e.g.,
JPEG).
1 Frequency Analysis
Huffman coding starts with a frequency analysis of the input data. The frequency of each
symbol (character or group of characters) in the input is determined. This step helps identify
the most common symbols, which will be assigned shorter codes.
2 Building the Huffman Tree
Once the frequencies are determined, a binary tree called the Huffman tree is constructed.
The tree is built in such a way that the more frequent symbols have shorter binary codes. The
process involves iteratively combining the two least frequent symbols into a new node until
only one node remains—the root of the Huffman tree.
3 Assigning Binary Codes
After constructing the Huffman tree, binary codes are assigned to each symbol based on their
position in the tree. Traversing left or right in the tree corresponds to appending '0' or '1' to
the code, respectively. The result is a set of variable-length codes for each symbol.

Program:
x= input('Enter the number of symbols:');
N=1:x;
disp('The number of symbols are N:');
disp(N);
P=input('Enter the probabilities:');
disp('The probabilities are P:');
disp (P);
S=sort (P, 'descend');
disp('The sorted probabilities are:');
disp (S);
[dict, avglen]=huffmandict(N,S);
disp('The average length of the code is:');
disp (avglen);
H=0;
for i=1:x
H=H+ (P(i) *log2 (1/P (i)));
end
disp('Entropy is:');
disp (H);
disp('bits/msg');
28
COMMUNICATION LABORATORY-II 2023-24

E=(H/avglen) *100;
disp('Efficiency is:')
disp(E);
codeword=huffmanenco(N,dict);
disp('The codewords are:');
disp(codeword);
decode=huffmandeco(codeword,dict);
disp('The decoded output:');
disp(decode);

Expected Output

Enter the number of symbols:5


The number of symbols are N:
1 2 3 4 5

Enter the probabilities:[0.1 0.1 0.2 0.2 0.4]


The probabilities are P:
0.1000 0.1000 0.2000 0.2000 0.4000

The sorted probabilities are:


0.4000 0.2000 0.2000 0.1000 0.1000

The average length of the code is:


2.2000

Entropy is:
2.1219

bits/msg
Efficiency is:
96.4513

The codewords are:


Columns 1 through 13

1 0 0 0 0 1 0 0 1 1 0 0 1

Column 14

The decoded output:


1 2 3 4 5

29
COMMUNICATION LABORATORY-II 2023-24

Experiment -6
Hamming Coding and Decoding

Aim: To encode binary data using a (7,4) Hamming code and decode it
Software: MATLAB
Theory: The Hamming Code method is a network technique designed by R.W.Hamming, for
damage and error detection during data transmission between multiple network channels.
The Hamming Code method is one of the most effective ways to detect single-data bit errors
in the original data at the receiver end. It is not only used for error detection but is also for
correcting errors in the data bit.
Here are some of the features of Hamming code:
Error Detection and Correction: Hamming code is designed to detect and correct single-bit
errors that may occur during the transmission of data. This ensures that the recipient receives
the same data that was transmitted by the sender.
Redundancy: Hamming code uses redundant bits to add additional information to the data
being transmitted. This redundancy allows the recipient to detect and correct errors that may
have occurred during transmission.
Efficiency: Hamming code is a relatively simple and efficient error-correction technique that
does not require a lot of computational resources. This makes it ideal for use in low-power
and low-bandwidth communication networks.
Single Error Correction: Hamming code is capable of correcting a single-bit error, which
makes it ideal for use in applications where errors are likely to occur due to external factors
such as electromagnetic interference.
Program:
clear
n = 7%# of codeword bits per block
k = 4%# of message bits per block
A = [ 1 1 1;1 1 0;1 0 1;0 1 1 ];%Parity submatrix-Need binary(decimal combination of
7,6,5,3)
G = [ eye(k) A ]%Generator matrix
H = [ A' eye(n-k) ]%Parity-check matrix
% ENCODER%
msg = [ 1 1 1 1 ] %Message block vector-change to any 4 bit sequence
code = mod(msg*G,2)%Encode message
% CHANNEL ERROR(add one error to code)%
%code(1)= ~code(1);
code(2)= ~code(2);
%code(3)= ~code(3);
%code(4)= ~code(4);%Pick one,comment out others
%code(5)= ~code(5);
%code(6)= ~code(6);
%code(7)= ~code(7);
recd = code %Received codeword with error
% DECODER%
syndrome = mod(recd * H',2)
%Find position of the error in codeword (index)
find = 0;
for ii = 1:n

30
COMMUNICATION LABORATORY-II 2023-24

if ~find
errvect = zeros(1,n);
errvect(ii) = 1;
search = mod(errvect * H',2);
if search == syndrome
find = 1;
index = ii;
end
end
end
disp(['Position of error in codeword=',num2str(index)]);
correctedcode = recd;
correctedcode(index) = mod(recd(index)+1,2)%Corrected codeword
%Strip off parity bits
msg_decoded=correctedcode;
msg_decoded=msg_decoded(1:4)

Expected output:
n=

k=

G=

1 0 0 0 1 1 1
0 1 0 0 1 1 0
0 0 1 0 1 0 1
0 0 0 1 0 1 1

H=

1 1 1 0 1 0 0
1 1 0 1 0 1 0
1 0 1 1 0 0 1

msg =

1 1 1 1

31
COMMUNICATION LABORATORY-II 2023-24

code =

1 1 1 1 1 1 1

recd =

1 0 1 1 1 1 1

syndrome =

1 1 0

Position of error in codeword=2

correctedcode =

1 1 1 1 1 1 1

msg_decoded =

1 1 1 1

32
COMMUNICATION LABORATORY-II 2023-24

EXPERIMENT NO-08
Cyclic Redundancy Check

AIM: For a given data, use CRC-CCITT polynomial to obtain the CRC code.
Verify the program for the cases a) Without error b) With error

THEORY:
The polynomial code (also known as a Cyclic Redundancy code or CRC code)
is widely used. polynomial codes are based upon treating bit string as representations of
polynomials with coefficients of 0 and 1 only. A k-bit frame is regarded as the coefficient list
for a polynomial with k terms, ranging from x k-1 to x0. Such a polynomial is said to be of a
degree k-1. The high order (left most) bit is the coefficient of x k-1; the next bit is the
coefficient of x k-2 and so on. For example 110001 has 6 bits and thus represents a six-term
polynomial with coefficients.1,1,0,0,0 and 1: x5+x4+x0.

When the polynomial code method is employed, the centre and receiver must agree upon a
generator polynomial, G(x) in advanced, both the high and low order bits of the generator must
be one. To compute the checksum for some frame with m bits, corresponding to the polynomial
M(x) the frame must be longer than the generator polynomial. the idea is so to append a
checksum to the end of the frame in such a way that the polynomial represented by the check
summed frame is divisible by G(x).When the receiver gets the check summed frame, it tries
dividing it by G(x).If there is a remember there has been a transmission error.

ALGORITHM:

➢ Let r be the degree of G(x). Append r zero bits to the low order end of the frame, so it now
contains m+r bits and corresponds to the polynomial xr M(x).
➢ Divide the bits string corresponding to G(x) into the bit string corresponding to xr M(x) using
modulo-2 division.
➢ Subtract the remainder(which is always r or fewer bits) from the bit string corresponding to xr
M(x) using modulo-2 subtraction. The result is the checksummed frame to be transmitted. Call
its polynomial T(x).
➢ The CRC- CCITT polynomial is X3+ X1 + 1

#include<stdio.h>
#include<conio.h>
#include<string.h>
#define degree 3
int res[30];
int getnext(int array[],int);
void crc(int len)
{
int cp[]={1,0,1,1};
int i=0,pos=0,newpos;
while(pos<len-degree)
{
for(i= pos;i<pos+degree+1;++i)
33
COMMUNICATION LABORATORY-II 2023-24

res[i]=res[i]^cp[i-pos];
newpos=getnext(res,pos);

if(newpos>pos+1)
pos= newpos-1;
++pos;
}
}
int getnext(int array[], int pos)
{
int i = pos;
while( array[i] ==0)
++i;
return i;
}
void main()
{
int array[30];
char ch;
int len,i=0;
clrscr();
puts("enter the data stream:");
while((ch =getche())!='\r')
array[i++] = ch-'0';
len=i;
for(i=0;i<degree; ++i)
array[i+len]=0;
len+= degree;
for(i=0;i<len;i++)
res[i]=array[i];
crc(len);
printf("\n the transmitted frame is: ");
for(i=0; i<len-degree; ++i)
printf("%d", array[i]);
for(i=len-degree; i<len;++i)
printf("%d", res[i]);
printf("\nEnter the stream for which crc to be checked");
i=0;
while((ch=getche())!='\r')
array[i++]= ch-'0';
len=i;
for(i=0;i<len;i++)
res[i]=array[i];
crc(len);
printf("\n checksum: ");
for(i=len-degree; i<len;i++)
printf("%d", res[i]);
getch();
}
OUTPUT:

(Without error)
Enter data stream 10011
Transmitted frame is 10011100
34
COMMUNICATION LABORATORY-II 2023-24

Enter the stream for which CRC to be checked 10011100


Checksum: 000
(With error)
Enter data stream 10011
Transmitted frame is 10011100
Enter the stream for which crc to be checked 10011101
Checksum: 001

35
COMMUNICATION LABORATORY-II 2023-24

EXPERIMENT NO – 9

9. Write a program for Congestion control using the leaky bucket algorithm.

LEAKY BUCKET ALGORITHM

The leaky-bucket implementation is used to control the rate at which traffic is sent to
the network. A leaky bucket provides a mechanism by which bursty traffic can be shaped to
present a steady stream of traffic to the network, as opposed to traffic with erratic bursts of
low-volume and high-volume flows.

Traffic analogy An appropriate analogy for the leaky bucket is a scenario in which four
lanes of automobile traffic converge into a single lane. A regulated admission interval into the
single lane of traffic flow helps the traffic move. The benefit of this approach is that traffic
flow into the major arteries (the network) is predictable and controlled. The major liability is
that when the volume of traffic is vastly greater than the bucket size, in conjunction with the
drainage-time interval, traffic backs up in the bucket beyond bucket capacity and is discarded.

● The Leaky-bucket algorithm

The algorithm can be conceptually understood as follows:


● Arriving packets (network layer PDUs) are placed in a bucket with a hole in the
bottom.
● The bucket can queue at most b bytes. If a packet arrives when the bucket is full, the
packet is discarded.
● Packets drain through the hole in the bucket, into the network, at a constant rate of r
bytes per second, thus smoothing traffic bursts.
The size b of the bucket is limited by the available memory of the system.
Sometimes the leaky bucket and token algorithms are lumped together under the same name.

36
COMMUNICATION LABORATORY-II 2023-24

PROGRAM :

#include<stdio.h>
#include<iostream.h>
#include<stdlib.h>
#include<conio.h>
#include<dos.h>
#define bucketsize 300
void bktinput(int a, int b)
{
if (a>bucketsize)
cout<<"\n\t bucket overflow";
else
{
delay(1000);
while(a>b)
{
cout<<"\n\t\t"<<b<<"bytes outputed";
a-=b;
delay(1000);
}
if (a>0)
cout<<"\n\t\t last"<<a<<"butes sent \t";
cout<<"\n\t bucket output sucessful";
}
}
void main()
{
int op,pktsize;
randomize();
cout<<"enter the outputrate:";
cin>>op;
for(int i=1;i<=3;i++)
{
delay (random(500));
pktsize=random(500);

cout<<"\n packet mo"<<i<<"\t packet size"<<pktsize;


bkt input (pktsize,op);
}
getch();
}

37
COMMUNICATION LABORATORY-II 2023-24

OUTPUT 1 :

OUTPUT 2 :

38
COMMUNICATION LABORATORY-II 2023-24

EXPERIMENT NO-10
DISTANCE VECTOR ALGORITHM

Aim: Write a program for distance vector algorithm to find suitable path for
transmission.

Theory:

One of the most popular & dynamic routing algorithms, the distance vector
routing algorithms operate by using the concept of each router having to maintain
a table( ie., a vector ), that lets the router know the best or shortest distance to
each destination and the next hop to get to there. Also known as Bellman
Ford(1957) and Ford Fulkerson (1962). It was the original ARPANET algorithm.

Algorithm Overview:

Each router maintains a table containing entries for and indexed by each
other router in the subnet. Table contains two parts:

1. A preferred outing line.


2. Estimate of time or distance to that destination.

The metric used here is the transmission delay to each destination. This metric
maybe number of hops, queue length, etc.

The router is assumed to know the distance metric to each of its neighbors.
Across the network the delay is calculated by sending echo packets to each of
neighbors.

PROGRAM :

#include<stdio.h>
#include<string.h>
#include<conio.h>

struct rtable
{
int dist[20],nextnode[20];
}table[20];

int cost[10][10],n;
void distvector()
39
COMMUNICATION LABORATORY-II 2023-24

{
int i,j,k,count=0;
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
table[i].dist[j]=cost[i][j];
table[i].nextnode[j]=j;
}
}
do
{
count=0;
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
for(k=0;k<n;k++)
{
if(table[i].dist[j]>cost[i][k]+table[k].dist[j])
{
table[i].dist[j]=table[i].dist[k]+table[k].dist[j];
table[i].nextnode[j]=k;
count++;
}
}
}
}

}while(count!=0);
}

void main()
{
int i,j;
printf("\nenter the no of vertices:\t");
scanf("%d",&n);
printf("\nenter the cost matrix\n");
for(i=0;i<n;i++)
for(j=0;j<n;j++)
scanf("%d",&cost[i][j]);
distvector();
for(i=0;i<n;i++)
{
printf("\nstate value for router %c \n",i+65);
printf("\ndestnode\tnextnode\tdistance\n");
for(j=0;j<n;j++)
{
if(table[i].dist[j]==99)
40
COMMUNICATION LABORATORY-II 2023-24

printf("%c\t\t-\t\tinfinite\n",j+65);
else

printf("%c\t\t%c\t\t%d\n",j+65,table[i].nextnode[j]+65,table[i].dist[j]);
}

%%return 0;

getch(),
}
}

OUTPUT :

Example 1

enter the no of vertices: 5


enter the cost matrix

0 2 99 4 3
2 0 5 99 99
99 5 0 99 7
4 99 99 0 8
3 99 7 8 0

41
COMMUNICATION LABORATORY-II 2023-24

State value for router A

destnode nextnode distance


A A 0
B B 2
C B 1
D D 4
E E 3

State value for router B

destnode nextnode distance


A A 2
B B 0
C C 5
D A 6
E A 5

State value for router C

destnode nextnode distance


A B 7
B B 5
C C 0
D B 11
E E 7

State value for router D

destnode nextnode distance


A A 4
B C 5
C C 0
D E 3
E E 3

State value for router E

destnode nextnode distance


A D 4
B D 5
C D 0
D D 0
E E 0

42
COMMUNICATION LABORATORY-II 2023-24

EXPERIMENT NO – 11

Stop and Wait Protocol and Sliding Window Protocol

AIM: Implementation of Stop and Wait Protocol and Sliding Window Protocol

THEORY:

In computer networks sliding window protocol is a method to transmit data on a


network. Stop and wait protocol and Sliding window protocol are applied on the Data Link
Layer of OSI model. At data link layer data is in the form of frames. In Networking, Window
simply means a buffer which has data frames that needs to be transmitted.

Flow Control
Consider a situation in which the sender transmits frames faster than the receiver can accept
them. If the sender keeps pumping out frames at high rate, at some point the receiver will be
completely swamped and will start losing some frames. This problem may be solved by
introducing flow control. Most flow control protocols contain a feedback mechanism to
inform the sender when it should transmit the next frame.

Mechanisms For Flow Control:

• Stop and Wait Protocol: This is the simplest file control protocol in which the sender
transmits a frame and then waits for an acknowledgement, either positive or negative,
from the receiver before proceeding. If a positive acknowledgement is received, the
sender transmits the next packet; else it retransmits the same frame. However, this
protocol has one major flaw in it. If a packet or an acknowledgement is completely
destroyed in transit due to a noise burst, a deadlock will occur because the sender cannot
proceed until it receives an acknowledgement. This problem may be solved using
timers on the sender's side. When the frame is transmitted, the timer is set. If there is
no response from the receiver within a certain time interval, the timer goes off and the
frame may be retransmitted.

43
COMMUNICATION LABORATORY-II 2023-24

Stop and Wait Protocol

Step 1: Start the Program


Step 2: Generate a random that gives the total number of frames to be
transmitted
Step 3: Transmit the first frame
Step 4: receive the acknowledgement for the first frame
Step 5: Transmit the next frame
Step 6: Find the remaining frames to be sent
Step 7: If the acknowledgment is not received for a particular frame retransmit
that frame alone again
Step 8: Repeat the step 5 to 7 till the number of remaining frames to be send
becomes zero
Step 9: Stop the Program
44
COMMUNICATION LABORATORY-II 2023-24

#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<dos.h>
Void main()
{
int i,j,noframes,x,x1=10,x2;
clrscr();
for(i=0;i<200;i++)
rand();
noframes=rand()/200;
i=1;j=1;
noframes=noframes/8;
printf(“\n Number of frames is %d”,noframes);
getch();
while(noframes>0)
{
printf(“\n Sending frames %d”,i);
srand(x1++);
x=rand()%10;
if(x%2==0)
{
for(x2=1;x2<2;x2++)
{
Printf(“Waiting for %d seconds \n”,x2);
sleep(x2);
}
printf(“\n sending frame %d”,i);
srand(x1++);
x=rand()%10;
}
printf(“\n ack for frame %d”.j);
noframes-=1;
i++;j++;
}
printf(“\n end of stop and wait protocol”);
getch();
}

• Sliding Window Protocols: In spite of the use of timers, the stop and wait protocol
still suffers from a few drawbacks. Firstly, if the receiver had the capacity to accept
more than one frame, its resources are being underutilized. Secondly, if the receiver

45
COMMUNICATION LABORATORY-II 2023-24

was busy and did not wish to receive any more packets, it may delay the
acknowledgement. However, the timer on the sender's side may go off and cause an
unnecessary retransmission. These drawbacks are overcome by the sliding window
protocols.
In sliding window protocols the sender's data link layer maintains a 'sending window'
which consists of a set of sequence numbers corresponding to the frames it is permitted
to send. Similarly, the receiver maintains a 'receiving window' corresponding to the set
of frames it is permitted to accept. The window size is dependent on the retransmission
policy and it may differ in values for the receiver's and the sender's window. The
sequence numbers within the sender's window represent the frames sent but as yet not
acknowledged. Whenever a new packet arrives from the network layer, the upper edge
of the window is advanced by one. When an acknowledgement arrives from the
receiver the lower edge is advanced by one. The receiver's window corresponds to the
frames that the receiver's data link layer may accept. When a frame with sequence
number equal to the lower edge of the window is received, it is passed to the network
layer, an acknowledgement is generated and the window is rotated by one. If however,
a frame falling outside the window is received, the receiver's data link layer has two
options. It may either discard this frame and all subsequent frames until the desired
frame is received or it may accept these frames or buffer them until the appropriate
frame is received and then pass the frames to the network layer in sequence.

Sliding window works in full duplex mode


46
COMMUNICATION LABORATORY-II 2023-24

It is of two types:-

1. Selective Repeat: Sender transmits only that frame which is erroneous or is lost.

2. Go back n: Sender transmits all frames present in the window that occurs after the error bit
including error bit also.

Sliding Window Protocol Programme:

#include<stdio.h>
#include<conio.h>
#include<stdlib.h>

void main()
{
int w,i,f,frames[50];
printf("Enter window size: ");
scanf("%d",&w);
printf("\nEnter number of frames to transmit: ");
scanf("%d",&f);
printf("\nEnter %d frames: ",f);
for(i=1;i<=f;i++)
scanf("%d",&frames[i]);
printf("\nWith sliding window protocol the frames will be sent in the following manner
(assuming no corruption of frames)\n\n");
printf("After sending %d frames at each stage sender waits for acknowledgement sent by
the receiver\n\n",w);
for(i=1;i<=f;i++)
{
if(i%w==0)
{
printf("%d\n",frames[i]);
printf("Acknowledgement of above frames sent is received by sender\n\n");
}
else
printf("%d ",frames[i]);
}
if(f%w!=0)
printf("\nAcknowledgement of above frames sent is received by sender\n");
getch();
}

47
COMMUNICATION LABORATORY-II 2023-24

Output

Enter window size: 3

Enter number of frames to transmit: 5

Enter 5 frames: 12 5 89 4 6

With sliding window protocol the frames will be sent in the following manner (assuming no
corruption of frames)

After sending 3 frames at each stage sender waits for acknowledgement sent by the receiver

12 5 89
Acknowledgement of above frames sent is received by sender

46
Acknowledgement of above frames sent is received by sender

48
COMMUNICATION LABORATORY-II 2023-24

EXPERIMENT - 12
(BUS/STAR) TOPOLOGY USING SIMULATION SOFTWARE OR
CONFIGURE A SIMPLE NETWORK (RING/MESH) TOPOLOGY

Aim: Configure a simple network (Bus/Star) topology using simulator software


OR Configure a simple network (Ring/Mesh) topology using simulator
software
Apparatus (Software): Packet Tracer Software

Procedure:

1. Develop a topology shown in the figures given below


2. Configure all the nodes
3. Verify the continuity using PING command from one node to another
node
4. Repeat step1 to step3 for all (Bus, Star, Ring, and Mesh) topologies

Figure 12A : Bus Topology

49
COMMUNICATION LABORATORY-II 2023-24

Figure 12B : Star Topology

Figure 12C : Ring Topology

50
COMMUNICATION LABORATORY-II 2023-24

Figure 12D: Mesh Topology

51
COMMUNICATION LABORATORY-II 2023-24

EXPERIMENT - 13

Aim: Configure and simulate simple Wireless Local Area Network


.
Apparatus (Software): Packet Tracer Software

Procedure:

1. Develop a topology shown in the figure given below


2. Configure access points AP1 & AP2 with different SSID names. port
status should be turned on
3. Connect a hosts and two WLAN access points to a router
4. Setup nodes around the two WLAN access points and set the path for
each node
5. Verify the 802.11 wireless parameters in simulation mode

52
COMMUNICATION LABORATORY-II 2023-24

Viva Questions
1.What do you mean by data communication?
Ans: It is the exchange of data between two devices via some form of transmission medium
such as wire cable. The communicating system must be part of a communication system made
up of a combination of hardware and software. The effectiveness of a data communication
system depends on three fundamental characteristics: delivery, accuracy and timeliness.

2.What is simplex?
Ans: It is the mode of communication between two devices in which flow of data is
unidirectional. i.e. one can transmit and other can receive. E.g. keyboard and monitor.

3.What is half-duplex?
Ans: It is the mode of communication between two devices in which flow of data is bi-
directional but not at the same time. ie each station can transmit and receive but not at the same
time. E.g walkie-talkies are half-duplex system.

4.What is full duplex?


Ans: It is the mode of communication between two devices in which flow of data is bi-
directional and it occurs simultaneously. Here signals going in either direction share the
capacity of the link. E.g. telephone

5.What is a network?
Ans: It is a set of devices connected by communication links. A node can be a computer or
any other device capable of sending and/or receiving data generated by other nodes on the
network.

6.What is distributed processing?


Ans: It is a strategy in which services provided by the network reside at multiple sites.

7.What is point to point connection?


Ans:It provides a dedicated link between two devices. The entire capacity of the link is
reserved for transmission between the two devices e.g. when we change the TV channels by
remote control we establish a point to point connection between remote control and TV control
system.

8.What is multipoint connection?


Ans: In multipoint connection more than two specific devices share a single link. Here the
capacity of the channel is shared either separately or temporally.

9.What is a topology?
Ans: Topology of a network is defined as the geometric representation of the relationship of
all the links and linking devices (node) to one another.Four basic topologies are star, bus, ring
and mesh. Star – Here each device has a dedicated point to point link only to a central controller
called hub.Bus -It is multipoint. One long cable acts as a backbone to link all the devices in the
network. Ring -Here each device has a dedicated point to point connection only with the two
devices on either side of it. Mesh -Here every device has a dedicated point to point link to
every other device.

53
COMMUNICATION LABORATORY-II 2023-24

10.Define LAN, MAN and WAN.


Ans: LAN- A local area network (LAN) is a privately owned and links the devices in a single
office, building or campus. It allows resources to be shared between personal computers and
work stations. MAN- A metropolitan-area network (MAN) spreads over an entire city. It may
be wholly owned and operated by a private company, eg local telephone company. WAN – A
wide area network (WAN) provides long distance transmission of data, voice, image and video
information over large geographic areas that comprise a country, a continent or even whole
world.

11.Define internet?
Ans: It is a network of networks.

12.What is a protocol?
Ans: It is a set of rules that governs data communication. A protocol defines what is
communicated, how it is communicated, and when it is communicated. The key elements of
protocol are syntax, semantics and timing.

13.What is TCP/IP protocol model?


Ans: It is a five layered model which provides guidelines for the development of universally
compatible networking protocols. The five layers are physical, data link, network, transport
and application.

14.Describe the functions of five layers?


Ans: Physical- It transmits raw bits over a medium. It provides mechanical and electrical
specification. Data link- It organizes bits into frames. It provides hop to hop delivery. Network-
It moves the packets from source to destination.It provide internetworking. Transport-It
provides reliable process to process message delivery and error recovery. Application-It allows
ti access to network resources.

15.What is ISO-OSI model?


Ans: Open Systems Interconnection or OSI model was designed by the International
Organization for Standardization (ISO) .It is a seven layer model. It is a theoretical model
designed to show how a protocol stack should be implemented. It defines two extra layers in
addition to TCP/IP model. Session -It was designed to establish, maintain, and synchronize the
interaction between communicating system. Presentation-It was designed to handle the syntax
and semantics of the information exchanged between the two systems. It was designed for data
translation, encryption, decryption, and compression.
16. What is multiplexing?
Ans: Multiplexing is the process of dividing a link, the phycal medium, into logical channels
for better efficiency. Here medium is not changed but it has several channels instead of one.

17.What is switching?
Ans: Switching in data communication is of three types Circuit switching Packet switching
Message switching

18.How data is transmitted over a medium?


Ans: Data is transmitted in the form of electromagnetic signals.

54
COMMUNICATION LABORATORY-II 2023-24

19. Compare analog and digital signals? Ans: Analog signals can have an infinite number
of values in a range but digital signal can have only a limited number of values.

20.Define bandwidth?
Ans: The range of frequencies that a medium can pass is called bandwidth. It is the difference
between the highest and lowest frequencies that the medium can satisfactorily pass.

21.What are the factors on which data rate depends?


Ans: Data rate ie.how fast we can send data depends upon i) Bandwidth available ii) The levels
of signals we can use iii) The quality of the channel (level of noise)

22.Define bit rate and bit interval?


Ans: Digital signals are aperiodic.so instead of using period and frequency we use bit interval
and bit rate respectively.Bit interval is the time required to send one single bit.Bit rate is the
number of bit intervals per second.

23.What is Nyquist bit rate formula?


Ans: For a noiseless channel, the Nyquist bit rate formula defines the theoretical maximum bit
rate Bitrate=2* Bandwidth*log2L Where Bandwidth is the bandwidth of the channel L is the
number of signal level used to represent the data Bitrate is the bit rate in bits per second.

24.Define Shannon Capacity?


Ans: Shannon Capacity determines the theoretical highest data rate foe a noise channel.
Capacity= Bandwidth * log2 (1+SNR) Bandwidth is the bandwidth of the channel. SNR is the
signal to noise ratio, it is the statical ratio of the power of the signal to the power of the noise.
Capacity is the capacity of the channel in bits per second
25.What is sampling? Ans: It is the process of obtaining amplitude of a signal at regular
intervals.
26.Define pulse amplitude modulation? Ans: It is an analog to digital conversion method
which takes analog signals, samples it and generates a series of pulse based on the results of
the sampling. It is not used in data communication because the series of pulses generated still
of any amplitude. To modify it we use pulse code modulation.
27.Define pulse code modulation? Ans: Pulse code Modulation modifies pulses created by
PAM to create a completely digital signal. For this PCM first quantizes the PAM pulse.
Quantization is the method of assigning integral values in a specific tange to sampled
instances.PCM is made up of four separate processes: PAM, quantization, binary encoding and
line encoding.
28.What is Nyquist Theorem? Ans: According to this theorem, the sampling rate must be at
least 2 times the highest frequency of the original signal.
29.What are the modes of data transmission? Ans: Data transmission can be serial or
parallel in mode In parallel transmission, a group of bits is sent simultaneously, with each bit
on a separate line.In serial transmission there is only one line and the bits are sent sequentially.
30.What is Asynchronous mode of data transmission? Ans: It is a serial mode of
transmission. In this mode of transmission, each byte is framed with a start bit and a stop bit.
There may be a variable length gap between each byte.
31.What is Synchronous mode of data transmission? Ans: It is a serial mode of
transmission.In this mode of transmission, bits are sent in a continuous stream without start
and stop bit and without gaps between bytes. Regrouping the bits into meaningful bytes is the
responsibility of the receiver.
55
COMMUNICATION LABORATORY-II 2023-24

32.What are the different types of multiplexing? Ans: Multiplexing is of three types.
Frequency division multiplexing and wave division multiplexing is for analog signals and time
division multiplexing is for digital signals.
33.What is FDM? Ans: In frequency division multiplexing each signal modulates a different
carrier frequency. The modulated carrier combines to form a new signal that is then sent across
the link. Here multiplexers modulate and combine the signal while demultiplexers decompose
and demodulate. Guard bands keep the modulating signal from overlapping and interfering
with one another.
34.What is TDM ? Ans: In TDM digital signals from n devices are interleaved with one
another, forming a frame of data. Framing bits allow the TDM multiplexer to synchronize
properly.
35.What are the different transmission media? Ans: The transmission media is broadly
categorized into two types i)Guided media(wired) i)Unguided media(wireless)
36.What are the different Guided Media? Ans: The media which provides a conduct from
one device to another is called a guided media. These include twisted pair cable, coaxial cable,
and fiber-optic cable.
37.Describe about the different Guided Medias. Ans: Twisted pair cable consists of two
insulated cupper wires twisted together. It is used in telephone line for voice and data
communications. Coaxial cable has the following layers: a metallic rod-shaped inner
conductor, an insulator covering the rod, a metallic outer conductor (shield), an insulator
covering the shield, and a plastic cover.Coaxial cable can carry signals of higher frequency
ranges than twisted-pair cable. Coaxial cable is used in cable TV networks and Ethernet
LANs.Fiber-optic cables are composed of a glass or plastic inner core surrounded by cladding,
all encased in an outer jacket.Fiber-optic cables carry data signals in the form of light. The
signal is propagated along the inner core by reflection. Its features are noise resistance, low
attenuation, and high bandwidth capabilities. It is used in backbone networks, cable TV
nerworks, and fast Ethernet networks.
38.What do you mean by wireless communication? Ans: Unguided media transport
electromagnetic waves without using a physical conductor. This type of communication is
referred as wireless communication. Here signals are broadcaster through air and thus available
to anyone who has a device to receive it. are connected to one another efficiently. A switch is
intermediary hardware or software that links devices together temporarily.
39.What are the switching methods? Ans: There are three fundamental switching methods:
circuit switching, packet switching, And message switching.In circuit switching, a direct
physical connection between two devices is created by space division switches, time division
switches or both. In packet switching data is transmitted using a packet switched network.
Packet switched network is a network in which data are transmitted in independent units called
packets.
40.What are the duties of data link layer? Ans: Data link layer is responsible for carrying
packets from one hop (computer or router) to the next. The duties of data link layer include
packetizing, adderssing, error control, flow control, medium access control.
41.What are the types of errors? Ans: Errors can be categorized as a single-bit error or burst
error. A single bit error has one bit error per data unit. A burst error has two or more bits errors
per data unit.
42.What do you mean by redundancy? Ans: Redundancy is the concept of sending extra
bits for use in error detection. Three common redundancy methods are parity check, cyclic
redundancy check (CRC), and checksum.
43.Define parity check. Ans: In parity check, a parity bit is added to every data unit so that
the total number of 1s is even (or odd for odd parity).Simple parity check can detect all single
56
COMMUNICATION LABORATORY-II 2023-24

bit errors. It can detect burst errors only if the total number of errors in each data unit is odd.In
two dimensional parity checks, a block of bits is divided into rows and a redundant row of bits
is added to the whole block.
44. Define cyclic redundancy check (CRC). Ans: C RC appends a sequence of redundant
bits derived from binary division to the data unit. The divisor in the CRC generator is often
represented as an algebraic polynomial.
45. What is hamming code? Ans: The hamming code is an error correction method using
redundant bits. The number of bits is a function of the length of the data bits. In hamming code
for a data unit of m bits, we use the formula 2r >= m+r+1 to determine the number of redundant
bits needed. By rearranging the order of bit transmission of the data units, the hamming code
can correct burst errors.
46.What do you mean by flow control? Ans: It is the regulation of sender’s data rate so that
the receiver buffer doesn’t become overwhelmed.i.e. flow control refers to a set of procedures
used to restrict the amount of data that the sender can send before waiting for
acknowledgement.
47.What do you mean by error control? Ans: Error control refers primarily to methods of
error detection and retransmission. Anytime an error is detected in an exchange, specified
frames are retransmitted. This process is called automatic repeat request (ARQ).
48.Define stop and wait ARQ. Ans: In stop and wait ARQ, the sender sends a frame and
waits for an acknowledgement from the receiver before sending the next frame.
49.Define Go-Back-N ARQ? Ans: In Go-Back-N ARQ, multiple frames can be in transit at
the same time. If there is an error, retransmission begins with the last Unacknowledged frame
even if subsequent frames arrived correctly. Duplicate frames are discarded.
50.Define Selective Repeat ARQ? Ans: In Selective Repeat ARQ, multiple frames can be in
transit at the same time. If there is an error, only unacknowledged frame is retransmitted.
50.What do you mean by pipelining, is there any pipelining in error control? Ans: The
process in which a task is often begun before the previous task has ended is called pipelining.
There is no pipelining in stop and wait ARQ however it does apply in Go-Back-N ARQ and
Selective Repeat ARQ.
51.What is HDLC? Ans: It is a bit oriented data link protocol designed to support both half
duplex and full duplex communication over point to point and multi point links.HDLC is
characterized by their station type,configuration and their response modes.
52.What do you mean by point to point protocol? Ans: The point to point protocol was
designed to provide a dedicated line for users who need internet access via a telephone line or
a cable TV connection. Its connection goes through three phases: idle, establishing,
authenticating, networking and terminating. At data link layer it employs a version of HDLC.
53. What do you mean by point to point protocol stack? Ans: Point to point protocol uses
a stack of other protocol to use the link, to authenticate the parties involved, and to carry the
network layer data. Three sets of protocols are defined: link control protocol, Authentication
protocol, and network control protocol.
54.What do you mean by line control protocol? Ans: It is responsible for establishing,
maintaining, configuring, and terminating links.
55.What do you mean by Authentication protocol? Ans: Authentication means validating
the identity of a user who needs to access a set of resources. It is of two types i)Password
Authentication Protocol(PAP) ii)Challenge Handshake Authentication Protocol(CHAP) PAP
is a two step process. The user sends a authentication identification and a password. The system
determines the validity of the Information sent.CHAP is a three step process. The system sends
a value to the user. The user manipulates the value and sends the result. The system Verifies
the result.
57
COMMUNICATION LABORATORY-II 2023-24

56.What do you mean by network control protocol? Ans: Network control protocol is a set
of protocols to allow the encapsulation of data coming from network layer protocol that
requires the services of PPP.
57. What do you mean by CSMA? Ans: To reduce the possibility of collision CSMA method
was developed. In CSMA each station first listen to the medium (Or check the state of the
medium) before sending. It can’t eliminate collision.
58.What do you mean by Bluetooth? Ans: It is a wireless LAN technology designed to
connect devices of different functions such as telephones, notebooks, computers, cameras,
printers and so on. Bluetooth LAN Is an adhoc network that is the network is formed
spontaneously? It is the implementation of protocol defined by the IEEE 802.15 standard.
59.What is IP address? Ans: The internet address (IP address) is 32bits that uniquely and
universally defines a host or router on the internet. The portion of the IP address that identifies
the network is called netid. The portion of the IP address that identifies the host or router on
the network is called hostid.
60.What do you mean by subnetting? Ans: Subnetting divides one large network into several
smaller ones. It adds an intermediate level of hierarchy in IP addressing.
61.What are the advantages of fiber optics cable ? Ans: The advantages of fiber optics cable
over twisted pair cable are Noise resistance-As they use light so external noise is not a factor.
Less signal attenuation-fiber optics transmission distance is significantly greater than that of
other guided media.Higher bandwidth-It can support higher bandwidth.
62.What are the disadvantages of fiber optics cable? Ans: The disadvantages of fiber optics
cable over twisted pair cable are Cost-It is expensive Installation/maintenance-Any roughness
or cracking defuses light and alters the signal Fragility-It is more fragile.
63.What are the propagation type of radio wave ? Ans: Radio wave propagation is
dependent upon frequency.There are five propagation type. i)surface propagation
ii)Tropospheric propagation iii)Ionospheric propagation iv)Line of sight propagation v)space
propagation
64.What do you mean by Geosynchronous Satellites ? Ans: Satellite communication uses
a satellite in geosynchronous orbit to relay signals.The Satellite must move at the same speed
as the earth so that it seems to remain fixed above a certain spot..Only one orbit can be
geosynchronous.This orbit occurs at the equatorial plane and is approximately 22,000 miles
from the surface of earth.
65.What are the factors for evaluating the suitability of the media ? Ans: The factors are
cost,throughput,attenuation,Electromagneric interference(EMI),securtty.
66.What do you mean by medium access control(MAC) sublayer. Ans: The protocols used
to determine who goes next on a multi-access channel belong to a sublayer of the data link
layer is called the multi-access channel(MAC) sublayer.It is the buttom part of data link layer.
67.What do you mean by ALOHA ? Ans: It is the method used to solve the channel allocation
problem .It is used for: i)ground based radio broadcasting ii)In a network in which
uncoordinated users are competing for the use of single channel. It is of two types: 1.Pure aloha
2.Slotted aloha
68.What is pure ALOHA? Ans: It lets users transmit whenever they have data to
sent.Collision may occur but due to feedback property sender can know the status of
message.conflict occur when at one time more bits are transmitted.The assumptions are : i)all
frame size is same for all user. ii)collision occur when frames are transmitted simultaneously
iii)indefinite population of no of user. iv)N=number of frames/frame time iv)it obeys poisson’s
distribution if N>1 there will be collision 0<1
69.What is slotted ALOHA? Ans: In this method time is divided into discrete intervals,each
interval corresponding to one frame.It requires user to agree on slot boundaries.Here data is
58
COMMUNICATION LABORATORY-II 2023-24

not send at any time instead it wait for beginning of the next slot.Thus pure ALOHA is tuened
into discrete one.
70.What do you mean by persistent CSMA(carrier sense multiple access) ? Ans: When a
station has data to send,it first listens to the channel to see if anyone else is transmitting at that
moment.If channel is busy it waits until the station becomes idle. When collision occurs it
waits and then sends.It sends frame with probability 1 when channel is idle.
71.What do you mean by non persistent CSMA(carrier sense multiple access) ? Ans: Here
if no one else is sending the station begins doing so itself.However if the channel is already in
use,the station does’t continuously sense it rather it waits for a random period of time and then
repeats.It leads better channel utilization but longer delay.
72.What do you mean by p persistent CSMA(carrier sense multiple access) ? Ans: It
applies to slotted channels.when a station becomes ready to send,it senses the channel.If it is
idle it transmits with a probability P,with a probability Q=P-1 It defers until the next slot.If
that slot is also idle,it either transmits or defers again with probability P and Q.The process is
repeated until either the frame has been transmitted or another station begins transmitting.
73.What is FDDI? Ans: It is high performance fiber optic token ring LAN running at
100Mbps over distance up 1000 stations.FDDI access is limited by time.A FDDI cabling
consist of two fiber rings. i)one transmitting clockwise ii)one transmitting counterclockwise
74.What is Firewalls? Ans: It is an electronic downbridge which is used to enhance the
security of a network. It’s configuration has two components. i)Two routers ii)Application
gateway the packets traveling through the LAN are inspected here and packets meeting certain
criteria are forwarded and others are dropped.
75.What is Repeaters ? Ans: A receiver receives a signal before it becomes too weak or
corrupted,regenerates the original bit pattern,and puts the refreshed copy back onto the link.It
operates on phycal layer of OSI model.
76.What is Bridges? Ans: They divide large network into smaller components.They can relay
frames between two originally separated LANs.They provide security through partitioning
traffic.They operate on phycal and data link layer of OSI model.
77.What is Routers ? Ans: Router relay packets among multiple interconnected
networks.They receive packet from one connected network and pass it to another
network.They have access to network layer addresses and certain software that enables them
to determine which path is best for transmission among several paths.They operate on
phycal,data link and network layer of OSI model.
78.What is Gateway ? Ans: It is a protocol converter.A gateway can accept a packet formatted
for one protocol and convert it to a packet formatted for another protocol.It operates on all the
seven layers of OSI model.
79.What do you mean by Data Terminal Equipment(DTE) ? Ans: It is any device that is
source of or destination for binary digital data.At phycal layer it can be a terminal computer.
They generate or consume information.
80.What do you mean by Data Terminating Equipment (DCE) ? Ans: Data circuit
terminating equipment includes any functional unit that transmit or receives data in the form
of an analog or digital signal through a network.DTE generates digital data and passes them to
a DCE ,the DCE converts the data to a form acceptable to the transmission media and sends
the converted signal to another DCE on the network.
81.What do you mean by protocol stack ? Ans: The list of protocols used by certain system
,one protocol per layer is called protocol stack.
82.What do you mean by peer ? Ans: Entities comprising the corresponding layers on
different machines are called peers.It may be • hardware device. • processes • human being
peers communicate by using protocol.
59
COMMUNICATION LABORATORY-II 2023-24

83.What do you mean by broadcasting ? Ans: Broadcast system allow addressing a packet
to all destination by using a special code in address field.when packet is transmitted it is
received and processed by every machine on the network.
84.What are the advantages of broadcast network. Ans: • a single communication channel
is shared by all computers. • packets are transmitted and received by all the computer. • address
field is attached to whom it is intended. • multicasting is used in network.
85.What do you mean by point to point network? Ans: Point to point network consist of
many connections between individual pair of machines.large networks are point to
point.Routing algorithm plays an important in point to point network.It uses stored ad forword
technique.It is a packet switching network.
86.What are the design issue of layers ? Ans: The design issue of layer are • Addressing
technique.ie source and destination address • Types of communication • Error control • Order
of message. • Speed matching • Multiplexing and demultiplexing.
87.What are the protocols in application layer ? Ans: The protocols defined in application
layer are • TELNET • FTP • SMTP • DNS
88.What are the protocols in transport layer ? Ans: The protocols defined in transport layer
are • TCP • UDP
89.Define TCP ? Ans: It is connection oriented protocol.It consist byte streams oeiginating
on one machine to be delivered without error on any other machine in the network.while
transmitting it fragments the stream to discrete messages and passes to interner layer.At the
destination it reassembles the messages into output stream.
90.Define UDP ? Ans: It is unreliable connectionless protocol.It is used for one-shot,client-
server type,requesr-reply queries and applications in which prompt delivery is required than
accuracy.
91.Define IP ? Ans: Internetwork protocol (IP) is the transmission mechanism used by TCP/IP
protocol.It is an unreliable and connectionless datagram protocol.It provides no error checking
and tracking.
92.What do you mean by client server model ? Ans: In client server model ,the client runs
a program to request a service and the server runs a program to provide the service.These two
programs communicate with each other. One server program can provide services to many
client programs.
93.What are the information that a computer attached to a TCP/IP internet must
possesses ? Ans: Each computer attached to TCP/IP must possesses the following information
• Its IP addesss • Its subnet mask • The IP addesss of the router. • The Ip address of the name
server.
94.What is domain name system(DNS)? Ans: Domain Name System (DNS )is a client server
application that identifies each host on the internet with a unique user friendly name.
95.What is TELNET ? Ans: TELNET is a client –server application that allows a user to log
on to a remote machine,giving the user access to the remote system. TELNET is an
abbreviation of terminal Network.
96.What do you mean by local login and remote login ? Ans: When a user logs into a local
time-sharing system ,it is called local login. When a user wants to access an application
program or utility located on a remote machine,he or she performs remote login.
97.What is Network Virtual Terminal ? Ans: A universal interface provided by TELNET is
called Network Virtual Terminal(NVT) character set.Via this interface TELNET translates
characters (data or command) that come from local terminal into NVT form and delivers them
to the network.
98.What do you mean by Simple Mail Transfer Protocol ? Ans: The TCP/IP protocol that
supports electronic mail on the internet is called Simple Mail Transfer Protocol.SMTP provides
60
COMMUNICATION LABORATORY-II 2023-24

for mail exchange between users on the same or different computer and supports Sending a
single message to one or more recipient Sending message that include text, voice,video,or
graphics.Sending message to users on network outside the internet.
99.What is Hypertext Transfer Protocol(HTTP) ? Ans: It is the main protocol used to
access data on the World Wide Web .the protocol transfers data in the form of plain
text,hypertext,audio,video,and so on. It is so called because its efficiency allows its use in a
hypertext environment where there are rapid jumps from one document to another.
100.What is URL ? Ans: It is a standard for specifying any kind of information on the World
Wide Web.
101. What is World Wide Web ? Ans: World Wide Web is a repository of information spread
all over the world and linked together.It is a unique combination of flexibility,portability,and
user-friendly features .The World Wide Web today is a distributed client-server service,in
which a client using a browser can access a service using a server.The service provided is
distributed over many locations called web sites.
102.What is HTML ? Ans: Hypertext Markup Language (HTML) is a language for creating
static web pages

61
COMMUNICATION LABORATORY-II 2023-24

62
COMMUNICATION LABORATORY-II 2023-24

63

You might also like