NetBurner 3.5.6
PDF Version
Multihome

Multihome Application

A NetBurner TCP/IP Stack example demonstrating IPv4 multihoming capabilities.

Overview

This application demonstrates how to implement multiple IP addresses on a single NetBurner device using the Multihome functionality. The device will respond to requests from multiple network interfaces simultaneously:

  • DHCP Interface: Obtains a dynamic IP address from a DHCP server
  • AutoIP Interface: Uses automatic IP address assignment
  • Static Interface: Uses a fixed IP address (10.1.1.240)

Features

  • Multiple network interface support (up to 10 interfaces)
  • Web-based IP address display and diagnostics
  • Real-time IP address monitoring via serial debug output
  • Responds to HTTP requests on any configured IP address

Prerequisites

Required System Configuration

Before building and running this application, you must enable multihome support:

The application example includes a predef-overload.h file that automatically enables:

  • MULTIHOME functionality
  • Support for up to 10 network interfaces (NUM_MULTI_INTERFACES)

The file utilizes the NetBurner overload feature by locating the file at: \MultiHome\overload\nbrtos\include\predef-overload.h

This way NetBurner system file predef.h does not need to be mofified. See the OverloadDirectory example or the Overload section of this manual for more information.

Alternatively, you can modify the NetBurner predef.h system file as described below:

  1. Navigate to \nburn\nbrtos\include\predef.h
  2. Uncomment the MULTIHOME definition
  3. Rebuild the system files

Application Behavior

Network Interface Setup

  1. Primary Interface: Attempts DHCP address assignment
  2. Secondary Interface: Uses AutoIP for automatic address assignment
  3. Tertiary Interface: Configures static IP address (10.1.1.240) with subnet mask 255.255.255.0

Web Interface

The application starts an HTTP server that provides IP address information. Access the web interface using any of the configured IP addresses to view:

  • Source IP address of the requesting client
  • Destination IP address (which interface received the request)
  • All configured IP addresses on the device

Debug Output

The application continuously outputs IP address information to the debug serial port every 5 seconds, showing:

  • DHCP assigned IP address
  • AutoIP assigned address
  • Static multihome IP address

Code Structure

Key Files

  • main.cpp: Main application logic and web server implementation
  • ReadMe.txt: Original documentation (Doxygen format)
  • predef-overload.h: Compiler definitions for multihome support

Key Functions

  • UserMain(): Main application entry point
  • WebDisplayIpSettings(): Web page handler for IP address display
  • AddInterface(): Adds the static multihome interface

Important Variables

  • DhcpIb: Interface block for DHCP interface
  • StaticIb: Interface block for AutoIP interface
  • MultiHome1Ib: Interface block for static multihome interface

Usage

  1. Ensure multihome support is enabled in system configuration
  2. Build and deploy the application to your NetBurner device
  3. Connect the device to your network
  4. Monitor the debug serial output for IP address assignments
  5. Access the web interface using any of the assigned IP addresses

Network Configuration

The static interface is configured with:

  • IP Address: 10.1.1.240
  • Subnet Mask: 255.255.255.0
  • Gateway: Not configured (IPADDR4::NullIP())

Ensure your network topology can accommodate this address range if you plan to access the static interface.

Error Handling

The application includes a compile-time check to ensure multihome support is enabled. If MULTIHOME is not defined, compilation will fail with an informative error message directing you to enable the feature in the system configuration.

System Requirements

  • NetBurner device with TCP/IP stack
  • NBRTOS operating system
  • Multihome capability enabled in system build