RS-232, veteran of the networking world

Get off my lawn

Get off my lawn

RS-232 serial is a bit like the old vet Walt Kowalski, Clint Eastwood’s character in Gran Torino.  On one hand he’s a little old-fashioned and set in his ways, but he stands his ground and you know he’s got your back when there’s trouble.

Up until the mid-90s, RS-232 was commonplace in every day computing, it was the way mice connected to PCs and the way PCs connected to the Internet via dial-up modem.  Looking back even further to the 60s and 70s, RS-232 was a way for green/amber-screen terminals around offices and computer labs to connect to the central mainframe or minicomputer (the original cloud computing, in a sense) – in fact the origins of ASCII text-based data comms over RS-232 go back to teletype machines from the start of last century. Over time, RS-232 has been displaced by USB and other interfaces for these common applications.

However, it’s still going strong in the networking world in the form of the out-of-band management or console port.  It’s interesting to think that the state-of-the-art infrastructure that makes up the fabric of Internet still uses (and during outages may utterly rely on) an old codger like RS-232.

This is because the console provides low-level CLI access independent of network connectivity.  This gives ops a convenient interface for initial provisioning (getting infrastructure connected to the network in the first instance), routine maintenance (making changes that may affect connectivity) and fault finding and repair (when it’s dropped off the network).  RS-232 has got your back.

While USB can and does provide similar connectivity, the plug’n’play simplicity of the protocol that made it so popular actually puts it at a bit of a disadvantage by increasing the hidden complexity.  Using RS-232, both ends must be manually wired and configured before the hardware UARTs will talk, and once it’s set up there’s not a lot to go wrong.

Like Mr Kowalski, RS-232 has its idiosyncrasies (or was that idio-async-rasies?).

• Wiring up pins pairs: In RS-232, pins at each end connect to perform a set function, e.g. to receive data and to transmit data (RxD/TxD), to signal ready to transmit and to signal ready to receive (RTS/CTS, DTR/DSR) and so on.  One device’s TxD (say pin 2) is wired to the other’s corresponding RxD (say pin 3).  Modern devices with large data buffers and plenty of processing power don’t usually need special signals to control console data flow, so often RS-232 consoles only need three wires connected (TxD, RxD and GND, electrical ground).

DTE or DCE: There are two RS-232 DB9 pin-out standards, DTE (“data terminal equipment”) and DCE (“data carrier equipment”).  Historically, input/display devices such as terminals and PCs used DB9 male, DTE pin-out.  Comms peripherals like modems used DB9 or DB25 female, DCE pin-out.  These two devices connect with a straight-wired cable connecting PC pin 1 to modem pin 1, pin 2 to pin 2 and so on.

This means the DB9 DCE pin-out is the reverse of DTE.  Where it gets confusing is the pin names in DCE are “from the DTE perspective” – in DCE land a RxD pin actually transmits data!  So it helps to have a console pin-out diagram that either specifies DCE or DTE naming convention, or even better, has arrows showing the signal direction in or out.

The majority of DB9 consoles on IT infrastructure are DB9M DTE, which means you use the 319015 adapter to connect to Opengear “X2” pinout models.

• RJ45 consoles: These days, most RS-232 console ports on network infrastructure are RJ45 (like an Ethernet port with no link/activity LEDs).  There are no standards for the RS-232 pin-out over RJ45, however the vast majority of serial consoles follow the de facto standard adopted by Cisco (notable exceptions include some PDU and environmental monitoring devices).  For Cisco-style consoles, use a simple straight through patch cable to connect to Opengear “X2” models.

• Weird & wonderful pin-outs and connectors: Some consoles have RJ11 or even 1/8 stereo headphone jack connectors.  For these, either find a pin-out diagram, get out the crimper and build a custom console cable, or use the original console cable that shipped with the equipment, connecting via a 319016 adapter to Opengear “X2” pinout models.

• Maximum cable length: The RS-232 standard specifies this as 50 feet/15 metres.  However this is a very conservative figure that accounts for high speeds.  By slowing down the baud rate to 9600 (the typical console speed) the maximum length increases dramatically to 500 feet/150 metres.

For more practical info on cabling up RS-232 consoles to your Opengear, check out our knowledge base: