home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / bsd / 4523 < prev    next >
Encoding:
Internet Message Format  |  1992-08-20  |  7.0 KB

  1. Path: sparky!uunet!kithrup!stanford.edu!rutgers!gatech!destroyer!caen!hellgate.utah.edu!fcom.cc.utah.edu!gateway.univel.com!ns.novell.com!gateway.novell.com!thisbe.Eng.Sandy.Novell.COM!terry
  2. From: terry@thisbe.Eng.Sandy.Novell.COM (Terry Lambert)
  3. Newsgroups: comp.unix.bsd
  4. Subject: Re: (386BSD) Modems and com ports
  5. Keywords: internal or external?
  6. Message-ID: <1992Aug20.213721.4548@gateway.novell.com>
  7. Date: 20 Aug 92 21:37:21 GMT
  8. References: <1992Aug20.171557.30071@watson.ibm.com>
  9. Sender: news@gateway.novell.com (NetNews)
  10. Organization: Novell NPD -- Sandy, UT
  11. Lines: 130
  12. Nntp-Posting-Host: thisbe.eng.sandy.novell.com
  13.  
  14. In article <1992Aug20.171557.30071@watson.ibm.com> cchase@watson.ibm.com (Craig Chase) writes:
  15. >So, before I go plunk $250+ on a modem I wonder if someone could
  16. >clarify the situation with dropped characters on a serial line.
  17. >
  18. >I understand that the 386BSD device drivers have trouble keeping
  19. >up with high-speed serial communications, but how much trouble
  20. >and how fast?  The FAQ lists 38K bps as higher than you're likely
  21. >to be able to go, does this mean the 19.2K would be OK with sl/ip?
  22.  
  23. 1)    Dropping characters depends on the device driver.  With the default
  24.     device driver and the right chips at a high clock rate, 38400 is
  25.     about top speed.  It is possible to write a driver to go faster
  26.     (I have a driver for SCO that I wrote that would do 115K but
  27.     liked to lock non-16550 machine up tight).
  28.  
  29. 2)    People have posted that they have has no problems with SLIP up
  30.     to 19200 in comp.unix.bsd (here).
  31.  
  32. >(BTW: 19.2K being MNP5 + V.32 and quite doable on a modem
  33. > with V.32bis + V.42bis you can go up to 56K)
  34.  
  35. I think you mean "can burst up to 56K".  The problem is that most of these
  36. modems expext to be able to flow control the sender, since you can't
  37. guarantee a minimum compression, and even 960 characters a second is asking
  38. a lot that your normal phone line can't deliver.  Generally, this is
  39. implemented with a large forward channel and a small (~150 baud) back
  40. channel and is more suited to unidirectional connections (like sliding
  41. window file transfer protocols).
  42.  
  43. From my experience, this generally means that you will have either in band
  44. flow control (XON/XOF) or out of band flow control (CTS/RTS).
  45.  
  46. The problems with using in band flow control on SLIP or any other binary
  47. protocol are manyfold:
  48.  
  49. 1)    Modem buffers generally exceed the 128 character UNIX tty buffers.
  50.     This means that by the time you react to the flow control, it's
  51.     too late.  This is a problem for polled drivers, like my 115K
  52.     driver for SCO, which took an interupt and polled like hell until
  53.     an input latency (window border) was seen, since more data is
  54.     dumped than can possibly be read, including the flow control
  55.     characters.
  56.  
  57. 2)    A UNIX write, once started, must run to completion before it may be
  58.     XOFed.  Cheap modems have less than the required 384 character
  59.     buffer window, as they expect the host to respond to flow control
  60.     more or less immediately.
  61.  
  62. 3)    If you are using in band flow control, you can't use a binary
  63.     protocol.  For instance, packet sequence numbers for xmodem packets
  64.     17 and 19 are ^Q and ^S, respectiveyly.  This includes zmodem,
  65.     unfortunately, because the handshake to determine if binary data
  66.     can be used is binary (GAK!).
  67.  
  68. The problems with out of band flow control are also prohibitive:
  69.  
  70. 1)    Your driver must be written to uderstand the type of flow control
  71.     your modem uses for CTS/RTS.  This May be Hayes style, or it
  72.     could be Bell 103-C style.  See "Technical Aspects of Data
  73.     Communications" from "Digital Press", by McNeely.
  74.  
  75. 2)    CTS/RTS lines are *not* standardized by the driver (see below).
  76.  
  77.  
  78. The problem shared by any flow control whatsoever is lockup on line drop.
  79. If the computer is ^s'ed, or !RTS or !CTS'ed, then the driver will wait
  80. for the condition to be cleared.  In most cases, this takes precedence
  81. over a little thing like DCD dropping because of call waiting or a bad
  82. connection.  Result:  Serial port is hung until (1) someone calls in
  83. and manually resets it or (b) you reset your computer.  The good thing
  84. about this is that DTR generally will not be re-raised to the modem
  85. so that you *CAN* dial in to reset it until *AFTER* you have dialed
  86. in and reset it, resulting in a catch-22.
  87.  
  88. One major problem here is that *many* (read: most) cheap MNP modems (read:
  89. not from Microcomm) *force* in band flow control on in MNP mode.  Thus
  90. you can *never* use binary data and *always* risk lockup.  This is
  91. because, in general, the modems are cheaper from skimping on buffer memory.
  92. If you had input and output buffers in excess of the window size of your
  93. protocol plus 384 characters, you would never need flow control from the
  94. modem to the computer or the modem to the modem (still need it for computer
  95. to modem because of UNIX's small tty buffers).
  96.  
  97. The soloution is to ask a sales guy, who probably doesn't know and just
  98. wants you to drop a third of a kilobuck so he gets his 10%, or a modem
  99. manufacturer, who does know but hates to tell anyone anything bad about
  100. their products, or to buy it on a trial basis.
  101.  
  102. >My *real* question is, will it matter if I get an internal modem
  103. >or an external modem?  From a performance standpoint, it would
  104. >seem that an internal modem has a little less hardware between the
  105. >phone line and the bus, and so might have less trouble at the
  106. >higher performance rates.  But then, I tend to doubt that it 
  107. >makes any difference you could notice from a device driver.
  108.  
  109. Ah, here's the nasty!  If you use an internal modem, what are the default
  110. values of CTS/RTS/DCD/DTR?  Do they float?  Are they sinked low?  Are they
  111. sinked high?
  112.  
  113. Generally, on a UNIX system, it pays to not buy an internal modem.  Sure,
  114. the fancy ones will let you peg the signals seen by the computer for the
  115. pseudo-RS232 level to values that will let it work -- but will it work
  116. right?  Generally, no, not unless the UART is seperate from the modem
  117. chips, and probably not then.  With a connector, you are guaranteed you
  118. can buy a 150 ohm resistor and do the job if it isn't done correctly
  119. by the serial board (I know of only one (it's built-in) serial board where
  120. this is necessary).
  121.  
  122. Why is this important?  Well, you need tobe able to have DCD sinked low
  123. unless carrier is present.  You need CTS sinked low unless it is raised
  124. by the device (indicating it is truly clear to send)  You want the same
  125. for RTS.  You want DTR to only go high (allowing the modem to answer)
  126. when it is asserted by the driver (ie: a process, like getty, has the
  127. port open.  You want HUPCL and ~CLOCAL set so that when you log out, it
  128. hangs up the phone (1 22Hr long distance call will tell you this real fast!).
  129. You want the "login:" message to only pop up (ie: getty's open succeeds)
  130. only when carrier is present so that your modem doesn't talk you serial
  131. port into SILO overflows.
  132.  
  133. And all of this dependant on the tty driver understanding either /dev/cua0
  134. or the partial open hack to work right.
  135.  
  136.  
  137.                     Terry Lambert
  138.                     terry_lambert@gateway.novell.com
  139.                     terry@icarus.weber.edu
  140.  
  141. ---
  142. Disclaimer:  Any opinions in this posting are my own and not those of
  143. my present or previous employers.
  144.