13.07.2015 Views

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

154 Transput Chapter 5one bit and the next.)This simple picture is complicated by the fact that the sender and the receiver usuallydo not have the same clock. They must use their own clocks to achieve the sameresult. Therefore, each transmission is prefixed by a header containing a prearrangedpattern of bits that allows the receiver to adjust its clock to match the sender for the restof the transmission. As long as the adjustment is close, the transmission will be properlyunderstood. The clocks can be expected to drift slowly with respect to each other, soafter a while it is necessary to resynchronize. Therefore, the transmission is divided intoframes, each of which starts with the header.Since the header is treated specially by the receiving hardware, it is necessary toavoid using the header’s bit pattern inside the message itself. Therefore, the sendinghardware might insert an extra bit in the message every time it would otherwise accidentallysend a bit combination that looks like the header. Likewise, the receiving hardwareautomatically strips those extra bits when they are discovered. This technique is calledbit stuffing.If transmissions are restricted to multiples of full bytes, we say the protocol ischaracter-oriented instead of bit-oriented. In this case the header is an entire byte withspecial contents. <strong>An</strong> entire byte is stuffed instead of a single bit when necessary toprevent an accidental header. The byte that is introduced is an example of an escapeconvention, where a special character means “the following character is an ordinarypiece of data, not a special character”. We will see escape conventions again when welook at terminal control.BISYNC is an example of a character-oriented synchronous protocol. To sendsome text, a packet is formed with the following contents:controltextchecksumBy we mean the single character that means ‘‘synchronize.’’ It is used as aheader. The character means ‘‘start of header,’’ and it introduces the controlsection. This section contains the source, the destination, sequence numbers, and otherdata of interest to the transmission protocol. The and characters (for‘‘start of text’’ and ‘‘end of text’’) delimit the data part of the message. The whole frameis closed by a checksum, which is used by the receiver to check that the message arrivedundamaged. A character is used as an escape convention to allow any of the specialcharacters, including , , , , and , to be presentin the message.Asynchronous transmission.In comparison with synchronous transmission,asynchronous transmission is much simpler but requires a higher proportion ofextra bits. Instead of allowing a frame to be very long and contain many characters, weput header and trailer bits on each character. If only a few characters need to be sent, theasynchronous method actually uses fewer bits. For example, 110-baud asynchronoustransmission starts each character with a zero bit, then sends eight data bits, then two onebits. Fewer ending bits are used at higher baud rates.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!