How external interfaces work in OMNETPP/INET?

2019-05-23 01:22发布

问题:

I have been trying in the past few days to build and run a very simple network to no avail (most of the network I try to build is borrowed from extServer example). No matter my configuration in terms of IP addresses, routes etc. I cannot seem to make it work.
I have seen many people struggling with it, but have not found any solutions posted anywhere. The readme file in the Emulation folder of INET is more confusing than helpful. Hence, I would like your help in making the following simple network work and, hopefully, even make it (the post) a tutorial for others as well.

The network I want to build (could not be simpler):

External Server <----> [ext0] ROUTER [ppp0] <----> [ppp0] Standard Host

My setup:

  • Software:

    • OMNET++ 4.6 with PCAP enabled.
    • INET Integration head (includes several features that I like).
  • OS:

    • Xubuntu in VirtualBox as a guest which hosts OMNET++. The reason for using Virtualbox is that my Host Win 7 machine refuses to run any external interface example with the error "cSocketRTScheduler: couldn't set socketopt for raw socket.". I modified the source a bit and used WSAGetLastError function, which resolved the issue as "The requested address is not valid in its context.".

    • Back to VirtualBox :) Xubuntu has one network interface set to Host-only networking with IP address 10.0.0.1 and netmask 255.255.255.0 .

Standard Host Setup in omnetpp.ini:

**.server.numTcpApps = 1
**.server.tcpApp[*].typename = "TCPSinkApp"
**.server.tcpApp[*].localAddress = "172.0.1.111"
**.server.tcpApp[*].localPort = 10021

The standard host is using the same server.mrt from extServer example.

The router.mrt is as follows:

ifconfig:
# interface 1 to server
name: ppp0
    inet_addr: 172.0.1.100
    Mask: 255.255.255.0
    MTU: 1500
    POINTTOPOINT MULTICAST

# interface 2 to external server (real network interface)
name: ext0
    inet_addr: 10.0.0.2
    Mask: 255.255.255.0
    MTU: 1500
    POINTTOPOINT MULTICAST
ifconfigend.

route:
#Destination     Gateway          Genmask          Flags  Metric  Iface
172.0.1.111      172.0.1.100      255.255.255.255  H      0       ppp0
10.0.0.1         10.0.0.2         255.255.255.255  H      0       ext0
0.0.0.0          *                0.0.0.0          G      0       ext0
routeend.

Any ideas on how to make this network work are really welcome as, should it work, I want to expand it later. Also, I would greatly appreciate it if any suggestions are in step-by-step style.

Thank you in advance.

标签: omnet++ inet