← Back to Blog

The Engineer's Guide to Network Protocols: SMB, FTP, FTPS & SFTP

Published on Jan 16, 2026 • 15 min read • Full Stack Development

Moving files between systems is one of the oldest tasks in computing, yet it remains one of the most misunderstood. Whether you are building a React frontend that needs to fetch assets or a Node.js backend managing automated backups, choosing the right protocol is a balance between speed, security, and network compatibility.

Deep Dive: Understanding the Protocols

SMB (Server Message Block)

SMB is a Network File System protocol. Unlike the others, it isn't just for transferring files; it allows you to mount a remote folder as if it were a local drive.

SFTP (SSH File Transfer Protocol)

SFTP is built on top of the Secure Shell (SSH) protocol. It is the modern gold standard for remote work. Because it tunnels everything through a single port (typically 22), it is highly secure and easy to manage through firewalls.

Why FTPS?

You might wonder: if SFTP is so great, why does FTPS even exist? FTPS (FTP over SSL/TLS) is essentially "Standard FTP wearing a seatbelt." It adds a layer of encryption using the same SSL/TLS certificates that secure the web (HTTPS).

Here is why an engineer would choose FTPS:

Step-by-Step: Setting up FTPS on Windows

To host your own secure server using Windows IIS, follow these architectural steps:

  1. Install IIS FTP: Enable "FTP Service" and "FTP Extensibility" under Windows Features.
  2. Create a Certificate: Open IIS Manager, navigate to Server Certificates, and create a Self-Signed Certificate. This provides the "S" in FTPS.
  3. Configure the Site: Add a new FTP site, bind it to your IP (e.g., 192.168.100.11), and select Require SSL using your new certificate.
  4. Firewall Rules: You must allow Port 21 and your Passive Data Range (e.g., 5000-5100) in the Windows Advanced Firewall.

Automating Transfers with Node.js

As developers, we rarely move files manually. We automate. To connect to an SFTP server using Node.js, we use the ssh2-sftp-client library. This is far more professional than using standard FTP libraries.

const Client = require('ssh2-sftp-client');
const sftp = new Client();

async function uploadLogs() {
    try {
        await sftp.connect({
            host: '192.168.100.11',
            port: 22,
            username: 'pokha',
            password: 'your-password'
        });

        console.log("Connected to Server...");
        await sftp.put('./local-logs.txt', '/remote/path/logs.txt');
        console.log("Upload Complete.");

    } catch (err) {
        console.error("SFTP Error:", err.message);
    } finally {
        await sftp.end();
    }
}

uploadLogs();

Protocol Comparison Matrix

Feature SMB SFTP FTPS
Primary Goal LAN Sharing Remote Management Legacy Security
Firewall Ports 445 22 (Single) 21 + Passive Range
Encryption Optional (v3+) Native (SSH) Native (TLS/SSL)
Bigyan's Recommendation: While FTPS is a solid choice for legacy enterprise systems, SFTP remains the modern standard for general web development and Node.js automation due to its firewall-friendly single-port architecture.