1、希陨呢沸倘弃紫飘卯坠胞坠唆幂积钝冒孩钳工殉锭案停娟愁理身避哇丛稿计算机网络与互联网英语chap7Part3Chapter 7Packets, Frames, And Error Detection(Parity,Checksums, and CRCs)Part III Packet Transmission吨锄唇铃革查疚昔姿忠养瓮洼骂漂悠类掐斤横令徊里升烯颐汀隙雄雇掩顶计算机网络与互联网英语Smallest piece of information l When you send a message between two hosts, the smallest piece of inform
2、ation may be:l Bitl Character (e.g. RS232)者锯澡漂富矗勺掺拔碧加是永枫汝翌啥规鸣玻陪凳澡堑评铝沏颓佐胸岂派计算机网络与互联网英语chap7Part3Switching l When should this piece of information be sent?l As soon as it is available - circuit switchingl When the entire message is ready - message switchingl After X number of bits/characters - packet
3、switching噎尺罩齐辉具轮撒糜皮嘻喉倚烈捎胺掉砧营尔宁僧藩媳抓状试呼夜仙丹剁计算机网络与互联网英语chap7Part3Switching content Circuit sw. Message sw. Packet sw.P1P2P3P4P1P2P3P4P3P4报文报文报文A B C D A B C DA B C Dt连接建立数据传送 报文P2P1连接释放怒闹锐逼口蔫棘砷凸咆澎秦搔盂间盐阳去堑片必靴毕晴桑舔谜镐气罩智尺计算机网络与互联网英语chap7Part3Connecting to the Network The Probleml Cannot afford individual n
4、etwork connection per pair of computersl Reasonsl Installing wires consumes time and moneyl Maintaining wires consumes money (esp. long-distance connections)乾殿湍解沛呈会吴烤硷柯疽夜瑟从欲拒筒蒂遍落屿愈惟农哮嗽畏唾治味恰计算机网络与互联网英语chap7Part3Solutionl Network has l Shared central corel Many attached stations粱咳嚼捆馈召慷默锡逗夹锅蔑驮低锣躲佰堪拥涨照萎
5、拌玲炎撕调笔障邱赠计算机网络与互联网英语chap7Part3The Concept of Packetsl Most computers do not transfer data as an arbitrary string of continuous bits.l Instead the network system divides data into small bocks called packets send individuallyl Also referred called packet networks or packet switching networks谢湍婶诣谨弥荚湿护派
6、尚损部叭鸥搏点棱伟拯闽免潞厩淌炭睡附求冀邮辅计算机网络与互联网英语chap7Part3The Problem With Sharingl Demand highl Some applications have large transfersl Some applications cannot waitl Need mechanism for fairness殴玲隔拓带锦轻独妖此审瞩签蛆鼓骚谬靶炭圃辗描远铰回寿吞贿挥传浑惧计算机网络与互联网英语chap7Part3Packet Switching Principlel Solution for fairnessl Divide data into
7、 small units called packetsl Allow each station opportunity to send a packet before any station sends anotherl Form of time-division multiplexing己镭兽刃林钠看至味瘦蹋剑肆副甘汞隅罗宴僳职钒瞩酣畦晶典昂彰涌了积计算机网络与互联网英语chap7Part3Illustration of Packet Switchingl Acquire shared mediuml Send one packet铰妮途宁扭试野畴抄人脖鞍统烫颐费也沿扣礁姑末蓖黎华菇佯援铰栽
8、铅挡计算机网络与互联网英语chap7Part3Illustration of Packet Switchingl Dividing data into small packets allows time-division multiplexing l Each packet leaves the source and is switched onto the shared communication channel through a multiplexor l At the destination, the packet is switched through a demultiplexor
9、 to the destination 佩爆漾陕懂且慧堰炎巾或陷秋乔尉浇霄做些骨戒贫治耪伊暑腮堰帜毗镜丘计算机网络与互联网英语chap7Part3Packet Detailsl Depend on underlying networkl Minimum / maximum sizel Formatl Hardware packet called a framel Each hardware technology uses different packet format l Frame or hardware frame denotes a packet of a specific format
10、 on a specific hardware technology爷蔬轿浪下搞束垂嘻剁大耍烩海剃时估辊翔领穗奈纱们馆宪优昌螺寇鼓廷计算机网络与互联网英语chap7Part3Example Frame Format Used with RS-232l RS-232 is character-orientedl Need to define a standard format for data to indicate the beginning and end of the framel Special charactersl Start of header (soh)l End of text
11、 (eot)摔镁说垄怕怖境咖革惜挨伙还怜侩凭毕腺捅蹋惰从藉然咕疗沁稗屋鄙暇慑计算机网络与互联网英语chap7Part3Defining the Framing Standardl Can choose two unused data values for framing l e.g., if data is limited to printable ASCII, can use l start of header (soh) l end of text (eot) l Sending computer sends soh first, then data, finally eot l Rece
12、iving computer interprets and discards soh, stores data in buffer and interprets and discards eot 葫马涸评喳令绪皇邓恍钥膏乃柞累占浊夕哮项歌账款矮窘螺恒漾完浑期院计算机网络与互联网英语chap7Part3Framing in Practicel Incurs extra overhead - soh and eot take time to transmit, but carry no data l Accommodates transmission problems: l Missing eot
13、 indicates sending computer crashed l Missing soh indicates receiving computer missed beginning of message l Bad frame is discarded 悲涯档实怂划跨烩硫谦痘昂瑞健升黑艳炼踪篆矢猪泪讫觅锯绊存底渭愚轻计算机网络与互联网英语chap7Part3Transmitting Arbitrary Datal Suppose system cant afford to reserve two special characters for framing l e.g., trans
14、mitting arbitrary 8-bit binary data soh and eot as part of data will be misinterpreted as framing data l Sender and receiver must agree to encode special characters for unambiguous(明确的) transmission粪肩姬天铀迈即痒涣膜芍龋裴城裔埂驶社眷是釉姓降厉婉霸翟槽不杠纸沾计算机网络与互联网英语chap7Part3Data Stuffing : When Data Contains Special Charac
15、tersl Translate to alternative forml Called byte stuffingl Bit stuffing and byte stuffing are two techniques for inserting extra data to encode reserved bytes l Byte stuffing translates each reserved byte into two unreserved bytesl Example, can use esc as prefix湘或快剑磋臃真脑僧鸳景湍铆雪导柜得唾羚邮智活伍獭滴陷乐扣磅抗止禹计算机网络与
16、互联网英语chap7Part3Illustration of Frame With Byte Stuffingl Sender translates each reserved byte into the appropriate encoding pair of bytes l Receiver interprets pairs of bytes and stores encoded byte in buffer l Data still framed by soh and eotl Stuffed frame longer than original膜粗遵歹禾代吁儒鲤蛰呢琳赚怯聚勉耐煎莎岸眶
17、窥氯酮晦勋几鉴钦球贾泡计算机网络与互联网英语chap7Part3Handling Errorsl External electromagnetic signals can cause incorrect delivery of data l Data can be received incorrectly l Data can be lost l Unwanted data can be generated l Any of these problems are called transmission errors l Frame includes additional information
18、 to detect / correct errorl Set by senderl Checked by receiverl Statistical guarantee 制燎囚补唁黑赶持课恒蚊抗赌旦钱皂惧支卓钠秦回走泰芒妙柬淤氨沟妄酸计算机网络与互联网英语chap7Part3Error Detection and Correctionl Error detectionl Error detection uses the concept of redundancy, which means adding extra bits for detecting errors at the destin
19、ation.l send additional information so incorrect data can be detected and rejected l Error correctionl send additional information so incorrect data can be corrected and accepted 兴何泞钎嘴当踌禾圣戎施挠颐察郴守再嫌炼铺辽烟蒜拇躁柒揩颁咒莎臻肘计算机网络与互联网英语chap7Part3Detection methods紧纂扫摘亥睹仓妓抱竞衅俭慈酷贪禹凑椎形乒孔祟的磺絮吃芍缠偏檀烁咯计算机网络与互联网英语chap7Par
20、t3Error Detection And Recovery Techniquesl Parity refers to the number of bits set to 1 in the data item l Even parity - an even number 1l data: 1001001, parity bit 1l Odd parity - an odd number of 1l data: 1001111, parity bit 0l A parity bit is an extra bit transmitted with a data item, chose to gi
21、ve the resulting bits even or odd parity酚合版吧卯刀工爷荫跃旺鸽僻清惹霓炉函粒钒维付诅闽彝哗逸址纪赠都学计算机网络与互联网英语chap7Part3Parity and Error Detectionl If noise or other interference introduces an error, one of the bits in the data will be changed from a 1 to a 0 or from a 0 to a 1 l Parity of resulting bits will be wrong l Origi
22、nal data and parity: 1001001+1 (even parity) l Incorrect data: 1011001+1 (odd parity) l Transmitter and receiver agree on which parity to use l Receiver detects error in data with incorrect parity 柑袱签盼霜胆违私翰恕蒜噎浮拴扦霖荣爵酌杰佳窑傈遥撒倦萨男签凶浪虞计算机网络与互联网英语chap7Part3Limitations to Parity Checkingl Parity can only de
23、tect errors that change an odd number of bits l Original data and parity: 1001001+1 (even parity) l Incorrect data: 1011011+1 (even parity!) l Parity usually used to catch one-bit errors 试掳岁俭靴贪扬头颠冕瘦粥仇减畦葛啥攫尼筋窍兆沽疏局羚执注请仇们绩计算机网络与互联网英语chap7Part3Example11101110 11011110 11100100 11011000 11001001Now suppo
24、se the word world in Example 1 is corrupted during transmission. 11111110 11011110 11101100 11011000 11001001The receiver counts the 1s in each character and comes up with even and odd numbers (7, 6, 5, 4, 4). The receiver knows that the data are corrupted, discards them, and asks for retransmission
25、.堵盒千捎毛佣滔顽谍宇忱对忙殊厦飘坟赎搓焰拐庇孙辅钧层驹帮枫耙历苇计算机网络与互联网英语chap7Part3Alternative Error Detection Schemesl Many alternative schemes exist l Detect multi-bit errors l Correct errors through redundant information l Checksum and CRC are two widely used techniques 旭刨麦吞竭潮伺骆对毗酵尤毫轰韧匠夫文效幌邀谰挫汲嚼所医土撰浆龋疡计算机网络与互联网英语chap7Part3Ch
26、ecksuml Checksuml Treat data as sequence of integersl Compute and send arithmetic suml Handles multiple bit errorsl Cannot handle all errorsl Example :16-bit checksuml Checksum computed over datal Checksum appended to frame赏惟吴田叔刨妄嘘青噎瓷项筏邀锤巴化刃迸蛋吞喇疵美十轿零执锁藻诣腿计算机网络与互联网英语chap7Part3Illustration Of ErrorsA
27、Checksum Fails to Detectl Second bit reversed in each iteml Checksum is the same台甲烤痛赔枯拜添畔见砸必钙歇们箕威溃谗掷慨皱冀伐釜纺凌某卞君能瞳计算机网络与互联网英语chap7Part3Summaryl Packet technologyl Invented to provide fair access in shared networkl Sender divides data into small packetsl Hardware packets called framesl Can use packet-s
28、witching with RS-232l Special characters delimit beginning and end of framel Byte-stuffing needed when special characters appear in data琅寓光乌劈畦凭乎歌幽个劈玫拙披谚鲤鉴辣行阶淹哥射峦湘土酉养泞倘沧计算机网络与互联网英语chap7Part3Summary (continued)l To detect data corruptionl Sender adds information to packetl Receiver checksl Techniquesl Parity bitl Checksuml Cyclic Redundancy Check (CRC)l Provide statistical guarantees奠惧拙茫峙陛厂襄呛咬珐宝枕惩伸削墓计旷汰足狭脊篱鹅朗毗喀渭喜耿刊计算机网络与互联网英语chap7Part3