what is bonding in Mikrotik routers

Bonding in MikroTik routers like MikroTik switches(CRS326-24G-2S+RM) refers to the process of combining multiple physical network interfaces into a single logical interface. This aggregated interface behaves like a single connection, but with the benefits of higher bandwidth, link redundancy, or both. Bonding is useful in situations where you want to maximize network performance or ensure failover protection.

Key Concepts of Bonding in MikroTik:

  1. Aggregated Bandwidth: By combining two or more interfaces, bonding increases the total throughput available. For example, if you bond two 1 Gbps Ethernet interfaces, you can achieve up to 2 Gbps combined bandwidth (depending on the bonding mode and traffic type).

  2. Redundancy: If one of the bonded links fails, traffic will continue to flow through the remaining active interfaces, ensuring continuous network service.

  3. RouterOS Bonding: MikroTik’s RouterOS includes a bonding feature that supports various bonding modes, allowing administrators to select the method that best suits their networking needs.

Bonding Modes in MikroTik:

  1. Balance-rr (Round Robin):

    • Traffic is split evenly between all available links in a sequential, round-robin fashion.
    • Good for maximizing throughput.
    • Can cause issues with out-of-order packet delivery in some applications.
  2. Active-backup:

    • Only one interface is active at a time; the rest are in standby.
    • If the active link fails, another link takes over.
    • Ensures redundancy but doesn't aggregate bandwidth.
  3. Balance-xor:

    • Uses XOR of MAC addresses to determine which interface to use for each packet.
    • Ensures that traffic between two devices always goes through the same link, avoiding out-of-order packet delivery.
    • Offers some load balancing.
  4. Broadcast:

    • Sends every packet on every interface in the bond.
    • Rarely used, except for specific needs like ensuring all connected devices receive the same data simultaneously (used in certain multicast environments).
  5. 802.3ad (LACP - Link Aggregation Control Protocol):

    • A standardized method for link aggregation.
    • Dynamically negotiates and balances traffic over aggregated links.
    • Requires switch or device on the other end to support LACP.
    • Widely used in enterprise settings for both load balancing and redundancy.
  6. Balance-tlb (Transmit Load Balancing):

    • Only outgoing traffic is load-balanced based on the current link load.
    • Incoming traffic is received via a single interface.
    • Does not require any special support from the switch or device at the other end.
  7. Balance-alb (Adaptive Load Balancing):

    • Dynamically balances both outgoing and incoming traffic.
    • Automatically adjusts traffic distribution based on load and interface performance.
    • Works without the need for special support on the other end.

Use Cases for Bonding:

  • Increased Bandwidth: For bandwidth-heavy applications like video streaming, file transfers, or web hosting, bonding can combine multiple links to handle more traffic.

  • Redundancy and Failover: Bonding ensures that if one link fails, the remaining links continue to function. This is critical in environments where network uptime is essential, such as data centers, ISPs, or enterprise networks. See MikroTik Load balancing across two ISP connections using Mangle.

  • Cost-Effective Scaling: Instead of upgrading to more expensive higher-speed links, you can bond multiple lower-speed connections to achieve a similar performance improvement.

Bonding in Routers vs. Switches:

  • Routers: Bonding on MikroTik routers can be used for WAN aggregation (combining multiple internet links) or LAN aggregation.
  • Switches: When bonding on MikroTik switches, it's typically used to aggregate multiple links between devices (servers, routers, other switches) to increase internal network bandwidth and redundancy.

How to Set Up Bonding on MikroTik:

  1. Create a Bonding Interface:

    • Use the MikroTik RouterOS web interface (Winbox) or command line to create a new bonding interface.
    • Assign physical interfaces (Ethernet or SFP) to the bonded interface.
  2. Select Bonding Mode:

    • Choose the bonding mode that best fits your application (e.g., 802.3ad for load balancing and redundancy or active-backup for failover).
  3. Configure IP and VLANs:

    • Apply IP addresses or VLANs to the bonded interface as needed.
  4. Monitor and Test:

    • Check traffic flow and performance to ensure the bonded interfaces are working as expected. Monitoring tools in RouterOS can help you view the status of bonded links.

Bonding is a powerful feature that can significantly enhance network performance and reliability. It is highly flexible and widely used in environments ranging from small businesses to large data centers.

For example the MikroTik CCR2004-16G-2S+ is a high-performance router from MikroTik's Cloud Core Router (CCR) series. It is designed for managing and routing data traffic efficiently in networks of various sizes, from small to medium-sized businesses to large enterprises. Here are its key features:

  1. CPU: It uses an ARM 64-bit Cortex-A57 1.7 GHz quad-core CPU, offering improved processing power compared to older models.

  2. Ports:

    • 16 Gigabit Ethernet ports (RJ45): These provide fast wired connectivity.
    • 2 SFP+ ports: These allow for fiber optic connectivity, each supporting up to 10 Gbps speed.
  3. Performance: The router is known for its powerful data throughput, handling up to 7.5 Gbps with all ports combined. It’s optimized for large data streams and multi-gigabit networking, making it ideal for ISPs, enterprise networks, and data centers.

  4. Operating System: It runs on RouterOS, MikroTik’s proprietary software, which is highly configurable for advanced network routing, traffic shaping, VPN, firewalls, and more.

  5. RAM and Storage:

    • 4 GB RAM: Suitable for most enterprise-grade networking tasks.
    • 128 MB NAND: Storage for RouterOS and configurations.
  6. Power: It supports both dual redundant power supplies and PoE (Power over Ethernet) in, providing flexible power options.

It is a versatile router for those needing advanced networking capabilities.

the MikroTik CCR2004-16G-2S+ supports the bonding feature, which is a method of aggregating multiple network interfaces into a single logical interface to increase bandwidth, provide redundancy, or both. This feature is part of the RouterOS operating system, which runs on the device.

Key aspects of bonding on the CCR2004-16G-2S+:

  1. Load Balancing: You can combine multiple Ethernet interfaces into one bonded interface to distribute traffic across them, which helps in balancing the load and effectively increasing the available bandwidth.

  2. Link Redundancy: If one of the bonded links fails, the remaining links continue to carry traffic, ensuring network uptime and reliability.

  3. Bonding Modes:

    • Balance-rr (Round Robin): Traffic is transmitted in a sequential, round-robin fashion over all available links.
    • Active-backup: One interface is active at a time; if the active link fails, another interface takes over.
    • Balance-xor: Transmits traffic based on the source MAC address XOR'd with the destination MAC address.
    • Broadcast: Sends all traffic over all interfaces, used for situations where you need the same data on all links (less common).
    • 802.3ad (LACP): Dynamic link aggregation based on the IEEE 802.3ad standard, which allows automatic configuration and negotiation of links.
    • Balance-tlb (Transmit Load Balancing): Only the outgoing traffic is balanced based on current load, with incoming traffic handled by a single interface.
    • Balance-alb (Adaptive Load Balancing): A more advanced load balancing mode that adjusts for incoming and outgoing traffic dynamically.
  4. Compatibility: Bonding can be done across various types of interfaces, including the 16 Ethernet ports and the 2 SFP+ fiber ports, allowing for flexible network design.

This feature is very useful for applications like high-availability systems, load balancing, or scenarios where you want to maximize the available bandwidth by using multiple links.

Bonding Requires Equal Conditions:

Bonding will not work in scenarios where one bonding interface has a static IP connection from one ISP and the another bonding interface has dynamic IP connection from another ISP. 

Consider this scenario, where you have eth0 with a static IP from one ISP and eth3 with a dynamic IP from another ISP, using bonding will not work effectively in a traditional sense. Here's why:

For bonding to work properly, all interfaces in the bond typically need to be connected to the same network or ISP with similar configurations (i.e., same subnet, routing, etc.). In your case, you're connecting to two different ISPs with different IP addressing schemes and gateways. Since bonding aggregates multiple links into one logical link, it expects uniformity between the links.

Routing and Different IPs:

  • With bonding, the traffic is split across multiple interfaces, but both interfaces would need to share the same destination and source IP configuration.
  • In your case, each ISP will assign its own IP address, gateway, and potentially use different routing policies, making bonding impractical.

Alternatives to Bonding in Multi-ISP Setup:

  1. Failover (Active-Backup):

    • You can set up an active-backup failover configuration, where traffic uses the primary ISP (eth0 with static IP) and only switches to the secondary ISP (eth3 with dynamic IP) if the primary one fails. This is not true bonding but ensures redundancy.
  2. Load Balancing with PCC (Per Connection Classifier):

    • Instead of bonding, you can use PCC load balancing in MikroTik, which distributes traffic across multiple ISPs based on rules you define (e.g., source IPs, destination IPs, etc.).
    • PCC allows you to utilize both ISPs, sending some connections through eth0 (static IP) and others through eth3 (dynamic IP).
  3. Policy-Based Routing:

    • You can configure policy-based routing to direct specific traffic types through each ISP. For example, HTTP traffic could go through one ISP and FTP through another.
  4. ECMP (Equal-Cost Multi-Path Routing):

    • If both ISPs offer similar bandwidth, you can use ECMP routing to load balance traffic between them. However, it does not truly bond the links, as the two ISPs will have different routing policies.

Why Bonding Won't Work with Different ISPs:

Bonding assumes that both links are equal and can forward traffic to the same destination as a single logical connection. When using two different ISPs:

  • Each ISP will have its own gateway and routes, causing issues with packet delivery (especially with round-robin or XOR-based bonding modes).
  • Packets sent via one ISP may not be routed properly back through the other, leading to connection failures.

Summary of Options:

  • True bonding won't work with a static IP from one ISP and a dynamic IP from another ISP due to different routing and network conditions.
  • Consider using failover, PCC load balancing, or policy-based routing to make use of both ISPs effectively without bonding.

Would you like help configuring one of these alternatives in MikroTik? See how to configure Mikrotik router with Weighted PCC Load Balancing.

Post a Comment

Previous Post Next Post