|Column Tag:||Mac Meets Ma Bell
A Communications Primer
By Bruce Lieberman, Software Engineer, MacTutor Contributing Editor
Welcome to the wild and wacky world of Telecommunications, this article is not meant to be the definitive introduction to this subject (as it covers far too vast an assortment of related areas), just a bit of dipping your toes in the water and getting familiar with the terminology commonly in use.
In a nutshell, you are going to try and have your computer communicate a stream of binary digits to another computer, have everyone understand the process involved and make sure that the information got to its destination in an unadulterated form. There is a catch, you are going to do this across a very restricted (slow, limited frequency bandwidth), noisy, error prone medium ..... the telephone companies phone lines and switching centers.
There's the rub. For speech, phone lines are good enough to maintain intelligibility (most of the time), for music ..... forget it, and for a stream of digital data ...... no way!
Enter the MODEM (MOdulate / DEModulate), this little goodie can take your digital data bits and convert them to an audio tone that represents 1 or 0 and convert them back again. The frequency of these tones is predetermined by an accepted standard for the person originating or answering the call (Bell 103, Bell 212, etc.) and the tone frequencies themselves easily fit within the limitation bandwidth of the phone system.
In the old days there were acoustically coupled modems that placed the old style phone handset into a box that had two holes surrounded with rubber (to make a tight seal around the mouthpiece and earpiece), within each hole was a complementary microphone and speaker to send and receive to and from the phone hand set. This approach had many drawbacks, not the least of which was induced physical noise. Nowadays we have direct connect modems that connect electronically to the phone lines and bypass the entire step of noise producing acoustical to electrical conversion. Direct Connect modems have been taken a step further, to what is now termed "Intelligent" modems (most of which are based on the Hayes Smartmodem which uses a standard licensed from Bizcomp, Inc.) that can perform a number of functions without the need of software; although all of these modems utilize software to make their functionality that much more flexible and approachable.
Now that we have a way of handling the limited frequency response of the phone lines, what do we do about all the noise and garbage on the line ? The loss of one character of information can corrupt an entire file (program or text), so we must provide a way of dealing with the errors that are part and parcel of the phone system. Basically, all we can do is contrive a way to determine if the data survived the transmission intact, and if it has not, send it again until it is correct (if there is a severe problem, the system will "time-out" after a predetermined number of retries). Each of the error correction protocols you will encounter will have there own way of accomplishing this task, the only thing you must keep in mind is that you have to run the same transfer protocol on each side of the transmission. We will take a quick look at some of the communications software packages now becoming available for the Macintosh; following that, I have included a very good glossary of telecommunications terms.
As you get started contacting the many public and private communications services available (BBS's, Dow Jones, Compuserve, The Source, etc.) you may encounter certain problems in making a viable connection, some of the most common problems are: wrong Baud Rate, the other system will not lock carrier (probably only supports 300 baud, switch to 300 and try again); wrong Data Format, you have locked carrier but there is garbage coming in on the screen (typically change from NO parity to EVEN).
For more in-depth information and for a wealth of telecommunications resources, look into these books : The OMNI series on Telecommunications (including the Online Database Directory), Technical Aspects of Data Communications (Digital Press), The RS232 Solution (Sybex Books) and for a look at how some of these services work, read The Complete Handbook of Personal Computer Communications (St. Martin's Press).
I have had the opportunity to briefly use three new telecommunications packages available now for the Macintosh:
inTouch by Software Masters, 3330 Hillcroft 'BB', Houston, Tx. 77057 713-266-5771, $149.95. (128 or 512K)
MacLine by TouchStone Software, 909 Electric Ave, Seal Beach, Ca. 90740 213-598-7746, $145.00. (128 or 512K)
SmartCom II by Hayes Microcomputer Products, 5923 Peachtree Industrial Blvd, Norcross, Ga. 30092, 404-449-8791, $149.00. (128 or 512K)
Each of these packages has unique capabilities of their own and all have more functionality than MacTerminal from Apple. All of these programs allow you to configure the communications protocol settings that you desire.
"inTouch" is a very well written telcomm progam capable of many styles of Terminal Emulation (TTY, Beehive, Televideo 925, IBM 3101, ADDS Viewpoint, DEC vt100 and even VIDTEX graphics!) direct and modem, it supports text file and binary file transfers including Xmodem & Crosstalk protocols and a special "inTouch" protocol for Mac to Mac file transfers. "inTouch" has 8 funtion (macro) keys and also programmable keys for "username" & "password", additionally there are keys to represent the DELETE, ESCAPE & BREAK keys found on terminals. These keys are all softkeys addressed with a click of the mouse.
There is an onscreen clock that also functions as an online timer; a phone number setting (with an auto redial function if the number is busy); a screen scroll buffer (40 lines on a 128K, 400 on a 512K); the ability to print incoming data in real time; save text to disk; manipulate incoming and outgoing CR&LF information; utilizes a MiniFinder for selecting files for transfer; the ability to view text files; supports auto-answer mode; an auto-execute funtion "inTouch" calls Communications Command Language, which is a very flexible batch command system that allows unattended telecommunications at predetermined times ....
You can write CCL files that will dial up Compuserve and logon for you, change to the appropriate area of the system, extract the information you want and log you off ..... or you could write a CCL file that would call a number of other Macs running 'inTouch' and transfer specific files to each machine at specific times. All in all a very nicely done, nicely documented package.
[An added feature is the IBM 3101 terminal emulation. Think you need Apple's $1000 box to talk to IBM networks? Not so. Since IBM started making an ASCII terminal (the 3101), they have had to support it on their networks. The end result is that most IBM networks have IBM software that provides full IBM 3278 full screen editing emulation for IBM 3101 Ascii terminals on the network. You dial up and log on as an 3101 character mode terminal, then switch to block mode transmission, and the IBM software emulates 3278 protocol for you. Hence, all that is needed to get full 3278 emulation is a software package capable of emulating an IBM 3101 ASCII terminal sufficiently to "fool" the IBM software into providing 3278 emulation rather than "dumb terminal" emulation. We have tested the "inTouch" program and while it does communicate with IBM systems as a 3101 terminal, it presently lacks the necessary block mode transmission to invoke the 3278 support from IBM's side. However, we have talked to the company and they are very enthusiastic about attempting to add whatever is necessary to get the 3278 support. - Ed.]
MacLine is a rather unique telcomm product, while it performs admirably as a stand alone package, it is how it fits into a family of software written for many operating systems that is unique. Presently TouchStone markets PCworks for the IBM-PC (and most clones), MacLine for the Macintosh and UniHost for a half dozen UNIX machines (I hear they are working on a DEC Vax VMS version also). These packages address the incompatibility of the different operating systems in a very different way, they all use a similar user interface to maintain familiarity among each system. The interface is user-definable and menu driven; it is divided into four basic areas, Terminal Communications, Request Network Services, Provide Network Services and Start Programs.
Terminal Emulation allows for direct and modem connections, emulation of TTY, ANSI and DEC VT 52/100 terminals; this area of the main menu is actually a minifinder-like scroll window that allows you to scroll through as many predefined terminal hookups (names, phone numbers, comm parameters and emulation) as you have disk space for.
The Start Programs area of the main menu is once again a scroll window (as are all of the windows on MacLine) and it allows you define a macro to start local Macintosh programs and remote Unix programs (dialing, logging you in, changing to the appropriate directory and executing the application) all from inside of MacLine, once the application is finished you will come back to the main menu of MacLine once again (the usefullness of this feature is obvious).
The Provide Network Services window allows you to define mutliple set-ups that are for the express purpose of unattended file transfers, each definition allows you to assign user account names and passwords, with read/ write and overwrite permissions being assignable also; there is also a provision for mail services within this area. This area turns your Mac into a secured Host.
The Request Network Services window is where it all comes together, in this area you can define the system you are calling, the logon, password, default directory, spooler label, terminal emulation and modem number (if you are using a dial-up rather than direct); within this area (which is also menu driven) there is a built in editor (for creating mail), once connected you can create a letter and mail it, load a letter from disk and mail it (there is an interface to UNIX mail and also a Mail system designed into each TouchStone package); send a file to the print spooler; print one locally; send a file to the Host system (text or binary) and convert it for that format or archive it there for future retrieval; Get a file from the Host in exactly the same fashion as sending it (conversion or archiving).
There is a lot to this program, however there are a few points that hamper it (which I am told are being addressed in a new version being prepared for release) : it does not support Xmodem (TouchStone uses a proprietary protocol which is very stable but it's not Xmodem) & you cannot capture a file to disk in the Terminal Emulator (although you can Send from disk). A unique program with good documentation.
SmartCom II is probably the most "friendly" package for telcomm I have ever seen, its use of icons is very well laid out and quite functional.
The program supports terminal emulation of TTY, DEC VT 52/100; autodial & redial if busy; a batch command system called "Autopilot" for unattended functions like time dependent logons, file transfers, etc.; file capture (select a piece of text already in the buffer and then save to disk or capture all incoming data to disk in real time); Xmodem & Smartcom protocol transfers; local print (select a piece of text already in the buffer and then print or print all incoming data in real time); text file transfer from disk; auto-answer; smooth scroll option; and a very interesting and completely unique feature .....
INTERACTIVE GRAPHICS (requires 512K), two people running Smartcom on 512K Mac's can create and/or modify drawings on-line; you may load a MacPaint file from the Scrapbook and utilize that on what Smartcom calls their "Canvas" or start from scratch. Hayes has even thoughtfully provided a chess board with all the pieces to allow you to play a real interactive VISUAL chess game through the modem! The implications and applications stagger the mind. Smartcom is a very nicely done package with excellent documentation.
All of these programs worked well for me, some had special features that were unique to themselves. All of them were miles away from MacTerminal and it's quirks. I would not hesitate to recommend that anyone evaluate them further to see if they fit their personal needs.
Happy Communicatin' ,
A Glossary Of Terms
Asynchronous ...... The transmission of characters, serially (one bit at a time), with start and stop bits separating each byte of data. The start and stop bits "frame" the data.
Subminiature "D" - connector ...... Called a "D" connector because the chamfered corners give the appearance of the letter D; this connector format is the standard used in communications hardware. The db-25 and db-9 connectors have 25 and 9 pins respectively.
RS232C ..... A low speed serial data communications "standard" defined by the "EIA" (Electronics Industry Association). The standard defines a number of parameters such as voltage levels, loading characteristics, and timing relationships. RS232C is capable of baud rates up to 19.2K (cable runs at that speed are limited to 50 feet).
"db25" Pin Assignments
Pin 1. Chassis Ground (CG) - Also known as Frame Ground, this connection insures that the chassis of both devices are at the same electrical potential to prevent electrical shock and other electrical faults. This connection is optional.
Pin 2. Transmit Data (TD) - This circuit is the path whereby serial data is sent from DTE to DCE. This circuit must be present if data is to travel in that direction at any time.
Pin 3. Receive Data (RD) - This circuit is the path whereby serial data is sent from DCE to DTE. This circuit must be present if data is to travel in that direction at any time.
Pin 4. Request To Send (RTS) - A signal from a DTE to a DCE to prepare the DCE for data transmission.
Pin 5. Clear To Send (CTS) - A signal from a DCE to a DTE that stays false until the DCE makes it true, indicating that all circuits are ready to transfer data.
Pin 6. Data Set Ready (DSR) - A signal from a DCE to a DTE indicating that the DCE has established a connection.
Pin 7. Signal Ground (SG) - This circuit is the ground to which all other voltages are referenced. It must be present in any RS232C interface.
Pin 8. Data Carrier Detect (DCD) - A signal from a DCE to a DTE indicating that it has an incoming carrier and that a communication connection has been established.
Pin 20. Data Terminal Ready (DTR) - A signal from a DCE to a DTE indicating a readiness to transmit or receive data.
Pin 22. Ring Indicator (RI) - An optional signal from a DCE to a DTE that indicates the arrival of a call.
RS422 ...... An expanded and higher speed version of RS232C. The Mac's serial ports are internally clocked at 230Kbaud and support externally clocked speeds of 920Kbaud. RS422 has better noise rejection and can support a much longer cable run than RS232C. As the signal format of the Mac SCC (for telecommunications) is an emulation of RS232C functions, we will continue to refer to those functions and not those of RS422.
"db9" Pin Assignments
Pin 1. (CG), Pin 3. (SG), Pin 5. (TD), Pin 6. (filtered +12 Volts), Pin 7. (CD), Pin 9. (RD).
ASCII ...... American Standard Code for Information Interchange; assigns a number from 0-255 to each text (and IBM PC character graphics) character and control function character. Many of you deal with Big Blue (IBM) everyday on the PC level, keeping in mind the growing number of IBM PC based Bulletin Board Systems and how much they utilize the special PC character graphics set, you should be aware of the following information ....... The special IBM PC ASCII characters have ASCII values above 127 (see Appendix G of your IBM PC BASIC manual). These characters cannot be transmitted or received when the system is using 7 data bits; the high-bit is assumed to be a parity bit and is stripped from the data in the transfer process leaving a character with an ASCII value 128 less than the one contained in the original file.
Baudot ..... 5 bit code used w/ Telex and DeafNet (typically 45-110 baud).
Baud-Rate ..... A unit of measurement of serial communication speed, in bits per second (bps), for phone lines it is typically 300 or 1200 baud; for hardwired communications (printers, terminals) it's normally 9600 baud.
Binary (base 2) ..... A number system with only two digits, 1 & 0 (On & Off, Hi & Lo, True & False) with each digit position moving from right to left representing a successive power of two (ie; decimal 1= binary 1, decimal 2= binary 10, decimal 4= binary 100, decimal 8= binary 1000 .......).
Bits & Bytes ...... A binary digit, the most fundamental of digital information, it represents one of two values or "states", 0 or 1 (On or Off). Eight bits comprise a byte and can represent a value between 0 and 255.
Break-out Box ...... An easily configurable test device that enables discrete viewing and control of most RS232 lines.
Buffer ..... A section of memory that acts as a reservoir between one device and another (information coming from a modem or going to a printer are typical applications for a buffer), the buffer acts as reservoir if the data is being sent faster than the receiving device can process it.
Capture ..... Opening a "capture" buffer and reading messages, e-mail, bulletins, etc into that buffer and then writing it to the disk when finished (you can also capture directly to disk).
Carrier ..... An audio signal that "carries" the data across the phone lines. The pitch that you hear when you connect and that your modem answers with (300 baud answers with a pure tone, 1200 answers with shaped noise). The modem "MOdulates" and "DEModulates" the digital data from digital bits to analog audio frequencies, the carrier is a constant frequency signal that maintains the connection between data being transmitted. The Bell standard frequencies for Originate & Answer are most commonly used in the microcomputer world (hence the description Bell 103 or Bell 212 for modem standards).The CCITT carrier standard is set by the International Telegraph & Telephone Consultative Committee and is far less common.
Carrier frequency definitions for Bell 103 :
Signal State Originate Answer
logic 0 space 1270 2225(cps)
carrier ----- 1170 2125
logic 1 mark 1070 2025
Character (or Data) Format ...... The combined information of the Data Bits, the Parity Bits and the Stop Bits.
Chat ....... Two-Way conversation via keyboard, normally between the SYSOP (System Operator) and yourself. Chat courtesy protocol : two carriage returns when you are finished typing (keeps the conversation and the screen clean). "GA", for "Go Ahead" is also frequently used.
Control Characters (codes) ..... A non-visible ASCII character that performs specific functions (like screen formatting, line feeds (^J) <LF>, carriage returns (^M) <CR>, form feeds (^L) <FF>, end of file markers (^Z) <EOF>, nulls (^A), escape (^[), continue, abort, etc). The "^" character is commonly used to represent a CONTROL character.
CRC ..... Cyclical Redundancy Check, used for 16 bit error correction schemes, similar to checksum but more accurate.
Data Bits ..... Several bits of information, normally 7 or 8, which represent ASCII characters.
DCE ...... Data Communications Equipment (transmit on 3, receive on 2), the modem.
DownLoad ..... Receiving a pre-written text-file or binary-file from the host system.
DTE ...... Data Terminal Equipment (transmit on 2, receive on 3), the computer.
Duplex ..... Convention to determine directionality of the data flow, ie: Full Duplex allows simultaneous transmission from both the Host and Guest (like the telephone system); Half Duplex allows only singular transmission in either direction (like a set of walkie talkies).
EBCDIC ..... Mainframe equivalent of the ASCII standard (Expanded Binary Coded Decimal Interchange Code).
Echo ....... Used to verify character transmission to the opposing party, if you type "hello" and see "hheelllloo" on your screen, turn echo off (or change Half-Duplex to Full).
Filters ..... Some communications software allows the user to define characters that they want screened (or filtered) from incoming and outgoing data (ie; catching a control L so the screen doesn't clear).
Flow Control ...... Software Handshaking, ie; Xon / Xoff protocol (control Q & control S) and Etx / Ack protocol (control D & control F)
FSK, PSK ..... The techniques used by Bell 103 and Bell 212 modems, Frequency Shift Keyed and Phase Shift Keyed.
Handshaking ...... Hardware or Software handshaking is used to keep a steady flow of information between devices without loss. Hardware handshaking uses RS232C control signals from the sending and receiving devices to tell when the communications buffer is getting full and to temporarily halt the flow of data from the sending device until the receiving buffer is sufficiently clear to handle incoming data again; Software handshaking is designed around intelligent software that recognizes the state of the buffer and uses control characters to communicate that information and to control the flow of data.
Hex ..... Hexidecimal Code (base 16), a numbering system that uses 16 digits; usually these are represented by the ten decimal digits, 0 through 9, plus the letters "A" through "F" ("A" representing decimal 10, "F" representing decimal 15, etc.). Each hexadecimal digit can represent a string of four binary digits.
Macros ..... A string of ASCII assigned to a predefined key (ie; your system account name, password, or anything you please).
Native File Format ...... Operating Systems store information in different ways, almost all of them incompatible with one another ..... "flat" ascii data files (non-formatted, ie: MacWrite in "text only" mode) can be moved from one system to another, but not without a modicum of difficulty ..... the major stumbling blocks are the Carriage Returns, Line Feeds and End Of File markers. Macintosh O.S. terminates each line of text with a <CR>, the last line of text in the document is NOT terminated; IBM PC-DOS termninated each line of text with a <CR><LF> pair and terminates the last line of text in the document with a <CR><LF> pair and then an <EOF> marker at the very end; UNIX Systems terminate each line of text with a <LF>, the last line of text in the document is terminated with a <LF> on its own line. Hence you can see the confusion that is rampant in the telecommunications world, you cannot simply grab a file from one machine and use it right away in a foreign O.S.. It must be converted to conform to the standards of the O.S. that you intend to read/manipulate it with.
Parity ..... The parity bit is set to 1 or 0 to modify the logical sum of the bits in a transmitted byte to be either even or odd (ie; to achieve even parity, if the sum of the bits in a byte is already even the parity bit is left as 0 .... if the sum is odd, setting the parity bit to 1 will make the byte even). Parity is used for error detection.
Protocol ...... Communications Settings (ie; Data Format, Baud Rate, File Transfer Method).
Start Bit ..... A start bit defines the arrival of a character on an RS232C communications link.
Stop Bits ..... One or two stop bits separate adjacent characters on an RS232C communications link.
Terminal Emulation ...... Some communications software allows your computer to emulate the terminals that are commonly used on multi-user systems so you may connect to such a system either directly or remotely (via modem) and have all the screen formatting and other terminal functions the same as they would be on the actual terminal, with the added ability to use the intelligence of your computer (ie; capturing data to disk, uploading data from disk).
UpLoad ..... Sending a pre-written text-file or binary-file to the host system.
XMODEM ..... Protocol Transfer via fixed length blocks of data, using Enquiry (ENQ) along with Acknowledge (ACK) and Negative Acknowledge (NAK); Start Of Header (SOH) and
End OF Transmission (EOT). Blocks of data are sent across, checked for the proper header and block checksum, if any errors are detected the data is re-transmitted until the block is verified, or after multiple retries it gives a "time-out" and aborts the transfer (this is common on Sprint and MCI lines). Xmodem is a public domain protocol created by Ward Christensen that has gained widespread acceptance as a file transfer standard, other protocols that you will possibly encounter are Kermit (also public domain, from Columbia University), Smartcom (from Hayes) and MNP (from MicroCom).
Cable recommendation for Mac to Smartmodem
db9 to db25:
Pins 3 & 8 to Pin 7
Pin 5 to Pin 2
Pin 6 to Pin 20
Pin 7 to Pin 8
Pin 9 to Pin 3
Future Areas Of Interest
Synchronous communications and protocols .... BCP's (byte control protocols);
DDCMP (D.E.C. digital data communications message protocol), Bisync (IBM mainfram standard) and BOP's (bit oriented protocols); IBM's SNA (System Network Architecture) which uses SDLC (synchronous data link control) a version of the internationally used HDLC (high-level data link control); Packet switched networks.