DCC FULL Data Communications Cusat
DCC FULL Data Communications Cusat
■ Performance
■ Depends on Network Elements
■ Measured in terms of Delay and Throughput
■ Reliability
■ Failure rate of network components
■ Measured in terms of availability/robustness
■ Security
■ Data protection against corruption/loss of data due to:
■ Errors
■ Malicious users
Physical Structures
■ Type of Connection
■ Point to Point - single transmitter and receiver
■ Multipoint - multiple recipients of single transmission
■ Physical Topology
■ Connection of devices
Types of connections: point-to-point and multipoint
Categories of topology
A fully connected mesh topology (five devices)
A star topology connecting four stations
A bus topology connecting three stations
A ring topology connecting six stations
A hybrid topology: a star backbone with three bus networks
Network Types
■ Syntax
■ Structure or format of the data
■ Indicates how to read the bits - field delineation
■ Semantics
■ Interprets the meaning of the bits
■ Knows which fields define what action
■ Timing
■ When data should be sent and what
■ Speed at which data should be sent or speed at which it is being
received.
Internet Standards
■ Thoroughly tested specification that is useful to and
adhered to by those who work with the Internet
Internet Administration
Chapter 2
Network Models
LAYERED
TASKS
We use the concept of layers in our daily life. As an
example, let us consider two friends who communicate
through postal mail. The process of sending a letter to a
friend would be complex if there were no services
available from the post office.
Tasks involved in sending a letter
THE OSI MODEL
Established in 1947, the International Standards
Organization (ISO) is a multinational body dedicated to
worldwide agreement on international standards. An ISO
standard that covers all aspects of network
communications is the Open Systems Interconnection
(OSI) model. It was first introduced in the late 1970s.
Note
• Framing
• Flow control
• Error control
• Access control
• Physical addressing
Hop-to-hop delivery
Network layer
Note
• Logical Addressing
• Routing
Source-to-destination delivery
Transport layer
Note
• Address of a node
• Included in the frame used by data link layer
• Lowest level address
Physical addresses
Physical Address
07:01:02:01:2C:4B
A 6-byte (12 hexadecimal digits) physical address.
Logical Address
753
A 16-bit port address represented
as one single number.
Specific Address
.
Note
Solution
First we change 100 ms to seconds, and then we
calculate the frequency from the period (1 Hz = 10−3
kHz).
Frequency
• Frequency is the rate of change with respect
to time.
• Change in a short span of time means high
frequency.
• Change over a long span of
time means low frequency.
Note
Solution
We know that 1 complete cycle is 360°. Therefore, 1/6
cycle is
Wavelength and period
The spectrum has only five spikes, at 100, 300, 500, 700,
and 900 Hz.
The bandwidth for Example
Example
Solution
The lowest frequency must be at 40 kHz and the highest
at 240 kHz. Figure shows the frequency domain and the
bandwidth.
The bandwidth for Example
Real Life examples of non periodic composite signal
InInbaseband
baseband transmission, the required bandwidth is
transmission, the required
bandwidth proportional to the bit rate;
is proportional to the bit rate;
ifif we
weneed to send bits faster, we need more bandwidth.
need to send bits faster, we need
more bandwidth.
Bandwidth requirements
Example
dB = 10log10P2/P1
P1 - input signal
P2 - output signal
Example
Solution
We can calculate the power in the signal as
Example
Solution
The values of SNR and SNRdB can be calculated as
follows:
Example
Solution
First, we use the Shannon formula to find the upper
limit.
Example
Solution
We can calculate the throughput as
Solution
We can calculate the propagation time as
Example
Solution
We can calculate the propagation and transmission time
as shown on the next slide:
Example (continued)
Solution
We can calculate the propagation and transmission
times as shown on the next slide.
Example (continued)
Solution
We assume that the average value of c is 1/2 . The baud
rate is then
Solution
The bandwidth of a low-pass signal is between 0 and f,
where f is the maximum frequency in the signal.
Therefore, we can sample this signal at 2 times the
highest frequency (200 kHz). The sampling rate is
therefore 400,000 samples per second.
Example
Solution
We cannot find the minimum sampling rate in this case
because we do not know where the bandwidth starts or
ends. We do not know the maximum frequency in the
signal.
Quantization
■ Sampling results in a series of pulses of varying
amplitude values ranging between two limits: a
min and a max.
■ The amplitude values are infinite between the two
limits.
■ We need to map the infinite amplitude values onto
a finite set of known values.
Steps in Quantization
1)The original analog signal has instantaneous
amplitude between Vmin and Vmax
2) Divide the range into L zones, each of
height Δ(delta)
Δ = (Vmax - Vmin)/L
3) Assign quantized values of 0 to L-1 to
midpoint of each zone
4) Approximate the value of sample amplitude
to the quantized values
Quantization Example
■ Assume we have a voltage signal with
amplitudes Vmin=-20V and Vmax=+20V.
■ We want to use L=8 quantization levels.
■ Zone width Δ = (20 - -20)/8 = 5
■ The 8 zones are: -20 to -15, -15 to -10, -10
to -5, -5 to 0, 0 to +5, +5 to +10, +10 to
+15, +15 to +20
■ The midpoints are: -17.5, -12.5, -7.5, -2.5,
2.5, 7.5, 12.5, 17.5
Encoding
■ Each zone is then assigned a binary code.
■ The number of bits required to encode the zones,
or the number of bits per sample as it is commonly
referred to, is obtained as follows:
nb = log2 L
■ Given our example, nb = 3
■ The 8 zone (or level) codes are therefore: 000,
001, 010, 011, 100, 101, 110, and 111
■ Assigning codes to zones:
■ 000 will refer to zone -20 to -15
■ 001 to zone -15 to -10, etc.
Quantization and encoding of a sampled signal
Quantization Error
■ When a signal is quantized, we introduce an error
- the coded signal is an approximation of the
actual amplitude value.
■ The difference between actual and coded value
(midpoint) is referred to as the quantization error.
■ The value of error for any sample is less than Δ/2.
i.e., -Δ/2 ≤ error ≤ Δ/2
■ Contribution of quantization error to SNRdB
depends on the bits per sample nb
SNRdB =6.02 nb + 1.76 dB
Example
Solution
We have 8 levels and 3 bits per sample,
SNRdB =6.02 *3 + 1.76 dB
SNRdB = 19.82 dB
Bit rate and bandwidth
requirements of PCM
■ The bit rate of a PCM signal can be calculated
form the number of bits per sample x the sampling
rate
Bit rate = nb x fs
■ A digitized signal will always need more
bandwidth than the original analog signal. Price
we pay for robustness and other features of digital
transmission.
Example
Solution
The sampling rate and bit rate are calculated as follows:
Recovery of original signal-PCM
Decoder
■ To recover an analog signal from a digitized signal
we follow the following steps:
■ We use a hold circuit that holds the amplitude value of
a pulse till the next pulse arrives.
■ We pass this signal through a low pass filter to smooth
the staircase signal into an analog signal.
■ The higher the value of L, the less distorted a
signal is recovered.
Components of a PCM decoder
Delta Modulation
■ This scheme sends only the difference between
pulses, if the pulse at time tn+1 is higher in
amplitude value than the pulse at time tn, then a
single bit, say a “1”, is used to indicate the
positive value.
■ If the pulse is lower in value, resulting in a
negative value, a “0” is used.
■ This scheme works well for small changes in
signal values between samples.
■ If changes in amplitude are large, this will result in
large errors.
The process of delta modulation
Modulator
Solution
In this case, r = 4, S = 1000, and N is unknown. We can
find the value of N from
Example
Chapter 6
Bandwidth Utilization:
Multiplexing and
Spreading
Note
Solution
For five channels, we need at least four guard bands.
This means that the required bandwidth is at least
5 × 100 + 4 × 10 = 540 kHz,
as shown in Figure in next slide
Figure
Wavelength-division multiplexing (WDM)
For the figure in previous slide, the data rate for each one
of the 3 input connection is 1 kbps. If 1 bit at a time is
multiplexed (a unit is 1 bit), what is the duration of (a)
each input slot, (b) each output slot, and (c) each frame?
Solution
We can answer the questions as follows:
a. The data rate of each input connection is 1 kbps. This
means that the bit duration is 1/1000 s or 1 ms. The
duration of the input time slot is 1 ms (same as bit
duration).
Example (continued)
Solution
a. The input bit duration is the inverse of the bit rate:
1/1 Mbps = 1 μs.
b. The output bit duration is one-fourth of the input bit
duration, or ¼ μs.
c. The output bit rate is the inverse of the output bit
duration or 1/(4μs) or 4 Mbps. This can also be
deduced from the fact that the output rate is 4 times as
fast as any input rate; so the output rate = 4 × 1 Mbps
= 4 Mbps.
d. The frame rate is always the same as any input rate.
So the frame rate is 1,000,000 frames per second
Example
Solution
Each frame carries 1 byte from each channel; the size of
each frame, therefore, is 4 bytes, or 32 bits. Because each
channel is sending 100 bytes/s and a frame carries 1 byte
from each channel, the frame rate must be 100 frames
per second. The bit rate is 100 × 32, or 3200 bps.
Interleaving
.
Classes of transmission media
Twisted-pair cable
The total delay is due to the time needed to create the connection,
transfer data, and disconnect the circuit
Note
Solution
In the first stage we have N/n or 10 crossbars, each of size
20 × 4. In the second stage, we have 4 crossbars, each of
size 10 × 10. In the third stage, we have 10 crossbars,
each of size 4 × 20. The total number of crosspoints is
2kN + k(N/n)2, or 2000 crosspoints. This is 5 percent of
the number of crosspoints in a single-stage switch (200 ×
200 = 40,000).
Note
According to the Clos criterion:
n = (N/2)1/2
k > 2n – 1
Solution
We let n = (200/2)1/2, or n = 10. We calculate k = 2n − 1 =
19. In the first stage, we have 200/10, or 20, crossbars,
each with 10 × 19 crosspoints. In the second stage, we
have 19 crossbars, each with 20 × 20 crosspoints. In the
third stage, we have 20 crossbars each with 19 × 10
crosspoints. The total number of crosspoints is 20(10 ×
19) + 19(20 × 20) + 20(19 ×10) = 15200.
Time Division Switch: Time-slot interchange(TSI)
• TDM multiplexer, a TDM demultiplexer, and a TSI consisting of
random access memory (RAM) with several memory locations.
• The size of each location is the same as the size of a single time slot.
• The number of locations is the same as the number of inputs.
• RAM fills up with incoming data from time slots in the order
received.
• Slots are then sent out in an order based on the decisions of a control
unit.
Time-space-time switch(TST)
Time-space-time switch(TST)
• Two time stages and one space stage and has 12 inputs and 12
outputs.
• divides the inputs into three groups and directs them to three
timeslot interchanges
• Thus the average delay is one-third of what would result from
using one time-slot interchange to handle all 12 inputs
• The last stage is a mirror image of the first stage.
• The middle stage is a space division switch (crossbar) that
connects the TSI groups to allow connectivity between all
possible input and output pairs
Packet switch components
Input port
(continued
)
Algorithm: Sender-site Selective Repeat algorithm
(continued
)
(continued
Algorithm: Sender-site Selective Repeat (continued
algorithm
)
Algorithm: Receiver-site Selective Repeat algorithm
Algorithm:Receiver-site Selective Repeat algorithm
Figure: Delivery of data in Selective Repeat ARQ
Example
The next point is about the ACKs. Notice that only two
ACKs are sent here. The first one acknowledges only the
first frame; the second one acknowledges three frames. In
Selective Repeat, ACKs are sent when data are delivered to
the network layer. If the data belonging to n frames are
delivered in one shot, only one ACK is sent for all of them.
Figure: Flow diagram for Example
Piggybacking
• In real life, data frames are normally flowing in
both directions
• A technique called piggybacking is used to
improve the efficiency of the bidirectional
protocols
• When a frame is carrying data from A to B, it can
also carry control information about arrived (or
lost) frames from B; when a frame is carrying
data from B to A, it can also carry control
information about the arrived (or lost) frames
from A.
Figure: Design of piggybacking in Go-Back-N ARQ
Link Utilization / Selective Repeat ARQ
• Some data types consist of many chunks of repeated data (e.g. multimedia
data such as audio, video, images, …)
• Lossless techniques enable exact reconstruction of the original document from the
compressed information.
• Lossy techniques usually achieve higher compression rates than lossless ones but
Classification of Lossless Compression Techniques
• Lossless techniques are classified into static, adaptive (or dynamic), and hybrid.
• In a static method the mapping from the set of messages to the set of codewords is fixed
before transmission begins, so that a given message is represented by the same codeword
every time it appears in the message being encoded.
• Static coding requires two passes: one pass to compute probabilities (or frequencies)
and determine the mapping, and a second pass to encode.
• Examples: Static Huffman Coding
• In an adaptive method the mapping from the set of messages to the set of codewords
changes over time.
• All of the adaptive methods are one-pass methods; only one scan of the message is
required.
• Examples: LZW, and Adaptive Huffman Coding
• An algorithm may also be a hybrid, neither completely static nor completely dynamic.
Run-length encoding
The following string:
BBBBHHDDXXXXKKKKWWZZZZ
can be encoded more compactly by replacing each repeated string of characters by a single instance
of the repeated character and a number that represents the number of times it is repeated:
B4H2D2X4K4W2Z4
Here "B4" means four B's, and “H2” means two H's, etc. Compressing a string in this way is called
run-length encoding.
The rectangular image can be compressed with run-length encoding by counting identical
bits as follows:
0, 40
0, 40 The first line says that the first line of the bitmap consists of 40 0's.
The third line says that the third line of the bitmap consists of 10 0's
0,10 1,20 0,10 followed by 20 1's followed by 10 more 0's, and so on for the other
character Frequency
a 5
b 9
c 12
d 13
e 16
f 45
Huffman coding- Example(contd.)
Extract two minimum frequency nodes from min
heap. Add a new internal node with frequency 5 + 9 =
14.
character Frequency
c 12
d 13
Internal Node 14
e 16
f 45
Huffman coding- Example(contd.)
Extract two minimum frequency nodes from heap.
Add a new internal node with frequency 12 + 13 = 25
character Frequency
Internal Node 14
e 16
Internal Node 25
f 45
Huffman coding- Example(contd.)
Extract two minimum frequency nodes. Add a new
internal node with frequency 14 + 16 = 30
character Frequency
Internal Node 25
Internal Node 30
f 45
Huffman coding- Example(contd.)
Extract two minimum frequency nodes. Add a new internal
node with frequency 25 + 30 = 55
character Frequency
f 45
Huffman coding- Example(contd.)
Extract two minimum frequency nodes. Add a new
internal node with frequency 45 + 55 = 100
character Frequency
Internal Node 100
Huffman coding- Generating the
code
Traverse the tree formed starting from the root. While
moving to the left child, write 0 . While moving to the
right child, write 1
Huffman coding- Generating the
codes
character code-word
f 0
e 111
d 101
c 100
b 1101
a 1100
Chapter 9
Using Telephone
and Cable Networks
for Data Transmission
TELEPHONE NETWORK
Packet-switch
Packet-switch or circuit-switch
Layers in SS7 (signaling system seven)
Protocol that is used in the signaling network is called
Signaling System Seven (SS7).
Layers in SS7 (signaling system seven)
MTP Level 1: uses several physical layer specifications
MTP Level 2: provides services such as packetizing, using source
and destination address in the packet header, and CRC for error
checking
MTP Level 3: provides end-to-end connectivity, route the signal
packets from the source to the destination.
SCCP: The signaling connection control point (SCCP) is used
for special services such as 800-call processing.
Telephone user port (TUP) is responsible for setting up voice
calls. It receives the dialed digits and routes the calls
Transaction capabilities application port (TCAP) provides
remote calls that let an application program on a computer invoke
a procedure on another computer
ISDN user port (ISUP) can replace TUP to provide services
similar to those of an ISDN network
Services Provided by Telephone Networks
Modem
stands for modulator/demodulator.
Modulator creates
a bandpass analog signal from binary
data
demodulator recovers the binary data
from the modulated signal
Modulation/demodulation
Modem Standards
V-series Modulation Data Rate Baud Rate
standard
V.32 32-QAM 9600 bps 2400 baud Only 4 bits
represent
data
V.32 bis 128-QAM 14,400 bps 2400 baud Only 6 bits
represent
data
V.34 bis M-QAM 28,800-33,60
0 bps
V.90 M-QAM 56 Kbps
(downstream)
33.6 Kbps
(upstream)
V.92 M-QAM 56 Kbps A modem
(downstream) adjusts its
48 Kbps speed
(upstream)
DIGITAL SUBSCRIBER LINE
Note
Note
IP address.
■ The CM and CMTS exchange some packets to
upstream channel.
■ Downstream Communication
Chapter 10
Error Detection
and
Correction
.
Note
Note
Note
Note
Solution
We first find all Hamming distances.
Solution
We first find all the Hamming distances.
Note
Our second block code scheme has dmin = 3. This code can
detect up to two errors. Again, we see that when any of the
valid codewords is sent, two errors create a codeword
which is not in the table of valid codewords. The receiver
cannot be fooled.
Note
Solution
This code guarantees the detection of up to three errors
(s = 3), but it can correct up to one error. In other words,
if this code is used for error correction, part of its capability
is wasted.
GATE-2017
Note
Note
Modulo 2 arithmetic:
r0 = a 2 + a 1 + a 0
r1 = a 3 + a 2 + a 1
r2 = a 1 + a 0 + a 3
Calculating the syndrome at the receiver:
s0 = b2 + b1 + b0 +q0
s1 = b3 + b2 + b1 + q1
s2 = b1 + b0 + b3+ q2
Hamming code C(7, 4) - n=7, k = 4
Logical decision made by the correction logic analyzer
Example
Let us trace the path of three datawords from the sender to
the destination:
1. The dataword 0100 becomes the codeword 0100011.
The codeword 0100011 is received. The syndrome is
000, the final dataword is 0100.
2. The dataword 0111 becomes the codeword 0111001.
The received codeword is: 0011001. The syndrome is
011. After flipping b2 (changing the 1 to 0), the final
dataword is 0111.
3. The dataword 1101 becomes the codeword 1101000.
The codeword 0001000 is received (two errors).The
syndrome is 101. After flipping b0, we get 0000,
the wrong dataword. This shows that our code cannot
correct two errors.
Example
C(15, 11)
Hamming Code for Burst Errors
■ Split a burst error between several codewords, one
error for each codeword
■ For a burst error of size N, make N codewords out
of our frame.
■ Then, arrange the codewords in a table and send
the bits in the table, a column at a time.
■ In each column, the bits are sent from the bottom
to the top.
■ When a burst error of size 4 corrupts the frame,
only 1 bit from each codeword is corrupted.
■ The corrupted bit in each codeword can then
easily be corrected at the receiver
Burst error correction using Hamming code
CYCLIC CODES
A. 11001001000
B. 11001001011
C. 11001010
D. 110010010011
Note
In a cyclic code,
If s(x) ≠ 0, one or more bits is corrupted.
If s(x) = 0, either
a. No bit is corrupted. or
b. Some bits are corrupted, but the
decoder failed to detect them.
Note
Note
Note
Note
Note
Note
Solution
The number 21 in binary is 10101 (it needs five bits). We
can wrap the leftmost bit and add it to the four rightmost
bits. We have (0101 + 1) = 0110 or 6.
Example
Solution
In one’s complement arithmetic, the negative or
complement of a number is found by inverting all bits.
Positive 6 is 0110; negative 6 is 1001. If we consider only
unsigned numbers, this is 9. In other words, the
complement of 6 is 9.
Figure : Example
Example
Note
Sender site:
1. The message is divided into 16-bit words.
2. The value of the checksum word is set to 0.
3. All words including the checksum are
added using one’s complement addition.
4. The sum is complemented and becomes the
checksum.
5. The checksum is sent with the data.
Internet Checksum
Note
Receiver site:
1. The message (including checksum) is
divided into 16-bit words.
2. All words are added using one’s
complement addition.
3. The sum is complemented and becomes the
new checksum.
4. If the value of checksum is 0, the message
is accepted; otherwise, it is rejected.
Example
Now let us see how the data link layer can combine
framing, flow control, and error control to achieve the
delivery of data from one node to another. The
protocols are normally implemented in software by
using one of the common programming languages. To
make our discussions language-free, we have written
in pseudocode a version of each protocol that
concentrates mostly on the procedure instead of
delving into the details of language rules.
Taxonomy of protocols
NOISELESS CHANNELS
(continued
)
Algorithm: Sender-site algorithm for Stop-and-Wait ARQ
(continued)
Algorithm: Receiver-site algorithm for Stop-and-Wait ARQ Protocol
Example
Solution
The bandwidth-delay product is
Example (continued)
The system can send 20,000 bits during the time it takes
for the data to go from the sender to the receiver and then
back again. However, the system sends only 1000 bits. We
can say that the link utilization is only 1000/20,000, or 5
percent. For this reason, for a link with a high bandwidth
or long delay, the use of Stop-and-Wait ARQ wastes the
capacity of the link.
Example
Solution
The bandwidth-delay product is still 20,000 bits. The
system can send up to 15 frames or 15,000 bits during a
round trip. This means the utilization is 15,000/20,000, or
75 percent. Of course, if there are damaged frames, the
utilization percentage is much less because frames have
to be resent.
Link Utilization / Efficiency of Stop and Wait ARQ
a = Tp / Tt
a = 22.5 / 5.461 = 4.12
Efficiency, η = 1 / (1+2a)
= 1 / (1 + 2 x 4.12) = 0.108 or 10.8%
Note
(continued
Algorithm: Go-Back-N sender algorithm
(continued
)
Algorithm: Go-Back-N receiver algorithm
Example
Following Figure shows an example of Go-Back-N. This
is an example of a case where the forward channel is
reliable, but the reverse is not. No data frames are lost,
but some ACKs are delayed and one is lost. The example
also shows how cumulative acknowledgments can help if
acknowledgments are delayed or lost. After initialization,
there are seven sender events. Request events are
triggered by data from the network layer; arrival events
are triggered by acknowledgments from the physical
layer. There is no time-out event here because all
outstanding frames are acknowledged before the timer
expires. Note that although ACK 2 is lost, ACK 3 serves
as both ACK 2 and ACK 3.
Figure: Flow diagram for Example
Example
Solution:
Transmission delay (Tt) = Frame size / Bandwidth
= 100 bytes / 20 Kbps=40 ms
(continued
)
Algorithm: Sender-site Selective Repeat algorithm
(continued
)
(continued
Algorithm: Sender-site Selective Repeat (continued
algorithm
)
Algorithm: Receiver-site Selective Repeat algorithm
Algorithm:Receiver-site Selective Repeat algorithm
Figure: Delivery of data in Selective Repeat ARQ
Example
The next point is about the ACKs. Notice that only two
ACKs are sent here. The first one acknowledges only the
first frame; the second one acknowledges three frames. In
Selective Repeat, ACKs are sent when data are delivered to
the network layer. If the data belonging to n frames are
delivered in one shot, only one ACK is sent for all of them.
Figure: Flow diagram for Example
Piggybacking
• In real life, data frames are normally flowing in
both directions
• A technique called piggybacking is used to
improve the efficiency of the bidirectional
protocols
• When a frame is carrying data from A to B, it can
also carry control information about arrived (or
lost) frames from B; when a frame is carrying
data from B to A, it can also carry control
information about the arrived (or lost) frames
from A.
Figure: Design of piggybacking in Go-Back-N ARQ
Link Utilization / Selective Repeat ARQ
• Some data types consist of many chunks of repeated data (e.g. multimedia
data such as audio, video, images, …)
• Lossless techniques enable exact reconstruction of the original document from the
compressed information.
• Lossy techniques usually achieve higher compression rates than lossless ones but
Classification of Lossless Compression Techniques
• Lossless techniques are classified into static, adaptive (or dynamic), and hybrid.
• In a static method the mapping from the set of messages to the set of codewords is fixed
before transmission begins, so that a given message is represented by the same codeword
every time it appears in the message being encoded.
• Static coding requires two passes: one pass to compute probabilities (or frequencies)
and determine the mapping, and a second pass to encode.
• Examples: Static Huffman Coding
• In an adaptive method the mapping from the set of messages to the set of codewords
changes over time.
• All of the adaptive methods are one-pass methods; only one scan of the message is
required.
• Examples: LZW, and Adaptive Huffman Coding
• An algorithm may also be a hybrid, neither completely static nor completely dynamic.
Run-length encoding
The following string:
BBBBHHDDXXXXKKKKWWZZZZ
can be encoded more compactly by replacing each repeated string of characters by a single instance
of the repeated character and a number that represents the number of times it is repeated:
B4H2D2X4K4W2Z4
Here "B4" means four B's, and “H2” means two H's, etc. Compressing a string in this way is called
run-length encoding.
The rectangular image can be compressed with run-length encoding by counting identical
bits as follows:
0, 40
0, 40 The first line says that the first line of the bitmap consists of 40 0's.
The third line says that the third line of the bitmap consists of 10 0's
0,10 1,20 0,10 followed by 20 1's followed by 10 more 0's, and so on for the other
character Frequency
a 5
b 9
c 12
d 13
e 16
f 45
Huffman coding- Example(contd.)
Extract two minimum frequency nodes from min
heap. Add a new internal node with frequency 5 + 9 =
14.
character Frequency
c 12
d 13
Internal Node 14
e 16
f 45
Huffman coding- Example(contd.)
Extract two minimum frequency nodes from heap.
Add a new internal node with frequency 12 + 13 = 25
character Frequency
Internal Node 14
e 16
Internal Node 25
f 45
Huffman coding- Example(contd.)
Extract two minimum frequency nodes. Add a new
internal node with frequency 14 + 16 = 30
character Frequency
Internal Node 25
Internal Node 30
f 45
Huffman coding- Example(contd.)
Extract two minimum frequency nodes. Add a new internal
node with frequency 25 + 30 = 55
character Frequency
f 45
Huffman coding- Example(contd.)
Extract two minimum frequency nodes. Add a new
internal node with frequency 45 + 55 = 100
character Frequency
Internal Node 100
Huffman coding- Generating the
code
Traverse the tree formed starting from the root. While
moving to the left child, write 0 . While moving to the
right child, write 1
Huffman coding- Generating the
codes
character code-word
f 0
e 111
d 101
c 100
b 1101
a 1100
LZW (Lempel–Ziv–Welch)
•It is lossless, meaning no data is lost when
compressing
•is typically used in GIF and Unix file compression
utility compress
•works by reading a sequence of symbols, grouping
the symbols into strings, and converting the strings
into codes
•The strings are replaced by their corresponding
codes and so the input file is compressed.
•The efficiency of the algorithm increases as the
number of long, repetitive words in the input data
increases.
LZW ENCODING
1 Initialize table with single character strings
2 P = first input character
3 WHILE not end of input stream
4 C = next input character
5 IF P + C is in the string table
6 P=P+C
7 ELSE
8 output the code for P
9 add P + C to the string table
10 P=C
11 END WHILE
12 output code for P
LZW Encoding Example
Data word : a b a b a b a b a
Dictionary
1 a
2 b
ababababa
Dictionary
1a Encoded word : 1
2b
3 ab
LZW Encoding Example(cont.)
ababababa
Dictionary
1a Encoded word : 1 2
2b
3 ab
4 ba
ababababa
ab already available in the dictionary, append next character
LZW Encoding Example(cont.)
ababababa
Dictionary
1a Encoded word : 1 2 3
2b
3 ab
4 ba
5 aba
ababababa
ab already available in the dictionary, append next character
ababababa
aba already available in the dictionary, append next character
LZW Encoding Example(cont.)
ababababa
Dictionary
1a Encoded word : 1 2 3 5
2b
3 ab
4 ba
5 aba
6 abab
ababababa
ba already available in the dictionary. Since, end of loop,
output code for ba
Encoded word: 1 2 3 5 4
Image Compression Standards
Image Compression Standards
•Tagged image file format (TIFF) : used widely in
printing business as photograph file standard and not
used in browsers
•Portable network graphics (PNG) :created as an
open-source alternative to GIF. Designed to transfer
images over the internet.
•Joint Photographic Experts Group (JPEG): working
group which creates the standard for still image
compression.
•JPEG 2000 : image compression standard compatible
with multimedia technologies with the features such as
superior bit rate performance progressive transmission
by pixel and by accuracy, coding of interested region,
and not error prone to bit errors
JPEG vs JPEG 2000
JPEG JPEG2000
Created for natural images Created for computer generated images
Discrete Cosine Transform Discrete Wavelet Transform
Video Compression Standards
Standard Application
H.261 Video conferencing over ISDN
MPEG-1 Video on digital storage media
(CD-ROM)
A repeater is a regenerator,
not an amplifier.
.
IEEE STANDARDS
Frame length:
Minimum: 64 bytes (512 bits)
Maximum: 1518 bytes (12,144 bits)
Example of an Ethernet address in hexadecimal notation
Unicast and multicast addresses
Note
.
IEEE 802.11
When the stations hear the beacon frame, they start their NAV
for the duration of the contention-free period of the repetition
interval
Frame format
Frame format
Frame control : defines the type of frame and some control
information.
D : defines the duration of the transmission that is used to
set the value of NAV
Addresses: There are four address fields
Sequence control: This field defines the sequence number
of the frame to be used in flow control
Frame body : This field, contains information based on the
type and the subtype defined in the FC field
FCS : contains a CRC-32 error detection sequence
Subfields in FC field
Types of Frames
• Management frames are used for the initial
communication between stations and access
points
• Control frames are used for accessing the
channel and acknowledging frames
• Data frames are used for carrying data and
control information.
Control frames
The time is divided into slots of 625 μs. The primary uses even
numbered slots (0, 2, 4, ...); the secondary uses odd-numbered slots (1,
3, 5, ...). TDD-TDMA allows the primary and the secondary to
communicate in half-duplex mode.
Multiple-secondary communication