



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Packets, Frames, and Error Detection
7.1 Introduction
o This chapter discusses the packet concept, packet implementation, coordination of sender and receiver, and error detection.
7.2 The Concept Of Packets
o Most network systems divide messages into small blocks of data called packets.
o Packets are useful for error control. A recipient checks each packet and requests a retransmission when necessary. With luck, it is necessary to resend only a few packets -- not whole messages.
o In a network that is not packet-switched, a process may have to wait a very long time for another process to finish sending a long message.
o Packet switching facilitates the fair sharing of a link.
It works much like round-robin scheduling. It is also similar to a quick-checkout line at a supermarket where shoppers are limited to ten or fewer items. Another similar practice: a large family shares a telephone and all members agree to make only short calls. A sender cannot tie up the link for any longer than the time it takes to send one packet. After each packet is sent, the other senders have a chance to send a packet. Usually, no sender has to wait very long to send a packet.
7.3 Packets And Time-Division Multiplexing
o Packet switching is a form of time-division multiplexing.
o Typically it will not take host X long to send a short message, even if Y is sending a long message at the same time.
7.4 Packets And Hardware Frames
o Standards must define the design of packets.
o The text uses the term "frame" to denote some standard kind of packet.
o The term "packet" is a general term -- not associated with any particular standard.
o It can be useful to have the ends of packets marked with special characters such as "soh" (start of header) and "eot" (end of transmission). These markers are not always needed. For example, they are not needed if packets all have the same size, however in error situations such as after crashes, they are useful for helping receivers "sync up."
7.5 Byte Stuffing
o We can use a system called byte stuffing to deal with soh's and eot's included by the sender in the data part of a packet. These could confuse the receiver. These internal occurrences are changed to something else, just while in transit, and then changed back by the receiver.
o For example we can replace "soh" with esc-x, "eot" with esc-y, and esc with esc-z.
7.6 Transmission Errors
o Lightning, power surges, and other such interference can introduce error into transmissions and even create the appearance of transmissions where none exist.
o Communication protocols must be designed to compensate for the effects of such transmission errors, even though this adds considerably to the complexity of these protocols.
7.7 Parity Bits And Parity Checking
o The RS-232 hardware checks that the voltage stays constant while a bit is being sent, and that the stop bit occurs at the proper time. If a check fails the hardware declares an error.
o Most RS-232 circuits also do a parity check. The sender adds a parity bit to each character before sending. With the "even parity" scheme, the
o We can treat each 16-bit sequence of bits as an integer, add them all, add carry bits too, and use the resulting 16-bit quantity as a checksum.
o This method is simple and efficient but there are common transmission errors that it does not detect.
7.10 Detecting Errors With Cyclic Redundancy Checks
7.11 Combining Building Blocks
o A cyclic redundancy check (CRC) is a type of "checksum" that is easy to calculate using shift registers and xor gates. Also, it does a good job of "mixing up" all the bits of the message.
o The resulting check bits are quite good at detecting common errors.
7.12 Burst Errors
o A burst error is a common kind of error caused by interference where many bits in a row will all be changed to the same value. For example we might get three characters in a row that appear to be all ones.
o Suppose that the 3rd and 5th bits of every character transmitted are always zero. This is an example of a vertical error -- where the same bit positions are consistently either held constant or inverted. Faulty hardware often introduces vertical error.
o CRC's do a good job of detecting burst errors and vertical errors. These are common kinds of errors that ordinary checksums are not too good at detecting.
7.13 Frame Format And Error Detection Mechanisms
o Typically a CRC is computed for each frame (packet) sent by the network. The sending software sends the frame first and the CRC immediately afterward. The receiver uses the CRC to check for error and request a retransmission of the frame if an error is detected.
o It's important that the sender and receiver have an exact agreement on the "formula" for the CRC.
7.14 Summary