1 / 16

Lecture 7: Reliable Packet Transmission

Lecture 7: Reliable Packet Transmission. 8. 16. 16. 8. Beginning. Ending. Header. Body. CRC. sequence. sequence. Cyclic Redundancy Check. Add k bits of extra data (the CRC field) to an n -bit message to provide error detection function For efficiency, want k << n

dawn
Télécharger la présentation

Lecture 7: Reliable Packet Transmission

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 7: Reliable Packet Transmission

  2. 8 16 16 8 Beginning Ending Header Body CRC sequence sequence Cyclic Redundancy Check • Add k bits of extra data (the CRC field) to an n-bit message to provide error detection function • For efficiency, want k << n • e.g., k = 32 for Ethernet and n = 12,000 (1500 bytes)

  3. CRC strategy • Sender and Receiver know the “divisor polynomial” • e.g. C(x)=x3+x2+1=1101 • Send Message÷ CRC with CRC chosen so that the whole thing is evenly divisible by C(x) • Receiver calculates the remainder of Message÷ CRC/C(x) There’s an error if it is not zero

  4. CRC example • Message=10011010 C=1101(3 rd order) • Message÷ CRC=10011010XYZ • Choose XYZ so that remainder is zero for Message÷ CRC/C

  5. CRC Example cont. • 11111001 1101÷10011010XYZ1101 1001 1101 1000 1101 X=1 1011 Y=0 1101 Z=1 1100 1101 1xyz 1101 • Message÷ CRC=10011010÷ 101

  6. CRC Example cont. • 11111001 1101÷10011010000 1101 1001 1101 1000 1101 1011 1101 1100 1101 1000 1101 101 • Message÷ CRC=10011010000 - (xor) 101

  7. C(x) Examples • CRC-8 x8+x2+x1+1=100000111 • CRC-10 11000110011 • CRC-12 110000000101 • CRC-16 11000000000000101 • CRC-CCITT 10001000000100001 • CRC-32 1000001001100000010001110110110111

  8. 1’s complement addition • 0=0000 -0=1111 • 1=0001 -1=1110 • 2=0010 -2=1101 • 2+3=0010+0011=0101=5 • 2+(-0)=0010+1111+0001=0010=2 • 3+(-2)=0011+1101+0001=0001

  9. Internet Checksum Strategy • 0 1010 0001 1001 1100 =0000A19C • 0 0110 1010 1111 0010 =00006AF2 • 1 0000 1010 1000 1110 =00010A8E • =>00000A8E • =>0000 1010 1000 1111=00000A8F • =>0A8F • =>F670

  10. Internet Checksum Algorithm • View message as a sequence of 16-bit integers; sum using 16-bit ones-complement arithmetic; take ones-complement of the result. 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); }

  11. Reliable Transmission • Problem: • To detect packet loss • To retransmit lost packets • Delete duplicates. • Assure proper order

  12. Stop and Wait Sequence numbers: 0,1,0,1 etc. Resend if no Ack before timeout + guarantees arrival of all frames in order -lots of downtime, particularly for long RTTs

  13. Frame sequencing for Stop-and-Wait protocol

  14. Time line for sliding window algorithm

  15. Sliding Window Algorithm-sender • LAR=last acknowledgement received • LFS=last frame sent • SWS=send window size • LFS-LAR<SWS

  16. Sliding Window Algorithm-receiver • NFE=next frame expected • LFA=last frame accepted • RWS=receive window size • LFA-NFE<RWS

More Related