---++ Simple 3 Node IPv4 Network on 3 machines (EXAMPLES/ETH_EMUL_3_NODES_IPv4)
This is an example of a small IPv4-based network deployment using a single-cluster OpenAir L2 protocol stack with PHY emulation. It makes use of 3 physical machines on an ethernet network. Data is exchanged between the CH and the two nodes using a single IPv4 radio bearer, RBID 12 for node 1 and RBID 13 for node 2.
---++++ Compiling the code
The Makefile has 4 rules (kernclean,userclean,kern,user) which compile the kernel and user-space versions of this emulation. The two with "clean" just clean the directories before compiling. You have to do this the first time you compile either of the two versions.
To compile a user emulation just do
# make usercleanTo compile a kernel emulation just do
# make kernclean---++++ Running the emulation
Here are the scripts to be installed on all machines
---+++++ Machine 0 (10.0.1.1)
start_ch_user: Inserts nasmesh.ko module and sets up network device and classification rules for IPv4 traffic to/from 2 nodes (10.0.1.2 on RB 12 and 10.0.1.3 on RB 20). Launches user-space emulation ( mac_sim).
start_ch_kern: Inserts nasmesh.ko and openair_l2.ko modules and sets up network device and classification rules for IPv4 traffic to/from 2 nodes (10.0.1.2 on RB 12 and 10.0.1.3 on RB 20). Launches ethernet PHY abstraction ( bypass_phy) and real-time L2 protocol stack via rt_emul.
---+++++ Machine 1 (10.0.1.2)
start_mr1_user: Inserts nasmesh.ko module and sets up network device and classification rules for IPv4 traffic to/from CH (10.0.1.1 on RB 4). Launches user-space emulation ( mac_sim).
start_mr1_kern: Inserts nasmesh.ko and openair_l2.ko modules and sets up network device and classification rules for IPv4 traffic to/from 2 nodes (10.0.1.1 on RB 4). Launches ethernet PHY abstraction ( bypass_phy) and real-time L2 protocol stack via rt_emul. ---+++++ Machine 2 (10.0.1.3)
start_mr2_user: Inserts nasmesh.ko module and sets up network device and classification rules for IPv4 traffic to/from CH (10.0.1.1 on RB 4). Launches user-space emulation ( mac_sim).
start_mr2_kern: Inserts nasmesh.ko and openair_l2.ko modules and sets up network device and classification rules for IPv4 traffic to/from 2 nodes (10.0.1.1 on RB 4). Launches ethernet PHY abstraction ( bypass_phy) and real-time L2 protocol stack via rt_emul.
Run the start_ch_kern script for kernel emulation or start_ch_user for user-space emulation first. Then run the other two similarly. You should then be able to do a
# ping 10.0.1.Xfrom the CH (where X is 2 or 3) and
ping 10.0.1.1
from either of the other two nodes. You can also set up the CH to route to another network by simply turning on forwarding like
# echo "1" > /proc/sys/net/ipv4/ip_forwardand adding a route to the CH as default gateway in each node like
route add default gw 10.0.1.1All IPv4 traffic will then pass through 10.0.1.1 and will be forwarded to all other interfaces on the CH (e.g. ethernet). Note that you cannot communicate between the two nodes directly. You would need openair3 for that since some special networking configurations are required to allow the CH to route traffic within the subnet.
-- User.RaymondKnopp - 10 Jul 2008