Module 1
Module 1
• The original TCP/IP protocol suite was defined as four software layers built
upon the hardware. Today, however, TCP/IP is thought of as a five-layer
model.
Layered Architecture
We want to use the suite in a small internet made up of three LANs (links), each with a
link-layer switch. We also assume that the links are connected by one router.
Each device is involved with a set of layers depending on the role of the device in the
internet
Layered Architecture
• Let us assume that computer A communicates with computer B.
• Five communicating devices in this communication: Source host (computer
A), the link-layer switch in link 1, the router, the link-layer switch in link 2,
and the destination host (computer B).
• Each device is involved with a set of layers depending on the role of the
device in the internet.
• The two hosts are involved in all five layers:
– The source host needs to create a message in the application layer and
send it down the layers.
– The destination host needs to receive the communication at the
physical layer and then deliver it through the other layers to the
application layer.
• The router is involved in only three layers - router is used only for routing
Layers in the TCP/IP Protocol Suite
• Although each switch in the above figure has two different connections, the
connections are in the same link, which uses only one set of protocols
Layers in the TCP/IP Protocol Suite
• The logical connection at the network layer is between the two hosts, we can
only say that identical objects exist between two hops in this case because a
router may fragment the packet at the network layer and send more packets
than received.
Description of Each Layer
Application Layer:
• Layer with which user interacts
• Responsible for providing services to the user.
• Used by user applications (google chrome, firefox, Microsoft outlook) that
pass message from one computer to another in a network. Applications use
application protocols to perform their activities.
• Communication at the application layer is between two processes (two
programs running at this layer).
Protocols:
• Hypertext Transfer Protocol (HTTP) - for accessing the World Wide Web (WWW).
• The Simple Mail Transfer Protocol (SMTP) -used in electronic mail (e-mail)
service.
• The File Transfer Protocol (FTP) -used for transferring files from one host to
another.
• The Terminal Network (TELNET) and Secure Shell (SSH) are used for accessing a
site remotely.
• The Simple Network Management Protocol (SNMP) is used by an administrator to
manage the Internet at global and local levels.
• The Domain Name System (DNS) is used by other protocols to find the network-
layer address of a computer.
Transport Layer
• Service-point addressing (Port address)
• Segmentation and reassembly (Sequence number)
• Connection control (Connectionless (UDP) or connection oriented (TCP))
• Flow control (end to end)
• Error Control (Process to Process)
Network Layer
• Routing
• Path determination
• Logical addressing
• IP is a connectionless protocol (unreliable) that provides no flow control,
no error control, and no congestion control services.
Protocols: IP, ICMP (ping uses), IGMP (multicasting)
Data Link Layer
• Framing (stream of bits into manageable data units)
• Physical addressing (MAC Address)
• Flow Control (mechanism for overwhelming the receiver)
• Error Control (trailer, retransmission)
• Access Control (defining master device in the same link)
• Error detection and correction
• MAC (data encapsulation, access medium) and LLC (flow control, error
control) are the sublayers of data link layer
Physical Layer
• Responsible for movements of individual bits from one hop (node) to the
next
• The purpose of the Physical layer is to create the electrical, optical, or
microwave signal that represents the bits
Protocols: Bluetooth, Ethernet (802.3), DSL, ISDN, 10 Base T
Encapsulation and Decapsulation
Encapsulation: Adding a chunk of data (header) at each layer as data goes from Application to physical layer.
Decapsulation: Reading/removing the data (header) at each layer as data goes from physical to application
layer
Encapsulation at source
Encapsulation at source:
• At the application layer, the data to be exchanged is referred to as a message.
A message normally does not contain any header or trailer.
• The transport layer adds the transport layer header to the payload,
– contains the identifiers (port numbers) of the source and destination application programs that
want to communicate
– information that is needed for the end-to end delivery of the message, such as information
needed for flow, error control, or congestion control.
• The network layer takes the transport-layer packet as data or payload and adds
its own header to the payload.
– The header contains the addresses of the source and destination hosts (IP address)
– some more information used for error checking of the header, fragmentation information
• The data-link layer takes the network-layer packet as data or payload and adds
its own header, which contains
– the link-layer addresses of the host or the next hop (the router). The result is the link-layer
packet, which is called a frame.
• After the set of bits are delivered to the data-link layer, this layer
decapsulates the datagram from the frame and passes it to the network
layer.
• The network layer only inspects the source and destination addresses in the
datagram header and consults its forwarding table to find the next hop to
which the datagram is to be delivered.
• The contents of the datagram should not be changed by the network layer
in the router unless there is a need to fragment the datagram if it is too big
to be passed through the next link.
• At the destination host, each layer only decapsulates the packet received,
removes the payload, and delivers the payload to the next-higher layer
protocol until the message reaches the application layer.
https://www.youtube.com/watch?v=FJIFfkpUO7o
Addressing
Addressing
• At the application layer, we normally use names to define the site that
provides services, such as someorg.com, or the e-mail address, such as
somebody@coldmail.com.
• At the transport layer, addresses are called port numbers, and these define
the application-layer programs at the source and destination. Port numbers
are local addresses that distinguish between several programs running at
the same time.
• At the transport layer, either UDP or TCP can accept a message from
several application-layer protocols.
• IP can also accept a packet from other protocols such as ICMP, IGMP,
and At the data-link layer, a frame may carry the payload coming from
IP or other protocols such as ARP so on.
Example
DATA RATE LIMITS
• A very important consideration in data communications is how fast we can
send data, in bits per second, over a channel.
Signal Levels:
In general, if a signal has L levels, each level needs log2 L bits. log24 = 2 bits
Noiseless Channel: Nyquist Bit Rate
Bitrate: the rate at which bits are transferred from one location to another. It
measures how much data is transmitted in a given amount of time.
2)
3)
Tradeoff
2)
Using Both Limits
Note
• At the sender, digital data are encoded into a digital signal; at the receiver, the
digital data are recreated by decoding the digital signal.
Characteristics of line coding schemes/ Factors to consider in digital
signaling
• Data Element Versus Signal Element
A data element is the smallest entity that A signal element carries data elements.
can represent a piece of information: this is
the bit
Data elements are what we need to send Signal elements are what we can send.
Data elements are being carried Signal elements are the carriers
ratio r - which is the number of data elements carried by each signal element
Characteristics of line coding schemes
• Data Rate Versus Signal Rate
The data rate defines the number of data The signal rate is the number of signal
elements (bits) sent in 1s elements sent in 1s.
The unit is bits per second (bps). The unit is the baud.
The data rate is sometimes called the bit The signal rate is sometimes called the
rate pulse rate, the modulation rate, or the
baud rate.
“One goal in data communications is to increase the data rate while decreasing the
signal rate”
• Increasing the data rate increases the speed of transmission; decreasing the signal rate
decreases the bandwidth requirement.
The relationship between data rate (N) and signal rate (S), we need to define three
cases: the worst, best, and average.
A signal is carrying data in which one data element is encoded as one signal
element ( r = 1/1). If the bit rate is 100 kbps, what is the average value of the
baud rate if c is between 0 and 1?
Solution
We assume that the average value of c is 1/2 . The baud rate is then
4.38
Characteristics of line coding schemes
• Self-synchronization
• The clocks at the sender and the receiver must have the same bit interval.
• If the receiver clock is faster or slower it will misinterpret the incoming bit stream.
In a digital transmission, the receiver clock is 0.1 percent faster than the sender
clock. How many extra bits per second does the receiver receive if the data rate is 1
kbps?
1. 1 bps
2. 10 bps
3. 100 bps
4.1000 bps
Receiver clock is 0.1% faster than sender clock. so Extra bits received by receiver
= 1000 * 0.1/100 =1 bit
In a digital transmission, the receiver clock is 0.1 percent faster than the sender clock.
How many extra bits per second does the receiver receive if the data rate is 1 Mbps?
1.10 bps
2.100 bps
3.1000 bps
4.10000 bps
Characteristics of line coding schemes
Self-synchronization
In a digital transmission, the receiver clock is 0.1 percent faster than the sender clock.
How many extra bits per second does the receiver receive if the data rate is 1 Mbps?
1.10 bps
2.100 bps
3.1000 bps
4.10000 bps
Receiver clock is 0.1% faster than sender clock. so Extra bits received by receiver
= 1000000 * 0.1/100 =1000 bits
– The incoming signal power is evaluated against this baseline to determine the value
of the data element.
– A long string of 0s or 1s can cause a drift in the baseline (baseline wandering) and
make it difficult for the receiver to decode correctly. So, we need to select a line
coding scheme that eliminates this problem.
In decoding a digital signal, the receiver calculates a running average of the received signal
power, called the .
a. baseline
b. base
c. line
d. broadline
Characteristics of line coding schemes
• DC Components
When the voltage level in a digital signal is constant for a while, the spectrum creates very low
frequencies. These frequencies around zero, called DC (direct-current) components, present
problems for a system that cannot pass low frequencies or a system that uses electrical coupling
(via a transformer). For these systems, we need a scheme with no DC component. The signal with
a DC component cannot pass through a transformer.
E.g., in a binary system that transmits a „1‟ as +1 volt and a „0‟ as -1 volt, making the total number
of „0‟and „1‟bits roughly equal over some interval gives a DC balanced signal.
• Complexity
A complex scheme is more costly to implement than a simple one. For example, a scheme that uses
four signal levels is more difficult to interpret than one that uses only two levels.
NRZ (Non-Return-to-Zero)
• The positive voltage defines bit 1 and the zero voltage defines bit 0. The signal level
does not return to zero during a symbol transmission.
(Digital Signal) Line Coding Schemes
Polar Schemes
• In polar schemes, the voltages are on both sides of the time axis
• The voltage level for 0 can be positive and the voltage level for 1 can be negative.
NRZ - Inversion (NRZ-I) - the change or lack of change in the level of the voltage
determines the value of the bit. If there is no change, the bit is 0; if there is a change,
the bit is 1.
Note on Unipolar and Polar Line Coding
Unipolar Non return to zero (NRZ)
• Uses more power
• For continuous set of zeros or ones there will be self-synchronization and base line
wandering problem.
• The signal goes to 0 in the middle of each bit. It remains there until the beginning
of the next bit.
Note
• This scheme has more signal transitions (two per symbol) and therefore requires a wider
bandwidth.
• More complex as it uses three voltage level. It has no error detection capability.
Biphase: Manchester and Differential Manchester
Manchester encoding, the duration of the bit is divided into two halves. The voltage
remains at one level during the first half and moves to the other level in the second
half.
Differential Manchester, If the next bit is 0, there is a transition; if the next bit is 1,
there is none.
Bipolar Schemes
• In bipolar encoding (sometimes called multilevel binary), there are three voltage
levels:positive, negative, and zero.
Pseudoternary
• The 1 bit is encoded as a zero voltage and the 0 bit is encoded as alternating
positive and negative voltages.
Multilevel Schemes
m = 2, n = 1, and L = 4 (quaternary).
0011011001
Note: The 2B1Q scheme is used in DSL (Digital Subscriber Line) technology to provide a
high-speed connection to the Internet by using subscriber telephone lines
Multilevel Schemes
2B1Q
Digitaldata: 11001100101110
Multilevel Schemes
8B6T (eight binary, six ternary)
• This code is used with 100BASE-4T cable
• The idea is to encode a pattern of 8 bits as a pattern of six signal elements, where the
signal has three levels (ternary).
• 2^8 = 256 different data patterns and 3^6 = 729 different signal patterns.
Each signal pattern has a weight of 0 or +1 DC values. This means that there is no pattern with
the weight −1. To make the whole stream DC-balanced, the sender keeps track of the weight. If
two groups of weight 1 are encountered one after another, the first one is sent as is, while the next
one is totally inverted to give a weight of −1.
Multilevel Schemes
4D-PAM5 four-dimensional five level pulse amplitude modulation
• 4D means that data is sent over four wires at the same time
• It uses five voltage levels, such as −2, −1, 0, 1, and 2
• All 8 bits can be fed into a wire simultaneously and sent by using one signal element.
The point here is that the four signal elements comprising one signal group are sent
simultaneously in a four dimensional setting.
• Gigabit LANs use this encoding technique to transmit 1 Gbps data over four copper
cables which can handle 125 Mbaud.
Multitransition: MLT-3
The multiline transmission, three-level (MLT-3) scheme uses three levels (+V, 0, and −V)
and three transition rules to move between the levels.
1. If the next bit is 0, there is no transition.
2. If the next bit is 1 and the current level is not 0, the next level is 0.
3. If the next bit is 1 and the current level is 0, the next level is the opposite of the last
nonzero level.
Multitransition: MLT-3
• Block coding normally involves three steps: division, substitution, and combination
• In the division step, a sequence of bits is divided into groups of m bits. For example,
in 4B/5B encoding, the original bit sequence is divided into 4-bit groups.
• In the substitution step, we substitute an m-bit group with an n-bit group. For
example, in 4B/5B encoding we substitute a 4-bit group with a 5-bit group.
• In the combination step, the n-bit groups are combined to form a stream. The new
stream has more bits than the original bits.
4B/5B (four binary/five binary)
• NRZ-I has a good signal rate. But it has a synchronization problem. A long
sequence of 0s can make the receiver clock lose synchronization.
• The 4B/5B scheme achieves this goal. The block-coded stream does not have more
that three consecutive 0s.
• At the receiver, the NRZ-I encoded digital signal is first decoded into a stream of
bits and then decoded to remove the redundancy.
4B/5B (four binary/five binary)
• The first two columns pair a 4-bit group with a 5-bit group.
• A group of 4 bits can have only 16 different combinations. while a group of 5 bits can
have 32 different combinations.
• This means that there are 16 groups that are not used for 4B/5B encoding. Some of these
unused groups are used for control purposes; the others are not used at all. The latter
provide a kind of error detection.
8B/10B (eight binary/ten binary)
• Similar to 4B/5B encoding except that a group of 8 bits of data is now substituted
by a 10-bit code. Provides greater error detection capability than 4B/5B.
• The 8B/10B block coding is actually a combination of 5B/6B and 3B/4B encoding
• The five most significant bits of a 10-bit block are fed into the 5B/6B encoder; the
three least significant bits are fed into a 3B/4B encoder. The split is done to
simplify the mapping table.
• To prevent a long run of consecutive 0s or 1s, the code uses a disparity controller
which keeps track of excess 0s over 1s (or 1s over 0s)
2^10 − 2^8 = 768 redundant groups that can be used for disparity checking and error
detection.
Scrambling – convert digital data to digital signal
Scrambling is a technique that does not increase the number of bits and does provide
synchronization. Problem with technique like Bipolar AMI(Alternate Mark Inversion)
is that continuous sequence of zero‟s create synchronization problems one solution to
this is Scrambling.
There are two common scrambling techniques:
• B8ZS(Bipolar with 8-zero substitution)
• HDB3(High-density bipolar3-zero)
B8ZS (Bipolar with 8-zero substitution)
It is commonly used in North America. eight consecutive zero-level voltages are replaced
by the sequence 000VB0VB (V- violation and B-bipolar)
1. If the number of nonzero pulses after the last substitution is odd, the substitution
pattern will be 000V, which makes the total number of nonzero pulses even.
2. If the number of nonzero pulses after the last substitution is even, the substitution
pattern will be B00V, which makes the total number of nonzero pulses even.
Techniques
1. Pulse Code Modulation (PCM)
2. Delta Modulation (DM)
https://www.youtube.com/watch?v=cmc-BPtkdAU
Example
Example
Pulse Code Modulation (PCM)
• A technique by which analog signal gets converted into digital form
• A PCM encoder has three processes:
1. Sampling
2. Quantization
3. Binary encoding
Sampling
• The process of obtaining amplitudes of a signal at regular intervals.
• Analog signal is sampled every TS secs.
• Ts is referred to as the sampling interval.
• fs = 1/Ts is called the sampling rate or sampling frequency (is the number
of samples per second).
• There are 3 sampling methods:
– Ideal - an impulse at each sampling instant
– Natural - a pulse of short width with varying amplitude
– Flattop - sample and hold, like natural but with single amplitude value
• The sampling process is sometimes referred to as pulse amplitude
modulation (PAM)..
Ts
4.73
Figure 4.22 Three different sampling methods for PCM
4.74
Note
Impulse/Ideal sampling can be performed by multiplying input signal x(t) with impulse train of
period 'T'. Here, the amplitude of impulse changes with respect to amplitude of input signal x(t)
Natural sampling is similar to impulse sampling, except the impulse train is replaced by
pulse train of period T.
Flat top: Here, the top of the samples are flat i.e. they have constant amplitude. Hence,
it is called as flat top sampling or practical sampling. Flat top sampling makes use of
sample and hold circuit.
Sampling Rate
Note
4.77
Example 4.6
For an intuitive example of the Nyquist theorem, let us sample a simple sine wave
at three sampling rates:
fs = 4f (2 times the Nyquist rate),
fs = 2f ( Nyquist rate), and
fs = f (one-half the Nyquist rate). Figure 4.24 shows the sampling and the
subsequent recovery of the signal.
It can be seen that sampling at the Nyquist rate can create a good
approximation of the original sine wave (part a).
Oversampling in part b can also create the same approximation, but it is redundant
and unnecessary.
Sampling below the Nyquist rate (part c) does not produce a signal that looks like
the original sine wave.
4.78
Figure 4.24 Recovery of a sampled sine wave for different sampling rates
4.79
Example 4.9
Telephone companies digitize voice by assuming a maximum frequency of 4000 Hz. The
sampling rate therefore is 2x4000= 8000 samples per second.
Example 4.10
A complex low-pass signal has a bandwidth of 200 kHz. What is the minimum sampling
rate for this signal?
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 4.11
A complex bandpass signal has a bandwidth of 200 kHz. What is the minimum sampling
rate for this signal?
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.
Example 4.9
Let us assume, VOIP application digitize voice by assuming a maximum frequency of
7000 Hz. What is the sampling rate?
• 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
+20
-20
Quantization
• Assume we have a voltage signal with amplitudes Vmin=-20V and
Vmax=+20V.
• 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
Rounding off of the signal to its nearest level-quantization level
Levels
7 +20
6 15
5 10
4
5
0
3
-5
2 -10
1 -15
0 -20
Quantization
Assigning Codes to Zones
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 = log2 8 =3
• Digital representation: 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.
101 110
4.86
Figure 4.26
Quantization
nine samples
10 11 11 11 10 01 00 01
Quantization
Note: The choice of L, the number of levels, depends on the range of the amplitudes of the analog
signal and how accurately we need to recover the signal.
• If the amplitude of a signal fluctuates between two values only, we need only two levels.
• In audio digitizing, L is normally chosen to be 256;
• If the signal, like voice, has many amplitude values, we need more quantization levels.
• In video it is normally thousands.
Example
• If the input value is also at the middle of the zone, there is no quantization error;
otherwise, there is an error.
• The normalized amplitude of the third sample is 3.24, but the normalized
quantized value is 3.50. This means that there is an error of 3.50-3.24= +0.26.
4.91
Quantization Error and SNQR
• SNR is actually the ratio of what is wanted (signal) to what is not wanted (noise).
A high SNR means the signal is less corrupted by noise; a low SNR means the
signal is more corrupted by noise.
• Shannon Capacity: To determine the theoretical highest data rate for a noisy
channel:
• The quantization error changes the signal-to-noise ratio of the signal, which
in turn reduces the upper limit capacity according to Shannon
• It can be proven that, the Quantization error to the SNRdB of the signal
depends on the number of quantization levels L, or the bits per sample nb,
We can use the formula to find the quantization. We have eight levels and 3 bits
per sample, so SNRdB = 6.02(3) + 1.76 = 19.82 dB.
Example 4.13
A telephone subscriber line must have an SNRdB above 40. What is the minimum
number of bits per sample?
Solution
We can calculate the number of bits as Telephone companies usually assign 7 or 8 bits
per sample.
SNRdB = 6.02nb + 1.76
6.02nb+1.76=40
nb=(40-1.76)/6.02 =6.35
Uniform Versus Nonuniform Quantization
• In nonuniform, the height of Δ is not fixed; it is greater near the lower amplitudes and less
near the higher amplitudes.
• Nonuniform quantization can also be achieved by using a process called companding and
expanding
• Companding means reducing the instantaneous voltage amplitude for large values; expanding
is the opposite process.
Companding refers to a technique for compressing and then expanding (or decompressing) an
analog or digital signal.
Original Signal Recovery (PCM Decoder)
To recover an analog signal from a digitized signal we follow the
following steps:
• The decoder first uses circuitry to convert the code words into a pulse
that holds the amplitude until the next pulse.
• After the staircase signal is completed, it is passed through a low-pass
filter to smooth the staircase signal into an analog signal.
• The filter has the same cutoff frequency as the original signal at the
sender.
The higher the value of L, the less distorted a signal is recovered.
Bit rate and bandwidth requirements of PCM
• A digitized signal will always need more bandwidth than the original
analog signal. Price we pay for robustness and other features of digital
transmission.
4.96
Example 4.14
Solution
The human voice normally contains frequencies from 0
to 4000 Hz. So the sampling rate and bit rate are
calculated as follows:
4.97
Delta Modulation (DM) – Analog to Digital
step size is
constant
• 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.
The process records the small positive or negative changes, called delta δ. If the delta
is positive, the process records a 1; if it is negative, the process records a 0.
Delta Modulation (DM)
• The modulator, at each sampling interval, compares the value of the analog signal
with the last value of the staircase signal. If the amplitude of the analog signal is
larger, the next bit in the digital data is 1; otherwise, it is 0.
• The output of the comparator, however, also makes the staircase itself. If the next bit
is 1, the staircase maker moves the last point of the staircase signal δ up; if the next
bit is 0, it moves it δ down.
• Delay unit - to hold the staircase function for a period between two comparisons.
Delta Modulation (DM)
The demodulator takes the digital data and, using the staircase maker and the delay
unit, creates the analog signal. The created analog signal, however, needs to pass
through a low-pass filter for smoothing.
Error Detection- Introduction
• For most applications, a system must guarantee that the data received are
identical to the data transmitted.
• Some applications can tolerate a small level of error. For example, random
errors in audio or video transmissions may be tolerable, but when we
transfer text, we expect a very high level of accuracy.
• Whenever bits flow from one point to another, they are subject to
unpredictable changes because of interference (change the shape of the
signal).
Dataword:1001000
Divisor: 1011
10.
Figure 10.16 Division in the CRC decoder for two cases
10.
Assume the data to be transmitted is
Data: 100100
Divisor:1101
Sender 100100 000 (one number less than the divisor)
111101
1101 100100000
1101
1000
1101 Sender sends the codeword to receiver:
1010 100100001
1101
1110
1101
0110
0000
1100
1101
001
Assume the data to be transmitted is
Data: 100100
Divisor:1101
Receiver received 100100001
111101
1101 100100001
1101
1000
1101
1010
1101
1110
1101
0110
0000
1101
1101
Syndrome=0 ---- no errors
0000
CRC encoder and decoder
• The dataword has k bits (4 here); the codeword has n bits (7 here).
• The size of the dataword is augmented by adding n − k (3 here) 0s to the right hand side
of the word. The n-bit result is fed into the generator.
• The generator uses a divisor of size n − k + 1 (4 here), predefined and agreed upon.
• The generator divides the augmented dataword by the divisor (modulo-2 division).
• The quotient of the division is discarded; the remainder (r2r1r0) is appended to the
dataword to create the codeword.
Question
A bit stream 10011101 is transmitted using the standard CRC
method. The divisor is 1001.
• What is the actual bit string transmitted?
Polynomials
• We can use a polynomial to represent a binary word.
Note
• The degree of a polynomial is the highest power in the polynomial. For example, the
degree of the polynomial x6 + x + 1 is 6. Note that the degree of a polynomial is 1 less
than the number of bits in the pattern.
Addition: x5 + x4 + x2 Multiplication: x3 × x4 is x7
x6 + x4 + x2
x6 + x5 Division: x6/x3, or x3
Polynomials
1. The information sequence (x) =100100000. Write the corresponding polynomial
equation.
The divisor in a cyclic code is normally called the generator polynomial g(x) or
simply the generator.
Let Divisor / g(x)=x^3 + x+1. Consider the information sequence:1001000
1001000=x^6 +X^3
Sender
X^3+x
Note: we continue to divide until the degree of the remainder is less than the degree of
the divisor.
Let g(x)=x^3 + x+1. Consider the information sequence:1001011
1001011=x^6 +X^3
Receiver
X^3+x^1
0
Does CRC detect all errors (1 bit, 2bits and burst errors) ?
• Divisor polynomial (generator): x^2 which corresponds to 1 0 0 and
• After appending CRC bits ( when we divide 101011 with the generator 100 , CRC is
0 0) we get 1 0 1 0 1 0 0 0.
• Assuming during the data transmission, the 3rd bit is in error and the message received
at the receiver is 1 0 1 0 1 ˆ1 0 0. On performing CRC check on 1 0 1 0 1 1 0 0, we see
that the remainder is zero and the receiver wrongly concludes that there is no error in
transmission
• The reason this error is undetected by the receiver is that the message received is
perfectly divisible by the divisor 1 0 0.
Message received = 1 0 1 0 1 1 0 0
Message received = message transmitted + error polynomial, i.e.,
1 0 1 0 1 1 0 0= 1 0 1 0 1 0 0 0 + 0 0 0 0 0 1 0 0
Does CRC detect all errors (1 bit, 2bits and burst errors) ?
Divisor: 1 0 0
Message received = 1 0 1 0 1 1 0 0
Message received = message transmitted + error polynomial, i.e.,
1 0 1 0 1 1 0 0= 1 0 1 0 1 0 0 0 + 0 0 0 0 0 1 0 0
100 ) 1 0 1 0 1 1 0 0
000
• Clearly both are divisible by the divisor 1 0 0. In general, if the error polynomial is
divisible by the divisor, then such errors are undetected by the receiver. The receiver
wrongly concludes that there is no error in transmission
If the divisor is 1 0 1, then both errors are detected by the receiver. Thus,
choosing an appropriate divisor is crucial in detecting errors at the
receiver if any during the transmission.
Cyclic Code Analysis
• We can analyze a cyclic code to find its capabilities by using polynomials.
We define the following, where f(x) is a polynomial with binary
coefficients.
Dataword: d(x) Codeword: c(x) Generator: g(x) Syndrome: s(x) Error: e(x)
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.
Cyclic Code Analysis
In our analysis we want to find the criteria that must be imposed on the
generator, g(x) to detect the type of error we especially want to be detected.
The received codeword is the sum of the sent codeword and the error.
Received codeword = c(x) + e(x)
The receiver divides the received codeword by g(x) to get the syndrome.
In a cyclic code, those e(x) errors that are divisible by g(x) are not caught.
• Single-Bit Error
• Two Isolated Single-Bit Errors
• Odd Numbers of Errors
• Burst Errors
Note on Polynomials
• If a polynomial has no factors other than 1 and itself, it is a prime
polynomial or an Irreducible Polynomial.
https://www.ece.unb.ca/tervo/ee4253/polytable.shtml
http://www.ee.unb.ca/cgi-bin/tervo/factor.pl?binary=11000001
Cyclic Code Analysis
If the generator has more than one term and the coefficient of x0 is 1,
all single errors can be caught.
Solution
a. All values of i make xi divisible by g(x). xi/1
No single-bit error can be caught. This g(x) is useless.
In another way,
If we make G(x) not prime but a multiple of (x+1), then E(x) can't be divided by G(x). can
detect all odd no. of errors.
• We can show this type of error as e(x) = xj + xi. The values of i and j define
the positions of the errors, and the difference j − i defines the distance
between the two errors,
e(x) = xj + xi.
We can write e(x) = xi(xj–i + 1).
Two Isolated Single-Bit Errors
If g(x) has more than one term and one term is x0, it cannot divide xi, as we saw in the
previous section. g(x) = more than one term +1 xi / (more than one term + 1)
• where L is the length of the error. All burst errors with length
smaller than or equal to the number of check bits r will be
detected
Burst Errors
Standard polynomials
The divisor polynomials are such that it detects almost all odd bit errors and a few even
bit errors. The commonly used polynomials in the literature are
Note
• Asynchronous Transfer Mode and refers to a communication protocol which can be used to
transfer data, videos and speech.
• ATM adoption layer is basically a software layer that accepts user data, which may be digitized
voice, video or computer data, and makes them suitable for transmission over an ATM network.
• HDLC is a group of data link (Layer 2) protocols used to transmit synchronous data packets
between point-to-point nodes.
Access Control
• When nodes or stations are connected and use a common link, called a
multipoint or broadcast link, we need a multiple-access protocol to
coordinate access to the link.
• At time t1, station B senses the medium and finds it idle, so it sends a
frame.
• At time t2 (t2 > t1), station C senses the medium and finds it idle because,
at this time, the first bits from station B have not reached station C. Station
C also sends a frame.
• Vulnerable Time= Propagation time (the time needed for a signal to
propagate from one end of the medium to the other)
CSMA
• The vulnerable time for CSMA is the propagation time Tp. This is the time
needed for a signal to propagate from one end of the medium to the other.
Persistence Methods
What should a station do if the channel is busy? What should a station do
if the channel is idle?
• 1-Persistent: After the station finds the line idle, it sends its frame
immediately. This method has the highest chance of collision.
• Nonpersistent: A station that has a frame to send senses the line. If the line
is idle, it sends immediately. If the line is not idle, it waits a random amount
of time and then senses the line again. It reduces the chance of collision. it
is unlikely that two or more stations will wait the same amount of time
and retry to send simultaneously
Persistence Methods
P-Persistent
In this method, after the station finds the line idle it follows these steps:
1. With probability p, the station sends its frame.
2. With probability q = 1 − p, the station waits for the beginning of the next
time slot and checks the line again.
a. If the line is idle, it goes to step 1.
b. If the line is busy, it acts as though a collision has occurred and uses the
backoff procedure.
P=0.3
R=0.2
R=0.8
CSMA/CD
Send
Station
Listen to the medium
1. We need to sense the channel before we start sending the frame by using one
of the persistence processes (nonpersistent, 1-persistent, or p-persistent).
• At time t1, station A has executed its persistence procedure and starts
sending the bits of its frame.
• At time t2, station C has not yet sensed the first bit sent by A.
• Station C executes its persistence procedure and starts sending the bits in its
frame, which propagate both to the left and to the right.
• The collision occurs sometime after time t2.
• Station C detects a collision at time t3 when it receives the first bit of A‟s
frame. Station C immediately aborts transmission.
• Station A detects collision at time t4 when it receives the first bit of C‟s
frame; it also immediately aborts transmission
CSMA/CD
CSMA/CD
Transmit and Listening to medium
G - the average number of frames generated by the system during one frame
transmission time
• For the 1-persistent method, the maximum throughput is around 50 percent
when G = 1.
• For the nonpersistent method, the maximum throughput can go up to 90
percent when G is between 3 and 8.
CSMA/CA
• Invented for wireless networks (wlan (IEEE 802.11) uses).
• Collisions are avoided through the use of CSMA/CA‟s three strategies:
– the interframe space
– the contention window
– acknowledgments
Send
Frame
• Acknowledgment: The positive acknowledgment and the time-out timer can help
guarantee that the receiver has received the frame
CSMA/CA Flow Diagram
Continuous checking