Networking basics Continued

FTP
Networking
List of Computers
Shell Accounts
UNIX
Windows
Command Prompt
Ports
Comp Secruity
Weboard

Links
Tutorials & Games

Visual Basic
My Programs
Sign Guestbook
View Guestbook

Welcome to the next page :)   Are you with it so far ?  I take it most of you out there use modems, or have had or will have contact with them at some point, so I feel it best to know talk about them. 

A modem is used to connect serial networks over PSTN (Public Service Telephone Network - your phone lines), leased lines or privates networks.  a modem generally has two interfaces:

  • An analogue connection to interface with the WAN.
  • A serial connector (most commonly RS323 - do not confuse it with ethernet wire even though they may look the same.  It whats inside and not how they look (where have i heard that before ? ;)))

I hope you can make sence of this diagram (top marks to you if you do ;))  But I am trying to show a typical modem link over a PSTN or leased line.


DTE (Data terminal equipment)
(ie computer)

 

Digital
_____
DCE (Data communications equipment)
(ie Modem)
      Analogue network      DCE (Modem) _____ DTE (computer)

When the modem recieves digital data from the DTE, it must convert it to analogue (MOdulate) to send over the WAN.   The recieving modem must then convert it back to digital (DEModulate) to send to the DTE it is connected to.  This is where the name modem, originates.

Short range modems or line drivers are used to transmit digital data over private analogue networks.  Line drivers are avilable to support the following:

  • Synchronouse and asychronouse data.
  • Any serial interface
  • 2 and 4 wire copper networks.

If a private network doesn't make use of amplifiers, the transmission rates will be affected by the distance.  The higher the distance, the lower the maximum transmission rate.  However, becasue private networks are not restricted to the 300Hz to 4000Hz range, the maximum transmission rates can be higher that those achievable across PSTN or leased line.

This table shows example transmission rates for 2 and 4 wire private networks.

2400bps 9600bps 19200bps 64Kbps 128Kbps
2 wire 5Km 2.7Km 2Km 1.3Km 1Km
4 wire 9Km 6Km 4Km

Fibre wires are less affected by distance and also offers higher bandwidths.  Fibre line drivers can support speeds of 2.5Mb/s over 2Km.

Most modems are designed to dial over the PSTN network and they generally remain off-line until a dial message is set from the attached computer.   When a PSTN modem is off-line, it is in command mode.  In this mode, the modem is ready to accept commands from the DTE.  If the modem understands the command, it will obey it, otherwise it will ignore and report the error back.

There are two command sets that are commonbly used: AT and V.25bis.  More on these further down the page.

There are several ways that you can get a modem to dial another modem and form a WAN connection.

  1. If the modem is configured to accept AT commands, the DTE could send the AT command  "ATD" to begin dialing.
  2. If the modem is configured to accept V.25bis commands, the DTE could send the v.25bis command "CRN".
  3. If the modem is configured for "DTR dial", then the DTE couls simple switch the DTR pin from space to mark.
  4. If the modem has front panel buttons, it can be told to dial from there.

When a modem atempts to connect to a remote modem, it may need to send a variety of status messages back to the DTE.  In general this only happens if the AT command set is used.  The following messages can be sent

  • NO DIAL TONE.  This occurs if the modem could not detect a dial tone "duh"
  • BUSY.  This occurs if the modem detects a busy tone.
  • NO CARRIER.  THis occurs of the modem failed to connect to the other modem for some other reason.

There are two methods of which the modem can answer a call

  1. If the modem is configured to manual answer, it will not answer unless the DTE tells it to.
  2. If the modem is configured for auto answer, it will answer the call after a programmable number of rings.

Handshaking

Before modems can go online they need to negotiate.   This allows the modems to test the line for quality and each other for common modulation modes.  CNegotiation begins with the following signals:

The dialing modem emits a "originate" signal
The answering modem emits an "answer" signal.

In a best case scenario, the modem will go online at the highest comman speed.  How ever if the line quality is poor, this may be lower.

Data Mode:
When online the modem enters data mode.  In this mode data transmitted from DTE is sent immediately across the WAN to the other modem which passes the data onto its DTE.  In this mode, the modems are transparent, it appears as if the two DTEs are directly connected.

Flow Control:
Modems can be configured for the following flow control methods (flow control being how much data is passed out before it takes more in)

  • None.  No flow control is used
  • Software. XON/XOFF signals will be sent to control the flow.
  • Hardware.  RTS/CTS (Request to send / Clear to send) signlas will be sent to control the flow.

Leased Line modems  usually have a similar set of features to PSTN modems.  The main difference is that they don't need to dial a number, but instead begin handshaking immediatly.  Most leased line modems fall into one of two categories.

  • 2 wires leased line and PSTN only.  These are the most commonly available modems.  An AT command or front panel button can switch the modem between PSTN and leased line operation.
  • 4 wire and 2 wire PSTN.  These modems are very expensive.

When a modem is configured for leased line operation, it will leave command mode and begin handshaking.  In general the only to get back to command mode is via one of the following methods.

  1. Send The escape sequence (+++)
  2. Set DTR to space.

Since it is not obvious which modem is the originator and which is the answering, one leased line modem will have to be configured to emit an originate signal and the other a answer signal.   If this is set incorrectly  the modems will fail to handshake.

AT Commands.

This command set was originally defined by Hayes and is now the only standard supported by most modems.  Although the original command set was quite powerful, most modem manufacturers have added extra commands and altered already existing ones.  This has reached a point where each modem can be considered to have a different command set, altough much of the orignal command set remains the same.

  • AT commands are almost exclusively used in the asynchronous environment.
  • On modems without front panel controls, AT commands are the only way to perform detailed modem configurations.

When issuing the commands to the modems, it wil rtespond with a variety of "responce codes" depending ont he command issued.  Some examples are listed below.

Response Description
OK Command accepted
ERROR Command Unknown or out of range
NO DIALTONE A dial command was issued, but no dial tone is detected
NO CARRIER Failed to handshake or have disconnected
BUSY A dial command wa issued but the other node was busy
RING An incoming call is detected
CONNECT Have connected to a remote modem

Here is a list of the most command AT commands.   They are fairly consistant from modem to modem.  To use the AT commands you will need to open a package such as Hyperterminal and then type into there.  Refer to the help files of these products for more info.

Command Extra Description
ATA 0 Manually answer incoming call
ATD Tx
Px
Sn
Dial the number x using tone dialing
Dial the number x using pulse dialing
Dial number stored n
ATE 0
1
Disable the command mode echo
Enable the command mode echo.  This is the normal mode
ATH Hand-up the modem
ATL 0to3 Speaker volume
ATM 0
1
2
3
Speaker off
Speaker on whilst dialing and training
Speaker always on
Speaker only on during training
ATO Enter the data mode from command mode (if online)
ATQ 0
1
Display result code as normal
Don't display result codes
ATS n=x
n?
Set S register to hold value x (see s registers later)
Display contents of s register
ATV 0
1
Result codes are sent as numbers (useful for scripts).
Result codes are textual.  This is normal mode
ATY 0
1
Don't use long space disconnect
Disconnect on long space
ATZ n Load from option set n
AT&C 0
1
Sets DCD to always be high
Sets DCD to always be low
AT&D 0
1
2
Ignore DTR (assume it is high).  Useful if no DTR pin
DTR is escape.  This makes the modem enter command mode when DTR drops
DTR is disconnect.  This makes the modem drop the line when DTR drops.
AT&F n Reset the modem to factory setting n
AT&K 0
1
3
No flow control
XON/XOFF flow control
RTS/CTS flow control
AT&L 0
1
2
Configure for PSTN operation
Configure for 2 wire leased line operation
Confidure for 4 wire leased operation
AT&M 0
1
Async operation
Sync operation
AT&S 0
1
DSR is always on.  This is the normal mode.
DSR is controlled by the modem.  Varies from modem to modem.
AT&V 0
1
Display modem configuration status in long form
Display modem configuration in short form
AT&W n Save current configuration to slot n
AT&Y n Select default power-up configuration to be save slot n
AT&Z n,z Enter stored phone number into x into phone number slot x
+++ The default escape sequence used to enter command mode.   There must be one second on inactivity before and after this string is sent, otherwise it will be ignored.

S registers are special purpose registers which can be set to hold different values.  They are useful when a wide range of values need to be set and normal AT commands would be unsuitable.

S Number Effect
0 Answer incoming calls aster specified number of rings. 0 = disabled
1 Counter holding number of rings so far
2 Specify escape code character.  This is normally 43 for +
10 Specifies the time in 10th of a second that carrier must be lost before the modem hangs up.
27 Specifies the time in 10th of a second that DTR must be low before the modem accepts the DTR drop.

V.25bis commands.

This command set is mainly used in SYNC applications. It has a very limited and strict command set (Every modem exactly the same set).  This is mainly due to the fact that the higher level SYNC protocols deal with most of this things.

Commands
CRN Call requested number DIC Disregard incoming call
CRS Call stored number RLF Request list of forbidden numbers
CRR Re-dial last number RLN Request list of stored numbers
CIC Connect incoming call
Responces
CFI Call failure VAL Valid
INC Incoming call INV Invalid
ONL Online LSN List of stored numbers

Additional modem features.

Error detection is a method by which modems can detect the presence of an error in incoming data (by making use of check sums) and inform the sending modem to re-transmitt the data.

More sophisticated modems can attempt to correct errors in data once the error has been detected.  This is know as error correction.  A more complicated checksum system is used which makes it possible for a modem to sometimes determine what the errors in recieved data are and fix them, with out having to ask the sending modem to re-transmit.

The standatds for error correction / detection are as follows:

  • MNP (Microsoft Networking Protocol) levels 2 to 4.  Level 4 is the only mode in use since it uses 16bit checksum making it more efficient.
  • LAPM.  This is a more powerful system which breaks data in 128byte packets and adds 32bit checksum.  Most modems support this standard.
  • v.42.  This standard for error correction attemps to use LAPM (if both modems support it) and falls back MNP4 is it can't.

 

Questions I am commanly asked.

1)  I have a 56k modem but only seem to connect at 28.8/33.6k.  Why is this ?

There are several reasons that this can be caused.

  • If you plug your modem into a phone you stand no chance in hell of connecting over 33.6.  Analogue phone lines only run at 33.6k hence you ain't gonna get above that (well you might if your ISP has a isdn line going to the PSTN and then you might get 35/36 but i doubt it)
  • Your ISP doesn't support 56k speeds or you are dialing a modem that goes at 33.6
  • You do not have the right drivers.  You need v.90 drivers for your modem to reach 56k and even then it is only theoretically possible.
  • Bad line quality.

I think that bangs modems nicely on the head, if you have any questions, feel free to ask them on my weboard and I or someone else will do or best to answer.  Coming up next, introduction to LANS,  LAN Protocols over a serial connection (ie SLIP, PPP), Microsoft Neworks and Introduction into IP.  Then I will briefly talk about ATM and I think that'll be it.

 

 

 

Hosted by www.Geocities.ws

1