Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Lecture Slides on Packets, Frames and Error Detection | CPSC 5157U, Study notes of Computer Systems Networking and Telecommunications

Material Type: Notes; Professor: Bosworth; Class: Computer Networks; Subject: Computer Science; University: Columbus State University; Term: Summer 2006;

Typology: Study notes

Pre 2010

Uploaded on 08/04/2009

koofers-user-f0z
koofers-user-f0z 🇺🇸

10 documents

1 / 15

Toggle sidebar

Related documents


Partial preview of the text

Download Lecture Slides on Packets, Frames and Error Detection | CPSC 5157U and more Study notes Computer Systems Networking and Telecommunications in PDF only on Docsity! CPSC 5157 Computer Networks Lecture for Monday June 19, 2006 Packets, Frames, and Error Detection Summary Packets are a convenient way to group data Packets facilitate fair use of a network Packets facilitate error control and correction Packets are delimited by specific characters, so use character stuffing to send these as text. Basically, packets should be viewed as envelopes with standard mail inside. The contents are just delivered; other programs interpret the contents of the package. Slide 1 of 15 slides CPSC 5157 Revised June 27, 2006 CPSC 5157 Chapter 7 Slide 2 The physical layer of a network transmits individual bits across the network. This is usually either copper wire or glass fiber. We now consider how the bits of data are organized into packets that are recognized by both sender and receiver. Packets are “small blocks” of data, sent as a unit. As a guess, most packets are probably smaller than a few thousand bytes. Remember that both the term “byte” and the term “octet” refer to eight bits of data; the latter term is the preferred Internet terminology. The sender gains exclusive use of the network for the duration of time to send one packet and then must wait to send the next packet in the data stream< if there is one. This allows fairer sharing of the network resources. Slide 2 of 15 slides CPSC 5157 Revised June 27, 2006 CPSC 5157 Chapter 7 Slide 5 Packets Facilitate Error Detection and Recovery Imagine a 5 MB file transmitted as a single unit. At 56 Kb/s (7,000 bytes per second), this requires almost 12 minutes. A single bit error, if detected, will force retransmission of everything. Imagine a 5 MB file transmitted as 5,000 packets, each of 1 KB. At 56 Kb/sec, this requires about 143 milliseconds for each packet. A single bit error, if detected, will force retransmission of only one packet. On a lightly loaded network, transmission of the file might not take significantly more than 12 minutes. IP (Internet Protocol) As we shall see, the use of packets facilitates both the IP and protocols built on top of the IP. Slide 5 of 15 slides CPSC 5157 Revised June 27, 2006 CPSC 5157 Chapter 7 Slide 6 Packets and Frames A packet is a “small block” of data. The sender and receiver operate according to a protocol that allows easy identification of packets. Commonly, packets are placed in “frames” with a start character the data “package” an end character. One common packet format calls for 8–bit ASCII characters to encode the data. The start character, called soh, has ASCII code 1 (control–A) The end character, called eot, has ASCII code 4 (control–D) These frame delimiters are “unprintable” only in that most applications, other than hex debuggers, will not print them in readable form. Control characters, such as soh and eot, go back to the old Teletype days. Slide 6 of 15 slides CPSC 5157 Revised June 27, 2006 CPSC 5157 Chapter 7 Slide 7 Byte Stuffing If your message is purely readable text, the above framing scheme works well. Suppose your message has another encoding scheme and includes characters with ASCII codes 1 and 4. Receipt of the Control–D will cause the receiver to terminate the frame. This is not good. The solution is to use character stuffing, with the escape character, which is denoted as esc with ASCII code 0x1B or 27 (decimal). A soh character in the data is replaced by the sequence esc x, or 1B 78. An eot character in the data is replaced by the sequence esc y, or 1B 79. But what about an esc character in the data, especially one followed by an x. The esc character itself is converted to esc z, or 1B 7A, so that the two byte data sequence “esc d” would convert to “esc z d” and transmitted as 1B 7A 64. Slide 7 of 15 slides CPSC 5157 Revised June 27, 2006 CPSC 5157 Chapter 7 Slide 10 CRC (part 2) The CRC treats any message M as a sequence of bits. Denote the number of bits in a message by m. For IP messages, this may be a large number, say m  12,000. Append to this message M of length m a check sum R of length r. The full frame thus has a length of (m + r) bits. For IP version 4, r = 32. Any of the standard CRC algorithms can detect burst errors in transmission that do not exceed r bits. For IP version 4, r = 32, so the CRC can detect burst errors (strings of bad bits) of length less than 33. The CRC is generated by an (r + 1)–bit pattern, called the generator. This is denoted by G. For IP version 4, this has 33 bits. The CRC theory is based on the study of polynomials of order r over GF(2), the field of binary numbers. For this reason, many discussions focus on G as a polynomial, though it can be represented as a binary string. For our example, G is the polynomial X3 + 1, represented as 1001, which stands for 1X3 + 0X2 + 0X1 + 1. Slide 10 of 15 slides CPSC 5157 Revised June 27, 2006 CPSC 5157 Chapter 7 Slide 11 CRC (part 3) (NOTE:The earlier versions of the notes, dated 6/22/2006, had an error. In this example the message was changed to 101110, six bits.) In simple terms, the CRC for the message is the remainder from division of the binary number M2r by the binary number G. In binary, a number is multiplied by 2r by appending r zero bits. Example: M = 10111 G = 1001 so r = 3, as G has (r + 1) bits. M2r = 10111 000, the message with 3 zeroes appended. Converted to decimal, M = 23 and M2r = 184. The generator G is required to have the leftmost (most significant) bit set to 1. Here it is the leading 1, the coefficient of X3. Begin division, remembering to use the XOR function in stead of subtraction. Slide 11 of 15 slides CPSC 5157 Revised June 27, 2006 CPSC 5157 Chapter 7 Slide 12 CRC Calculation We show a number of steps in the long division, beginning with the first. _____1____ 1001 ) 10111000 Note: It is now 10111 000. 1001 0010 Here the XOR looks just like subtraction. We “bring down” the 1 bit and note that “101” is smaller than “1001” _____10___ 1001 ) 10111000 1001 101 Slide 12 of 15 slides CPSC 5157 Revised June 27, 2006
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved