Serial Networking Devices  «Prev  Next»

Lesson 4 Serial modems
Objective Define a modem's role in the Linux system.

Linux Serial Modems

The role of the traditional analog modem has certainly diminished since the advent of high-speed internet connections like DSL, cable, and fiber-optic services. In these high-speed connections, modems are often replaced by network devices such as broadband modems, routers, or combination modem-routers. For the Red Hat Linux operating system, or any modern Linux distribution, the dependency on traditional dial-up modems for internet connectivity is minimal. Most Linux systems are now configured to use Ethernet or Wi-Fi connections for high-speed internet. However, Red Hat Linux (and other distributions) still support dial-up modems if needed, primarily for use in areas where high-speed internet is not available. In modern setups, the term "modem" still applies to devices that modulate and demodulate signals for internet connections, such as DSL modems or cable modems, but the traditional analog modem role has been largely deprecated.
  • Legacy Modems
    A modem places calls to or receives calls from other computers over conventional telephone lines. When a call is established, the communicating computers negotiate a protocol. Linux supports serial protocols such as Xmodem, Zmodem , and Kermit, as well as Internet protocols such as PPP and SLIP. PPP enables other protocols, such as IP or IPX, to function over a telephone line. PPP provides a peer-to-peer connection and is the most common method of connecting to an Internet Service Provider (ISP). As illustrated below, the client computer uses its modem to establish a connection to the server computer at your ISP. The client computer must have a properly configured kernel, meaning PPP or SLIP support is available to the kernel. PPP support is modularized and included with Red Hat Linux.
  1. Protocol: Protocols identify the type of content communicated. One of the most common protocols is PPP, for communication to and from an Internet Service Provider.
  2. Xmodem: Xmodem is a popular file-transfer protocol.
  3. Zmodem: Zmodem is similar, but has improved error detection.
  4. Kermit: A communications protocol developed at Columbia University.
  5. PPP: Point-to-Point Protocol. It is used to connect computers with the Internet.
  6. SLIP: Serial Line Internet Protocol. SLIP is very similar to PPP.
  7. IPX: Internetwork Packet Exchange protocol. IPX is a networking protocol.

Connecting with a serial modem
Connecting with a serial modem

More information about how to configure a PPP dial-up connection is included in the Linux Documentation Project (LDP) PPP-HOWTO, available from the Resources page. You can also find additional information in The Official Red Hat Linux Installation Guide. The following section discusses the setserial command to query the characteristics of a serial device.

Using setserial Command

Use the setserial command to query the characteristics of a serial device. As you have seen, the command is easy to use.
You simply enter setserial followed by the device name.
How do I check and configure serial ports under Linux for various purposes such as modem, connecting null modems or connect a dumb terminal? Linux offers various tools. Linux uses ttySx for a serial port device name. For example, COM1 (DOS/Windows name) is ttyS0, COM2 is ttyS1 and so on.
Task: Display Detected System's Serial Support
Simple run dmesg command
$ dmesg | grep tty

Output:
[   37.531286] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[   37.531841] 00:0b: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[   37.532138] 0000:04:00.3: ttyS1 at I/O 0x1020 (irq = 18) is a 16550A

Red Hat Reference

How do I use the setserial command in Linux

The setserial command is used in Linux to configure and query the serial port settings of a computer. The command is typically used in conjunction with a device file that represents the serial port, such as /dev/ttyS0. Here are some examples of how setserial can be used:
  1. To display the current settings of a serial port:
    setserial /dev/ttyS0
    
  2. To change the baud rate of a serial port:
    setserial /dev/ttyS0 baud_base 921600
    
  3. To set the data bits, stop bits, and parity of a serial port:
    setserial /dev/ttyS0 cs8 -parenb -cstopb
    
  4. To enable or disable hardware flow control:
    setserial /dev/ttyS0 crtscts on
    
  5. To enable or disable software flow control:
    To enable or disable software flow control:
    

It is important to note that this command requires administrator level permission to execute, for this reason you need to prefix with
sudo

Please refer to man setserial for full documentation and other options available.
The next lesson discusses uses for multiple network interface cards.

SEMrush Software 4 SEMrush Banner 4