【正文】
1 Error Detection (see chapter6 P177)zAdditional bits added by transmitter for error detection codezParity checkzCyclic Redundancy Check(循環(huán)冗余 )2Parity check 奇偶校驗(yàn) P179zAppend a parity bit to the end of a block of datazIf use odd parity(奇校驗(yàn) ), to transmit 1110001, append a 1 and transmit 11110001zThe receiver examines zValue of parity bit is such that character has even (even parity) or odd (odd parity) number of oneszEven number of bit errors goes undetected3Cyclic Redundancy Check(循環(huán)冗余 ) P179zFor a block of k bits message, transmitter generates n bit sequence as a frame check sequence (FCS)幀檢驗(yàn)序列zTransmit k+n bits which is exactly divisible by some numberzReceiver divides frame by that numberyIf no remainder, assume no error4Modulo 2 Arithmetic (模 2運(yùn)算)zUses binary addition with no carries (進(jìn)位 ), just the exclusive OR (異或 ) operation. 做加減運(yùn)算時(shí):相同為 0,相異為 15CyclicRedundancy CheckRemainderAt the receiver:Transmitted Frame T=1010001101011108T= n bit frame to be transmitted 發(fā)送出去的幀( n bits)D= k bit message, the first k bits of T 數(shù)據(jù)( k bits)F= nk bit FCS, the last nk bits of T 校驗(yàn)碼( nk) bitsP=pattern of nk+1 bits。 this is the predetermined divisor 生成多項(xiàng)式或除數(shù)( nk+1) bit ( 1) 發(fā)送幀由數(shù)據(jù)和校驗(yàn)碼構(gòu)成,在 D的末尾添加( nk)個(gè) 0( 2) 長(zhǎng)除法商 余數(shù)CRC循環(huán)冗余校驗(yàn)的原理quotient remainder9( 3)Use this remainder as the FCS發(fā)送幀由數(shù)據(jù)和余數(shù)構(gòu)成在接收端:將 T/P,若傳輸正確,余數(shù)將為 0。( 4)( 5) 根據(jù)公式( 2),可化簡(jiǎn)為公式( 5)。( 6) 模 2運(yùn)算,相同相加為 0。沒有余數(shù)。若 T在傳輸中發(fā)生錯(cuò)誤,在接收端進(jìn)行 T/P運(yùn)算,余數(shù)將不為 0。10Polynomials( 生成 多項(xiàng)式 ) P183For P=110011, P(X)=X5+X4+X+1常用的生成多項(xiàng)式:CRC12 = x12 + x11 + x3 + x2 + x + 1CRC16 = x16 + x15 + x2 + 1CRCCCITT = x16 + x12 + x5 + 111 Flow Control P209zFlow control: Assuring the sending entity does not overwhelm the receiving entity with datayPreventing buffer overflow12Model of Frame Transmission混淆13Stop and Wait flow control 停等流量控制 P210zSource transmits framezDestination receives frame and replies wit