Saturday, June 2, 2007

CHAPTER 2


Computer-to-Computer

Communications

Services intended for access by microcomputers are nowadays

usually presented in a very user-friendly fashion: pop in your

software disc or firmware, check the connections, dial the telephone

number, listen for the tone...and there you are. Hackers, interested

in venturing where they are not invited, enjoy no such luxury. They

may want to access older services which preceded the modern 'human

interface'; they are very likely to travel along paths intended, not

for ordinary customers, but for engineers or salesmen; they could be

utilising facilities that were part of a computer's commissioning

process and have been hardly used since.

So the hacker needs a greater knowledge of datacomms technology than

does a more passive computer user, and some feeling for the history

of the technology is pretty essential, because of its growth pattern

and because of the fact that many interesting installations still use

yesterday's solutions.

Getting one computer to talk to another some distance away means

accepting a number of limiting factors:

* Although computers can send out several bits of information at

once, the ribbon cable necessary to do this is not economical at any

great length, particularly if the information is to be sent out over

a network--each wire in the ribbon would need switching separately,

thus making ex- changes prohibitively expensive. So bits must be

transmitted one at a time, or serially.

** Page 7

* Since you will be using, in the first instance, wires and networks

already installed--in the form of the telephone and telex

networks--you must accept that the limited bandwidth of these

facilities will restrict the rate at which data can be sent. The data

will pass through long lengths of wire, frequently being

re-amplified, and undergoing de- gradation as it passes through dirty

switches and relays in a multiplicity of exchanges.

* Data must be easily capable of accurate recovery at the far end.

* Sending and receiving computers must be synchronised in their

working.

* The mode in which data is transmitted must be one understood by

all computers; accepting a standard protocol may mean adopting the

speed and efficiency of the slowest.

* The present 'universal' standard for data transmission used by

microcomputers and many other services uses agreed tones to signify

binary 0 and binary 1, the ASCII character set (also known as

International Alphabet No 5), and an asynchronous protocol, whereby

the transmitting and receiving computers are locked in step every

time a character is sent, not just at the beginning of a transmission

stream. Like nearly all standards, it is highly arbitrary in its

decisions and derives its importance simply from the fact of being

generally accepted. Like many standards, too, there are a number of

subtle and important variations.

To see how the standard works, how it came about and the reasons

for the variations, we need to look back a little into history.

The Growth of Telegraphy

The essential techniques of sending data along wires has a history

of 150 years, and some of the common terminology of modern data

transmission goes right back to the first experiments.

The earliest form of telegraphy, itself the earliest form of

electrical message sending, used the remote actuation of electrical

relays to leave marks on a strip of paper. The letters of the

alphabet were defined by the patterns of 'mark' and 'space'.

** Page 8

The terms have come through to the present, to signify binary

conditions of '1' and '0' respectively. The first reliable machine

for sending letters and figures by this method dates from 1840; the

direct successor of that machine, using remarkably unchanged

electromechanical technology and a 5-bit alphabetic code, is still

widely used today, as the telex/teleprinter/teletype. The mark and

space have been replaced by holes punched in paper-tape: larger holes

for mark, smaller ones for space. Synchronisation between sending and

receiving stations is carried out by beginning each letter with a

'start' bit (a space) and concluding it with a 'stop' bit (mark). The

'idle' state of a circuit is thus 'mark'. In effect, therefore, each

letter requires the transmission of 7 bits:

. * * . . . * (letter A: . = space; * = mark)

of which the first . is the start bit, the last * is the stop bit and

* * . .. is the code for A.

This is the principle means for sending text messages around the

world, and the way in which news reports are distributed globally.

And, until third-world countries are rich enough to afford more

advanced devices, the technology will survive.

Early computer communications

When, 110 years after the first such machines came on line, the

need arose to address computers remotely, telegraphy was the obvious

way to do so. No one expected computers in the early 1950s to give

instant results; jobs were assembled in batches, often fed in by

means of paper-tape (another borrowing from telex, still in use) and

then run. The instant calculation and collation of data was then

considered quite miraculous. So the first use of data communications

was almost exclusively to ensure that the machine was fed with

up-to-date information, not for the machine to send the results out

to those who might want it; they could wait for the 'print-out' in

due course, borne to them with considerable solemnity by the computer

experts. Typical communications speeds were 50 or 75 baud. (The baud

is the measure of speed of data transmission: specifically, it refers

to the number of signal level changes per second and is thus not the

same as bits-per-second.)

These early computers were, of course, in today's jargon,

single-user/single-task; programs were fed by direct machine coding.

Gradually, over the next 15 years, computers spawned multi-user

capabilities by means of time-sharing techniques, and their human

interface became more 'user-friendly'.

** Page 9

With these facilities grew the demand for remote access to

computers, and modern data communications began.

Even at the very end of the 1960s when I had my own very first

encounter with a computer, the links with telegraphy were still

obvious. As a result of happenstance, I was in a Government-run

research facility to the south-west of London, and the program I was

to use was located on a computer just to the north of Central London;

I was sat down in front of a battered teletype--capitals and figures

only, and requiring not inconsiderable physical force from my

smallish fingers to actuate the keys of my choice. As it was a

teletype outputting on to a paper roll, mistakes could not as readily

be erased as on a VDU, and since the sole form of error reporting

consisted of a solitary ?, the episode was more frustrating than

thrilling. VDUs and good keyboards were then far too expensive for

'ordinary' use.

The telephone network

But by that time all sorts of changes in datacomms were taking

place. The telex and telegraphy network, originally so important, had

long been overtaken by voice-grade telephone circuits (Bell's

invention dates from 1876). For computer communication, mark and

space could be indicated by different audio tones, rather than by

different voltage conditions. Data traffic on a telex line can

operate in only one direction at a time, but, by selecting different

pairs of tones, both 'transmitter' and 'receiver' could speak

simultaneously--so that in fact, one has to talk about 'originate'

and 'answer' instead.

Improved electrical circuit design meant that higher speeds than

50 or 75 baud became possible; there was a move to 110 baud, then 300

and, so far as ordinary telephone circuits are concerned, 1200 baud

is now regarded as the top limit.

The 'start' and 'stop' method of synchronising the near and far

end of a communications circuit at the beginning of each individual

letter has been retained, but the common use of the 5-bit Baudot code

has been replaced by a 7-bit extended code which allows for many more

characters, 128 in fact.

Lastly, to reduce errors in transmission due to noise in the

telephone line and circuitry, each letter can be checked by the use

of a further bit (the parity bit), which adds up all the bits in the

main character and then, depending on whether the result is odd or

even, adds a binary 0 or binary 1.

The full modern transmission of a letter in this system, in this

case, K, therefore, looks like this:

** Page 10

START-STOP TRANSMISSION OF A DATA CHARACTER

TIME

INTERVAL_____________9___0___1___2___3___4___5___6___7___8___9___

NUMBER

1 1 1 1 1 1

Mark +---+ +---+ +---+ +---+---+ +---+

LINE | | 0 | | 0 0 | | 0 | | 0 | |

CONDITION Space-+ +---+ +---+---+ +---+ +---+ +-

^ ^

| |

BINARY STOP-+ START 1 0 0 1 0 1 1 0

DIGIT

The first 0 is the start bit; then follows 7 bits of the actual

letter code (1001011); then the parity bit; then the final 1 is the

stop code.

This system, asynchronous start-stop ASCII (the common name for

the alphabetic code), is the basis for nearly all micro-based

communications. The key variations relate to:

bit-length; you can have 7 or 8 databits (*)

parity; (it can be even or odd, or entirely absent),

Tones - The tones used to signify binary 0 and binary 1, and which

computer is in 'originate' and which in 'answer', can vary according

to the speed of the transmission and also to whether the service is

used in North America or the rest of the world. (Briefly, most of

the world uses tones and standards laid down by the Geneva-based

organisation, CCITT, a specialised agency of the International

Telecommunications Union; whereas in the United States and most parts

of Canada, tones determined by the telephone utility, colloquially

known as Ma Bell, are adopted.) The following table gives the

standards and tones in common use.

(*) There are no 'obvious explanations' for the variations commonly

found: most electronic mail services and viewdata transmit 7 data

bits, even parity and I stop Bit; Telecom Gold and most hobbyist

bulletin boards transmit 8 data bits, odd parity and 1 stop bit.

Terminal emulator software--see chapter 3--allows users to adjust for

these differing requirements.

** Page 11

Service Speed Duplex Transmit Receive Answer

Designator 0 1 0 1

V21 orig 300(*) full 1180 980 1850 1650 -

V21 ans 300(*) full 1850 1650 1180 980 2100

V23 (1) 600 half 1700 1300 1700 1300 2100

V23 (2) 1200 f/h(**) 2100 1300 2100 1300 2100

V23 back 75 f/h(**) 450 390 450 390 -

Bell 103 orig 300(*) full 1070 1270 2025 2225 -

Bell 103 ans 300(*) full 2025 2225 1070 1270 2225

Bell 202 1200 half 2200 1200 2200 1200 2025

(*)any speed up to 300 baud, can also include 75 and 110 baud

services

(**)service can either be half-duplex at 1200 baud or asymmetrical

full duplex, with 75 baud originate and 1200 baud receive (commonly

used as viewdata user) or 1200 transmit and 75 receive (viewdata

host)

Higher Speeds

1200 baud is usually regarded as the fastest speed possible on an

ordinary voice-grade telephone line. Beyond this, noise on the line

due to the switching circuits at the various telephone exchanges,

poor cabling, etc. make accurate transmission difficult. Indeed, at

higher speeds it becomes increasingly important to use transmission

protocols that include error correction.

Error correction techniques usually consist of dividing the

transmission stream into a series of blocks which can be checked, one

at a time, by the receiving computer. The 'parity' system mentioned

above is one example, but obviously a crude one. The difficulty is

that the more secure an error-correction protocol becomes, the

greater becomes the overhead in terms of numbers of bits transmitted

to send just one character from one computer to another. Thus, in the

typical 300 bit situation, the actual letter is defined by 7 bits,

'start' and 'stop' account for another two, and the check takes a

further one--ten in all. After a while, what you gain in the speed

with which each actual bit is transmitted, you lose, because so many

bits have to be sent to ensure that a single character is accurately

received!

** Page 12

Although some people risk using 2400 baud on ordinary telephone

lines--the jargon is the PTSN (Public Telephone Switched

Network)--this means using expensive modems. Where higher speeds are

essential, leased circuits, not available via dial-up. become

essential. The leased circuit is paid for on a fixed charge, not a

charge based on time-connected. Such circuits can be conditioned',

for example by using special amplifiers, to support the higher data

rate.

For really high speed transmissions, however, pairs of copper

cable are inadequate. Medium speed is obtainable by the use of

coaxial cable (a little like that used for tv antenna hook-ups) which

have a very broad bandwidth. Imposing several different channels on

one cable-length is called multiplexing and, depending on the

application, the various channels can either carry several different

computer conversations simultaneously or can send several bits of one

computer conversation in parallel, just as though there were a ribbon

cable between the two participating computers. Either way, what

happens is that each binary 0 or binary 1 is given, not an audio

tone, but a radio frequency tone.

Synchronous Protocols

In the asynchronous protocols so far described, transmitting and

receiving computers are kept in step with each other every time a

character is sent, via the 'start' and 'stop' bits. In synchronous

comms, the locking together is done merely at the start of each block

of transmission by the sending of a special code (often SYN). The SYN

code starts a clock (a timed train of pulses) in the receiver and it

is this that ensures that binary 0s and 1s originating at the

transmitter are correctly interpreted by the receiver; clearly, the

displacement of even one binary digit can cause havoc.

A variety of synchronous protocols exist, such as the length of

block sent each time, the form of checking that takes place, the form

of acknowledgement, and so on. A synchronous protocol is not only a

function of the modem, which has to have a suitable clock, but also

of the software and firmware in the computers. Because asynchronous

protocols transmit so many 'extra' bits in order to avoid error,

savings in transmission time under synchronous systems often exceed

20-30%. The disadvantage of synchronous protocols lie in increased

hardware costs.

One other complication exists: most asynchronous protocols use the

ASCII code to define characters. IBM ('Big Blue'), the biggest

enthusiast of synchronous comms, has its own binary code to define

characters. In Appendix IV, you will find an explanation and a

comparison with ASCII.

** Page 13

The hacker, wishing to come to terms with synchronous comms, has

two choices: the more expensive is to purchase a protocol convertor

board. These are principally available for the IBM PC, which has been

increasingly marketed for the 'executive workstation' audience, where

the ability to interface to a company's existing (IBM) mainframe is a

key feature. The alternative is to see whether the target mainframe

has a port on to a packet- switched service; in that event, the

hacker can use ordinary asynchronous equipment and protocols--the

local PAD (Packet Assembler/Disassembler) will carry out the

necessary transformations.

Networks

Which brings us neatly to the world of high-speed digital networks

using packet-switching. All the computer communications so far

described have taken place either on the phone (voice-grade) network

or on the telex network.

In Chapter 7 we will look at packet-switching and the

opportunities offered by international data networks. We must now

specify hackers' equipment in more detail.

No comments: