Transcript ch8

Computer Networks and Internets, 5e
By Douglas E. Comer
Lecture PowerPoints
By Lami Kaya, [email protected]
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
1
Chapter 8
Reliability
and
Channel Coding
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
2
Topics Covered
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
8.1 Introduction
8.2 The Three Main Sources of Transmission Errors
8.3 Effect of Transmission Errors on Data
8.4 Two Strategies for Handling Channel Errors
8.5 Block and Convolutional Error Codes
8.6 An Example Block Error Code: Single Parity Checking
8.7 The Mathematics of Block Error Codes and (n, k) Notation
8.8 Hamming Distance: A Measure of a Code's Strength
8.9 The Hamming Distance Among Strings in a Codebook
8.10 The Tradeoff Between Error Detection and Overhead
8.11 Error Correction with Row and Column (RAC) Parity
8.12 The 16-Bit Checksum Used in the Internet
8.13 Cyclic Redundancy Codes (CRCs)
8.14 An Efficient Hardware Implementation of CRC
8.15 Automatic Repeat reQuest (ARQ) Mechanisms
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
3
İşlenecek Konular
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
8.1 Giriş
8.2 İletim hatalarının üç ana kaynağı
8.3 iletim hatalarının veri üzerine etkisi
8.4 Kanal hatalarının yakalanmasında iki strateji
8.5 Block ve Convolutional hata kodları
8.6 Block hata koduna bir örnek: Single Parity Checking
8.7 Block hata kodlarının matematiği ve (n, k) gösterimi
8.8 Hamming uzaklığı: kodlarının gücünün hesaplanması
8.9 Hamming uzaklığı Among Strings in a Codebook
8.10 Hata tespiti ve buna bağlı ekstra yüklerin arasındaki denge
8.11 Error Correction with Row and Column (RAC) Parity
8.12 Internette kullanılan 16-bitlik checksum
8.13 Cyclic Redundancy Codes (CRCs)
8.14 CRC nin etkili donanım implementasyonu
8.15 Automatic Repeat reQuest (ARQ) Mechanisms
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
4
8.1 Introduction
• This chapter
– continues the discussion by examining errors that can occur during
transmission and techniques that can be used to control errors
– The concepts presented here
• are fundamental to computer networking
• and are used in communication protocols at many layers of the stack
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
5
8.1 Giriş
• Bu bölümde
– İletim sırasında meydana gelen hataların incelenmesi ve onların
kontrol edilme tekniklerinin incelenmesine devam edilecek
– Burada sunulan kavramlar
• Bilgisayar ağları için temel teşkil eder
• Yığının pek çok katmanında ki haberleşme protokolleri için kullanılır
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
6
8.2 The Three Main Sources of
Transmission Errors
• All data communications systems are susceptible to errors
– some of the problems are inherent in the physics of the universe
– and some result either from devices that fail or from equipment that
does not meet the engineering standards
• Small errors that occur during transmission are more difficult
to detect than complete failures
– We need ways/mechanisms to control and recover from such errors
• There are three main categories of transmission errors:
• Interference
– electromagnetic radiation emitted from devices such as electric
motors
– and background cosmic radiation
– can cause noise that can disturb radio transmissions and signals
traveling across wires
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
7
8.2 İletim hatalarının üç ana kaynağı
• Bütün veri haberleşme sistemleri hatalara karşı hassastır
– Bazı problemler evrenin fiziğinden türer
– Ve bazıları araçların bozulması veya mühendislik standartlarıyla
uyuşmayan araçlardan oluşur
• İletim sırasında oluşan küçük hataların tespiti bütün
bozukluklardan daha zordur
– Bu tip hataları kontrol etmek ve geri düzeltmek için mekanizmalara
ihtiyacımız vardır
• İletim hatalarının üç ana kategorisi vardır:
• Karışım (Interference)
– Araçlardan emilen elektromanyetik radyasyon – elektrik motorları gibi
– and background cosmic radiation
– Kablolardan iletilen sinyallerin ve radyo iletiminin bozulmasına sebep
olan gürültü ye sebep olur
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
8
8.2 The Three Main Sources of
Transmission Errors
•
Distortion
– All physical systems distort signals
– As a pulse travels along an optical fiber, the pulse disperses
– Wires have properties of capacitance and inductance
• that block signals at some frequencies while admitting signals at other
frequencies
– Placing a wire near a large metal object can change the set of
frequencies that can pass through the wire
– Metal objects can block some frequencies of radio waves, while
passing others
•
Attenuation
– As a signal passes across a medium, the signal becomes weaker
• signals on wires or optical fibers become weaker over long distances, just as
a radio signal becomes weaker with distance
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
9
8.2 İletim hatalarının üç ana kaynağı
•
(Bozulma)Distortion
– Bütün fiziksel sistemler sinyalleri bozarlar
– Bir fiber optik boyunca bir sinyal hareket ederken, sinyal
dağılır(disperse)
– Kablolar capacitance (kapasitans) ve inductance (indüktans)
özelliklerine sahiptir
• Diğer frekanslardaki sinyallerin girmesine izin verirken, bazı frekanslardaki
sinyalleri bloke eder.
– Bir kabloyu büyük bir metal nesnenin yanına yerleştirmek, kablonun
içinden geçen sinyallerin frekansını değiştirebilir
– Metal objeler radyo dalgalarının frekansını bloke edebilir
•
(Zayıflama)Attenuation
– Bir sinyal ortamlar arasından geçerken, sinyal zayıflar
• Kablo veya fiber optiklerin üzerindeki sinyaller uzun mesafelerde zayıflar, bir
radyo sinyali uzaklıkla birlikte zayıflar
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
10
8.2 The Three Main Sources of
Transmission Errors
• Shannon's Theorem suggests one way to reduce errors:
– increase the signal-to-noise ratio (either by increasing the signal or
lowering noise if possible)
• Mechanisms like shielded wiring can help lower noise
• Physical transmission system is always susceptible to errors
– it may not be possible to change the signal-to-noise ratio
• Noise/interference cannot be eliminated completely
– But many transmission errors can be detected
– In some cases, errors can be corrected automatically
• We will see that error detection adds overhead
• Error handling is a tradeoff
– in which a system designer must decide whether a given error is
likely to occur, and if so, what the consequences will be
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
11
8.2 İletim hatalarının üç ana kaynağı
• Shannon's Theorem hataları düşürmek için bir yol
önermiştir:
– Sinyalin gürültüye oranını yükseltmek (sinyali yükselterek veya
mümkün ise gürültüyü azaltmak ile)
• Kabloları kalkanlama mekanizması gürültüyü azaltabilir
• Fiziksel iletim sistemleri genellikle hatalara karşı hassastır
– Sinyal gürültü oranını değiştirmek mümkün olmayabilir
• Gürültü/karışım dan tam olarak elimine edilemeyebilir
– Fakat pekçok iletim hatası tespit edilir
– Bazı durumlarda, hatalar otomatik olarak düzeltilebilir
• Hata tespiti ek olarak bazı yükler ortaya çıkarır
• hata yakalama bir tradeoff dur
– in which a system designer must decide whether a given error is
likely to occur, and if so, what the consequences will be
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
12
8.3 Effect of Transmission Errors on Data
• Figure 8.1 lists the three principal ways transmission errors
affect data
• The figure points out that an underlying transmission error
often manifests itself as a specific data error
– For example, extremely short duration interference, called a spike, is
often the cause of a single bit error
– Longer duration interference or distortion can produce burst errors
– Sometimes a signal is neither clearly 1 nor clearly 0, but falls in an
ambiguous region, which is known as an erasure
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
13
8.3 Veri üzerine iletim hatalarının etkisi
• Figure 8.1 iletim hatalarının veriye olan etkisini 3 prensiple
listelemiştir
• The figure points out that an underlying transmission error
often manifests itself as a specific data error
– Örnek olarak; çok kısa süren karışım, spike olarak adlandırılır, tek
bitlik hataya sebep olur
– Uzun süren karışım veya bozulma burst (birden fazla bitlik) hataları
üretebilir
– Bazen bir sinyal açık olarak 1 veya 0 değildir,fakat belirsiz bir alana
düşer ki bu erasure (silinmiş yer) olarak adlandırılır
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
14
8.3 Veri üzerine iletim hatalarının etkisi
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
15
8.3 Effect of Transmission Errors on Data
• For a burst error, the burst size, or length, is defined as the
number of bits from the start of the corruption to the end of
the corruption
• Figure 8.2 illustrates the definition
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
16
8.3 Veri üzerine iletim hatalarının etkisi
• Burst hatası için, burst boyutu ve uzunluğu bozulmanın
başladığı yerden bittiği yere kadar bit sayısı olarak belirlenir
• Figure 8.2 tanımı gözterir
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
17
8.4 Kanal hatasını yakalamada iki strateji
• İletim esnasındaki hataların üstesinden gelmek ve
güvenilirliği artırmak için pekçok değişik matematiksel teknik
vardır
– Kanal kodlama olarak bilinir
• Teknikler iki kategoriye ayrılır:
– Forward Error Correction (FEC) mekanizması(ileri hata düzeltme)
– Automatic Repeat reQuest (ARQ) mekanizması(otomatik istek
yenileme)
• FEC deki ana fikir ileriye dönül çalışmasıdır:
– Alıcının veriyi doğru aldığını doğrulama ve eğer olursa hataları
düzelmesi için, veriye ekstra bilgiler eklenir
• Figure 8.3 FEC mekanizmasını gösterir
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
18
8.4 Kanal hatasını yakalamada iki strateji
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
19
8.4 Two Strategies for Handling Channel
Errors
• Basic error detection mechanisms allow a receiver to detect
when an error has occurred;
• FEC mechanisms allow a receiver to determine
– exactly which bits have been changed and to compute correct values
• The second approach to channel coding, known as an ARQ,
– requires the cooperation of a sender; a sender and receiver
exchange messages to insure that all data arrives correctly
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
20
8.4 Kanal hatasını yakalamada iki strateji
• Basit hata tespiti mekanizması alıcının hata olduğunu tespit
etmesine imkan sağlar;
• FEC mechanism alıcının karar vermesine izin verir
– Tam olarak hangi bitin değiştiği ve doğru olanı hesaplama
• İkinci yaklaşım ARQ dur,
– Gönderinin birlikte çalışması gerekir, gönderen ve alan birbirlerine
bütün verinin doğru iletildiğine dair mesaj yollamasıdır
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
21
8.5 Block and Convolutional Error Codes
• The two types of FEC techniques satisfy separate needs:
• Block Error Codes
– It divides the data to be sent into a set of blocks
– It attaches extra information known as redundancy to each block
– The encoding for a given block of bits depends only on the bits
themselves, not on bits that were sent earlier
– They are memoryless in the sense that the encoding mechanism
does not carry state information from one block of data to the next
•
Convolutional Error Codes
– It treats data as a series of bits, and computes a code over a
continuous series
– Thus, the code computed for a set of bits depends on the current
input and some of the previous bits in the stream
– Convolutional codes are said to be codes with memory
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
22
8.5 Block ve Convolutional hata kodları
• İki tip FEC tekniği ayrı ayrı şu durumları kapsamalıdır:
• Block Error Codes
– Gönderilecek veriyi blok kümelerine böler
– Redundancy olarak bilinen ekstra bilgiyi her bloğa ekler
– Verilen bir bloğun bitleri için şifreleme sadece kendi bitlerine bağlıdır,
önceden gönderilenlere değil
– Hafızasız (memoryless) dırlar. Bir şifreleme mekanizması bir blok
veriden diğerine herhangi bir bilgi taşımaz
•
Convolutional Error Codes
– Veriyi bitler serisi olarak ele alır, ve continuous(sürekli) seri ler
üzerinden bir kod hesaplar.
– Böylece, bir bitler kümesi için bazı önceki bitler ve mevcut inputa
bağlı bir kod hesaplanır
– Convolutional kodlar hafıza ile kodlar olarak söylenir
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
23
8.6 An Example Block Error Code: Single
Parity Checking
• How can additional information be used to detect errors?
– consider a single parity checking (SPC) mechanism
• One form of SPC defines a block to be an 8-bit unit of data
(i.e., a single byte)
– On the sending side, an encoder adds an extra bit, called a parity bit,
to each byte before transmission
– A receiver uses parity bit to check whether bits in the byte are correct
– Before parity can be used, the sender and receiver must be
configured for either even parity or odd parity
• Figure 8.4 lists examples of data bytes and the value of the
parity bit that is sent when using even or odd parity
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
24
8.6 An Example Block Error Code: Single
Parity Checking
• Ek bilgiler hata tespit etmede nasıl kullanılır?
– single parity checking (SPC) mekanizmasını düşünün
• SPC nin bir formu, 8 bit birim verisi olan bir blok tanımlar
(i.e., tak bir byte)
– Gönderen tarafında, encoder extra bir bit ekler, parity bit ismiyle
adlandırılır, iletimden önce her byte için
– Alıcı byte ın içindeki bitlerin doğruluğunu bulmak için parity biti
kullanır.
– Parity kullanılmadan önce, gönderen ve alan even veya odd parity
den biri için konfigüre edilmelidir.
• Figure 8.4 lists examples of data bytes and the value of the
parity bit that is sent when using even or odd parity
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
25
8.6 An Example Block Error Code:
Single Parity Checking
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
26
8.6 An Example Block Error Code:
Single Parity Checking
• SPC is a weak form of channel coding that can detect errors
– but cannot correct errors
• An even parity mechanism can only handle errors where an
odd number of bits are changed
– If one of the nine bits (including the parity bit) is changed during
transmission, the receiver will declare that the incoming byte is
invalid
– However, if a burst error occurs in which two, four, six, or eight bits
change value, the receiver will incorrectly classify the incoming byte
as valid
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
27
8.6 An Example Block Error Code:
Single Parity Checking
• SPC hataları tespit etmede kanal kodlamanın zayıf bir
formudur
– Fakat hataları düzeltemeybilir
• Even parity mekanizması, tek sayıdaki bitler değiştiği zaman
hataları yakalayabilir
– Eğer 9 bit den herhangi biri iletim sırasında değişirse, alıcı gelen
byte ın geçersiz olduğunu ifade eder.
– Eğer 2,4,6,8 bitlerde değişiklik olursa, yani burst hata olursa, alıcı
yanlış olarak sınıflandırma yapıp, gelen byte ı uygun olarak alır.
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
28
8.7 The Mathematics of Block Error
Codes and (n, k) Notation
• Mathematically
– we define the set of all possible messages to be a set of datawords
– and define the set of all possible encoded versions to be a set of
codewords
• If a dataword contains k bits and r additional bits are added
to form a codeword, we say that the result is an
(n, k) encoding scheme
– where n = k + r
• The key to successful error detection lies in choosing a
subset of the 2 possible combinations that are valid
codewords
– The valid subset is known as a codebook
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
29
8.7 The Mathematics of Block Error
Codes and (n, k) Notation
• Matematiksel
– Bir veri kelimelerinin kümesi olan bütün mümkün mesajlarının
kümesini tanımlarız
– Ve bir kod kelimelerinin kümesi olan bütün mümkün şifrelenmiş
versiyonlarının kümesini tanımlarız
• Eğer bir veri kelimesi k bit içeriyor ve ekstra r bit eklenerek
bir kod kelimesi oluşturuyorsa, sonucu şu şekilde
söyleyebiliriz
(n, k) şifreleme şeması
– where n = k + r
• The key to successful error detection lies in choosing a
subset of the 2 possible combinations that are valid
codewords
– Uygun altküme The valid subset is known as a codebook
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
30
8.7 The Mathematics of Block Error
Codes and (n, k) Notation
• As an example, consider SPC
• The set of datawords consists of any possible combination
of 8-bits
– Thus, k = 8 and there are 28 or 256 possible data words
– The set of n = 9 bits, so there are 29 or 512 possibilities
• However, only half of the 512 values form valid codewords
• Think of the set of all possible n-bit values and the valid
subset that forms the codebook
• If an error occurs during transmission
– one or more of the bits in a codeword will be changed, which will
either produce another valid codeword or an invalid combination
• For the example discussed above
– a change to a single bit of a valid codeword produces an invalid
combination, but changing two bits produces another valid codeword
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
31
8.7 The Mathematics of Block Error
Codes and (n, k) Notation
• Örnek olarak, SPC yi düşünelim
• 8 bitin kombinasyonundan oluşan veri kelimelerinin kümesi
– Thus, k = 8 ve 28 veya 256 mümkün veri kelimeleri
– n = 9 bit olursa, 29 veya 512 olasılık
• Böylece , sadece 512 nin yarısı kadar uygun kod kelimesi
• Muhtemel n bit le oluşan kümeyi ve kodbook u oluşturan
uygun altkümeleri düşünün
• Eğer iletim sırasında hata olursa
– Kod kelimesinde bir veya daha fazla bit değişecek, bu bir başka
uygun kod kelimesi oluşturacak yada bir uygun olmayan
kombinasyon
• Yukarda tartışılan örnek için
– Uygun kod kelimesinde ki bir bitlik değişiklik, uygun olmayan bir
kombinasyon üretir, fakat iki bitlik değişim, uygun bir kod kelimesi
yol açar
©oluşmasına
2009 Pearson Education
Inc., Upper Saddle River, NJ. All rights reserved.
32
8.8 Hamming Distance:
A Measure of a Code's Strength
• No channel coding scheme is ideal!
– changing enough bits will always transform to a valid codeword
• What is the minimum number of bits of a valid codeword
that must be changed to produce another valid codeword?
– To answer the question, engineers use a measure known as the
Hamming distance, named after a theorist at Bell Laboratories who
was a pioneer in the field of information theory and channel coding
• Given two strings of n bits each, the Hamming distance is
defined as the number of differences
• Figure 8.5 illustrates the definition
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
33
8.8 Hamming Distance:
A Measure of a Code's Strength
• Hiçbir Kanal kodlama tasarısı ideal değildir!
– Yeteri kadar bitin değişimi, herzaman uygun bir kod kelimesi
dönüştürecek
• Bir geçerli kod kelimesinin, yeni bir geçerli kod kelimesi
oluşturması için gerekli en az kaç tane biti değişmelidir?
– Soruyu cevapmak için, mühendisler Hamming distance, isminde bir
ölçüm kullanmışlar., named after a theorist at Bell Laboratories who
was a pioneer in the field of information theory and channel coding
• Verilen n bitlik her iki string için, hamming uzaklığı fark
olarak tanımlanır
• Figure 8.5 tanımı anlatır
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
34
8.8 Hamming Distance:
A Measure of a Code's Strength
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
35
8.8 Hamming Distance:
A Measure of a Code's Strength
• One way to compute the Hamming distance consists of
– taking the exclusive or (xor) between two strings
– and counting the number of 1 bits in the answer
• For example, consider the Hamming distance between
strings 110 and 011
– The xor of the two strings is:
which contains two 1 bits
– Therefore, the Hamming distance between 011 and 101 is 2
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
36
8.8 Hamming Distance:
A Measure of a Code's Strength
• Haming uzaklığını hesaplamak için.
– İki string arasında xor uygulanır
– Ve 1 lerin sayısı hesaplanır
• örneğin, 110 ve 011 arasındaki uzaklığa bakalım
– İki string in xor işlemi:
Sonuc 2 tane 1 içerir
– Bunun için, 011 ve 101 arasındaki uzaklık 2 dir.
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
37
8.9 The Hamming Distance Among
Strings in a Codebook
• Errors can transform a valid codeword into another valid
codeword
– To measure such transformations, we compute the Hamming
distance between all pairs of codewords in a given codebook
• Consider odd parity applied to 2-bit datawords
• Figure 8.6 lists the four (4) possible datawords
– the 4 possible codewords that result from appending a parity bit
– and the Hamming distances for pairs of codewords
• We use to denote the minimum Hamming distance, dmin
among pairs in a codebook
– The concept gives an answer to the question above
– How many bit errors can cause a transformation from one valid
codeword into another valid codeword?
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
38
8.9 Hamming uzaklığı Among Strings
in a Codebook
• Hatalar geçerli kodlu kelime(codeword )’den diğer geçerli
kodlu kelimeye değiştirilebilir
– Bu Değişimleri hesaplamak için, Bütün kodlu kelime çiftleri arasını
hamming uzaklığını hesaplayarak verilen kodlu kelimeyi bulabiliriz
• 2-bit dataword’e tek parite uygulamadığımızı hesaba katalım
• Şekil 8.6 olası 4 dataword’ünü listelemiştir
– Eklenen paritebitleri sonucu oluşabilecek 4 codeword’leri
– Ve Hamming uzaklığı codeword çiftleri için
• En küçük Hamming uzaklığını, göstermek dmin kullanırız
– Bu konsept yukarıdaki sorunun cevabını verir
– Geçerli bir codeword’ü geçerli bir diğer codeword’e çevirmek için, ne
kadarlık bit bozulması oluşması gerekir
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
39
8.9 The Hamming Distance Among
Strings in a Codebook
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
40
8.9 The Hamming Distance Among
Strings in a Codebook
• In the SPC example of Figure 8.6, the set consists of the
Hamming distance between each pair of codewords, and
dmin=2
– The definition means that there is at least one valid codeword that
can be transformed into another valid codeword, if 2-bit errors occur
during transmission
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
41
8.9 Hamming uzaklığı Among Strings
in a Codebook
• Şekil 8.6 daki SPC örneğinde, küme her çift codeword’ün
Hamming uzaklığını içerir ve dmin=2
– Bu şu manaya gelir, en az bir geçerli codeword mevcuttur ve bu
başka geçerli bir codeword’e çevrilebilir, eğer gönderimde sadece 2bitlik bir bozulma olursa
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
42
8.10 The Tradeoff Between Error
Detection and Overhead
• A large value of dmin is desirable
– because the code is immune to more bit errors, if fewer than dmin bits
are changed, the code can detect that error(s) occurred
• Equation 8.1 specifies the relationship between dmin and e,
the maximum number of bit errors that can be detected:
• A code with a higher value of dmin sends more redundant
information than an error code with a lower value of dmin
• Code rate that gives the ratio of a dataword size to the
codeword size as shown in Equation 8.2
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
43
8.10 Hata tespiti ve buna bağlı ekstra
yüklerin arasındaki denge
• Arzu edilen dmin ‘nin yüksek değerlerde olmasıdır
– Çünkü code daha fazla bite karşı bağışıklıdır, eğer dmin ‘den daha az
bit değiştiyse , code oluşan bu hataları ortaya çıkarabilir
• 8.1 deki denklem dmin ve e arasındaki ilişkiyi açıklar,
maksimum sayıdaki bit hataları saptanabilir
• Dmin den daha büyük olan code, dmin den daha küçük olan
code’tan daha fazla gereksiz bilgi gönderir
• Code oranı, 8.2 deki dataword’ün büyüklüğünün codeword’e
oranını verir
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
44
8.11 Error Correction with Row and
Column (RAC) Parity
• Imagine an array of 3-rows and 4-columns, with a parity bit
added for each row and for each column
– Figure 8.7 illustrates the arrangement, which is known as a Row and
Column (RAC) code
• Example RAC has n= 20, which means that it is a (20, 12) code
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
45
8.11 Hata Düzeltme Satır ve Sütun Paritesi
(RAC)
• 3 satır ve 4 kolonluk bir dizi hayal edin, parite bitleri her
kolon ve sütüna eklenmiş olsun
– Şekil 8.7 düzenlemeyi gösterir, ve genelde Satır ve Sütun code’u
olarak bilinir (RAC)
• Örnek RAC n=20, buda (20,12) lik kod manasına gelir
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
46
8.11 Error Correction with Row and
Column (RAC) Parity
• How error correction works? Assume that one of the bits in
Figure 8.7 (below) is changed during transmission:
– When the receiver arranges the bits into an array and parity bits are
recalculated
• two of the calculations will disagree with the parity bits received, as Figure
8.8 illustrates
• a single bit error will cause two calculated parity bits to disagree with the
parity bit received
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
47
8.11 Hata Düzeltme Satır ve Sütun Paritesi
(RAC)
• Hata doğrulama nasıl çalışır? Şekil 8.7 deki bir bitin
gönderim aşamasında değiştiğini farzedin
– Alıcı dizideki bitleri düzenlerken parite bitlerini yeniden hesaplalar
• Alıcı tarafındaki parite bitleri İki hesaplama birbiriyle uyuşmaz, şekil 8.8 deki
gösterildiği şekli ile
• Tek bir bit’in bozulması iki parite bitinin uyuşmaması ile hesaplanabili
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
48
8.11 Error Correction with Row and
Column (RAC) Parity
• The two disagreements correspond to the row and column
position of the error
• A receiver uses the calculated parity bits to determine
exactly which bit is in error, and then corrects the bit
– Thus, an RAC can correct any error that changes a single data bit
• What happens to an RAC code if an error changes more
than one bit in a given block?
• RAC can only correct single-bit errors
• In cases where two or three bits are changed
– an RAC encoding will be able to detect an odd number of errors
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
49
8.11 Hata Düzeltme Satır ve Sütun Paritesi
(RAC)
• İki anlaşmazlık satır ve sütün pozisyonundaki hatanın
oluştuğuna onay verir
• Alıcı parite bitlerini hesaplayarak hangi bitin değiştiğini
hesaplayabilir, ve sonra onu düzeltebilir
– Böylelikle, RAC her hatayı düzeltebilir (tek bir bitlik veriyi)
• Eğer verilen blokta bir bitten daha fazla bir bozulma varsa
ne olacak?
• RAC sadece bir bitlik hatayı düzetmek için kullanılır
• İki üç bitlik veriler değiştiği zaman ne olacak?
– RAC encoding tek sayıdaki hataları bulmak için kullanılabilir
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
50
8.12 The 16-Bit Checksum Used in the
Internet
• A particular coding scheme plays a key role in the Internet
– Known as the Internet checksum, the code consists of a 16-bit 1s
complement checksum
• The Internet checksum does not impose a fixed size on a
dataword
– the algorithm allows a message to be arbitrarily long
– and computes a checksum over the entire message
• The Internet checksum treats data in a message as a series
of 16-bit integers, as Figure 8.9 below illustrates
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
51
8.12 Internette kullanılan 16-bitlik
checksum
• Özel coding şeması internette önemli bir rol oynar
– Genelde internet checksum olarak bilinir, code 16-bit 1’in
tamamlayıcısı(complement ) checksum olarak bilinir
• Internet checksum dataword üzerinde eşit veri büyüklünü empoze etmez
– Algoritma mesajları keyfi uzunlukta olmasına izin verir
– Ve bütün mesaj üzerinden checksum hesaplaması yapılmasına izin verir
• Internet checksum mesajlar içerisindeki verilere 16-bitlik tamsayılar
şeklinde muamele eder, aşağıdakli Şekil 8.9 bunu gösterir
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
52
8.12 The 16-Bit Checksum Used in the
Internet
• To compute a checksum, a sender
– adds the numeric values of the 16-bit integers
– and it transmits the result
• To validate the message, a receiver performs the same
computation
• Algorithm 8.1 gives the details of the computation
– The checksum is computed in 1s complement arithmetic
– and uses 16 bit integers instead of 32 or 64 bit integers
• During the for loop, the addition may overflow
– Thus, following the loop, the algorithm adds the overflow (the highorder bits) back into the sum
• Why is a checksum computed as the arithmetic inverse of
the sum instead of the sum?
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
53
8.12 Internette kullanılan 16-bitlik
checksum
• Checksum hesaplamak için, gönderici
– 16-bitlik tamsayılara sayısal depğerler ekler
– Ve sonucu gönderir
• Mesajı onaylamak için, alıcı aynı işlemi yeniden
hesaplamalıdır
• 8.1 deki algoritma hesaplamadaki detayları detaylı olarak
verir
– Checksum 1’in tamamlayıcısı aritmetiğine göre hesaplanır
– Ve 32 ve 64 bit tam sayı aritmetiği yerine 16’lık kullanılır
• Döngü aşamasında, overflow (taşma)oluşabilir
– Bunun için aşağıdaki döngü, algoritma overflow olan veriyi geri
toplama ekler
• Neden checksum toplamın tersi aritmetiğine göre
hesaplanırda, toplama göre hesaplanmaz?
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
54
8.12 Internette kullanılan 16-bitlik
checksum
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
55
8.13 Cyclic Redundancy Codes (CRC)
• A form of channel coding known as a Cyclic Redundancy
Code (CRC) is used in high-speed data networks
• Key properties of CRC are summarized below
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
56
8.13 Cyclic Redundancy Codes (CRCs)
• Kanal kodlama formu olarak bilinen Cyclic Redundancy
Code (CRC) yüksek hızlı ağlarda kullanılır
• CRC’nin asıl özelliği aşağıda özetlenmiştir
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
57
8.13 Cyclic Redundancy Codes (CRC)
• Cyclic terimi codeword özelliğinde türemiştir:
– Codeword’teki bitlerin Dairesl kayması ile diğer bir tanesi oluşturulur
• Şekil 8.11 (Aşağıdaki) (7, 4) gösterir CRC by Hamming
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
58
8.13 Cyclic Redundancy Codes (CRC)
• CRC codes have been studied extensively
– A variety of mathematical explanations and computational
techniques have been produced
– The descriptions seem so disparate that it is difficult to understand
how they can all refer to the same concept
Principal views include:
• Mathematicians
– explain a CRC computation as the remainder from a division of two
polynomials with binary coefficients
• one representing the message and another representing a fixed divisor
• Theoretical Computer Scientists
– explain a CRC computation as the remainder from a division of two
binary numbers
• one representing the message and the other representing a fixed divisor
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
59
8.13 Cyclic Redundancy Codes (CRCs)
• CRC code kapsamlı şekilde çalışılmıştır
– Matematiksel tanımları değişlik gösterebilir ve hesaplama teknikleri
oluşturulabilir
– Açıklamalar görünebilir böylelikler hepsinin aynı konsepti gösterdiğini
açıklmak zorlaşır
En önemli görüşler:
• Matematikçiler
– İki polinomun İkili katsayı’ya bölünmesinden kalan form olarak
tanımlarlar CRC hesaplamasını
• Biri mesajı diperi sabit böleni temsil eder
• Teorik Bilgisayar Bilimadamları
– CRC hesaplamanın neden iki tane ikili sayının bölümünden kalanı
olduğunu açıklarlar
• Biri mesajı diperi sabit böleni temsil eder
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
60
8.13 Cyclic Redundancy Codes (CRC)
• Cryptographers
– explain a CRC computation as a mathematical operation in a Galois
field of order 2, written GF(2)
• Computer programmers
– explain a CRC computation as an algorithm that iterates through a
message
– and uses table lookup to obtain an additive value for each step
• Hardware architects
– explain a CRC computation as a small hardware pipeline unit that
takes as input a sequence of bits from a message
– and produces a CRC without using division or iteration
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
61
8.13 Cyclic Redundancy Codes (CRCs)
• Cryptographer (Şifre çözücüleri)
– CRC hesaplamasını matematiksel Galoa(2nin katı) alanı olarak
tanımlarlar, GF(2) şeklinde yazılır
• Bilgisayar programcıları
– Mesaj boyunca ilerleyen algoritmanın hesaplanması olarak bakarlar
• Donanım mimarları
– CRC hesaplamasını küçük donanım pipeline’ı şeklinde tanımlarlar
– Ve CRC iterasyon ve bölmeye gerek kalmaksızı üretilir
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
62
8.13 Cyclic Redundancy Codes (CRCs)
• As an example of the views above
– consider the division of binary numbers under the assumption of no
carries
• Figure 8.12 illustrates the division of 1010
– which represents a message, by a constant chosen for a specific
CRC, 1011
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
63
8.13 Cyclic Redundancy Codes (CRC)
• Yukarıda örnek verilen bakış açılarına göre
– İki sayıların bölümü olarak düşünün ve taşıma işleminin olmadığını
farzedin
• Şekil 8.12 1010 a bölümü gösterir
– Mesajı simgeler, sabitler CRC den seçilmiştir, 1011
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
64
8.13 Cyclic Redundancy Codes (CRC)
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
65
8.13 Cyclic Redundancy Codes (CRC)
• How can mathematicians view the above process as a
polynomial division?
– think of each bit in a binary number as the coefficient of a term in a
polynomial
• For example, we can think of the divisor in Figure 8.12,
1011, as coefficients in the following polynomial:
– Similarly, the dividend in Figure 8.12, 1010000, represents the
polynomial:
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
66
8.13 Cyclic Redundancy Codes (CRC)
• Matematikçilerin bakış açısı ile yukarıdaki hesaplamayı,
polinom bölmesi nasıl yapılır?
– Binary sayısındaki her bitin polinomda birer sabit olduklarını düşünü
– n
– Örnek olarak, Şekil 8.12 deki 1011 bölen olarak düşünebiliriz, ve
sabitler aşağıdaki polinomdur
– Benzer olarak,Şekil 8.12 deki bölünen 1010000, polinomu temsil
etsin:
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
67
8.13 Cyclic Redundancy Codes (CRC)
• Term generator polynomial to describe a polynomial that
corresponds to a divisor
– The selection of a generator polynomial is key to creating a CRC
with good error detection properties
• An ideal polynomial is irreducible (i.e., can only be divided
evenly by itself and 1)
• A polynomial with more than one non-zero coefficient can
detect all single-bit errors
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
68
8.13 Cyclic Redundancy Codes (CRC)
• Polinom oluşturucusu terimi ilgili bölen polinomunu temsil
eder
– Polinom oluşturucusununseçimi CRC deki önemli bir iştir ve iyi hata
algılama özelliğine sahiptir
• İdeal polinom azaltılamaz ( sadece kendine veya 1 e
bölünebilir)
• 0 olmayan sabitlere sahip olan polinomlar bütün tek-bitlik
hataları saptayabilir
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
69
8.14 An Efficient Hardware
Implementation of CRC
• CRC donanım shift ragister’ı exclusive(xor) şeklinde düzenlenir,yada
bitler arasındaki xor kapıları arasında düzenlenir
• Şekil 8.13 ilgili donanım için gerekli 3-bitlik CRC hesaplmasını gösteriri
(şekil8.12 de)
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
70
8.15 Automatic Repeat reQuest (ARQ)
Mechanisms
• Whenever one side sends a message to another, the other
side sends a short acknowledgement (ACK) message back
– For example, if A sends a message to B, B sends an ACK back to A
– Once it receives an ACK, A knows that the message arrived correctly
– If no ACK is received after T time units, A assumes the message
was lost and retransmits a copy
• ARQ is especially useful in cases of dealing with detecting
errors
– but not in cases for error correction
– many computer networks use a CRC to detect transmission errors
• An ARQ scheme can be added to guarantee delivery if a
transmission error occurs
– the receiver discards the message if an error occurs
– and the sender retransmits another copy
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
71
8.15 Automatic Repeat reQuest (ARQ)
Mechanisms
• Bir taraf diğer tarafa mesaj gönderdiği zaman, diğer taraf
mesajı aldığına dair geriye küçük onay (acknowledgement )
ACK mesajı gönderir.
– Mesela, eğer A B ye mesaj gönderdiyes, B de A ya ACK gönderir
– ACK alındıktan sonra, A mesajın doğru şekilde yerine ulaştığını anlar
– Eğer T zaman aralığında ACK gelmezse, A mesajın kaybolduğunu
farzeder ve mesajın bir kopyasını yeniden gönderir
• ARQ hata saptanan veri’nin üstesinden gelmek için
önemlidir
– fakat hata doğrulama yöntemi değildir
– Gönderim hatalarının saptanması için çoğu bilgisayar ağları CRC’yi
kullanır
• ARQ şeması gönderimin garantiye alınmasını salar, eğer
gönderim sırasında hata oluşmuşsa
– ©Eğer
hata oluşmuşsa
alıcı Saddle
paketiRiver,
atarNJ. All rights reserved.
2009 Pearson
Education Inc., Upper
72