{"id":292,"date":"2020-08-18T19:23:47","date_gmt":"2020-08-18T20:23:47","guid":{"rendered":"http:\/\/www.linux-tutorial.info\/?page_id=77"},"modified":"2020-08-22T19:26:17","modified_gmt":"2020-08-22T20:26:17","slug":"this-is-the-page-title-toplevel-127","status":"publish","type":"page","link":"http:\/\/www.linux-tutorial.info\/?page_id=292","title":{"rendered":"Modems"},"content":{"rendered":"\n<title>Modems<\/title>\n<p>\nUp to this point, I&#8217;ve talked about things that almost every computer user has and almost always\ncome with  the system. We are now moving into a new area, where we get one computer to talk to\nanother. In my opinion, this is where computers begin to show their true power.\n<\/p>\n<p>\nAlthough once almost a standard, modems are no longer common computer accessories. Other technologies such as\n<glossary>ISDN<\/glossary>, <glossary>DSL<\/glossary> and <glossary term=\"VPN\">VPNs<glossary> have supplanted the functionality of\nmodems, as of this writing, knowing how to cofigure modems is still part of some Linux certificatations.\n<\/p>\n<p>\nPerhaps the earliest means of getting computers to talk to one another (at least over long\ndistances) was  the <glossary>modem<\/glossary>.  Modem stands for\n<u>Mo<\/u>dulator\/<u>Dem<\/u>odulator, which is its basis of operation. It takes the digital signals\nthat come across the <glossary>bus<\/glossary> from the <glossary>CPU<\/glossary> and converts them\ninto a signal that can be understood by the telephone wires. This process is called\n<i>modulation<\/i>. On the other end, the signals are converted back from telephone signals into\ncomputer signals by a process called <i>demodulation<\/i>. Graphically this looks like Figure\n0-15.\n<\/p>\n<p>\n<img decoding=\"async\" src=\"ser_xfer.png\" width=612 height=144 border=0 usemap=#ser_xfer_map>\n<map name=\"ser_xfer_map\">\n<area shape=\"RECT\" coords=\"175,71,252,99\" href=\"popup#Modem#A modem converts digital computer signals into analog signals to send across a telephone line.\">\n<area shape=\"RECT\" coords=\"361,72,438,100\" href=\"popup#Modem#A modem converts digital computer signals into analog signals to send across a telephone line.\">\n<area shape=\"RECT\" coords=\"512,2,610,139\" href=\"popup#Modem#When using a modem, computer talk indirectly with each other.\">\n<area shape=\"RECT\" coords=\"2,0,100,137\" href=\"popup#Modem#When using a modem, computer talk indirectly with each other.\">\n<\/map>\n<p>\n<icaption>Image &#8211; Transfer of Data Across Modems (<b>interactive<\/b>)<\/icaption>\n<\/p>\n<p>\nThe underlying concept of the transmission of data across the telephone line is that of a\n<i>carrier<\/i>.  A <glossary>carrier<\/glossary> is a signal\nthat runs along the phone line that is at a constant strength (amplitude), frequency, and phase.\nBecause all  of these are known values, changes in them can be detected. It is the changes that are\nused to <glossary>encode<\/glossary> the data.\n<\/p>\n<p>\nWhen data are sent at <i>relatively<\/i> low speeds, the exact timing of that data being sent is not\nimportant.  (relative to modem speeds) Markers, the start and stop bits, used within the transmitted data indicate the\nbeginning and the end of each piece of data. (Note: You could have two stop bits.) If each\n<glossary>modem<\/glossary> is set to the same values, it knows when one piece of data stops and the\nnext one begins. This is called asynchronous transfer.\n<\/p>\n<p>\nHow big is that piece of data? Usually just a single character. All the modems that I have ever\nseen have either 7 or 8 bits for data. That means that there are 7 or 8 bits between the start-stop\nbit pairs .This, too, is something that both modems need to agree on.\n<\/p>\n<p>\nParity works like this. Lets assume that a specific byte has 3 bits that are set. If you are\nusing  even <glossary>parity<\/glossary>,  then the <glossary>parity bit<\/glossary>\nwould be set to make the total number set four, which is an even number. If you are using odd\nparity,  the number of the bit is already an odd number (three), and the parity bit would not be\nset.\n<\/p>\n<p>\nWhen the settings at which your <glossary>modem<\/glossary>\nmust be are determined, the order is usually the number of data bits, followed by the number of stop\nbits, then the <glossary>parity<\/glossary>.  By default, Linux uses eight data bits, one\n<glossary>stop bit<\/glossary>,  and no parity. It is common to refer to this as &#8220;eight, one, and\nnone,&#8221; or &#8220;8-1-N.&#8221; Other settings might be 7-2-E for seven data bits, two stop bits, and even\nparity.\n<\/p>\n<p>\nAnother important characteristic is the speed at which the <glossary>modem<\/glossary>\ntransmits the data. Although the exact timing is not critical, signals must be received within a\ncertain time or problems happen. (For example, you could be waiting for months if the connection\nsuddenly dropped.)<\/p>\n<p>\nNow, lets go back to the modulated <glossary>carrier<\/glossary>\nwave. The term for the number of changes in the carrier wave per second is <i>baud<\/i>, named after\nthe  French telegraph expert, J. M. E. Baudot. One way of encoding data, based on the changes to the\ncarrier wave, is called <i>frequency shift keying<\/i>, or FSK. The number of changes that can take\nplace per second is the number of bits of information that can be sent per second (one change\n= one bit).\n<\/p>\n<p>\nLets consider a <glossary>modem<\/glossary>\nconnection that operates at 2400 <glossary>baud<\/glossary>,\n eight data bits, one <glossary>stop bit<\/glossary>,\n and no <glossary>parity<\/glossary>.\n This gives us a total of 10 bits used for each character sent. (Did you forget the start bit?)\nBecause baud  is a measurement of the number of <em>bits<\/em> sent per second, 2400 baud means that\n240 characters can be sent per second.\n<\/p>\n<p>\nOther encoding methods result in getting more bits per <glossary>baud<\/glossary>.\n For example, the Bell 212A standard operates at 300 baud. However, because it gets four bits of\ndata per  baud, it gets 1,200 bits per second for those 300 baud. This rate is accomplished by\nchanging more than just the frequency. If you changed both frequency and amplitude, you have four\ndistinct values that you could use.\n<\/p>\n<p>\nHave you ever had someone tell you that you have a 9600 <glossary>baud<\/glossary>\nmodem? Don&#8217;t believe them! There is no such thing. In fact, the fastest <glossary>baud rate<\/glossary>\nis only 2400. So what are people taking about when they say their <glossary>modem<\/glossary>\ngoes 9,600 or 14,400? They are talking about the <i>bits-per-second<\/i> (bps). If you get one\nbit-per-baud,  then these terms are synonymous. However, all 9600 modems get more than that. They\noperate at 2400 baud but use a modulation technique that yields 4 bits per baud. Thus, a 2400 baud\nmodem gives 9,600 bits per second.\n<\/p>\n<p>\nAs with all the other kinds of hardware I&#8217;ve talked about, modems must have\nstandards to be useful. Granted,  you could have a <glossary>modem<\/glossary>\nthat can only communicate with another from the same manufacturer, but even that\nis a kind of standard.\n<\/p>\n<p>\nModem standards are like opinions: everyone has one. There are the AT&amp;T standards, the Bell\nstandards, the  International Telecommunications Union (ITU) standards (which was formally the\nComite Consultatif International Telegraphique et Telephoneique, or CCITT), and the Microcom\nNetworking Protocol (MNP) standards.\n<\/p>\n<p>\nAs of this writing, the two most common standards are the <glossary>CCITT<\/glossary>\nand MNP. The MNP standards actually work in conjunction with modems that adhere to the other\nstandards and for  the most part define technologies rather than speeds or other characteristics.\n<\/p>\n<p>\nThe CCITT\/ITU standards define (among other things) modulation methods that allow speeds up to\n9,600bps  for the V.32 standard and 14,00bps for the V.32 bis standard. The new V.34 standard\nsupports 2,800bps. One newer standard, V.42, is accepted worldwide and provides error-correction\nenhancements to V.32 and V.32 bis. The V.42 standard also incorporates the MNP 4 standard, enabling\none <glossary>modem<\/glossary> that supports V.42 to communicate with another that supports MNP 4.\n(For much more detail on the different modem standards, see <i>The Winn L. Rosch Hardware Bible<\/i>,\nThird Edition, and the <i>Modem Reference<\/i>, Second Edition, by Michael Banks. Both are published\nby Brady Books.)<\/p>\n<p>\nOne standard we need to go into is the <i>Hayes command set<\/i>. This set was developed by and\nnamed for  the <glossary>modem<\/glossary> manufacturer Hayes and is used by almost every modem\nmanufacturer. It consists of dozens of commands that are used to modify the functionality as well as\nread the characteristics of your modem. Most of the commands in this set begin with AT (which is\nshort for &#8220;attention&#8221;), so this is often referred to as the <glossary>AT command set<\/glossary>.\nNote that the AT and almost every other letter is capitalized.\n<\/p>\n<p>\nSeveral AT commands can be combined in a single string, and this is often used to initialize the\n<glossary>modem<\/glossary> before first use. These commands can set the default speed, whether the\nmodem should automatically answer when someone calls in, and even how many rings it should wait for.\nI&#8217;ll talk about these in more detail later when I talk about configuring modems.\n<\/p>\n<p>\nModems come in two forms: internal and external. Because a <glossary>modem<\/glossary>\nis a serial device (it communicates serially as opposed to parallel), it will always take up a\nserial port.  With an external modem, you must physically make the connection to the serial port, so\nyou are more conscious of the fact that the modem is taking up a port. Internal modems also take up\na serial port, but it is less obvious. Because you don&#8217;t actually see the modem, some users don&#8217;t\nrealize that they no longer have a COM1 (or COM2).\n<\/p>\n<p>\nIn addition to the traditional serial modems, you can also find external USB modems. Some motherboards are\nproduced with the modem built into the motherboard.\n<\/p>\nExternal modems are usually connected to the computer via a 25-pin RS-232 connector. Some\n<glossary>serial<\/glossary> ports have only a 9-pin serial port, so you need an adapter to convert\nthe 25-pin to 9-pin, because <em>every<\/em> <glossary>modem<\/glossary> I have every seen has a\n25-pin connector.\n<\/p>\n<p>\nSo, what happens when I want to dial into another site or send an e-mail message to my sister  in\nWashington? Well, the communications software (maybe cu or uucp) sends a signal (an increase in\nvoltage) along pin 20 (data <glossary>terminal<\/glossary> ready, or DTR) to tell the\n<glossary>modem<\/glossary> that it is ready to transmit data. On the modem, the equivalent pin is\npin 6, data set ready, or DSR.\n<\/p>\n<p>\nThe <glossary>modem<\/glossary>\nis told to go &#8220;off hook&#8221; via the transmit data line (TX, line 2). Shortly thereafter, the system\nsends  the AT-commands to start the modem dialing either with pulses (ATDP) or with tones (ATDT).\nThe modem acknowledges the commands via line 3 (receive data, or RX).\n<\/p>\n<p>\nThe <glossary>modem<\/glossary>\ndials just like a phone and tries to connect to some device on the other end, probably a modem. If\n<i>auto answer <\/i>is enabled, the modem being called should answer, or <i>pick up<\/i>, the modem.\nWhen the connection is made, the calling modem sends a high-pitched signal to tell the receiving\nmodem that a modem is calling. The receiving modem sends a higher-pitched acknowledgment. (You can\nhear this if your modem has a speaker.)<\/p>\n<p>\nThe <glossary>carrier<\/glossary>\nsignal\nis then established between the two modems, which is kept at a steady, predetermined frequency. This\nis the signal that is then modulated actually to transmit the data. When the\n<glossary>modem<\/glossary> has begun to receive this carrier signal, it sends another signal back to\nthe system via line 8 (carried detect, or CD). This signal is held active for the duration of the\ncall.\n<\/p>\n<p>\nThe two modems must first decide how they will transmit data. This negotiation is called a\nhandshake.  The information exchanged includes many of the things that are defined in the different\nstandards I talked about earlier.\n<\/p>\n<p>\nWhen the system is ready to send data, it first raises line 4 (request to send, or RTS). If it is\nready,  the <glossary>modem<\/glossary> says okay by raising line 5 (clear to send, or CTS). Data\nthen is sent out on line 2 and received on line 3. If the modem cannot keep up, it can drop the CTS\nline to tell the system to stop for a moment.\n<\/p>\n<\/p>\n<p>\nModerm modems, are almost always plug-n-play, but you still need a means of communicating with it.\nFor this, one tool you can use is <command>setserial<\/command>. It can be used to not only specify various modem\nsettings, but can also provide information about how your modem is currently set. This includes basic information like what\n<glossary>interrupt<\/glossary> or <glossary>base address<\/glossary> the modem uses, but also how to behave with hangup\nsignals.\n<!---\nMost new modems are Plug and Play and you have various ways to deal with it:\n    * The serial driver does it all for you.\n    * Use the isapnp program: http:\/\/linux.die.net\/HOWTO\/Plug-and-Play-HOWTO-4.html\n      * ISA Bus: Isapnp (part of isapnptools)\n    * Let a PnP BIOS do the configuration.\nTo display the configuration of an ISA device, use pnpdump. This utility can dump information (IO ports, interrupts, and DMA channels) that the card uses. To configure any ISA devices, use isapnp. For more information check the man page of isapnp.conf file.\nDiscussion of setserial command: http:\/\/linux.die.net\/man\/8\/setserial\nDial Out and In:\nminicom command: http:\/\/linux.die.net\/man\/1\/minicom\nMain Menu --> System Tools &#8211;> Internet Configuration Wizard\nhttp:\/\/www.yolinux.com\/TUTORIALS\/LinuxTutorialPPP.html\n&#8211;>\n","protected":false},"excerpt":{"rendered":"<p>Modems Up to this point, I&#8217;ve talked about things that almost every computer user has and almost always come with the system. We are now moving into a new area, where we get one computer to talk to another. In &hellip; <a href=\"http:\/\/www.linux-tutorial.info\/?page_id=292\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-292","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=\/wp\/v2\/pages\/292","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=292"}],"version-history":[{"count":1,"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=\/wp\/v2\/pages\/292\/revisions"}],"predecessor-version":[{"id":629,"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=\/wp\/v2\/pages\/292\/revisions\/629"}],"wp:attachment":[{"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=292"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}