NEmu

Network Emulator for Mobile Universes

Documentation - Virtual Wireless Link (VAirLink))

A VAirLink is a virtual device which enables to create a pseudo wireless connection between or more virtual entities. Wireless traffic is mapped on a pseudo IEEE 802.11 header. A VAirLink is derived from a basic VLink, thus it can be used as a regular virtual link. Several air virtual links are actually available in NEmu:

VAirWic(name)

A VAirWic is a virtual device that plays the role of wireless connector. This device has only one Ethernet interface, the other side is a wireless antenna. name is the name of device.

VAirAp(name, niface)

A VAirAp is a virtual access point device that includes an Ethernet switch and a wireless antenna. name is the name of this virtual AP and niface is the number of ports of the switch part of the AP.

Currently, VAirLink elements can run only on the top of udp for wireless communications.
Those devices can be used as a standard VLink.

VAirRemoteLink(name)

Same as VRemote, but for air links.

SetAirMode(name, mode)

A VAirWic can be used in ad-hoc or infrastructure mode. Thus it is necessary to specify the required one.

Join(client, core)

Same as Link function but for air links.
client is the name of a virtual air element. This argument should be {virtual air element name}.
core is the name of another virtual air element. This argument should be {virtual air element name}.

Unjoin(*targets)

Same as Unlink, but for air links.

SetAirIface(name, addr, port, laddr, lport)

Same as SetIface, but for air links.

Here is a first example of an ad-hoc network and its related script:

air ad-hoc
InitNemu()

VHost("alice", nics=[VNic()])
VHost("bob", nics=[VNic()])
VHost("coffee", nics=[VNic()])

VAirWic("awic")
VAirWic("bwic")
VAirWic("cwic")

SetAirMode("awic", "adhoc")
SetAirMode("bwic", "adhoc")
SetAirMode("cwic", "adhoc")

Link("alice", "awic")
Link("bob", "bwic")
Link("coffee", "cwic")

Join("awic", "bwic")
Join("awic", "cwic")

StartNemu()

Here is another example of an infrastructure network and its related script:

air infrastructure
InitNemu()

VHost("alice", nics=[VNic()])
VHost("bob", nics=[VNic()])
VHost("coffee", nics=[VNic()])
VHost("dean", nics=[VNic()])

VAirWic("awic")
VAirWic("bwic")

SetAirMode("awic", "infra")
SetAirMode("bwic", "infra")

VAirAp("ap", niface=2)

Link("alice", "awic")
Link("bob", "bwic")

Link("coffee", "ap:0")
Link("dean", "ap:1")

Join("awic", "ap")
Join("bwic", "ap")

StartNemu()

Finally, here is an example of a distributed and hybrid network and its related scripts:

air distributed
# Physical host 1 [192.168.0.1]
InitNemu()

VHost("alice", nics=[VNic(hw="0a:55:78:32:e5:7f")])

VAirWic("aw")

SetAirMode("aw", "adhoc")

Link("alice", "aw")

SetAirIface("alice:bob", addr="192.168.0.1", port=8000, laddr="192.168.0.2", lport=9000)
SetAirIface("alice:coffee", addr="192.168.0.1", port=8001, laddr="192.168.0.2", lport=9001)

StartNemu()
# Physical host 2 [192.168.0.2]
InitNemu()

VHost("bob", nics=[VNic(), VNic()])
VHost("coffee", nics=[VNic(), VNic()])
VHost("dean", nics=[VNic()])
VHost("elf", nics=[VNic()])
VHost("funf", nics=[VNic()])
VHost("graup", nics=[VNic()])

VAirWic("bw")
VAirWic("cw")
VAirWic("dw")
VAirWic("ew")

SetAirMode("bw", "adhoc")
SetAirMode("cw", "adhoc")
SetAirMode("dw", "infra")
SetAirMode("ew", "infra")

VAirAp("ap", niface=1)
VSwicth("sw", niface=3)

Link("bob:1", "bw")
Link("coffee:1", "cw")
Link("dean", "dw")
Link("elf", "ew")

Link("bob:0", "ap:0")

Link("coffee:0", "sw:0")
Link("funf", "sw:1")
Link("graup", "sw:2")

Join("dean", "ap")
Join("elf", "ap")

VAirRemote("alice")

SetAirIface("alice:bw", addr="192.168.0.1", port=8000, laddr="192.168.0.2", lport=9000)
SetAirIface("alice:cw", addr="192.168.0.1", port=8001, laddr="192.168.0.2", lport=9001)

Join("bw", "alice")
Join("cw", "alice")

StartNemu()