DCCN Lab 1-14
DCCN Lab 1-14
DCCN Lab 1-14
Lab 01
Introduction to Networking Equipment’s
Modem
Modem is a contraction of the terms modulator and demodulator. Modems perform a simple
function: They translate digital signals from a computer into analog signals that can travel
across conventional phone lines. The modem modulates the signal at the sending end and
demodulates at the receiving end.
ADSL Modem
Asymmetric digital subscriber line (ADSL) is a type of digital subscriber line (DSL) technology, a
data communications technology that enables faster data transmission over copper telephone
lines rather than a conventional voiceband modem can provide.
Hubs
Hubs are simple network devices, and their simplicity is reflected in their low cost. Small hubs
with four or five ports (often referred to as workgroup hubs) costs very less, with the requisite
cables, they provide everything needed to create a small network. Hubs with more ports are
available for networks that require greater capacity. Figure 3.1 shows an example of a
workgroup hub, and Figure 1-7 shows an example of the type of hub you might see on a
corporate network.
1|Page
Data Communication and Computer Networks
Switches
On the surface, a switch looks much like a hub. Despite their similar appearance, switches are
far more efficient than hubs and are far more desirable for today’s network environments.
Figure 1-8 shows an example of a 32-port Ethernet switch. If you refer to Figure 1-7, you’ll
notice few differences in the appearance of the high-density hub and this switch. As with a hub,
computers connect to a switch via a length of twisted-pair cable. Multiple switches are often
interconnected to create larger networks. Despite their similarity in appearance and their
identical physical connections to computers, switches offer significant operational advantages
over hubs.
As discussed earlier in this lab, a hub forwards data to all ports, regardless of whether the data
is intended for the system connected to the port. This arrangement is inefficient; however, it
requires little intelligence on the part of the hub, which is why hubs are inexpensive.
Rather than forwarding data to all the connected ports, a switch forwards data only to the port
on which the destination system is connected. It looks at the Media Access Control (MAC)
addresses of the devices connected to it to determine the correct port. A MAC address is a
unique number that is stamped into every NIC. By forwarding data only to the system to which
the data is addressed, the switch decreases the amount of traffic on each network link
dramatically. In effect, the switch literally channels (or switches, if you prefer) data between the
ports.
Router
A router is a networking device that forwards data packets between computer networks.
Routers perform the traffic directing functions on the Internet. A data packet is typically
forwarded from one router to another router through the networks that constitute the
internetwork until it reaches its destination node. A router is connected to two or more data
lines from different networks. When a data packet comes in on one of the lines, the router
reads the address information in the packet to determine the ultimate destination. Then, using
information in its routing table or routing policy, it directs the packet to the next network on its
journey. This creates an overlay internetwork.
2|Page
Data Communication and Computer Networks
3|Page
Data Communication and Computer Networks
4|Page
Data Communication and Computer Networks
Lab 02
Building Cables and Introduction to Networking Equipment’s
Objective
In this lab, you will build and test straight-through and crossover Unshielded Twisted-Pair (UTP)
Ethernet network cables along with introduction of basic Networking Equipment’s.
Theory
With a straight-through cable, the color of wire used by pin 1 on one end is the same color used
by pin 1 on the other cable end, and similarly for the remaining seven pins. The cable will be
constructed using either TIA/EIA T568A or T568B standards for Ethernet, which determines the
color wire to be used on each pin. Straight-through patch cables are normally used to connect a
host directly to a hub or switch or to a wall plate in an office area. With a crossover cable the
second and third pairs on the RJ-45 connector at one end of the cable are reversed at the other
end. The pinouts for the cable are the T568A standard on one end and the T568B standard on
the other end. Crossover cables are normally used to connect hubs and switches or can be used
to directly connect two hosts to create a simple network.
Tools Required
Two 0.6 to 0.9m (2 to 3 ft.) lengths of cable, Category 5 or 5e
A minimum of four RJ-45 connectors (more may be needed if miss-wiring or breakage
occurs)
An RJ-45 crimping tool
Cable Tester
Wire cutters
Wire stripper
Figure 2-1
5|Page
Data Communication and Computer Networks
Table 2-1
T568A – Standard
Pin Number Pair Number Wire Color Function
1 3 Green – White Transmit
2 3 Green Transmit
3 2 Orange – White Receive
4 1 Blue Not Used
5 1 Blue – White Not Used
6 2 Orange Receive
7 4 Brown – White Not Used
8 4 Brown Not Used
Table 2-2
T568B – Standard
Pin Number Pair Number Wire Color Function
1 2 Orange – White Transmit
2 2 Orange Transmit
3 3 Green – White Receive
4 1 Blue Not Used
5 1 Blue – White Not Used
6 3 Green Receive
7 4 Brown – White Not Used
8 4 Brown Not Used
6|Page
Data Communication and Computer Networks
Figure 2-2
Figure 2-3
7|Page
Data Communication and Computer Networks
4. Untwist a short length of the pairs and arrange them in the exact order needed by the
standard moving left to right starting with pin 1. It is very important to untwist as little as
possible. The twists are important because they provide noise cancellation.
5. Straighten and flatten the wires between your thumb and forefinger.
6. Ensure the cable wires are still in the correct order as the standard.
Figure 2-4
7. Cut the cable in a straight line to within 1.25 to 1.9 cm (1/2 to 3/4 in.) from the edge of the
cable jacket. If it is longer than this, the cable will be susceptible to crosstalk (the
interference of bits from one wire with an adjacent wire).
8. The key (the prong that sticks out from the RJ-45 connector) should be on the underside
pointing downward when inserting the wires. Ensure the wires are in order from left to right
starting with pin 1.
9. Insert the wires firmly into the RJ-45 connector until all wires are pushed as far as possible
into the connector.
Figure 2-5
4. Visually re-inspect the connector. If improperly installed, cut the end off and repeat the
above process.
8|Page
Data Communication and Computer Networks
Step 4: Terminate the Other End of Cable
1. Use the previously described steps to attach an RJ-45 connector to the other end of the
cable.
2. Visually re-inspect the connector. If improperly installed, cut the end off and repeat the
process.
3. Which standard [T568A | T568B] is used for patch cables in our Lab?
9|Page
Data Communication and Computer Networks
6. Cut the cable in a straight line to within 1.25 to 1.9 cm (1/2 to 3/4 in.) from the edge of the
cable jacket. If it is longer than this, the cable will be susceptible to crosstalk (the
interference of bits from one wire with an adjacent wire).
7. The key (the prong that sticks out from the RJ-45 connector) should be on the underside
pointing downward when inserting the wires. Ensure the wires are in order from left to right
starting with pin 1. Insert the wires firmly into the RJ-45 connector until all wires are pushed
as far as possible into the connector.
10 | P a g e
Data Communication and Computer Networks
Cross – over
Straight Cable
Cable
11 | P a g e
Data Communication and Computer Networks
3 - What is Face – Plate?
4 - What is Dogger?
12 | P a g e
Data Communication and Computer Networks
Lab 03
An Introduction to MATLAB and Digital Modulation
Objective
To understand the Digital Modulation with respect to digital data using MATLAB.
Theory
MATLAB, short for MATrix LABoratory is a programming package specifically designed for quick
and easy scientific calculations and I/O. It has literally hundreds of built-in functions for a wide
variety of computations and many toolboxes designed for specific research disciplines,
including statistics, optimization, solution of partial differential equations, data analysis.
MATLAB integrates mathematical computing, visualization, and a powerful language to provide
a flexible environment for technical computing. The open architecture makes it easy to use
MATLAB and its companion products to explore data, create algorithms and create custom
tools, that provide early insights and competitive advantages.
There are two types of modulation, Analog modulation and Digital modulation. The main
difference is that in Digital modulation the modulating signal is digital and in analog modulation
it is analog. Other than that, in digital modulation, at the receiver we are actually interested in
getting back the 1's and 0's and not the original signal whereas in analog modulation we ideally
desire the exact signal waveform which makes analog modulations more sensitive to noise.
Move over, in Analog modulation modulating signals are continuous analog signals like audio,
voice, video etc. and in Digital modulation the modulating signals are discrete 1 and 0s or bit
streams from computing system.
Baseband signal is always analog for this modulation. There are three properties of a carrier
signal amplitude, frequency and phase thus there are three basic types of analog modulations.
Digital modulation in somewhat similar to the analog modulation except baseband signal is of
discrete amplitude level. For binary signal, it has only two level, either high or logic 1 or low or
logic 0. The modulation scheme is mainly three types.
13 | P a g e
Data Communication and Computer Networks
ASK or Amplitude Shift Key
FSK or Frequency shift key
PSK or Phase shift key
14 | P a g e
Data Communication and Computer Networks
figure('Name','DCCN Lab - 03 : Spring 2017 -- < Your
Name>’,'NumberTitle','off')
t1=linspace(0,t,1000);
eq=(1+m.*y1).*(Ac.*y2);
subplot(311);
plot(t1,y1);
xlabel('Time');
ylabel('Amplitude');
title('Message signal')
subplot(312)
plot(t1,y2);
xlabel('Time');
ylabel('Amplitude');
title('Carrier signal');
subplot(313);
plot(t1,eq);
15 | P a g e
plot(t1,eq,'r');
Data Communication and Computer Networks
Figure 3 – 1
16 | P a g e
Data Communication and Computer Networks
figure('Name','DCCN Lab - 03 -- Iqbal Uddin
Khan','NumberTitle','off')
t =0:0.001:1;
Wm =2*pi*fm;
m = Am*cos(Wm*t);
subplot(2,2,1);
plot(t,m);
hold on
xlabel('Time --->');
ylabel('Amplitude --->')
17 | P a g e
Data Communication and Computer Networks
Wc= 2*pi*fc;
c = Ac*cos(Wc*t);
subplot(2,2,2);
plot(t,c);
hold on
title('Carrier Signal');
xlabel('Time --->');
s_fm = Ac*cos(Wc*t+2*pi*kf*cumsum(m));
subplot(2,2,3);
plot(t,s_fm);
hold on
xlabel('Time --->');
ylabel('Amplitude --->')
Figure 3 – 2
I Q B A L
49 51 42 41 4C
4. Now place binary values in array section of code, remember there should be 1 space
between each element and 2 spaces between each set
5. Figure 3 – 3 is the screen shot of I Q B A L
6. Attach the screenshot containing your name
19 | P a g e
Data Communication and Computer Networks
figure('Name','DCCN Lab - ASK PSK FSK : Spring 2017 -- Iqbal
Uddin Khan','NumberTitle','off')
f=2;
f2=6;
nx=size(x,2);
S=size(x,2);
i=1;
while i<nx+1
t = i:0.001:i+1;
if x(i)==1
ask=sin(2*pi*f*t);
fsk=sin(2*pi*f2*t);
psk=sin(2*pi*f*t);
else
ask=0;
ASK PSK FSK Demonstration Code
fsk=sin(2*pi*f*t);
psk=sin(2*pi*f*t+pi);
end
subplot(3,1,1);
plot(t,ask);
hold on;
grid on;
axis([1 (S) -1 1]);
title('Amplitude Shift Key --- ASK')
20 | P a g e
Data Communication and Computer Networks
Figure 3 – 3
21 | P a g e
Data Communication and Computer Networks
6. If wave forms are not visible use X Zoom button in each scope window
7. Attach screen shot of your outputs by each scope
Figure 3 – 4
22 | P a g e
Data Communication and Computer Networks
e. Frequency (Rad / Sec): 100
f. Phase (Rad): 0
g. Sample Time: 0.001
h. Check: Interpret Vector Parameters as 1-D
6. Open Switch Parameters and set following:
a. Threshold: 0.1
b. Sample Time: -1
7. Click run icon, double click on every scope to open their output window
8. If wave forms are not visible use X Zoom button in each scope window
9. Attach screen shot of your outputs by each scope
Figure 3 – 5
23 | P a g e
Data Communication and Computer Networks
a. Wave Form: Time Based
b. Time (t): Use Simulation Time
c. Amplitude: 2
d. Frequency: 200
e. Unit: Hertz
f. Check: Interpret Vector Parameters as 1-D
Figure 3 – 6
5. Open Product Parameters and set following:
a. Number of Inputs: 2
b. Multiplication: Element-Wise
c. Sample Time: -1
6. Click run icon, double click on every scope to open their output window
7. If waveforms are not visible use X Zoom button in each scope window
8. Attach screenshot of your outputs by each scope
24 | P a g e
Data Communication and Computer Networks
Lab 04
Demonstration of Amplitude Shift Keying
Objective
To Demonstrate Amplitude Shift Keying Modulation and De-Modulation.
Theory
Amplitude-shift keying (ASK) is a form of amplitude modulation that represents digital data as
variations in the amplitude of a carrier wave. In an ASK system, the binary symbol 1 is
represented by transmitting a fixed-amplitude carrier wave and fixed frequency for a bit
duration of T seconds. If the signal value is 1 then the carrier signal will be transmitted;
otherwise, a signal value of 0 will be transmitted.
Like AM, an ASK is also linear and sensitive to atmospheric noise, distortions, propagation
conditions on different routes in PSTN, etc. Both ASK modulation and demodulation processes
are relatively inexpensive. The ASK technique is also commonly used to transmit digital data
over optical fiber. For LED transmitters, binary 1 is represented by a short pulse of light and
binary 0 by the absence of light. Laser transmitters normally have a fixed "bias" current that
causes the device to emit a low light level. This low level represents binary 0, while a higher-
amplitude light wave represents binary 1. Figure 4-1 demonstrates ASK diagram and Figure 4-2
illustrate MATLB’s ASK Modulation and Demodulation.
Figure 4-1
25 | P a g e
Data Communication and Computer Networks
Figure 4-2
Theory
Generation of ASK
Amplitude shift keying - ASK - is a modulation process, which imparts to a sinusoid two or more
discrete amplitude levels. These are related to the number of levels adopted by the digital
message. For a binary message sequence, there are two levels, one of which is typically zero.
The data rate is a sub-multiple of the carrier frequency. Thus, the modulated waveform consists
of bursts of a sinusoid. One of the disadvantages of ASK, compared with FSK and PSK, for
example, is that it has not got a constant envelope. This makes its processing (e.g., power
amplification) more difficult, since linearity becomes an important factor. However, it does
make for ease of demodulation with an envelope detector.
Demodulation
ASK signal has a well-defined envelope. Thus, it is amenable to demodulation by an envelope
detector. Some sort of decision-making circuitry is necessary for detecting the message. The
signal is recovered by using a correlation and decision making circuitry is used to recover the
binary sequence.
Algorithm
Initialization commands
ASK modulation
1. Start FOR loop
26 | P a g e
Data Communication and Computer Networks
2. Generate binary data, message signal (on-off form)
3. Generate ASK modulated signal.
4. Plot message signal and ASK modulated signal.
5. End FOR loop.
6. Plot the binary data and carrier.
ASK demodulation
1. Start FOR loop
2. Perform correlation of ASK signal with carrier to get decision variable
3. Make decision to get demodulated binary data. If x>0, choose ‘1’ else choose ‘0’
4. Plot the demodulated binary data.
Figure 4-3
27 | P a g e
Data Communication and Computer Networks
28 | P a g e
Data Communication and Computer Networks
Figure 4-4
29 | P a g e
Data Communication and Computer Networks
Figure 4-5
30 | P a g e
Data Communication and Computer Networks
31 | P a g e
Data Communication and Computer Networks
32 | P a g e
Data Communication and Computer Networks
Lab 05
Demonstration of Frequency Shift Keying
Objective
To Demonstrate Frequency Shift Keying Modulation and De-Modulation.
Theory
Frequency-shift keying (FSK) is a frequency modulation scheme in which digital information is
transmitted through discrete frequency changes of a carrier signal. The technology is used for
communication systems such as amateur radio, caller ID and emergency broadcasts. The
simplest FSK is binary FSK (BFSK). BFSK uses a pair of discrete frequencies to transmit binary (0s
and 1s) information. With this scheme, the "1" is called the mark frequency and the "0" is called
the space frequency. The time domain of an FSK modulated carrier is illustrated in the figures to
the right.
Moreover, as its name suggests, a frequency shift keyed transmitter has its frequency shifted by
the message. Although there could be more than two frequencies involved in an FSK signal, in
this experiment the message will be a binary bit stream, and so only two frequencies will be
involved. The word ‘keyed’ suggests that the message is of the ‘on-off’ (mark-space) variety,
such as one (historically) generated by a Morse key, or more likely in the present context, a
binary sequence. The output from such a generator is shown in in Figure 5-1 below.
Figure 5-1
Conceptually, and in fact, the transmitter could consist of two oscillators (on frequencies F 1 and
F2), with only one being connected to the output at any one time. This is illustrated in block
33 | P a g e
Data Communication and Computer Networks
diagram form in Figure 2 on next page. Unless there are special relationships between the two
oscillator frequencies and the bit clock there will be abrupt phase discontinuities of the output
waveform during transitions of the message. There are different methods of demodulating FSK.
A natural classification is into synchronous (coherent) or asynchronous (non-coherent). The
receiver of Figure 5-3 takes advantage of this. The FSK signal has been separated into two parts
by bandpass filters (BPF) tuned to the MARK and SPACE frequencies.
Figure 4-2
Figure 5-3
Theory
Generation of FSK
Frequency-shift keying (FSK) is a frequency modulation scheme in which digital information is
transmitted through discrete frequency changes of a carrier wave. The simplest FSK is binary
FSK (BFSK). BFSK uses a pair of discrete frequencies to transmit binary (0s and 1s) information.
With this scheme, the "1" is called the mark frequency and the "0" is called the space
frequency. In binary FSK system, symbol 1 & 0 are distinguished from each other by
transmitting one of the two sinusoidal waves that differ in frequency by a fixed amount.
34 | P a g e
Data Communication and Computer Networks
0 Elsewhere
Where i=1, 2 & Eb=Transmitted energy/bit
Transmitted freq= ƒi = (nc + i) /Tb , and n = constant (integer), Tb = bit interval
Symbol 1 is represented by S1 (t)
Symbol 0 is represented by S0 (t)
BFSK Transmitter
The input binary sequence is represented in its ON-OFF form, with symbol 1 represented by
constant amplitude of √Eb with & symbol 0 represented by zero volts. By using inverter in the
lower channel, we in effect make sure that when symbol 1 is at the input, the two frequency f1
& f2 are chosen to be equal integer multiples of the bit rate 1/T b. By summing the upper &
lower channel outputs, we get BFSK signal.
Figure 5-4
BFSK Receiver
The receiver consists of two correlators with common inputs which are supplied with locally
generated coherent reference signals c1(t) and c2 (t). The correlator outputs are then subtracted
one from the other, and the resulting difference x is compared with a threshold of zero volts. If
x >0, the receiver decides in favor of symbol 1 and if x <0, the receiver decides in favor of
symbol 0.
Figure 5-5
35 | P a g e
Data Communication and Computer Networks
Algorithm
Initialization commands
FSK modulation
Generate two carriers signal.
1. Start FOR loop
2. Generate binary data, message signal and inverted message signal
3. Multiply carrier 1 with message signal and carrier 2 with inverted message signal
4. Perform addition to get the FSK modulated signal
5. Plot message signal and FSK modulated signal.
6. End FOR loop.
7. Plot the binary data and carriers.
FSK demodulation
1. Start FOR loop
2. Perform correlation of FSK modulated signal with carrier 1 and carrier 2 to get two decision
variables x1 and x2.
3. Make decision on x = x1-x2 to get demodulated binary data. If x>0, choose ‘1’ else choose
‘0’.
4. Plot the demodulated binary data
Figure 5-6
36 | P a g e
Data Communication and Computer Networks
37 | P a g e
Data Communication and Computer Networks
38 | P a g e
Data Communication and Computer Networks
Figure 5-7
39 | P a g e
Data Communication and Computer Networks
Figure 5-8
40 | P a g e
Data Communication and Computer Networks
41 | P a g e
Data Communication and Computer Networks
42 | P a g e
Data Communication and Computer Networks
43 | P a g e
Data Communication and Computer Networks
44 | P a g e
Data Communication and Computer Networks
Lab 06
Demonstration of Phase Shift Keying
Objective
To Demonstrate Phase Shift Keying Modulation and De-Modulation.
Theory
Phase-shift keying (PSK) is a digital modulation scheme that conveys data by changing
(modulating) the phase of a reference signal (the carrier wave). The modulation is impressed by
varying the sine and cosine inputs at a precise time. It is widely used for wireless LANs, RFID and
Bluetooth communication.
Any digital modulation scheme uses a finite number of distinct signals to represent digital data.
PSK uses a finite number of phases; each assigned a unique pattern of binary digits. Usually,
each phase encodes an equal number of bits. Each pattern of bits forms the symbol that is
represented by the particular phase. The demodulator, which is designed specifically for the
symbol-set used by the modulator, determines the phase of the received signal and maps it
back to the symbol it represents, thus recovering the original data. This requires the receiver to
be able to compare the phase of the received signal to a reference signal — such a system is
termed coherent (and referred to as CPSK).
Consider a sinusoidal carrier. If it is modulated by a bipolar bit stream according to the scheme
illustrated in Figure 6-1 below, its polarity will be reversed every time the bit stream changes
polarity. This, for a sinewave, is equivalent to a phase reversal (shift). The multiplier output is a
BPSK signal.
Figure 6-1
The information about the bit stream is contained in the changes of phase of the transmitted
signal. A synchronous demodulator would be sensitive to these phase reversals. The
appearance of a BPSK signal in the time domain is shown in Figure 6-2 (middle trace). The upper
trace is the binary message sequence.
Demodulation of a BPSK signal can be considered a two-stage process. One is translation back
to baseband, with recovery of the bandlimited message waveform second is regeneration from
45 | P a g e
Data Communication and Computer Networks
the bandlimited waveform back to the binary message bit stream. Translation back to baseband
requires a local, synchronized carrier.
In stage – 1, Translation back to baseband is achieved with a synchronous demodulator, as
shown in Figure 6-2. This requires a local synchronous carrier. In this experiment a stolen carrier
will be used.
In stage – 2, The translation process does not reproduce the original binary sequence, but a
bandlimited version of it. The original binary sequence can be regenerated with a detector. This
requires information regarding the bit clock rate. If the bit rate is a sub-multiple of the carrier
frequency, then bit clock regeneration is simplified.
Figure 5-2
Figure 6-2
46 | P a g e
Data Communication and Computer Networks
Theory
Generation of PSK
PSK is a digital modulation scheme that conveys data by changing, or modulating, the phase of
a reference signal (the carrier wave). PSK uses a finite number of phases, each assigned a
unique pattern of binary digits. Usually, each phase encodes an equal number of bits. Each
pattern of bits forms the symbol that is represented by the particular phase. The demodulator,
which is designed specifically for the symbol-set used by the modulator, determines the phase
of the received signal and maps it back to the symbol it represents, thus recovering the original
data. In a coherent binary PSK system, the pair of signal S 1(t) and S2 (t) used to represent binary
symbols 1 & 0 are defined by:
Antipodal Signal
The pair of sinusoidal waves that differ only in a relative phase shift of 180° are called antipodal
signals.
BPSK Transmitter
Figure 6-3
The input binary symbols are represented in polar form with symbols 1 & 0 represented by
constant amplitude levels √Eb & -√Eb. This binary wave is multiplied by a sinusoidal carrier in a
product modulator. The result in a BSPK signal.
BSPK Receiver
Figure 6-4
47 | P a g e
Data Communication and Computer Networks
The received BPSK signal is applied to a correlator which is also supplied with a locally
generated reference signal c1 (t). The correlated o/p is compared with a threshold of zero volts.
If x> 0, the receiver decides in favor of symbol 1. If x< 0, it decides in favor of symbol 0.
Algorithm
Initialization commands
PSK modulation
Generate carrier signal.
1. Start FOR loop
2. Generate binary data, message signal in polar form
3. Generate PSK modulated signal.
4. Plot message signal and PSK modulated signal.
5. End FOR loop.
6. Plot the binary data and carrier.
PSK demodulation
1. Start FOR loop
2. Perform correlation of PSK signal with carrier to get decision variable
3. Make decision to get demodulated binary data. If x>0, choose ‘1’ else choose ‘0’
4. Plot the demodulated binary data.
Figure 6-5
48 | P a g e
Data Communication and Computer Networks
49 | P a g e
Data Communication and Computer Networks
50 | P a g e
Data Communication and Computer Networks
Figure 6-6
51 | P a g e
Data Communication and Computer Networks
Figure 6-7
52 | P a g e
Data Communication and Computer Networks
53 | P a g e
Data Communication and Computer Networks
54 | P a g e
Data Communication and Computer Networks
Lab 07
Demonstration of Line Coding
Objective
To Demonstrate Line Coding: RZ, NRZ and Manchester.
Theory
The terminology line coding originated in telephony with the need to transmit digital
information across a copper telephone line; more specifically, binary data over a digital
repeatered line. The concept of line coding, however, readily applies to any transmission line or
channel. In a digital communication system, there exists a known set of symbols to be
transmitted. These can be designated as: {mi}, i = 1, 2, . . ., N, with a probability of occurrence
{pi}, i = 1, 2, . . ., N, where the sequentially transmitted symbols are generally assumed to be
statistically independent. The conversion or coding of these abstract symbols into real,
temporal waveforms to be transmitted in baseband is the process of line coding. Since the
most common type of line coding is for binary data, such a waveform can be succinctly
termed a direct format for serial bits. The concentration in this lab will be line coding for
binary data.
55 | P a g e
Data Communication and Computer Networks
Unipolar NRZ
One" is represented by a DC bias on the transmission line (conventionally positive), while "zero"
is represented by the absence of bias - the line at 0 volts or grounded. For this reason, it is also
known as "on-off keying." In clock language, a "one" transitions to or remains at a biased level
on the trailing clock edge of the previous bit, while "zero" transitions to or remains at no bias
on the trailing clock edge of the previous bit. Among the disadvantages of unipolar NRZ is that it
allows for long series without change, which makes synchronization difficult - although this is
not unique to the unipolar case. One solution is to not send bytes without transitions. More
critically, and unique to unipolar NRZ, are issues related to the presence of a transmitted DC
level - the power spectrum of the transmitted signal does not approach zero at zero frequency.
This leads to two significant problems - first, the transmitted DC power leads to higher power
losses than other encodings and second, the presence of a DC signal component requires that
the transmission line be DC coupled.
Figure 7-1
Unipolar RZ
Unipolar encoding is a line code. A positive voltage represents a binary 1, and zero volts
indicate a binary 0. It is the simplest line code, directly encoding the bit-stream, and is
analogous to on-off keying in modulation. Its drawbacks are that it is not self-clocking and it has
a significant DC component, which can be halved by using return-to-zero, where the signal
returns to zero in the middle of the bit period. With a 50% duty cycle each rectangular pulse is
only at a positive voltage for half of the bit period. This is ideal if one symbol is sent much more
often than the other and power considerations are necessary, and also makes the signal self-
clocking.
56 | P a g e
Data Communication and Computer Networks
Figure 7-2
Manchester
The name comes from its development at the University of Manchester, where the coding was
used to store data on the magnetic drum of the Manchester Mark 1 computer. Manchester
coding is widely used. There are more complex codes, such as 8B/10B encoding, that use less
bandwidth to achieve the same data rate but may be less tolerant of frequency errors and jitter
in the transmitter and receiver reference clocks.
Manchester code always has a transition at the middle of each bit period and may (depending
on the information to be transmitted) have a transition at the start of the period also. The
direction of the mid-bit transition indicates the data. Transitions at the period boundaries do
not carry information. They exist only to place the signal in the correct state to allow the mid-
bit transition. The existence of guaranteed transitions allows the signal to be self-clocking, and
also allows the receiver to align correctly; the receiver can identify if it is misaligned by half a bit
period, as there will no longer always be a transition during each bit period. The price of these
benefits is a doubling of the bandwidth requirement compared to simpler NRZ coding schemes.
57 | P a g e
Data Communication and Computer Networks
Figure 7-3
Lab Task
1. Write a Matlab code to demonstrate wave form of Unipolar RZ, Unipolar NRZ and
Manchester Coding.
2. Write complete code in Code box, also attached screen shots
3. Reference code Unipolar NRZ:
[t,s] = unrz(bits,bitrate);
plot(t,s,'LineWidth',3);
plot(t,s,'LineWidth',3);
58 | P a g e
Data Communication and Computer Networks
5. Reference code Manchester:
figure;
[t,s] = manchester(bits,bitrate);
plot(t,s,'LineWidth',3);
grid on;
Figure 7-3
MATLAB Code
59 | P a g e
Data Communication and Computer Networks
MATLAB Code
60 | P a g e
Data Communication and Computer Networks
Lab 08
Demonstration of PCM and PAM
Objective
To get familiar with PCM and PAM using MATLAB.
Theory
Pulse-code modulation (PCM) is a method used to digitally represent sampled analog signals. It
is the standard form of digital audio in computers, compact discs, digital telephony and other
digital audio applications. In a PCM stream, the amplitude of the analog signal is sampled
regularly at uniform intervals, and each sample is quantized to the nearest value within a range
of digital steps. A PCM stream has two basic properties that determine the stream's fidelity to
the original analog signal: the sampling rate, which is the number of times per second that
samples are taken; and the bit depth, which determines the number of possible digital values
that can be used to represent each sample.
Modulation
In the figure 7-1, a sine wave (red curve) is sampled and quantized for PCM. The sine wave is
sampled at regular intervals, shown as vertical lines. For each sample, one of the available
values (on the y-axis) is chosen by some algorithm. This produces a fully discrete representation
of the input signal (blue points) that can be easily encoded as digital data for storage or
manipulation. For the sine wave example at right, we can verify that the quantized values at the
sampling moments are 8, 9, 11, 13, 14, 15, 15, 15, 14, etc. Encoding these values as binary
numbers would result in the following set of nibbles: 1000
(23×1+22×0+21×0+20×0=8+0+0+0=8), 1001, 1011, 1101, 1110, 1111, 1111, 1111, 1110, etc.
These digital values could then be further processed or analyzed by a digital signal processor.
Several PCM streams could also be multiplexed into a larger aggregate data stream, generally
for transmission of multiple streams over a single physical link. One technique is called time-
division multiplexing (TDM) and is widely used, notably in the modern public telephone system.
The PCM process is commonly implemented on a single integrated circuit generally referred to
as an analog-to-digital converter (ADC).
Figure 8-1
Demodulation
To recover the original signal from the sampled data, a "demodulator" can apply the procedure
of modulation in reverse. After each sampling period, the demodulator reads the next value
61 | P a g e
Data Communication and Computer Networks
and shifts the output signal to the new value. As a result of these transitions, the signal has a
significant amount of high-frequency energy caused by aliasing. To remove these undesirable
frequencies and leave the original signal, the demodulator passes the signal through analog
filters that suppress energy outside the expected frequency range (greater than the Nyquist
frequency ⁄ ). The sampling theorem shows PCM devices can operate without introducing
distortions within their designed frequency bands if they provide a sampling frequency twice
that of the input signal. For example, in telephony, the usable voice frequency band ranges
from approximately 300 Hz to 3400 Hz. Therefore, per the Nyquist–Shannon sampling theorem,
the sampling frequency (8 kHz) must be at least twice the voice frequency (4 kHz) for effective
reconstruction of the voice signal. The electronics involved in producing an accurate analog
signal from the discrete data are similar to those used for generating the digital signal. These
devices are Digital-to-analog converters (DACs). They produce a voltage or current (depending
on type) that represents the value presented on their digital inputs. This output would then
generally be filtered and amplified for use.
Pulse-amplitude modulation (PAM), is a form of signal modulation where the message
information is encoded in the amplitude of a series of signal pulse. It is an analog pulse
modulation scheme in which the amplitudes of a train of carrier pulses are varied according to
the sample value of the message signal. Demodulation is performed by detecting the amplitude
level of the carrier at every single period. Principle of PAM: (1) original signal, (2) PAM signal, (a)
amplitude of signal, (b) time.
Figure 8-2
Lab Task – 8.1
Simulating PCM
In this simulation, we will quantize a sinewave signal (message) and encode it to binary bits. We
will reconstruct the sine wave from binary bits. We will also calculate the SQNR for the 8-level
and 16-level quantization. For the simulation, generate a sinusoidal signal with amplitude 1,
and co=l. Using a uniform PCM scheme, quantize it once to 8 levels and once to 16 levels. Plot
the original signal and the quantized signals on the same axis. Compare the resulting SQNRs in
the two cases.
We arbitrarily choose the duration of the signal to be 10s. The resulting SQNRs are 18.90 dB for
the 8-level PCM and 25.13 dB for 16-level PCM, compare these values with the results that you
get from your simulation. The plots are shown in figure 8-3. A sinusoidal signal before and after
62 | P a g e
Data Communication and Computer Networks
quantization. You can compare this figure 7-2 with your simulation results. A zoomed portion of
this figure is given in the following figure 7-4.
Figure 8-3
Simulation procedure
The following procedure only gives you an idea of how the PCM modulation and de-modulation
are performed. Actual implementation may vary.
1. Construct a time array from 0 to 10 Sec with 0.1 intervals. Name it ‘t’.
2. Find the size of the array t. Use ‘length’ function. Name the size ‘m’.
3. Construct signal array ‘a’. Signal is a sinewave with unity amplitude and angular frequency.
4. Assign the number of quantization level n equal to 8.
5. Calculate, amax = max (abs (a)). See figure 8-3.
6. Calculate the following as shown in figure 8-3.
b = a + amax
c = (n-1) x (b/(2amax))
d = round(c)
a_quan = 2 x amax.d/(n-l) – amax
a_error = a-a_quan
63 | P a g e
Data Communication and Computer Networks
Figure 8-4
7. Calculate
64 | P a g e
Data Communication and Computer Networks
1. Connect all modules as in figure 8-5 and start running
2. Attach screen shots of your outputs
3. What type of waveform appears at scope?
4. Set the simulation parameters (Simulation -> Configuration Parameters) as follows:
Start time to 0.0
Stop time to 100.0
Type to Variable-step
Solver to discrete (no continuous states)
Max. step size to auto
Figure 8-5
Remember, available of options might vary from version to version.
65 | P a g e
Data Communication and Computer Networks
Lab 09
Introduction to Basic Network Commands
Objective
To get familiar eight most used networking command.
Theory
There are a lot of IP commands with short descriptions listed here but you should only need the
ones mentioned here at the top of the page to diagnose and configure your network.
1 – HOSTNAME
This is the simplest of all TCP/IP commands. It simply displays the name of your computer.
3 – PING
Ping is the most basic TCP/IP command, and it’s the same as placing a phone call to your best
friend. You pick up your telephone and dial a number, expecting your best friend to reply with
“Hello” on the other end. Computers make phone calls to each other over a network by using a
Ping command.
66 | P a g e
Data Communication and Computer Networks
4 – NETSTAT
Netstat displays a variety of statistics about a computers active TCP/IP connections. This tool is
most useful when you’re having trouble with TCP/IP applications such as HTTP, and FTP.
5 – TRACERT
The tracert command displays a list of all the routers that a packet has to go through to get
from the computer where tracert is run to any other computer on the internet.
67 | P a g e
Data Communication and Computer Networks
6 – PATHPING
Pathping is unique to Window’s, and is basically a combination of the Ping and Tracert
commands. Pathping traces the route to the destination address then launches a 25-second
test of each router along the way, gathering statistics on the rate of data loss along each hop.
68 | P a g e
Data Communication and Computer Networks
7 – NSLOOKUP
Nslookup is used for diagnosing DNS problems. If you can access a resource by specifying an IP
address but not its DNS, you have a DNS problem.
69 | P a g e
Data Communication and Computer Networks
8 – ARP
ARP is short for address resolution protocol, it will show the IP address of your computer along
with the IP address and MAC address of your router.
HOSTNAME
IPCONFIG
PING
NETSTAT
TRACERT
PATHPING
NSLOOKUP
ARP
70 | P a g e
Data Communication and Computer Networks
Lab 10
Introduction to Routers and IOSs
Objective
To introduce Cisco Routers and their IOSs.
Theory
What is a router?
Routers are devices whose primary purpose is to connect two or more networks and to filter
network signals so that only desired information travels between them. For example, routers
are often used to regulate the flow of information between school networks and the Internet.
However, routers can inspect a good deal more information than bridges, and they therefore
can regulate network traffic more precisely. They also have another important capability: they
are aware of many possible paths across the network and can choose the best one for each
data packet to travel.
Routers operate primarily by examining incoming data for its network routing and transport
information—for example, information carried within the TCP/IP portions of the network signal.
This information includes the source and destination network routing addresses.
Routers can be programmed to prevent information from being sent to or received from certain
networks or computers based on all or part of their network routing addresses. If you have
sensitive student records on a server, for example, you can use a router to filter packets headed
for the server so that only authorized personnel for example, personnel whose network
addresses match a specified list can connect to it.
71 | P a g e
Data Communication and Computer Networks
Figure 10-1
Figure 10-2
72 | P a g e
Data Communication and Computer Networks
1. System – LED
2. Activity – LED
3. Power Over Ethernet (POE) – LED
4. AC / Active Power Cord Connected – LED
5. AC Power Switch
6. AC Power Socket
Back Panel Slots and Connectors of the Cisco 2901 Router
Figure 10-3
1. DW-EHWICs can fit into slot 0 and 1, and into slot 2 and 3. EHWIC slots support HWIC, VIC,
and WIC.
2. Universal Serial Bus (USB)
3. Auxiliary Port
4. RJ-45 serial console port
5. 10/100/1000 Ethernet ports (GE0/1)
6. 10/100/1000 Ethernet ports (GE0/0)
7. Earth / Ground Screw
8. USB0 and USB1
9. Compact Flash 0 and 1, Only Advanced Capability CompactFlash (CF)
73 | P a g e
Data Communication and Computer Networks
Back Panel LEDs of Cisco 2901 Router
Figure 10-4
1. CompactFlash 0 and 1
2. Internal Services Module (ISM)
3. PVDM3 0 and 1
4. Enable USB Console (EN)
5. Enable RJ-45 Console (EN)
6. Speed (S)
7. Link (L)
74 | P a g e
Data Communication and Computer Networks
Figure 10-5
1 - show version
To display the configuration of the system hardware, the software version, the names and
sources of configuration files, and the boot images, use the show version EXEC command.
Table 10-1
1 System Version
2 ROM Version
4 Shared Memory
5 Main Memory
6 Recognized Hardware
75 | P a g e
Data Communication and Computer Networks
2 – show interfaces
Use the show interfaces EXEC command to display statistics for all interfaces configured on the
router or access server. The resulting output varies, depending on the network for which an
interface has been configured.
Table 10-2
1 Interface(s) Status
2 Slot(s) Available
5 Queuing Algorithm
3 – show logging
Use the show logging EXEC command to display the state of logging (syslog). This command
displays the state of syslog error and event logging, including host addresses, and whether
console logging is enabled. This command also displays Simple Network Management Protocol
(SNMP) configuration parameters and protocol activity.
Table 10-3
1 Messages Dropped
2 XML Status
76 | P a g e
Data Communication and Computer Networks
4 – show running-config
To display the configuration information currently running on the terminal, use the show
running-config EXEC command.
Table 10-4
5 – show buffer
To display statistics for the buffer pools on the network server, use the show buffers EXEC
command.
Table10-5
77 | P a g e
Data Communication and Computer Networks
Table10-6
1 AAA Server
2 IP Traceroute
4 SNMP Timer
5 TCP Timer
6 TCP Protocol
7 – conf t
To enter global configuration mode, use configure privileged EXEC command. T (terminal) will
executes configuration commands from the terminal. After typing conf t the following will
appear:
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#
Invoking interface Fast Ethernet 0/0
Now type int f 0/0, following will appear on your console window:
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#int f0/0
R1(config-if)#
Now you are ready to set IP of interface f0/0
8 – ip add
To set a primary or secondary IP address for an interface, use the IP address interface
configuration command. To remove an IP address or disable IP processing, use the no form of
this command. An interface can have one primary IP address and multiple secondary IP
addresses. Packets generated by the Cisco IOS software always use the primary IP address.
Therefore, all routers and access servers on a segment should share the same primary network
number.
Setting IP address of Fast Ethernet 0/0
Type the ip add 10.0.0.1 255.255.255.0 press enter and type no shutdown (to power UP the
interface) and following will appear:
R1(config-if)#ip add 10.0.0.1 255.255.255.0
R1(config-if)#no shutdown
78 | P a g e
Data Communication and Computer Networks
R1(config-if)#
*Mar 1 00:12:05.443: %LINK-3-UPDOWN: Interface FastEthernet0/0,
changed state to up
*Mar 1 00:12:06.443: %LINEPROTO-5-UPDOWN: Line protocol on
Interface FastEthernet0/0, changed state to up
R1(config-if)#
To exit from Interface configuration mode type exit.
R1(config-if)#exit
R1(config)#
9 – router rip
To configure the Routing Information Protocol (RIP) routing process, use the router rip global
configuration command. To turn off the RIP routing process, use the no form of this command.
Type router rip to enter in router configuration mode:
R1(config)#router rip
R1(config-router)#
10 – auto summary
To restore the default behavior of automatic summarization of subnet routes into network-
level routes, use the auto-summary router configuration command. To disable this feature and
transmit sub prefix routing information across classful network boundaries, use the no form of
this command. RIP Version 1 always uses automatic summarization. If you are using RIP Version
2, you can turn off automatic summarization by specifying no auto-summary. Disable automatic
summarization if you must perform routing between disconnected subnets. When automatic
summarization is off, subnets are advertised.
R1(config-router)#no auto-summary
R1(config-router)#version 2
R1(config-router)#net 10.0.0.0
R1(config-router)#exit
R1(config)#exit
R1#
11 - ping
Now ping our interface f0/0 having IP 10.0.0.1, the following will appear:
R1#ping 10.0.0.1
79 | P a g e
Data Communication and Computer Networks
Sending 5, 100-byte ICMP Echos to 10.0.0.1, timeout is 2
seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max =
1/1/1 ms
R1#
Now your f0/0 is configured and that ends the Lab Task – 1.
80 | P a g e
Data Communication and Computer Networks
%% ---- Configuring Ethernet port
iqbal# conf t
iqbal(config)# int e0
iqbal(config-if)# no sh
iqbal(config-if)# exit
flash:c806-o3sy6-mz.122-4.YH.bin
iqbal(config)#exit
iqbal#
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
81 | P a g e
Data Communication and Computer Networks
!!!!!!!!!!!!!!!!!!!!!!!!!!
iqbal#
Figure 10-6
82 | P a g e
Data Communication and Computer Networks
83 | P a g e
Data Communication and Computer Networks
rommon 1 > set
PS1=rommon ! >
?=0
RET_2_RTS=
BSI=0
IP_ADDRESS: 192.168.1.4
IP_SUBNET_MASK: 255.255.255.0
DEFAULT_GATEWAY: 192.168.1.1
TFTP_SERVER: 192.168.1.3
TFTP_FILE: c806.bin
Figure 10-10
84 | P a g e
Data Communication and Computer Networks
Lab 11
To Understand IPv4, Sub Netting and VLSM
Objective
To make understanding of Sub netting, Static IP, DHCP and VLSM.
Theory
IP Addressing
An IP address uniquely identifies a device on an IP network. Allocating, recycling, and
documenting IP addresses and subnets in a network can get confusing very quickly if you have
not laid out an IP addressing plan. A sound plan will help you prepare the network foundation
to support additional services such as unified communications, wireless access, and enhanced
network security. IP addressing is a Network Foundation service, which makes it core to the
network design. It provides the base for all other network and user services.
IP version 4 (IPv4) addresses, which uniquely identify a device on an IP network, are 32 bits in
length and are typically communicated in a format known as dotted decimal.
The 32 binary bits are:
10
10
16
1
The value in each octet ranges from 0 to 255 decimals, or 00000000 – 11111111 binaries. In
binary, the address 10.10.16.1 is represented as: 00001010 .0001010 .0010000 .0000001.
IP Address Classes
IP addresses are split up into several different categories, including Class A, B, C, D (Multicast),
and E (Reserved). Address classes are defined, in part, based on the number of bits that make
up the network portion of the address, and in turn, on how many are left for the definition of
individual host addresses.
85 | P a g e
Data Communication and Computer Networks
Sub-netting
Sub-netting allows you to create multiple logical networks that exist within a single Class A, B,
or C network. If you do not subnet, you can only use one network from your Class A, B, or C
network, which is simply unrealistic. Each data link on a network must have a unique network
address, with every host on that link being a member of the same network.
Figure 11-1
If you break a major network (Class A, B, or C) into smaller subnetworks, you can create a
network of interconnected subnetworks. Each data link on this network would then have a
unique network/subnetwork ID. To subnet a network, extend the mask using some of the bits
from the host ID portion of the address to create a subnetwork ID. For example: Given a
network of 192.168.5.0/24, which has a mask of 255.255.255.0, you can create subnets in this
manner:
192.168.5.0 -
11000000.10101000.00000101.00000000
255.255.255.224 -
11111111.11111111.11111111.11100000
--------------------------------------------[sub]-----
-
The address on the left is in dotted decimal notation, and the binary representation is on the
right. When planning IP sub-netting, sometimes it is easier to visualize the different portions of
the network address when looking at the binary format. The subnet mask is also represented in
86 | P a g e
Data Communication and Computer Networks
dotted decimal and binary. Any address bits that have corresponding mask bits set to 1
represent the network ID. Any address bits that have corresponding mask bits set to 0
represent the host ID.
By extending the mask to be 255.255.255.224, you’ve taken three bits (indicated by sub) from
the original host portion of the address and used them to make subnets. With these three bits,
you can create eight subnets. With the remaining five host ID bits, each subnet can have up to
32 host addresses. A single subnet can be split up into eight 32-host subnets. Eight 32-host
subnets, however, may not be flexible enough. For example:
192.168.5.0 255.255.255.224 address range 0 to 31
192.168.5.32 255.255.255.224 address range 32 to 63
…
87 | P a g e
Data Communication and Computer Networks
Technical Tip
There are two ways to denote subnet masks:
1. Since you are using three bits more than the originally specified 255.255.255.0 mask, the
mask is now 255.255.255.224.
2. The mask can also be denoted as /27 as there are 27 bits that are set in the mask. The mask
is denoted with the notation prefix/length. For example: 192.168.5.32/27 denotes the
network 192.168.5.32 with a mask of 255.255.255.224.
VLSM Example
Given the 192.168.5.0/24 network and requirements below, develop a sub-netting scheme with
the use of VLSM:
1. Network_A must support 330 hosts
2. Network_B must support 6 hosts for a point-to-point WAN link supporting Hot Standby
Router Protocol
3. Network_C must support 2 hosts for a T1 circuit to a remote site
4. Network_D must support a single address for a router loopback
The first step is to determine what mask allows the required number of hosts.
1. Network_A requires a /23 (255.255.254.0) mask to support 510 hosts
2. Network_B requires a /29 (255.255.255.248) mask to support 6 hosts
3. Network_C requires a /30 (255.255.255.252) mask to support 2 hosts
4. Network_D requires a /32 (255.255.255.255) mask to support 1 address
The easiest way to assign the subnets is to assign the largest first. For example: You can assign
the subnets in this manner:
1. Network_A — 192.168.5.0/23 address range 5.0 to 6.255
2. Network_B — 192.168.7.0/28 address range 0 to 7
3. Network_C — 192.168.7.8/28 address range 8 to 11
4. Network_D — 192.168.7.12/32 address of 12
88 | P a g e
Data Communication and Computer Networks
the network and broadcast addresses and number of host bits and hosts for the given IPv4
addresses and prefixes in the table 11 – 1.
Table 11 – 1
Total Total
IPv4 Broadcast
Network Address Number of Number of
Address/Prefix Address
Host Bits Hosts
192.168.100.25/28
172.30.10.130/30
10.1.113.75/19
198.133.219.250/24
128.107.14.191/22
172.16.104.99/27
Task – 1B
It consists of 05 problems along with a reference problem, following are IPv4 address, the
original subnet mask and the new subnet mask, you will be able to determine:
1. Network address of this subnet
2. Broadcast address of this subnet
3. Range of host addresses of this subnet
4. Number of subnets created
5. Number of hosts per subnet
Reference Problem
The table 10-2, shows a problem along with the solution for solving problem:
Table 10-2
Given
Find
89 | P a g e
Data Communication and Computer Networks
Description 1st Octet 2nd Octet 3rd Octet 4th Octet Description
90 | P a g e
Data Communication and Computer Networks
Fill out the next tables with appropriate answers given the IPv4 address, original subnet mask,
and new subnet mask.
Problem – 1
Given
Find
Problem – 2
Given
Find
91 | P a g e
Data Communication and Computer Networks
Problem – 3
Given
Find
92 | P a g e
Data Communication and Computer Networks
Problem – 4
Given
Find
Problem – 5
Given
Find
93 | P a g e
Data Communication and Computer Networks
Figure 11-2
Steps of Router_1
94 | P a g e
Data Communication and Computer Networks
Steps of Router_2
Figure 11-3
95 | P a g e
Data Communication and Computer Networks
Router_1(config)#int f0/0
Router_1(config-if)#no sh
Router_1(config-if)#
Router_1(dhcp-config)#default-router 10.0.1.1
Router_1(dhcp-config)#exit
Router_1(config)#int f0/1
Router_1(config-if)#no sh
Router_1(config-if)#
Router_1(config-if)#exit
Router_1(dhcp-config)#default-router 10.0.2.1
Router_1(dhcp-config)#exit
Router_1(config)#router rip
Router_1(config-router)#version 2
Router_1(config-router)#no auto-summary
Router_1(config-router)#net 10.0.1.0
Router_1(config-router)#net 10.0.2.0
Router_1(config-router)#exit
Router_1(config)#exit
Figure 11-4
96 | P a g e
Data Communication and Computer Networks
Scenario
The assignment is the Class B address 172.28.10.0 and it must support the network shown
in the figure 10-5. The use of IP unnumbered or NAT is not permitted on this network. Create
an addressing scheme that meets the said requirements. Fill the boxes for appropriate
answering.
97 | P a g e
Data Communication and Computer Networks
Figure 11-5
Sub-netting
Serial Link 2
98 | P a g e
Data Communication and Computer Networks
Serial Link 3
Ethernet 2
Ethernet 3
Ethernet 4
99 | P a g e
Data Communication and Computer Networks
Lab 12
To Understand Configuration of Static Routing
Objective
To make understanding of Configuring Static Routing and Cisco Discovery Protocol.
Theory
Routing is at the core of every data network, moving information across an internetwork from
source to destination. Routers are the devices responsible for the transfer of packets from one
network to the next. Static routes are very common and do not require the same amount of
processing and overhead as dynamic routing protocols.
Static routing table is created, maintained, and updated by a network administrator, manually.
A static route to every network must be configured on every router for full connectivity. This
provides a granular level of control over routing, but quickly becomes impractical on large
networks. Routers will not share static routes with each other, thus reducing CPU/RAM
overhead and saving bandwidth. However, static routing is not fault-tolerant, as any change to
the routing infrastructure (such as a link going down, or a new network added) requires manual
intervention. Routers operating in a purely static environment cannot seamlessly choose a
better route if a link becomes unavailable. Static routes have an Administrative Distance (AD) of
1, and thus are always preferred over dynamic routes, unless the default AD is changed.
Most hosts use static routing to configure their default route. Keeping static routing tables
entries consistent on routers is tedious, even in networks with a small number of routers.
Therefore, most routers run a routing protocol that automatically updates routing tables to
reflect changes of the network topology. Static routing entries can be added, even if a router
runs a routing protocol, however, static routes may interfere with the path calculation
determined by a routing protocol. When static routing entries are entered manually at a
command line interface, they remain valid only until the operating system is rebooted. To
ensure that static routing table entries remain valid after the operating system is rebooted,
commands to add static routes must be written in a configuration file, such as the startup
configuration file in IOS. Certain routing table entries are automatically configured. For
example, whenever a network interface is configured with an IP address, most operating
systems automatically add a routing table entry for the IP network to which the interface is
directly connected.
Note:
Do not confuse routing protocols with routed protocols:
A routed protocol is a Layer 3 protocol that applies logical addresses to devices and routes
data between networks (such as IP).
A routing protocol dynamically builds the network, topology, and next hop information in
routing tables (such as RIP, EIGRP, etc.)
100 | P a g e
Data Communication and Computer Networks
Advantages
1. Minimal CPU/Memory overhead
2. No bandwidth overhead (updates are not shared between routers)
3. Granular control on how traffic is routed
Disadvantages
1. Infrastructure changes must be manually adjusted
2. No “dynamic” fault tolerance if a link goes down
3. Impractical on large network
101 | P a g e
Data Communication and Computer Networks
Figure 12-1
4. Now run sh ip route on each router
Output of Router_HIET
102 | P a g e
Data Communication and Computer Networks
Output of Router_HCMD
b) Router_HCMD:
Write difference
Steps to follow:
103 | P a g e
Data Communication and Computer Networks
2. Configure each device as mentioned, do not type no sh on any interface of each router
3. Now type sh interfaces on ROUTER_HIET and fill table 12 – 1 below
4. Now enable all interfaces on each router and fill table 12 – 2 on next page
Table 12 – 1
Interface Name Up / Down Line protocol Up / Down
Figure 12-2
104 | P a g e
Data Communication and Computer Networks
Table 12 – 2
Interface Name Up / Down Line protocol Up / Down
Table 12 – 2
Device and Port
Local Interface Hold Time Capability Platform
ID
7. Enter show cdp neighbors detail in Router_HCMD and fill table 12-3 below
Table 12 – 3
Information Gathered Router_HCMD
105 | P a g e
Data Communication and Computer Networks
Port ID of neighbor router that your router is
on
106 | P a g e
Data Communication and Computer Networks
107 | P a g e
Data Communication and Computer Networks
Lab 13
To Understand Configuration of Dynamic Routing
Objective
To make understanding of Configuring RIP, RIP v2, EIGRP and OSPF.
Theory
The role of a router and a host are very different when it comes to routing. A host is only
responsible for maintaining a routing table, it is a silent/passive observer of the routing process.
A host listens to routing messages that are broadcast on the local subnet (e.g. router
advertisements) to fill in the necessary entries in its routing tables. A router on the other hand,
is responsible for:
1. Identifying neighbors (other routers)
2. Discovering routes (from other routers)
3. Selecting a route (next hop to a destination)
4. Maintaining routing information (dynamically participating in router message exchanges)
Depending on where a router falls in the Autonomous System (AS), it may be responsible for
only interior routing (e.g., a router inside an AS), only exterior routing (e.g., a router in a
backbone WAN) or maybe both (e.g., a gateway router, one interface is interior whereas the
other is exterior). The most common dynamic routing protocols use very different algorithms
for path determination. The distance vector based routing algorithms exchange information
only with its immediate neighbors and uses that to make hop by hop routing decisions, the link
state based algorithm exchanges full state information with all the nodes in a specified area,
the path vector.
108 | P a g e
Data Communication and Computer Networks
Any network that is 16 hops away or more is considered unreachable to RIP, thus the maximum
diameter of the network is 15 hops. A metric of 16 hops in RIP is considered a poison route or
infinity metric. If multiple paths exist to a particular destination, RIP will load balance between
those paths (by default, up to 4) only if the metric (hop count) is equal. RIP uses a round-robin
system of load-balancing between equal metric routes, which can lead to pinhole congestion.
For example, two paths might exist to a particular destination, one going through a 9600-baud
link, the other via a T1. If the metric (hop count) is equal, RIP will load-balance, sending an
equal amount of traffic down the 9600-baud link and the T1. This will (obviously) cause the
slower link to become congested. We can control the version of RIP a particular interface will
“send” or “receive.” Unless RIPv2 is manually specified, a Cisco will default to RIPv1 when
configuring RIP.
RIP Versions
RIP has two versions, Version 1 (RIPv1) and Version2 (RIPv2).
RIPv1
RIPv1 (RFC 1058) is classful, and thus does not include the subnet mask with its routing table
updates. Because of this, RIPv1 does not support Variable Length Subnet Masks (VLSMs). When
using RIPv1, networks must be contiguous, and subnets of a major network must be configured
with identical subnet masks. Otherwise, route table inconsistencies (or worse) will occur.
RIPv1 sends updates as broadcasts to address 255.255.255.255.
RIPv2
RIPv2 (RFC 2543) is classless, and thus does include the subnet mask with its routing table
updates. RIPv2 fully supports VLSMs, allowing dis-contiguous networks and varying subnet
masks to exist.
Other enhancements offered by RIPv2 include:
109 | P a g e
Data Communication and Computer Networks
110 | P a g e
Data Communication and Computer Networks
7. Now ping PC2 from PC1 and vice versa, was ping successful from either side? ___________
111 | P a g e
Data Communication and Computer Networks
Figure 13-1
112 | P a g e
Data Communication and Computer Networks
alternate route. These queries propagate until an alternate route is found. Its support for
variable-length subnet masks permits routes to be automatically summarized on a network
number boundary. In addition, EIGRP can be configured to summarize on any bit boundary at
any interface.
Figure 13-2
Configuring EIGRP
1. Create topology as illustrated in n figure 13-2
2. Configure PCs and Routers as mentioned
3. Now ping PC2 from PC1 and vice versa, was ping successful from either side? ___________
4. Now configure EIGRP on each router as following:
A. Router_HIET
HIET(config)#ip host HCMD 10.0.15.2 10.0.15.1
HIET(config)#router eigrp 101
HIET(config-router)#net 10.0.14.0
HIET(config-router)#net 10.0.15.0
HIET(config-router)#net 10.0.0.0
HIET(config-router)#exit
B. Router_HCMD
HCMD(config)#ip host HIET 10.0.15.1 10.0.15.2
HCMD(config)#router eigrp 101
HCMD(config-router)#net 10.0.15.0
HCMD(config-router)#net 10.0.16.0
HCMD(config-router)#exit
5. Type sh ip route on each router and write its output in the boxes on next page
6. Are there any EIGRP entries in the routing table now? ____________
8. What does the D mean in the first column of the routing table? _____________________
113 | P a g e
Data Communication and Computer Networks
9. Now type show ip eigrp topology all-links on each router and write output
in it relevant boxes
114 | P a g e
Data Communication and Computer Networks
Lab Task 13 – 3
A Brief Introduction
Open Shortest Path First (OSPF) was developed by the Internet Engineering Task Force (IETF) as
a replacement to overcome the shortcomings of RIP in RFC 2328. Unlike the Cisco proprietary
protocol EIGRP which was developed by Cisco to replace RIPv2, OSPF is vendor independent
and is the most used routing protocol by enterprise networks today. So, we have to give a
special attention on it as a network engineer. Let’s look at a detailed theoretical and practical
approach to OSPF.
Open Shortest Path First (OSPF), based on Dijkstra’s algorithm, generates link-state packets that
contain local information for each router. Each router exchanges local and external link state
information and generates a shortest path tree. Each router uses this exact topology to
calculate the shortest path to each destination. Recalculation occurs only if there are any
changes.
OSPF Advantages
It is the highest-performance open standard routing protocol.
It is a classless routing protocol.
It provides shortest path routing and is fast to fault-discovery and rerouting.
It consumes minimal link overhead when the network is in steady state.
It has been endorsed by the IETF and implemented by many vendors.
OSPF Disadvantages
It demands a higher processing and memory requirement than RIP.
It consumes a large bandwidth at the initial link-state packet flooding.
115 | P a g e
Data Communication and Computer Networks
Configuring OSPF (Simulation)
Figure 13-3
Configuring OSPF
1. Create topology as illustrated in n figure 13-3
2. Configure PCs and Routers as mentioned
3. Now ping PC2 from PC3 and vice versa, was ping successful from either side? ___________
4. Now ping PC1 from PC3 and vice versa, was ping successful from either side? ___________
5. Now ping PC1 from PC2 and vice versa, was ping successful from either side? ___________
6. Now configure OSPF on each router as following:
A. Router_FEST
FEST(config)#router ospf 100
FEST(config-router)#net 10.0.11.0 0.0.0.255 area 0
FEST(config-router)#net 10.0.1.0 0.0.0.255 area 0
FEST(config-router)#net 10.0.3.0 0.0.0.255 area 0
FEST(config-router)#exit
B. Router_HCMD
116 | P a g e
Data Communication and Computer Networks
HCMD(config)#router ospf 210
HCMD(config-router)#net 10.0.12.0 0.0.0.255 area 0
HCMD(config-router)#net 10.0.2.0 0.0.0.255 area 0
HCMD(config-router)#net 10.0.1.0 0.0.0.255 area 0
HCMD(config-router)#exit
C. Router_FEM
EM(config)#router ospf 220
FEM(config-router)#network 10.0.3.0 0.0.0.255 area 0
FEM(config-router)#network 10.0.2.0 0.0.0.255 area 0
FEM(config-router)#network 10.0.13.0 0.0.0.255 area 0
FEM(config-router)#exit
7. Now type sh ip route on each router, write down the output at each router
117 | P a g e
Data Communication and Computer Networks
Answer of bullet 14
118 | P a g e
Data Communication and Computer Networks
Lab 14
To analyze the working of HTTP (Application Layer)
Objective
To analyze the working HTTP GET/response and CONDITIONAL GET/response interactions using
WireShark packet analyzer.
WireShark
Introduction
Wireshark is a network packet analyzer. A network packet analyzer will try to capture network
packets and tries to display that packet data as detailed as possible. You could think of a
network packet analyzer as a measuring device used to examine what’s going on inside a
network cable, just like a voltmeter is used by an electrician to examine what’s going on inside
an electric cable (but at a higher level, of course). In the past, such tools were either very
expensive, proprietary, or both. However, with the advent of Wireshark, all that has changed. It
is perhaps one of the best open source packet analyzers available today.
It can capture traffic from many different network media types - and despite its name including
wireless LAN as well. Which media types are supported, depends on many things like the
operating system you are using.
As Wireshark runs on many different platforms with many different window managers,
different styles applied and there are different versions of the underlying GUI toolkit used, your
screen might look different from the provided screenshots. But as there are no real differences
in functionality these screenshots should still be well understandable.
119 | P a g e
Data Communication and Computer Networks
1
2 3
6
7
Figure 14-1
1. The menu
Wireshark’s main menu is located either at the top of the main window (Windows, Linux) or at
the top of your main screen (OS X). An example is shown in Figure 0-5. It is used to start actions.
Protocol
The presence of a field
120 | P a g e
Data Communication and Computer Networks
The values of fields
A comparison between fields
4. The Packet List Pane
The packet list pane displays all the packets in the current capture file. Each line in the packet
list corresponds to one packet in the capture file. If you select a line in this pane, more details
will be displayed in the “Packet Details” and “Packet Bytes” panes. While dissecting a packet,
Wireshark will place information from the protocol dissectors into the columns. As higher level
protocols might overwrite information from lower levels, you will typically see the information
from the highest possible level only.
For example, let’s look at a packet containing TCP inside IP inside an Ethernet packet. The
Ethernet dissector will write its data (such as the Ethernet addresses), the IP dissector will
overwrite this by its own (such as the IP addresses) and the TCP dissector will overwrite the IP
information, and so on.
Figure 14-2
121 | P a g e
Data Communication and Computer Networks
HTTP Request
HTTP Response
Windows’ PC
Web Server
HTTP Request
HTTP Request
HTTP Response
LINUX based PC
Figure14-3
In this lab, we’ll explore several aspects of the HTTP protocol: the basic GET/response
interaction, HTTP message formats and retrieving large HTML files.
122 | P a g e
Data Communication and Computer Networks
Figure 14-4
Now answer the following by analyzing the packets you have captured.
1. Is your browser running HTTP version 1.0 or 1.1? What version of HTTP is the server
running?
Answer of Bullet - 1
2. What is the IP addresses and port number of your computer and gaia.cs.umass.edu server?
123 | P a g e
Data Communication and Computer Networks
3. What is the status code returned from the server to your browser?
Answer of Bullet - 3
4. When the HTML file that you are retrieving was last modified at the server?
Answer of Bullet - 4
Answer of Bullet - 5
124 | P a g e
Data Communication and Computer Networks
Figure 14-5
Now answer the following by analyzing the packets you have captured.
1. Inspect the contents of the first HTTP GET request from your browser to the server. Do you
see an “IF-MODIFIED-SINCE” line in the HTTP GET?
Answer of Bullet - 1
2. Inspect the contents of the server response. Did the server explicitly return the contents of
the file? How can you tell?
Answer of Bullet - 2
3. Now inspect the contents of the second HTTP GET request from your browser to the server.
Do you see an “IF-MODIFIED-SINCE:” line in the HTTP GET? If so, what information follows
the “IF-MODIFIED-SINCE:” header?
Answer of Bullet - 3
What is the HTTP status code and phrase returned from the server in response to this second
HTTP GET? Did the server explicitly return the contents of the file? Explain.
125 | P a g e
Data Communication and Computer Networks
Answer of Bullet - 4
1. Start up your web browser, and make sure your browser’s cache is cleared, as discussed
above.
2. Start up the Wireshark packet sniffer and set HTTP filter
3. Enter the following URL into your browser
http://gaia.cs.umass.edu/wireshark-labs/HTTP-wireshark-file3.html
4. Your browser should display the rather lengthy US Bill of Rights.
5. Stop Wireshark packet capture.
In the packet-listing window, you should see your HTTP GET message, might be followed by a
multiple-packet TCP response to your HTTP GET request. Analyze the packet and answer the
following:
1. How many HTTP GET request messages did your browser send? Which packet number in
the trace contains the GET message for the Bill or Rights? Why?
Answer of Bullet - 1
2. Which packet number in the trace contains the status code and phrase associated with the
response to the HTTP GET request?
Answer of Bullet - 2
Answer of Bullet - 3
126 | P a g e
Data Communication and Computer Networks
4. How many data-containing TCP segments were needed to carry the single HTTP response
and the text of the Bill of Rights?
Answer of Bullet - 4
127 | P a g e