LANforge-ICE Cookbook
The LANforge-ICE Cookbook provides a set of high-level examples of how to
setup useful test scenarios in LANforge-ICE for WAN emulation. Each example
intends to give the reader a brief introduction to the test scenario and a set
of step-by-step instructions on how to use the LANforge-GUI to configure the test.
All of the following examples will work on Linux systems running the
LANforge software with the LANforge kernel and a sufficient license. If you are running
another Linux kernel, you will not be able to exactly duplicate some of the
examples, but there are usually work-arounds available to assist you.
Please contact us at [email protected]
if you have any questions.
If you are using the Windows version of LANforge, you will have to modify ports
using the Windows utilities and you will not be able to duplicate the Routed Mode
ICE examples. Everything else should work approximately the same, but
the performance is limited to 10Mbps speeds.
LANforge-ICE WAN Emulation
Before attempting the examples below, ensure that you have successfully
followed these software installation guides:
It is also recommended that you back up your current running LANforge-Server
database so that you may safely return to your current operating state.
LANforge-ICE Cookbook Examples
- Bridged Mode (Non-routed) WanLink
- Bridged Mode WanLink with Virtual Ports and Redirect Devices
- Routed Mode WanLinks with Virtual Routers
- Routed Mode WanLinks with a Single Physical Port
- Routed Mode WanLinks with WanPaths
- Virtual Router with DHCP Service
- Virtual Router with NAT
- Multiple Layer-2 Switches
- Multiple Virtual Routers
- Multiple Physical Port Testing - CT970-48
- Bridging Three Wanlinks
- WanPath Corruptions
- WanLink Queue Discipline
- ICE WiFi Gaming Demonstration Video
- Using Custom DNS on LANforge with DNSmasq
- Creating GRE Tunnels on LANforge
Bridged Mode (Non-routed) WanLink
Goal: Allow LANforge-ICE to sit transparently on a network segment by using a Bridged Mode WanLink to simulate a WAN.
| In this test scenario, a LANforge-ICE WanLink is created in Bridged Mode to simulate a WAN consisting of a DS1 speed (1.544Mbps) link with 20ms of delay in one direction and 30ms of delay in the other direction. |
|
| |
Bridged Mode WanLink with Virtual Ports and Redirect Devices
Goal: Setup a Bridged Mode WanLink using RDDs (Redirect Devices).
| In this test scenario, a LANforge-ICE WanLink is created in Bridged Mode using Redirect Devices to illustrate an example of how to send LANforge-FIRE traffic to yourself through LANforge-ICE. This is useful when physical ports are in short supply and a proof-of-concept test is needed. NOTE: THIS WILL NOT WORK PROPERLY WITHOUT THE INSTALLATION OF THE CANDELA KERNEL. |
|
| |
Routed Mode WanLinks with Virtual Routers
Goal: Setup a Routed Mode WanLink between two Virtual Routers.
| In this test scenario, LANforge-ICE is used to simulate a routed network where incoming traffic on one port is sent through one Virtual Router then through a WanLink, then through a second Virtual Router and then finally out to a port on a different network. |
|
| |
- Setup a Netsmith Connection.
- Go to the Status tab and click Netsmith
- Right-click in the Netsmith window and select New Connection
- Accept defaults, Auto Create everything then click OK
- Click Apply in the Netsmith window to create the connection
For more information see LANforge-GUI User Guide: Netsmith
- Setup two Virtual Routers.
- Right-click in the Netsmith window and select New Router
- Accept defaults, or change the name, graphical size and notes about the Virtual Router.
- Click OK when done
- Click the Apply button and repeat for the second Virtual Router
- NOTE: After making any changes to the Netsmith window, you must click Apply or your changes will NOT be implemented and could be lost.
- Click the Apply button followed by the Sync button
- NOTE: Clicking Sync makes sure any changes are synchronized with the current database.
- Also, note the Netsmith Apply Progress bar displayed at the bottom of the Netsmith window.
For more information see LANforge-GUI User Guide: Netsmith
- Configure the ports on the ends of the WanLink.
- Right-click port rddVR0 and select Modify Port
- Assign an IP address and Network Mask.
- This example uses 10.1.1.100 and 255.255.255.0.
- Right-click port rddVR1 and select Modify Port
- Assign an IP address and Network Mask.
- This example uses 10.1.1.101 and 255.255.255.0.
For more information see LANforge-GUI User Guide: Netsmith
- Drag the ends of the WanLink into the Virtual Routers.
- Left-click and drag rddVR0 into Router R0(1)
- Left-click and drag rddVR1 into Router R1(2)
- Click the Apply button at the bottom of the Netsmith window
For more information see LANforge-GUI User Guide: Netsmith
- Setup the Routed Mode WanLink characteristics.
- Right-click the WanLink and select Modify Wanlink
- Verify that the B-side ports, rddVR0b and rddVR1b are filled in.
- NOTE: Be sure to set the impairment, if any, and transfer rate.
- Click OK when done
- Right-click the WanLink and select Toggle Wanlink to set its status to Running (green).
For more information see LANforge-GUI User Guide: Netsmith
- Setup the physical ports.
- Right-click port eth1 and select Modify Port
- Assign port eth1 an IP address and Network Mask
- NOTE: This example uses 172.1.1.1 and 255.255.255.0
- Drag port eth1 into Router R0(1)
- Right-click port eth2 and select Modify Port
- Assign port eth2 an IP address and Network Mask.
- NOTE: This example uses 172.2.2.1 and 255.255.255.0
- If either physical port connects to a larger routed network, right-click the port and select Modify and enter values for Next Hop and Subnets as follows:
- NOTE: Next Hop is the default gateway of your next network hop
- Up to 8 different subnets can be configured or 0.0.0.0/0 for any subnet
- Click OK when done, then click Apply in Netsmith to apply your changes
- Drag port eth2 into Router R1(0)
- Click the Apply button at the bottom of the Netsmith window
For more information see LANforge-GUI User Guide: Netsmith
- Run traffic and verify results. (Refer to LANforge FIRE Cookbook to run traffic)
- Verify that the traffic on eth1 is being sent to Default Gateway 172.1.1.1 and that traffic on eth2 is being sent to Default Gateway 172.2.2.1
- NOTE: In this example, traffic to eth1 is from a port configured with IP address 172.1.1.105 Network Mask 255.255.255.0 and Default Gateway 172.1.1.1
- Traffic to eth2 is from a port configured with IP address 172.2.2.106 Network Mask 255.255.255.0 and Default Gateway 172.2.2.1
- To generate routed network traffic refer to the LANforge FIRE Cookbook Routed Network Testing section.
- If your physical configuration is complete, Netsmith should appear as shown here:
- Right-click one of the Virtual Routers and select Show Routing Table to view the internal routing table for the Virtual Router
- LANforge Virtual Routers by default use simple subnet routing, but can also use OSPF or BGP routing protocols. LANforge can also perform IPv4 multicast routing.
For more information see LANforge-GUI User Guide: Netsmith
For more information see LANforge FIRE Cookbook
Routed Mode WanLinks with a Single Physical Port
Goal: Setup a Routed Mode WanLink between two Virtual Routers that only use one physical port.
| In this test scenario, LANforge-ICE is used to simulate a routed network where a single physical port is used for incoming and outgoing traffic. The traffic will enter the physical port and will then be sent through two Virtual Routers connected by a WanLink and then back out the same physical port. |
|
| |
- Setup a Netsmith Connection.
- Go to the Status tab and click Netsmith
- Right-click in the Netsmith window and select New Connection
- Accept defaults, Auto Create everything and click OK
- Click Apply in the Netsmith window to create the connection
For more information see LANforge-GUI User Guide: Netsmith
- Setup two Virtual Routers.
- Right-click in the Netsmith window and select New Router
- Accept defaults, or change the name, graphical size and notes about the Virtual Router
- Click OK when done
- Click the Apply button and repeat for the second Virtual Router
- NOTE: After making any changes to the Netsmith window, you must click Apply or your changes will NOT be implemented and could be lost
- Click the Apply button followed by the Sync button
- NOTE: Clicking Sync makes sure any changes are synchronized with the current database
- Also, note the Netsmith Apply Progress bar displayed at the bottom of the Netsmith window
For more information see LANforge-GUI User Guide: Netsmith
- Configure the ports on the ends of the WanLink.
- Right-click port rddVR0 and select Modify Port
- Assign an IP address and Network Mask
- This example uses 10.1.1.100 and 255.255.255.0
- Right-click port rddVR1 and select Modify Port
- Assign an IP address and Network Mask
- This example uses 10.1.1.101 and 255.255.255.0
For more information see LANforge-GUI User Guide: Netsmith
- Drag the ends of the WanLink into the Virtual Routers.
- Left-click and drag rddVR0 into Router R0(1)
- Left-click and drag rddVR1 into Router R1(2)
- Click the Apply button at the bottom of the Netsmith window
For more information see LANforge-GUI User Guide: Netsmith
- Setup the Routed Mode WanLink characteristics.
- Right-click the WanLink and select Modify Wanlink
- Verify that the B-side ports, rddVR0b and rddVR1b, are filled in
- NOTE: Be sure to set the impairment, if any, and transfer rate
- Click OK when done
- Right-click the WanLink and select Toggle Wanlink to set its status to Running (green)
For more information see LANforge-GUI User Guide: Netsmith
- Setup MAC VLANs.
- Go to the Port Mgr tab, select eth1 and click Create
- Select the MAC-VLAN button
- Set a MAC address that begins with 00 (Ex: 00:11:33:55:77:01)
- Set the Quantity to 2
- Set the IP Address to 172.1.1.1 and IP Mask to 255.255.255.0
- Leave the Gateway IP field blank
- Click OK when done
- Select the MAC VLAN eth1#1 and click Modify
- Set eth1#1 IP address to 172.2.2.1 and IP Mask to 255.255.255.0
- Select eth2 and click Create
- Select the MAC-VLAN button
- Set a MAC address that begins with 00 (Ex: 00:22:44:66:88:01)
- Set the Quantity to 2
- Set the IP Address to 172.1.1.100 and IP Mask to 255.255.255.0
- Set the Gateway IP to 172.1.1.1
- Click OK when done
- Select the MAC VLAN eth2#1 and click Modify
- Set eth2#1 IP address to 172.2.2.100, IP Mask to 255.255.255.0 and Gateway IP to 172.2.2.1
For more information see LANforge-GUI User Guide: Virtual Interfaces
- Configure Netsmith.
- After clicking on the sync button,move the ports on the Netsmith window to be more clearly visible.Eth1 and eth2 are connected via a loopback cabel
- NOTE: Be sure to click Apply after moving objects so that their new positions are saved to the database
- Drag eth1#0 into Router R0(1)
- Drag eth1#1 into Router R1(2)
- Click Apply in the Netsmith window
- LANforge is now ready to accept incoming traffic on eth0, the single physical port that is connected to a Routed Mode WanLink
- Ports eth0 and eth1 are physically connected via a loopback cable in this example. MAC VLANs on eth1 are configured to generate test traffic to the Routed Mode WanLink
For more information see LANforge-GUI User Guide: Netsmith
- Setup a Layer-3 UDP connection between MAC VLANs eth2#0 and eth2#1.
- Go to the Layer-3 tab and click Create
- Set Endpoint A to be eth2#0 and Endpoint B to be eth2#1
- Enter the CX name then set the CX Type to LANforge UDP and the Report Timer to 1000
- Set the Min/Max Tx Rate to 1024000 and the Min/Max Pkt Size to 1472
- Select the new connection and click Start
- Netsmith now shows the new connection and traffic flowing through the Routed Mode WanLink
For more information see LANforge-GUI User Guide
Routed Mode WanLink with WanPaths
Goal: Setup a Routed Mode WanLink with WanPaths.
| In this test scenario, LANforge-ICE is used to filter traffic by IP address on a WanLink with the use of WanPaths. |
|
| |
Virtual Router with DHCP Service
Goal: Setup a Virtual Router with one interface serving DHCP.
| In this test scenario, a LANforge Virtual Router is created with one interface setup to serve DHCP to two remote redirect interfaces that are setup to be DHCP clients. |
|
| |
Virtual Router with NAT
Goal: Setup a Virtual Router with one interface performing NAT on outgoing traffic.
| In this test scenario, a pair of Virtual Routers are connected with a Redirected Interface connection with one side of the connection performing NAT on outgoing traffic. Two additional Redirected Interface connections are configured to pass traffic and demonstrate NAT. |
|
| |
Multiple Layer-2 Switches
Goal: Emulate the behavior of five Layer-2 Switches connected together for traffic fail-over testing.
| In this test scenario, the function of several layer-2 switches will be emulated using multiple LANforge Bridge devices with Spanning Tree Protocol (STP) so that each bridge can be connected to at least two others and fail-over tests can be demonstrated. |
|
| |
- Setup seven Netsmith Connections.
- Right-click inside the Netsmith window and select New Connection
- Accept defaults Auto Create everything then click OK.
- Repeat and create a total of seven (7) connections
- Click the Apply button to commit the changes in Netsmith to the LANforge-Server
- NOTE: Modifications in Netsmith are only sent to the LANforge-Server after Applying them
For more information see LANforge-GUI User Guide: Virtual Interfaces
- Setup five Bridge devices.
- Right-click inside the Netsmith window and select New Bridge
- Select the Bridge button, enter a name and quantity 5
- NOTE: The 5 bridges here are sw-0, sw-1, sw-2, sw-3, and sw-4
- In Netsmith, position the bridge devices into separate areas so they can be grouped with WanLink entry points
For more information see LANforge-GUI User Guide: Ports (Interfaces)
- Move the WanLinks into their desired positions.
- Position the WanLink entry points in groups near the bridges as follows:
- 2 entry points near sw-0, sw-1, and sw-2 (one to sw-3 and one to sw-4)
- 3 entry points near sw-3 and sw-4 (one to sw-0, sw-1, and sw-2)
- Bridges sw-3 and sw-4 should also have a WanLink between them
- Click Netsmith Apply to commit the changes
- Modify each Bridge to enable Spanning Tree Protocol (STP) and add Bridge Members.
- Right-click bridge sw-0 and select Modify Port
- Select the 'Set Bridge Info' and 'Spanning Tree' checkboxes, then add bridge members rddVR1 and rddVR3
- NOTE: Selecting the 'Spanning Tree' checkbox enables Spanning Tree Protocol (STP) for that port
- Click the Apply or OK button to commit the changes in bridge configuration to the LANforge-Server
- Right-click bridge sw-1 and select Modify Port
- Enable STP and add members rddVR5 and rddVR7
- Right-click bridge sw-2 and select Modify Port
- Enable STP and add members rddVR11 and rddVR13
- Right-click bridge sw-3 and select Modify Port
- Enable STP and add members rddVR0, rddVR4, rddVR8 and rddVR10
- Right-click bridge sw-4 and select Modify Port
- Enable STP and add members rddVR2, rddVR6, rddVR9 and rddVR12
- Create virtual interfaces for traffic generation and fail-over tests.
- Right-click sw-0 and select Create Ports and choose Redirect
- This step will create two Redirect Devices, rddA and rddB
- Add rddA to bridge sw-0
- Click the Apply or OK button to commit the changes in bridge configuration to the LANforge-Server
- Right-click rddB and select Create Ports, then select the MAC-VLAN button
- Enter a starting MAC address, quantity 5, and starting IP address
- Repeat for bridge sw-1
- NOTE: The Netsmith display has been 'zoomed-out' by clicking the '-' magnifying glass icon located at the top left of the Netsmith display
- Repeat for bridge sw-2
- Create Layer-3 connections.
- On the Layer-3 tab, create a Layer-3 UDP connection between
rddB#0 and rddD#0
- Create 4 more connections between the remaining rddB and rddD ports
- Create 5 connections between the rddD and rddF ports
- Repeat this step for the rddF and rddB ports for a total of 15 connections
- Test Fail-Over condition.
- On the Layer-3 tab, select all 15 connections and click Start
- In Netsmith, verify traffic is flowing through sw-3 or sw-4 via 3 separate WanLinks
- In this case, VRWL1.1.001, VRWL-1.1.003 and VRWL-1.1.006 all show traffic flowing
- Right-click WanLink VRWL-1.1.001 and select Toggle WanLink
- After approximately 1 minute, the traffic will find an alternate path
- Right-click WanLink VRWL-1.1.001 and select Toggle WanLink
- After approximately 1 minute, traffic resumes on its original path
- Traffic flow after simulating multiple path failures
- A sample LANforge HTML report of this fail-over test can be found here:
- Fail-Over Test Sample HTML Report
Emulating a Multiple Hop Network
Goal: Use virtual routers to emulate a multi-hop network.
| In this example, LANforge is used to emulate a live routed network by using multiple virtual routers to form a working multi-hop network. Each virtual router has its own routing table and can be configured to use one of many different routing protocols. OSPF will be used in this example and traceroute will be used to demonstrate the traversal of each hop. |
|
| |
- Use Netsmith to create five OSPF virtual routers.
- From the Status tab, select the Netsmith button.
- Right-click in the Netsmith window and select New Router.
- Select the Use OSPF checkbox.
- Select OK, then create four more OSPF virtual routers.
- After creating five OSPF virtual routers, select Apply.
For more information see LANforge-GUI User Guide: Netsmith
- Create four Netsmith connections to link all of the OSPF virtual routers.
- Right-click in the Netsmith window and select New Connection.
- Leave all the default settings and select OK.
- Create three more Netsmith connections.
- After creating four Netsmith connections, select Apply.
- Assign IP addresses to either end of each of the four Netsmith connections.
- Right-click on rddVR0 and select Modify Port.
- Set rddVR0 to 10.0.0.1/30 and select OK.
- Right-click on rddVR1 and select Modify Port.
- Set rddVR1 to 10.0.0.2/30 and select OK.
- Repeat the steps above to complete the following:
- rddVR2 is 11.0.0.1/30 and rddVR3 is 11.0.0.2/30
- rddVR4 is 12.0.0.1/30 and rddVR5 is 12.0.0.2/30
- rddVR6 is 13.0.0.1/30 and rddVR7 is 13.0.0.2/30
- Drag each end of a Netsmith connection into a virtual router to setup the network.
- A: Setup the following by dragging the interfaces into the specified virtual routers:
- rddVR0 in R0 and rddVR1 in R1
- rddVR2 in R1 and rddVR3 in R2
- rddVR4 in R2 and rddVR5 in R3
- rddVR6 in R3 and rddVR7 in R4
- B: Right-click on each Wanlink (red bar) and select Toggle Wanlink (change to green bar).
- Note: If you wanted to emulate an /impaired/ multi-hop network, you could modify each Wanlink to have any LANforge impairment such as latency, jitter, dropped packets, etc...
- After all interfaces are moved and Wanlinks started, select Apply in the Netsmith window.
- Assign IP addresses and Default Gateways to each of four physical interfaces.
- Right-click on each interface and select Modify Port.
- Setup the following IP addresses and Default Gateways:
- eth1 IP address is 172.16.0.101/24 and Default GW is 172.16.0.1
- eth2 IP address is 172.16.0.1/24 and Default GW is 172.16.0.1
- eth3 IP address is 192.168.0.1/24 and Default GW is 192.168.0.1
- eth4 IP address is 192.168.0.104/24 and Default GW is 192.168.0.1
- Drag eth2 into R0 and eth3 into R4, then Apply changes.
- Note: In this example, four physical interfaces are used. eth1 and eth2 are physically connected with a cable, as are eth3 and eth4. This allows us to use eth1 and eth4 to generate traffic to each other through the network interfaced by eth2 and eth3.
- Apply all changes in Netsmith, allow OSPF time to converge, and observe routing tables.
- After applying all Netsmith changes, right-click on a virtual router and select Show Routing Table. (Before OSPF converges, only the directly connected networks are shown.)
- After OSPF converges, each virtual router has a complete routing table for the entire network.
- Note: If you select Netsmith Apply again, this will restart all virtual routers and OSPF will need time to converge again.
- Alternative method to observe routing tables of each virtual router.
- With OSPF virtual routers, you can right-click on a virtual router and select Virtual Router Console to bring up the underlying xorp shell for the virtual router.
- Once at the xorp shell prompt, type the following to display the routing table information:
- show route table ipv4 unicast final
- Use traceroute to traverse all five hops.
- Open a terminal window in the LANforge system.
- Type the following command at the prompt:
- traceroute -i eth1 13.0.0.2
- Note: -i eth1 forces the traceroute program to use eth1 as its outgoing interface.
- Observe the results of each hop in the network.
- Traceroute from eth4.
- traceroute -i eth4 10.0.0.1
- Generate LANforge traffic through the multi-hop network.
- Go to the Layer-3 tab and select Create.
- Set Endpoint-A to use eth1 and Endpoint-B to use eth4.
- Start the Layer-3 connection.
- Traffic flowing through the multi-hop network.
Multiple Physical Port Testing - CT970-48 Example
Goal: Use LANforge and a managed ethernet switch to create 48 unique WAN emulations.
In this example, LANforge is paired with a managed ethernet switch to create 48 unique WAN emulations. Each of the 48 ports on the ethernet switch can be connected to an end-user device such as a PC or networked gaming console to provide 48 independent emulated links each with their own set of network impairments. Please see the CT970-48 product description for more details. NOTE: If you are attempting to run this test scenario, you will need a LANforge license key that enables the correct number of WanLinks. Please contact us at [email protected] for assistance. |
|
| |
- Download the CT970-48 configuration to your LANforge system. We have provided the LANforge database and managed switch configuration for this example to simplify the setup.
You can download all of the CT970-48 configuration files to your /home/lanforge/DB/CT970-48 directory.
- NOTE: This LANforge database uses eth0 as the Management port and eth2 as the VLAN trunk port. If you need to modify these, please contact us at [email protected] for assistance.
- NOTE: The managed switch referenced in this example is a Netgear FSM7352SNA ProSafe 48-port 10/100 L3 Managed Switch.
- Save your existing database, then load the new database into your LANforge system.
- On the Status tab, under the Test Configuration Database Name field, type in a name for your existing configuration, then select the Save button.
- Select CT970-48 from the Test Configuration Database List box.
- Select Load Behavior Overwrite.
- Select the Load button and acknowledge the confirmation pop-up message.
- After LANforge is finished loading the new database, open Netsmith to view the 48 WanLinks and modify if necessary.
- On the Status tab, under Resource 1, select the Netsmith button.
- If any changes are made to Netsmith, then select the Apply button to commit the changes to the LANforge server.
- When the 48port-sw-config.txt is loaded into the Netgear FSM7352SNA switch, port 52 on the switch is configured as the VLAN trunk which will connect to LANforge port eth2.
Each switch port and VLAN correspond to a WanLink in LANforge. Here, incoming traffic on switch port 1 is tagged for VLAN 101 and sent out switch port 52 to LANforge eth2 then on to WanLink VRWL-1.1.0 via endpoints eth2.101 and rdd1.101.
- Connect LANforge port eth2 to the FSM7352SNA switch, port 52 which is trunking vlans 101 - 148 to the LANforge system.
- Here, each WanLink can be modified to have its own unique impairment profile so that each end-device has a different upstream connection.
- If any changes are made to Netsmith, then select the Apply button to commit the changes to the LANforge server.
- Alternatively, a group of WanLinks can be modified together using the Batch Modify on the WanLinks tab in the main LANforge GUI. Highlight the group of WanLinks that you want to modify, then select Batch Modify to modify the highlighted set of WanLinks.
- The Batch Modifier will apply changes to the group of highlighted WanLinks.
- In this example, any end-devices connected to switch ports 1 - 48 can communicate with each other. Here, an end-device such as PC1 connected to switch port 1 can communicate to PC2 connected to switch port 2 through the network path:
PC1 - switch port 1 - vlan 101 - switch port 52 - LANforge port eth2 - WanLink VRWL-1.1.0 - Virtual Router R0 - vlan 102 - WanLink VRWL-1.1.1 - LANforge port eth2 - switch port 52 - switch port 2 - PC2.
The end-devices used here are LANforge-FIRE interfaces on a separate system. Each interface has its own MAC and IP address and will generate traffic to and receive traffic from the switch port it is connected to.
- On the Port Mgr tab, assign an IP address on the 10.1.1.0/24 network and a default gateway 10.1.1.1
- On the Port Mgr tab, assign an IP address on the 10.1.1.0/24 network and a default gateway 10.1.1.1
- The impairment settings on each WanLink will only apply to traffic that is sent or received from the switch port that it is associated with via the VLAN used with that WanLink. For example, WanLinks VRWL-1.1.0 and VRWL-1.1.1 are both set to have a total of 100ms of delay, so PC1 would see a 200ms round-trip delay when sending or receiving traffic to PC2.
- The total latency of WanLinks VRWL-1.1.0 and VRWL-1.1.1 is 100ms.
- Each end of the connection experiences 100ms of delay which gives a total round-trip delay of 200ms.
Bridging Multiple WAN-links
Goal: Create a star topology network similar to a central VPN server with remote offices.
| Using LANforge Netsmith, we connect three ethernet ports with WAN-links. Each WAN-link has an ethernet port on one side and a virtual redirect on the other. The redirects are then bridged. We can then model the WAN environment by changing the latency (and other parameters) of the WANlinks. In this example, we are using ports eth2, eth3 and eth4 This emulates a bridged network, but it is also possible to do a similar configuration using a Virtual Router instead of a bridge to emulate a routed network. |
|
| |
- Use Netsmith to create three WAN links
- In the Status tab, click the Netsmith button
- Right click in the Netsmith window
- Select New Connection
- Create new WAN link connection
- Select Port 1-A: eth2
- Select Port 1-B:Skip
- Click OK
- A tentative WAN link is displayed
- Click the Apply button at the bottom of the Netsmith window. This commits the WAN link to the resource.
- Creating two more WAN links is a similar process
- Repeat these steps:
- Right click, New Connection
- Choose eth3 for port 1-A and Skip for port 1-B, then OK
- Click Netsmith Apply to commit connection.
- Right click, New Connection
- Choose eth4 for port 1-A and Skip for port 1-B, then OK
- Click Netsmith Apply to commit connection.
- Use Netsmith to create a bridge port
- Right click, Select New Bridge
- Create the bridge with the following attributes:
- Select Bridge
- Quantity: 1
- Bridge Name: br0
- Click Netsmith Sync to bring the br0 port onto the Netsmith screen
- Right click the br0 port and select Modify Port
- In the text area below the Add Ports button, add the three virtual WAN link endpoints:
- rddVR1
- rddVR3
- rddVR5
- Click Add Ports to enter the selection. You will see them show up in the Bridge Information table.
- Click Apply to commit the change.
- Click Sync to read-in the ports to the screen. You will see them show up in the Bridge Information table.
- Click Cancel to close the window.
- Enable the WAN links in Netsmith
- In the Netsmith window, click Sync to bring the changes into view
- Right click on VRWL-1.1 and select Toggle WanLink
- Repeat the toggle for the next two WanLinks
WanPath Corruptions
Goal: Setup a WanLink with WanPath Corruptions.
| In this test scenario, LANforge-ICE is used to filter traffic by VLAN on a WanLink with the use of WanPaths and then use WanPath Corruptions to overwrite the DSCP field in the IP packet. Note: VLAN filtering was recently fixed and should be used with LANforge version 5.3.7 and up. |
|
| |
- Setup a WanLink connection.
- Go to the WanLinks tab and select Create.
- Enter the WanLink name, physical ports, base transfer rate, delay, jitter etc...
These impairments will be applied to all traffic on the WanLink.
- Select Apply to create the base WanLink.
For more information see LANforge-GUI User Guide: Creating & Modifying WanLinks
- Setup the WanPaths.
- Select All to un-hide the other WanLink config panels.
- In panel 3, for Endpoint-A WAN Paths, select Create-WP.
- Enter a Name and Transfer Rate for the WanPath.
Here we are matching the WanLink's transfer rate.
- Select checkbox for Use Pcap Filter
- Enter the PCAP Filter vlan 1010 to apply any WanPath impairment or corruptions only to packets with 802.1q vlan id 1010
Expression is based on the tcpdump expression field.
- Select Apply to create the WanPath.
For more information see Tcpdump man page
, Pcap Filter Syntax
- Setup the Corruptions.
- Enter the following values into Corruption #0 fields
- Rate 100000
(how often, per million packets, should the corruption be applied)
- Corruption Write Byte
- Byte-to-Write 40
(hex 0x00-0xff or decimal 0-255)
If you enter 0x28 and select OK, the GUI will translate it to decimal 40.
- Min Offset 19
- Max Offset 20
The Differentiated Services Field is in byte 20 of the ethernet frame which corresponds to the 2nd byte of the IP header.
- Select checkbox Do Checksum which will re-calculate the checksum after making the errors so that the packet is still valid.
- Select OK then create a second WanPath for this WanLink on Endpoint-B using the same values.
- Verify that the WanPaths on this WanLink are setup correctly, then select OK on the Create/Modify WanLink window shown here
For more information see LANforge-GUI User Guide: Creating & Modifying WanPaths
- Run traffic through LANforge-ICE ports eth2 and eth3, and capture traffic on eth2.
- Here we are using LANforge-FIRE on a secondary resource to send a 10Mbps bi-directional UDP flow between 802.1q VLAN endpoints eth2.1010 and eth3.1010 with an IP ToS value of decimal 184 which corresponds to DSCP value decimal 46 or Expedited Forwarding
- Go to the Port Mgr tab and highlight WanLink port eth2, then select the Sniff Packets button to bring up Wireshark.
- The capture will show that periodically the DSCP field gets overwritten per the WanPath corruption logic of writing a decimal value 40 in the IP ToS field which corresponds to a DSCP value of decimal 10 or Assured Forwarding 11.
For more information see LANforge-GUI User Guide: Layer-3 Cross-Connects
WanLink Queue Discipline
Goal: Setup a WanLink with an alternate queue discipline.
| In this test scenario, the default WanLink queue discipline of FIFO (First In First Out) is replaced with WRR (Weighted Round Robin) to demonstrate how to setup queuing that will prioritize traffic flows based on IP ToS. Note: WRR can only be used with User Mode WanLinks. |
|
| |
- Setup a WanLink connection.
- Go to the WanLinks tab and select Create.
- Enter the WanLink name, physical ports, base transfer rate, delay, jitter etc...
These impairments will be applied to all traffic on the WanLink.
- Select Apply to create the base WanLink.
For more information see LANforge-GUI User Guide: Creating & Modifying WanLinks
- Setup WanLink for User Mode.
- Select All to un-hide the other WanLink config panels.
- In panel 2, un-check the Kernel-Mode box.
- Select Apply to change the WanLink.
For more information see LANforge-GUI User Guide: Creating & Modifying WanLinks
- Demonstrate the FIFO Queue Discipline.
- Start the WanLink, then run traffic through LANforge-ICE ports eth2 and eth3.
Here we are using LANforge-FIRE on a secondary resource to over-subscribe the 100Mbps WanLink with five 30Mbps traffic flows each with a different IP ToS value set to show that the FIFO WanLink ignores the ToS bits by treating all packets equally and processing them in the order they enter the queue.
- The dropped packet percentages show that even with a high value ToS, no priority is observed.
For more information see LANforge-GUI User Guide: Layer-3 Cross-Connects
- Change the WanLink queue discipline to WRR.
- Select the Stop All button to stop all connections, then Modify the WanLink.
- In panel 4, change the QDisc field to the following string:
WRR,2000-0-255,4000-64-255,8000-96-255,16000-128-255,32000-192-255 for both Endpoint-A and Endpoint-B.
The WRR string format is weight-ToS-mask where higher weights are given higher priority to packets matching the ToS and bit mask.
Note: Minimum weighting should be equal to or greater than your MTU.
- Select OK to apply changes to the WanLink and close the modify window.
For more information see LANforge-GUI User Guide: Creating & Modifying WanLinks
- Demonstrate the WRR Queue Discipline.
- Run the WanLink and the same five UDP traffic flows through LANforge-ICE ports eth2 and eth3.
- This time, the higher valued ToS UDP flows are experiencing less drops due to the WRR priorities setup in the WanLink.
For more information see LANforge-GUI User Guide: Layer-3 Cross-Connects
WiFi: Gaming Test: video demonstration
Goal: Learn about how to combine the WAN emulation and programmable
attenuation to emulate different network environments for game consoles.
Watch a demonstration of how to modify the gaming experience
using WAN links to drop packets and combining that with attenuating
the wifi signal in an isolation chamber.
This scenario requires LANforge version 5.3.9, two isolation chambers,
one or more programmable attenuators a DUT and three mesh AP nodes.
|
 |
WiFi Gaming Test demonstration
Using Custom DNS on LANforge with DNSmasq
Goal: Create a nameserver for your test network when no Internet access is available.
Isolated testbeds still regularly require their DUTs to resolve hostnames. The dnsmasq package on Linux provides this feature. Requires release 5.4.6 or later.
Role of dnsmasq and how to combine it with Virtual Routers
The dnsmasq service provides BOTH DHCP and DNS services.
If the dhcp-range directive is present in the /etc/dnsmasq.conf file, then it will respond to DHCP requests.
This setting is NOT governed by the Netsmith -> Virtual Router -> Modify -> DCHP setting. You can accidentally leave DNSmasq running in DHCP serving mode and use
Chamber View test scenarios that also create a new DHCP service in a virtual router. LANforge does not track the status of DNSmasq like it does the dhcpd process it starts in a virtual router.
You can end up running two DHCP services if you are not careful
The two modes you would configure are:
- DNS mode and use virtual routers for DHCP. Configure the DNS entry of the virtual router to let clients see the nameserver entry.
- DNS and DHCP mode and never use the DHCP option of the virtual router.
We suggest configuring DNSmasq in a DNS-only mode most of the time.
Typical Port Setup
If you are crafting a test scenario where you are providing DHCP as an upstream port, create a Virtual Router and drag your upstream port into it. You will probably want a static IP on the port. For this example, we will use eth1 with address 10.45.0.1.
- Right-click the port and select Modify
- In the Create/Modify Connection window:
- Select DHCP
- Configure DHCP DNS to be the IP of the port (10.45.0.1)
Enable the DNS service on the port
- Open the Port modify window by either double-clicking on the row in the Port Mgr tab or selecting the Modify Port option from the Netsmith right-click menu.
- At the lower left of the window, in the Services box, select DNS.
- Click OK.
You have now enabled DHCP in the virtual router.
Configure DNSmasq
The /etc/dnsmasq.conf file controls the behavior of the DNSmasq service. The configuration below will serve entries out of /etc/hosts. This example is configured to run on interface eth1.
/etc/dnsmasq.conf
domain=lanforge.com
expand-hosts
local=/local/
local=/0.45.10.in-addr.arpa/
log-dhcp
log-queries
interface=eth1
Hosts file /etc/hosts
# Loopback entries; do not change.
::1 localhost.localdomain localhost localhost6.loaldomain6 localhost6
127.0.0.1 localhost.localdomain localhost localhost4.localdomain4 localhost4 vm-6006-local
192.168.1.101 lanforge.localnet lanforge.localdomain
###-LF-HOSTNAME-NEXT-###
192.168.45.94 vm-6006 4585-f38.bitratchet.net
# Custom hostnames:
10.45.0.1 www.lanforge.com lanforge.com
Running DNSmasq:
- Check for configuration errors using
dnsmasq --test.
- Restart DNSmasq to apply changes:
sudo systemctl restart dnsmasq.service.
Creating GRE Tunnels on LANforge
Goal: create a GRE port and send traffic through it.
Overview of GRE
GRE stands for Generic Routing Encapsulation. This is an
unencrypted manner of nesting packets destined for a separate network. GRE tunnelling is intended to construct
overlay networks without the computational burden of encryption. The GRE client needs to know the local IP it
will bind to, and the remote IP of its peer providing GRE access.
In LANforge, GRE ports are treated as any other VLAN ports, such as MAC-VLANs or QVLANs, but they are a Layer 3 device:
they do not have MAC addresses. These GRE tunnels expect an already existing port with an IP.
⚠ This cookbook purposely avoids the phrase GRE endpoint because LANforge refers to
endpoints in the context of traffic connections (Layer 3 or Layer 4-7 endpoints).
Example
- The client gains a normal DHCP lease and is granted 192.168.0.234/24.
- A GRE provider is at the DHCP server address: 192.168.0.1.
- The client creates a GRE instance with the outer tunnel IPs 192.168.0.234 and 192.168.0.1.
- The client sets an overlay address of 10.0.0.5/24 on the GRE port.
- The client may then send tunneled traffic into the 10.0.0.0/24 network.
GRE Driver Devices
ⓘ When the GRE kernel module is loaded, you will see three GRE devices:
Creating a GRE port
- In the LANforge Manager -> Port Mgr tab, click the Create button.
- Select GRE tunnel.
- Enter the local IP of an existing port on the LANforge (EG 10.40.0.100)
- Enter the remote IP of the port acting as a GRE gateway (EG 10.40.0.1)
- (Optional) Enter the overlay IP for the GRE port in the IP Address field. (EG 10.39.0.100/24)
It is possible to create multiple GRE ports. Those port names should be different though.
Sending Traffic over GRE
To send traffic over GRE ports, the GRE port must be selected as an endpoint of a connection. It is not valid to
select the associated local port to send traffic from (it would be coming from the wrong network).
Layer 4-7 Traffic
- In the LANforge Manager -> Layer 4-7 tab, click the Create button.
- Select the source port (EG 1.1.07 gre0)
- Add the URL to query (EG http://10.39.0.1/)
See more in the Layer 4-7 Cookbook.
Layer 3 Traffic
Layer 3 traffic is possible so long as you have two different ports to transmit to. These could both be GRE tunnel
ports with different IPs, or one GRE tunnel port and one upstream port on the overlay network itself. Please see:
Generating Traffic to a Switch.
Linux Commands
For some versions of LANforge, the GUI might not create the GRE tunnel that you want, and you will want to alter the
details of the GRE port. When restoring a test configuration from the Status tab->Saved Test Configurations->Configuration dropdown, the IPs of the tunnel
might be missing.
To perform these commands, you will required to open a terminal on the LANforge and become root:
- Click on the MATE Terminal icon in the toolbar
- Use the command:
sudo -s Enter
Listing GRE details
-
Show the tunnel IPs: ip link show gre0
[root@ct522-jedway3 lanforge]# ip tunnel show
gre0: gre/ip remote any local any ttl inherit nopmtudisc
gre2p0001: gre/ip remote 10.40.0.239 local 10.40.0.2 ttl 255
-
Show the tunnel overlay IP: ip addr show gre0
[root@ct522-jedway3 lanforge]# ip addr show gre0
55: gre0@NONE: <NOARP> mtu 1476 qdisc noop state DOWN group default qlen 1000
link/gre 0.0.0.0 brd 0.0.0.0
[root@ct522-jedway3 lanforge]# ip addr show gre2p0001
58: gre2p0001@NONE: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1476 qdisc noqueue master vrf10001 state UNKNOWN group default qlen 1000
link/gre 10.40.0.2 peer 10.40.0.239
inet 10.39.0.2/32 scope global gre2p0001
valid_lft forever preferred_lft forever
inet6 fe80::a28:2/64 scope link
valid_lft forever preferred_lft forever
Changing the IPs
To change the overlay IP you will first add a new IP and then delete the old IP (if necessary).
You might find that the IPs are missing when the tunnel is restored from a saved configuration.
ip addr add 10.39.0.123/24 dev gre0
ip addr del 10.39.0.100/24 dev gre0
To change the tunnel IPs:
ip tunnel change gre0 local 10.40.0.111 remove 10.40.0.2
Deleting the GRE tunnel
If you wish to delete all the GRE tunnels, it involves unloading the ip_gre kernel module. Just removing the module
is insufficient because LANforge will attempt to re-load the module any time it finds a GRE referenced in a saved scenario.
⚠ This GRE tunnel then might show up in a scenario inadvertently when switching to a new scenario.
- (Optional) If you want save the scenario with the GRE tunnel, Use the Status tab->Saved Test Configurations->Save DB Name and click the Save button.
- Open a terminal, because root with
sudo -s
- Stop the LANforge service:
cd /home/lanforge; ./serverctl.bash stop
- Erase the present database:
rm -f /home/lanforge/DB/DFLT/*
- Remove the modules:
rmmod ip_gre gre
- Start the LANforge service:
./systemctl.bash start
You might have to connect the GUI again. You will notice that this starts LANforge with a blank database. Use the
Status tab->Saved Test Configurations->Configuration dropdown to load a previous scenario.
Adding a GRE Tunnel Port
These are the commands for adding a tunnel:
ip tunnel add gre1001 mode gre local 10.40.0.100 remote 10.40.0.1
ip link set up dev gre1001
ip addr add 10.39.0.100/24 dev gre1001
Sniffing a Tunnel
GRE ports can be sniffed with Wireshark or tcpdump, and can be performed on the GRE port or the port with the local ip.
Examples of tcpdump commands:
- On the GRE port:
tcpdump -ni gre0
- On the local port:
tcpdump -ni eth1 proto gre or icmp