220 likes | 707 Views
Error Detection. Objectives. Understand Transmission Errors Understand two dimensional parity Understand CRC and be able to work examples. Error Control Overview. Errors occur due to Noise or interference in the communication channel
E N D
Objectives • Understand Transmission Errors • Understand two dimensional parity • Understand CRC and be able to work examples
Error Control Overview • Errors occur due to • Noise or interference in the communication channel • Congestion in the network where packets musts be dropped • Error Control Strategies • Error Correcting codes (Forward Error Correction (FEC)) • Error detection and retransmission Automatic Repeat Request (ARQ)
Cyclic Redundancy Check • Add k bits of redundant data to an n-bit message. • Represent n-bit message as an n-1 degree polynomial; e.g., MSG=10011010 corresponds to M(x) = x7+ x4 + x3 + x1. • Let k be the degree of some divisor polynomial C(x); e.g., C(x) = x3+ x2 + 1.
CRC • Transmit polynomial P(x) that is evenly divisible by C(x), and receive polynomial P(x) + E(x); E(x)=0 implies no errors. • Recipient divides (P(x) + E(x)) by C(x); the remainder will be zero in only two cases: E(x) was zero (i.e. there was no error), or E(x) is exactly divisible by C(x). Choose C(x) to make second case extremely rare.
Example • Make all legal messages divisible by 3 • If you want to send 10 • First multiply by 4 to get 40 • Now add 2 to make it divisible by 3 = 42 • When the data is received .. • Divide by 3, if there is no remainder there is no error • If no error, divide by 4 to get sent message • If we receive 43, 44, 41, 40, then error • 45 would not be recognized as an error
Mod 2 Arithmetic review 1111 +1010 ===== 0101 11001 x 101 ===== 11001 + 11001 ========= 1111101
Sender: • multiply M(x) = x7+ x4 + x3 + x1by xk; for our example, we get • x10 + x7 + x6+ x4(10011010000); • divide result by C(x) (1101); Send 10011010000 + 101 = 10011010101, since this must be exactly divisible by C(x); 11111001 10011010000 Message 1101 1001 1101 1000 1101 1011 1101 1100 1101 1000 1101 101 Remainder Generator 1101
Want to ensure that C(x) does not divide evenly into polynomial E(x). • All single-bit errors, as long as the xkand x0 terms have non-zero coefficients. • All double-bit errors, as long as C(x) has a factor with at least three terms. • Any odd number of errors, as long as C(x) contains the factor (x + 1). • Any “burst” error (i.e sequence of consecutive errored bits) for which the length of the burst is less than k bits. • Most burst errors of larger than k bits can also be detected.
Even Parity Actually consists of using x+1 polynomial Given message 0111, multiply by x to get 01110 Now divide by x+1=11 11 01110 11 0010 11 1=remainder Message = 01110+1=01111 even parity 0101
Common polynomials for C(x): CRC CRC-8 CRC-10 CRC-12 CRC-16 CRC-CCITT CRC-32 C(x) x8+x2+x1+1 x10+x9+x5+x4+x1+1 x12+x11+x3+x2+x1+1 x16+x15+x2+1 x16+x12+x5+1 x32+x26+x23+x22+x16+x12+x11+x10+ x8+x7+x5+x4+x2+x+1
Internet Checksum Algorithm • Idea: view message as a sequence of 16-bit integers. • Add these integers together using 16-bit ones complement arithmetic, and then take the ones complement of the result. That 16-bit number is the checksum. • It is difficult to determine a way of changing the data and still generating the same checksum
u_short cksum(u_short *buf, int count) { register u_long sum = 0; while (count--) { sum += *buf++; if (sum & 0xFFFF0000) { /* carry occurred, so wrap around */ sum &= 0xFFFF; sum++; } } return ~(sum & 0xFFFF); }
Checksum Example • Message = 0xe123 0x2045, count=2 • sum = 0xE123 • sum += 0x2045 = 0x10168 • the carry can be at most one, so mask the high bits and add one • sum = 0x0168+1=0x0169 • return ~sum=0xFE96 • sent message= 0xe123 0x2045 0xFE96 • on receive sum=0x0169+0xFE96=0xFFFF • return ~sum=0 if there were no errors
Light For the word of the Lord is truth, and whatsoever is truth is light, and whatsoever is light is Spirit, even the Spirit of Jesus Christ. And the Spirit giveth light to every man that cometh into the world; and the Spirit enlighteneth every man through the world, that hearkeneth to the voice of the Spirit. [D&C 84:45–46]
What is this spirit? It is the light and the life of all things. It is the light and the life of man. It is the life of the animal creation. It is the life of the vegetable creation. It is in the earth . . . ; it is in the stars . . . ; it is in the moon . . . : it is in the sun, and is the light of the sun, and the power by which it was made; and these grosser particles of light that illuminate the heavens and enable us to behold the works of nature, are from that same Spirit which enlightens our minds and unfolds the things of God. As that light comes forth from the sun, so the light of God comes to us. [Charles W. Penrose, JD 26:21]
Wavelength Division Multiplexing The visible spectrum of light has a spiritual counterpart. The spiritual spectrum relates to various levels of intelligence, beginning with animal instinct and moving to more refined forms of light and truth. These gradations include man's reasoning ability and conscience, the light that comes through the Holy Ghost prior to baptism, and the light one receives through the gift of the Holy Ghost after entering the Lord's kingdom. Finally, a fullness of light is received when one has proven worthy of the Second Comforter and receives the "more sure word of prophecy" (2 Pet. 1:19; D&C 131:5). (The spiritual spectrum of light is based on statements by Parley P. Pratt in Key to the Science of Theology, 9th ed. [Salt Lake City: Deseret Book, 1965], 46–47; and Charles W. Penrose, JD 26:21–22.)
WDM must focus on one frequency And if your eye be single to my glory, your whole bodies shall be filled with light, and there shall be no darkness in you; and that body which is filled with light comprehendeth all things. [D&C 88:67]
Forward Error Correction There is also a kernel of light within each man and woman that "was not created or made, neither indeed can be" (D&C 93:29). This light or intelligence is called "the light of truth" as well and is coeternal with the Creator. Because "light cleaveth unto light," there is a natural link or affinity between our intelligence and the Light of Christ that equips all people with a basic discernment of good and evil--that part of us we call our conscience (D&C 88:40; see also Moroni 7:15–16).