Kuro5hin.org: technology and culture, from the trenches
create account | help/FAQ | contact | links | search | IRC | site news
[ Everything | Diaries | Technology | Science | Culture | Politics | Media | News | Internet | Op-Ed | Fiction | Meta | MLP ]
We need your support: buy an ad | premium membership

[P]
Introduction to Digital Communication

By Bios_Hakr in Technology
Wed May 22, 2002 at 01:14:04 PM EST
Tags: Hardware (all tags)
Hardware

Recently, I moved to Japan to take a new job. Upon my arrival here, I was heartbroken to discover that the only Internet access available was via 56k modem. I set up my PC, dug through my box of obsolete hardware, and pulled out my ancient 56k external modem. I was unable to find the cable to connect the modem to the PC, but I was able to make one rather quickly. I fired up the PC, turned on the modem, and connected to my local ISP. Soft red lights flickered on the modem; other lights gave a steady glow.

As my password was being authenticated, it dawned on me that there are probably people out there that look at those lights and have no idea what they signify. Well, read on for some insight into the journey your 1's and 0's take from your PC to your modem.


DTE/DCE

In order to understand how data passes from a computer to a modem, you need to know what these devices are called from an interface standpoint. A computer is considered a terminal. It will originate and terminate data. The DB-9 interface on the back of your computer is, therefore, Data Terminal Equipment (DTE).

The modem connected to your PC does not generate any data of its own. It merely takes the output of the PC and modulates it into a form that can be easily transmitted over a long distance. The (usually) DB-25 (RS-232) interface on the modem is considered Data Communications Equipment (DCE). DCE is also sometimes called Data Circuit-terminating Equipment, however, most people will understand both terms.

If you look closely at the two interfaces, you will notice two differences. The first is size. Because of the constraints of PCB layout, most multifunction devices will use the smallest interface possible while a device dedicated to one job will usually have the larger DB-25 connector.

The second difference is in the pins. The computer will have pins sticking out (male) and the modem will have holes to accept these pins (female). Virtually every DTE interface will be male while DCE will be female. The explanation given me is that a (male) DTE will send data out and a (female) DCE will accept data in. You can draw your own conclusions about the sexist nature of that statement, but it does make things easier to remember.

Basic Control Leads - DTR/DSR

When a computer wants to send data across a DTE interface, it needs to know that something will be waiting on that interface to accept the data. This is accomplished via the Data Terminal Ready (DTR)/Data Set Ready (DSR) handshake. These two leads tell the DTE and the DCE that the interface is wired to another interface, and that the equipment on the end of that wire is on.

The simplest explanation is that as soon as you turn on DTE, the DTR lead "goes high", meaning that a voltage is applied to it. The voltage and polarity applied depends on the specific standard of the interface and the manufacturers implementation of that standard. The voltage will continue to remain in this state until the DTE is turned off. The voltage, when detected by the DCE, signifies that the DTE is present and operational.

DSR, like DTR, goes high as soon as the equipment is powered on. The difference is that powering on the DCE activates DSR. You may be wondering why DSR is used vice DCR. The answer is that, back in the day, DCE was often called the "Data Set". Regardless of the acronym used, voltage is applied to DSR by the DCE and is detected by the DTE. The DTE then knows that DCE is present and operational.

More Control Leads - RTS/CTS/DCD

How fast does your can your computer send data across the serial port? Most serial ports top out at 115kbps. Now, how fast can your modem talk to your ISP? My modem connects at about 45kbps. What would happen if your computer started slamming data to your modem as fast as it could? There are two systems in place to prevent such a mess.

The first system is an internal buffer in the modem. Usually this is a very small amount of RAM, which stores data coming from the PC until it can be dumped to the analog line. The second system is the Request To Send (RTS)/Clear To Send (CTS) handshake.

The DTE has data waiting for transmission. Before sending this data, it needs to verify that the data will go somewhere. The DTE will apply a voltage to the RTS lead. When the DCE detects the voltage, it checks the internal buffer. If the buffer is not full, the DCE will apply voltage to the CTS lead. As soon as the buffer is full, the CTS lead will go low.

Just having data in the buffer does no good if the two modems are not connected. That is where the Data Carrier Detect (DCD) lead comes in. The AT commands, which are intercepted by the modem, trigger the modem to dial. When the modem detects an answer, it will attempt to establish a carrier. A carrier is the un-modulated wave that will carry the data between the two modems. As soon as the carrier is up, the DCE will apply voltage to the DCD lead. The DTE detects the voltage on the DCD lead and knows that the modem will pass any data to the distant end modem.

Now that the DTE sees both the DCD and the CTS leads as being high, it knows that it can slam data over to the DCE. When the DCE buffer is full, CTS goes low. The DTE sees CTS go low and it stops sending data. However, as long as the DTE buffer has data waiting to go out, the RTS lead will stay high.

Data Transmission - TD/RD

Ok, our DTE is on and has data in the buffer. The DTE applies voltage to the DTR and the RTS leads. The DCE has detected AT commands triggering a dial and has established a connection to the ISP. The DCE applies voltage to the CTS and the DCD leads. The DTE detects CTS and DCD. So now what?

Well, that's where the Transmit Data (TD) lead comes in. The purpose of this lead is to transport 1's and 0's from the DTE buffer to the DCE buffer. It does this by applying positive voltage to represent a "1" and no voltage to represent a "0". Before you go off on me, I do know it is more complicated than that, but this explanation will suffice.

The DCE reads the voltage from the TD lead and converts that to 1's and 0's in the buffer. What happens between the buffer and the analog line is going to have to wait for another day.

The DCE, upon receiving information from the ISP, takes that information and converts it to voltages that are then applied to the Receive Data (RD) lead. The DTE detects the voltages on the RD lead and then converts that into 1's and 0's which are then passed up the OSI layer to eventually end up as whatever you requested.

Summary

The relationship between DTE and DCE can be very complex. While I have tried to simplify this to the basics, it can still seem overwhelming. The basic thing you should be able to take away is an understanding of what the blinking lights mean. DCD, for instance, means that your modem has negotiated a connection with your ISP. Once you understand what they mean, the next important thing it to understand the direction of the signal. For instance, TD is an output on your computer and an input on your modem.

Assuming this article is accepted, I plan on writing other articles explaining how the modems modulate a carrier to pass data and how asynchronous and synchronous lines differ. From there, maybe details on how to build your own cables and what a "null-modem" cable does. Post some suggestions on things you'd like explained. If it deals with communication, I've probably done it. If I have done it, then I'd be happy to write about it.

Glossary of Terms
DTE - Data Terminal Equipment
DCE - Data Communications Equipment
DTR - Data Terminal Ready
DSR - Data Set Ready
DCD - Data Carrier Detect
RTS - Request To Send
CTS - Clear To Send
DB-9/25 - "DB" refers to the D-shaped connector on most communications equipment. It takes some imagination to see the connector as being D-shaped. Your best bet is to take my word for it:) The "9" or "25" is the pin count. For example, a DB-9 has a row of 5 pins and a row of 4 pins for a total of 9 pins.

Signal Flow
DTE-----DCE
DTR---->DTR
DSR<----DSR
RTS---->RTS
CTS<----CTS
DCD<----DCD
TD---->TD
RD----RD

Sponsors

Voxel dot net
o Managed Hosting
o VoxCAST Content Delivery
o Raw Infrastructure

Login

Poll
I have...
o External modem with all lights. 30%
o External modem with a few lights. 6%
o Internal modem with software for the lights. 5%
o Internal modem with TD/RD lights. 3%
o Cable modem with no need for control leads. 55%

Votes: 80
Results | Other Polls

Related Links
o Also by Bios_Hakr


Display: Sort:
Introduction to Digital Communication | 41 comments (18 topical, 23 editorial, 0 hidden)
Minor nitpick (4.00 / 2) (#15)
by ggeens on Wed May 22, 2002 at 03:42:47 AM EST

My modem connects at about 45kbps.

That is the speed used for receiving data. The upstream baud rate (used when you send data) is limited to 28.8 or 36 kbps.

L'enfer, c'est les huîtres.


Nitpicking your nitpick (3.00 / 1) (#29)
by JonesBoy on Wed May 22, 2002 at 02:18:33 PM EST

>The upstream baud rate (used when you send data) is limited to 28.8 or 36 kbps.

You are using baud and bps interchangably here.   That is not right!   Baud is signal changes on a line per second.    bps is bits per second, usually of transmitted data (ignoring start/stop/parity/error correcting bits).   A 56k modem is actually 8kbaud, with a constellation of roughly 128 points.

I believe the CCITT standard for maximum baud rate on an analog phone line is 9600.   The 56k modem is about as close as you can get before there is too much loss in the digital signal conversions between CO's.
Speeding never killed anyone. Stopping did.
[ Parent ]

Re: Nitpicking your nitpick (3.00 / 1) (#31)
by ShawnD on Wed May 22, 2002 at 06:08:48 PM EST

I believe the CCITT standard for maximum baud rate on an analog phone line is 9600.
The sampling rate is 8192hz so you really can't have more than 8192 baud.
The 56k modem is about as close as you can get before there is too much loss in the digital signal conversions between CO's.
56kbps is the highest you could ever get in the North American telephone system since that is the rate of the digital data in the system. 8192hz*7 bits = 56kbps.

BTW Europe uses 64kbps (8192hz*8 bits) channels, so in theory they should be able to support >56kbps modems, but I doubt it.

[ Parent ]

Only Muxed Signals (3.00 / 1) (#33)
by Bios_Hakr on Wed May 22, 2002 at 06:50:08 PM EST

That is only true for a multiplexed signal.  The copper from your phone to your RBOC can use frequencies up to 20khz easily.  Beyond that, it delves into the black magic of DSL.  Most RBOCs today have the capability to terminate the modem signal, convert it to digital, and send it on to the ISP.

[ Parent ]
Not the reason (none / 0) (#35)
by JonesBoy on Thu May 23, 2002 at 09:30:39 AM EST

The maximum speed of 9600 baud was around long before the digital conversions, and it has absolutely nothing to do with sampling rates, actually.    The limitation on baud rate was created to limit crosstalk between copper runs.   Higher speed digital waves transition faster, and have higher frequency components which 'jump' off the wires better.

Oh, and the 56k spec is 8 bits everywhere.   The problem lies in the line noise, which makes the modem back off to a smaller constellation, for more reliable transmission rates.

Speeding never killed anyone. Stopping did.
[ Parent ]

hmmmm... (4.00 / 4) (#17)
by athagon on Wed May 22, 2002 at 04:17:16 AM EST

Fascinating stuff. Thanks! (Of course, I'm a geek...) I might have included one fact, though. Modem -> M.O.D.E.M. It actually stands for MOdulator/DEModulator. ^_~ Just a moderately useful piece of knowledge. ;) (Sorry if you mentioned it, and I just read over it.)

Small Correction (none / 0) (#37)
by Rizzen on Thu May 23, 2002 at 05:00:17 PM EST

Since we're being nit-picky, that should be:
Modem -> Mod. Dem.
Otherwise, you are missing a lot of word definitions. :) M.O.D.E.M. would expand into 5 different words, while Mod. Dem. expands into the two words.

One thing I really don't like about broadband is how the industry has carried over the term "modem". Neither cable nor DSL "modems" do any modulating or demodulating --> the signal is digital all the way. Gateway would be a better, more appropriate term.

The years of peak mental activity are undoubtedly those between the ages of 4 and 18. At age four, we know all the questions; at eighteen, all the answers.
[ Parent ]
I repectfully disagree (none / 0) (#38)
by sroylance on Fri May 24, 2002 at 10:37:02 AM EST

Both cable internet and DSL are broadband communications media, in the technical sense of broadband. Unlike ethernet, which is baseband, the signals on the wire are analog. Analog signals are generated by somehow modulating a carrier signal. Since the signals 'on the wire' for DSL and cable are analog, the Cable/DSL modem must, in fact, modulate and demodulate.

[ Parent ]
Lamps should be blinking... (4.42 / 7) (#18)
by helander on Wed May 22, 2002 at 04:52:54 AM EST

Yes, all tech gear should have blinking lamps. The best modem I've ever had was a US robotics with all the lamps and a huge manual for tweaking data compression, line quality and a billion or two of obscure features. Think about it - from 1200 baud to v90/56k in just a few years - and it's still the same cooper wire.
My new ADSL modem is space-age tech with no blinking lamps - just three dull yellow LED (Power/Modem/Data). At least one of them should be blue, me thinks. And one of them should blink.


Cable modems, (3.33 / 3) (#19)
by binaryalchemy on Wed May 22, 2002 at 05:43:27 AM EST

well, my cable modem has blinking lights. As does my old US Robotics 56k I use so my laptop can call home.
------
Defending the GPL from a commercial perspective is like defending the Microsft E
Polarity (3.50 / 2) (#21)
by Bad Harmony on Wed May 22, 2002 at 08:08:23 AM EST

RS-232, the standard used for most serial interfaces on personal computers, uses negative logic. A "one" or "asserted" or "mark" is indicated by a negative voltage (-3V to -25V). A "zero" or "not asserted" or "space" is indicated by a positive voltage (+3V to +25V).

54º40' or Fight!

Neg Mark (3.00 / 1) (#32)
by Bios_Hakr on Wed May 22, 2002 at 06:45:01 PM EST

I have noticed that a lot of equipment use negative-mark inversion.  I dunno why, maybe it is easier to transmit a negative voltage.

[ Parent ]
Corrosion (3.50 / 2) (#34)
by Bad Harmony on Wed May 22, 2002 at 08:48:19 PM EST

I think it dates back to the days of the telegraph. That is where the terms "mark" and "space" came from. They used to have a device that made a mark on a moving strip of paper tape when the telegraph key was closed. I'm not familiar with the electrochemistry of corrosion, but I was told that negative voltages were chosen to reduce corrosion problems. That is also supposed to be the reason for the -48V loop voltage on telephone lines in the USA. The loop voltage is also supposed to prevent splices from going bad from corrosion.

54º40' or Fight!
[ Parent ]

Collectors (none / 0) (#39)
by epepke on Fri May 31, 2002 at 05:44:10 PM EST

Signals outside of computers generally have to have higher current than the signals inside computers, primarily because a cable makes a really nice antenna and will have some induced currents due both to induction and just picking up radio signals. (Don't laugh too hard: the oxide in a corroded crimp joint makes a servicable diode. People made rectifiers out of copper oxide back before semiconductors.) Back in the early days, transistors were more expensive, both to buy and to wire up (they were often discrete), so it made sense to use as few of them as possible. Now, with a positive VCC, the cheapest way to make a driver is to use a switching configuration of a class A amplifier. This takes just one NPN transistor. The emitter goes to the low voltage. The base is driven from the positive logic, i.e. high for a one, and low for a 0. The collector is biased to the high voltage, sometimes by putting a resistor there but often just because it's connected to something that will pull it high. When the input signal to the base goes high, the transistor conducts, and the voltage on the collector goes low. So, if you're using positive logic inside the box, negative logic outside the box is most natural with the cheapest possible driver.

Of course, on the recieving end you have to switch again, but that can be done with a low-current transistor and a resistor to handle the extra current. Low-current transistors are cheap, and resistors are cheap, too.


The truth may be out there, but lies are inside your head.--Terry Pratchett


[ Parent ]
Missing poll option (2.75 / 4) (#23)
by 87C751 on Wed May 22, 2002 at 09:21:08 AM EST

"Modem? It's in the router, under the stairs somewhere."

My ranting place.

My modem (1.00 / 1) (#36)
by tekue on Thu May 23, 2002 at 10:46:34 AM EST

is a Telindus Crocus HDSL (<=2Mbit/s), it's  external and has some lights. The lights are somewhat different (PWR, TST, AIS ERR, TXD, SQ1, SQ2, SQ3, RXD), and they are not exactly blinking (in fact, I'd be quite worried if they did). I've voted the second option, external with some lights, and I think there's no need to get all snobbish about it.
--
Humanity has advanced, when it has advanced, not because it has been sober, responsible, and cautious, but because it has been playful, rebellious, and immature. --Tom Robbins
[ Parent ]
blinking lights... (none / 0) (#40)
by gromgull on Tue Jun 04, 2002 at 05:43:00 AM EST

...is what I have a hub for... Lots of green lights blinking and a yellow one whenever there are "collisions".

--
If I had my way I'd have all of you shot

no broadband; well, I don't know what to say (none / 0) (#41)
by jago25 on Tue Aug 27, 2002 at 07:28:54 AM EST

 Just read an article in Wired about the way cable services are bundled with broadband and thus are really cheap in South Korea. (combined with the dense population and culture)

 I really did think the same was true for Japan in dense areas.

 

Introduction to Digital Communication | 41 comments (18 topical, 23 editorial, 0 hidden)
Display: Sort:

kuro5hin.org

[XML]
All trademarks and copyrights on this page are owned by their respective companies. The Rest © 2000 - Present Kuro5hin.org Inc.
See our legalese page for copyright policies. Please also read our Privacy Policy.
Kuro5hin.org is powered by Free Software, including Apache, Perl, and Linux, The Scoop Engine that runs this site is freely available, under the terms of the GPL.
Need some help? Email help@kuro5hin.org.
My heart's the long stairs.

Powered by Scoop create account | help/FAQ | mission | links | search | IRC | YOU choose the stories!