HOME TOPICS ABOUT ME A simple explanation, with common-sense examples, of how modems talk to each other so they can send stuff back and forth. |
technofile Al Fasoldt's reviews and commentaries, continuously available online since 1983 How modems communicateBy Al Fasoldt Copyright © 1993, The Syracuse Newspapers Copyright © 1997, Al Fasoldt Special series of 4 articles, updated in 1997 Part 1 When I was a kid growing up in the hills south of Troy, my friends and I used to play semaphore. That was the name we gave to a game of signaling. We used homemade flags during the day and flashlights at night. Two of us would climb one hill, and a few others would get up on a hill a few hundred yards away, and we'd use the flags or flashlights to talk back and forth, in our own code. You know how kids are -- we weren't out there to learn anything; we were just having fun. But we did learn a lot about communication, even if we didn't realize it until we were adults. There were many little lessons that make sense to me now. One, of course, was the need for each side to use the same code. Ours was pretty simple, cobbled from Morse code and imagination. It was weak in some areas -- as I recall, jumping up and down was our code for "Wait a minute! I have to go to the bathroom!" -- but the best part about it was that it worked. Another lesson was that each side had to keep watching for signals from the other side. This was a little more complicated. We had to know when the other send was ready to say something, and when the other side was ready to listen. The "ready-to-say-something" part wasn't hard, once we had agreed on a universal way of indicating the starting point of each conversation. That turned out to be a circular wave of one flag overhead. The agreed-on signal to send back when you were ready to talk was a circular wave of two flags. Kids these days probably use walkie-talkies you can buy at the toy store, or maybe cellular phones. But I hope some of them are still waving flags the way we did 40 years ago, making up their own language. It's a great foundation for learning how computers talk to each other over the telephone. Computers face the same difficulties our little band of adventurers surmounted. They need to adopt a common signaling language, and they have to agree on a lot of other things. If they don't, they can't communicate. They start with some sort of connection. The connection we had as kids was visual. But computers need wires and electrons. That's the only way they can "see" each other. The wires can be direct, going from one computer through a cable to the other computer, or indirect, using something like a telephone line. Telephone connections are the most common, and they bring up another problem. Phones were made for people, not computers. What can computers do to send information back and forth on a device that was made for human conversation? I thought you'd never ask. We'll get to that next. Part 2 Mary and Mo are two kids who want to talk to each other. They're each on a hilltop, a half-mile apart. It's too far to shout, so they wave little flags in each hand. Simple, right? Bonnng! Wrong answer. It's not simple at all. Before these two playmates can talk by waving flags, they have to agree on a code -- what sort of flag-waving makes an "A" or a "B" and so on. In fact, these two kids have already done that. (They're real bright.) They've made up a code for all the letters in the alphabet, all the numbers and all the punctuations. Are they ready to chat? No. Something else is required. Kids with flags and computers with modems all need to agree on a protocol. That's a term that sounds as if it belonged in the United Nations, but it has a special meaning in the technology of communications. In its most basic sense, a protocol is merely a way of doing something that both sides have agreed on. For example, Mary and Mo need to agree on what kind of signal they'll use as a starting point -- in other words, which wave of the hand means "I'm about to send you a message!" They also need to agree on the signal that indicates the ending point, the one that says, "I just sent you a message!" And they'll need to agree on a method of keeping the individual letters they send -- the packets, you might call them -- from blending into each other. If a "B" is an up-and-then-down wave of the right hand, and a "C" is a down-and-then-up wave of the right hand, Mo could get very confused if Mary sends those letters too close together, for instance. (Kitty bat and casecall cat would really seem weird.) So Mary and Mo would have to settle these matters before they start waving those flags. If they are as polite as they are bright, they'd probably shake hands to show that they agree on the protocol. And that's just what computers do. It's even called "handshaking" when one computer calls another one, and they spend a few fractions of a second (or sometimes a lot longer) trying to agree on a protocol. Sometimes they can't agree, and one or the other will just plain hang up. Sometimes, one of them finally agrees to the protocol the other one says it had to use, only to discover that the other computer has given up a millisecond too early, and the connection is lost. Sometimes the two of them fool each other into thinking they have agreed on a protocol, and the call goes through -- and what you see on the screen is gibberish -- B's that are C's, or letters that are silly-looking symbols. And sometimes they agree on a protocol, and everything is fine until someone picks up an extension phone while the two computers are merrily chatting away. When that happens, the sending computer keeps yacking, but the receiving computer hears nothing but crazy talk. Sometimes, if they have agreed on a really smart protocol, the receiving computer is able to shout back at the sending computer -- just like Mo would do if Mary's flag waving was interrupted -- and tell it to send the last few words again. There are other problems, too. We'll look at them next. Part 3 Mary and Mo have been sending signals to each other for quite some time now, and they're pretty good at this game of semaphore. They wave little flags from hilltops a short distance apart, with each letter and number represented by a different signal. Then Mary starts to get bored, and she decides to practice doing the whole thing a little faster. The two of them had been communicating at two waves per second, but she wants to talk at three waves per second. Mo doesn't like this. After all, he'd have to learn to interpret the flag signals 50 percent faster. But after an hour of trial and error, he gets up to speed. This is fine for a couple of weeks. But then Mo comes up with a challenge. He wants to try sending messages back and forth at six waves per second. To Mary, this is obviously impossible. They won't be able to wave their arms that fast. But what if they used a different signaling technique? What if they used some sort of shorthand? (They decide to call it "shortflag.") That way, they could compress whole words into a single wave of the flag. So they spend an entire afternoon inventing their "shortflag" language. The next day, after school, they practice for a few hours, and before long they're sending messages back and forth at six times the original rate. First, they had merely speeded up the actual transmission speed. When they reached that limit, they used a form of data compression. That way, they didn't have to wave their flags any faster, but their effective communication rate was the equivalent of six waves per second. It's the same story with computers that communicate over the telephone lines. The signaling speed of modems -- the things that do all the work for computers -- started out really slow many years ago -- 110 flags (or bits, in computer talk) per second, which seems fast to kids who wave flags but is no challenge at all to a computer. Then computers and modems got up to 300 bits, then 1200 and 2400. Things really improved when modems reached 9600, then 14,400 and 28,800 bits per second. The telephone lines that computers use can't go much faster than that. But communications engineers like challenges as much as kids do, and they've come up with ways of doing shorthand, too. Built into the fastest modems are clever circuits that compress the data, just as Mary and Mo did with their flag code. These days, instead of 28,800 bits per second, computers can use that compression to talk back and fourth four times faster. That's 115,200 bits per second -- quite a lot of flag-waving. But there are ways to improve on this, too, as we'll see next. Part 4 Ward Christensen is a name to remember. In the infancy of home computers, before the IBM PC was born and before the Apple Macintosh was ever dreamed of, Ward Christensen invented a foolproof way for computers to send files back and forth by telephone. He knew that telephone lines around his home in Chicago couldn't be trusted to transmit every little beep and blip that comes out of a computer's modem in perfect order. Phones were made for people, not computers, and any kind of a bad connection can turn a computer file into a bunch of gibberish. So Christensen came up with a way of wrapping computer data inside a protective packet. Each packet was small -- only 128 bytes (or characters), about the size of a typical sentence in this newspaper -- and was sent to the other computer with a brief code. The code worked like a passport photo. The computer that was sending the data took a quick snapshot of the data (in a mathematical way, so to speak) and sent the snapshot along with the data. When the packet containing the data and the snapshot arrived at the other computer, the receiving computer looked at the snapshot and then scanned the 128 bytes to check for a match. If something was wrong -- if the bytes that were more or less waiting at the border didn't match this passport photo -- the receiving computer sent the 128 bytes away with a message to come back and try again. This could happen as many as 10 times for each packet of 128 bytes before the receiving computer gave up all hope and shut down the border. Technically, what was going on involved computations of checksums. These are the combined totals of numbers, using the actual numerical equivalents in all the bytes. (All computer information is made up of numbers, so a quick computation is very simple.) The sending computer added them up and sent the results -- the checksum -- along to the receiving computer. It, in turn, did the same thing, then compared its results to the checksum that came along with the packet. If they matched, it let the data through and called for another packet. Christensen called his method "Xmodem," which stood for "Xternal Modem" (a modem that was far away from the one attached to the sending computer). It became the standard way of sending files from one computer to another, and helped launch the current revolution in personal computing. Xmodem is still being used today in both the original version, called Checksum Xmodem, and in an improved version that does more intricate math. It's called CRC Xmodem. (A "CRC" is a cyclical redundancy check, but we'll leave the explanation of that mouthful for another time.) Other methods have become popular, each one building on the success of Xmodem. One newer method -- or "protocol," as these file-transfer methods are called -- is Ymodem. It sends data in larger packets, among other improvements. Another is Zmodem, which is now the most widely used method. It's a super-smart protocol that's able to ask the receiving computer to do a lot of the groundwork in transferring files. But X, Y or Z, the methods in use today all owe their origins to Ward Christensen. He's still active in computing, and still sending files the good old way. |