keya
keya

Reputation: 11

Cannot resolve destination address in omnet++/inet module

I am trying to design a 3 tier datacenter model using INET modules. But when I run the network, then every time a TCP socket is created and I get the below-mentioned error:

starting session
issuing OPEN command
cannot resolve destination address: 

My ned files are as below:

Ned for the rack

import inet.nodes.inet.Router;
import inet.nodes.inet.StandardHost;
import inet.nodes.ethernet.Eth10M;
import inet.networklayer.autorouting.ipv4.IPv4NetworkConfigurator;


module Rack
{

    parameters:
        //int N @prompt(“Nodes per rack”);
        int N = default(10)

        @display("bgb=392,190");
    gates:
        inout iogate[];

    submodules:
        ComputingServer[N]: StandardHost {
            @display("p=120,91");
        }
        AccessRouter: Router {

            @display("p=289,91");
        }
        configurator: IPv4NetworkConfigurator;

connections:

        for i=0..N-1 {
            AccessRouter.ethg++ <--> Eth10M <--> ComputingServer[i].ethg++;
        }
        AccessRouter.ethg++ <--> iogate++;
        AccessRouter.ethg++ <--> iogate++;
}

Ned for the network

import inet.nodes.inet.Router;
import inet.nodes.inet.StandardHost;
import inet.nodes.ethernet.Eth100M;
import inet.networklayer.autorouting.ipv4.IPv4NetworkConfigurator;

network Basic_dcn_tcp
{
    parameters:
        int N = default(4);
        int AGR = default(4);
        int CR = default(2);

    submodules:

        AGRouter[AGR]: Router {
            @display("p=131,167");
        }
        CRouter[CR]: Router {
            @display("p=204,52");
        }
        Racks[N]: Rack {
            @display("p=131,304");
        }
        configurator: IPv4NetworkConfigurator;

    connections allowunconnected:

        for i=0..CR-1, for j=0..AGR-1 {
            CRouter[i].ethg++ <--> Eth100M <--> AGRouter[j].ethg++;
        }

        for i=0..1, for j=0..1 {
            AGRouter[i].ethg++ <--> Eth100M <--> Racks[j].iogate++;
        }

        for i=2..3, for j=2..3 {
            AGRouter[i].ethg++ <--> Eth100M <--> Racks[j].iogate++;
        }
}

The ini file is below :

[Config basic_dcn]
network = Basic_dcn_tcp

**.tcpType = "TCP"
**.tcp.advertisedWindow = 65535
**.tcp.delayedAcksEnabled = false
**.tcp.increasedIWEnabled = false
**.tcp.limitedTransmitEnabled = false
**.tcp.mss = 1452
**.tcp.nagleEnabled =true 
**.tcp.receiveQueueClass = default
**.tcp.recordStats = true
**.tcp.sackSupport = false
**.tcp.sendQueueClass = default
**.tcp.tcpAlgorithmClass = default
**.tcp.timestampSupport = true
**.tcp.windowScalingSupport = false


**.numTcpApps = 1
**.tcpApp[*].typename="TCPBasicClientApp"
**.tcpApp[*].localAddress = ""
**.tcpApp[*].localPort = -1
**.tcpApp[*].connectPort = 80
**.tcpApp[*].startTime = 0s
**.tcpApp[*].requestLength = 350B
**.tcpApp[*].replyLength = 5MiB
**.tcpApp[*].numRequestsPerSession = 1
**.tcpApp[*].thinkTime = 3s
**.tcpApp[*].idleInterval = 10s
**.tcpApp[*].reconnectInterval = 50s


**.tcpApp[*].dataTransferMode = "object"

Please help me to rectify the error. I have just started to code with inet.

Upvotes: 1

Views: 1130

Answers (1)

Jerzy D.
Jerzy D.

Reputation: 7002

There are two mistakes:

  1. The TCP connection is asymmetric, it requires a client and a server. The TCPBasicClientApp is a client application only. As a server you should use TCPGenericSrvApp, ref. INET Manual.
  2. You didn't write destination addresses of TCP connections. You should decide which host or hosts will be server (i.e. listen for incoming connection), and which hosts will make connections (i.e. acts as clients).

For example: assuming that ComputingServer[0] in Racks[0] is a server and it listens on port number 80, and all other hosts connect to it, your omnetpp.ini should look like:

[Config basic_dcn]
network = Basic_dcn_tcp

**.tcpType = "TCP"
**.tcp.advertisedWindow = 65535
**.tcp.delayedAcksEnabled = false
**.tcp.increasedIWEnabled = false
**.tcp.limitedTransmitEnabled = false
**.tcp.mss = 1452
**.tcp.nagleEnabled =true 
**.tcp.receiveQueueClass = default
**.tcp.recordStats = true
**.tcp.sackSupport = false
**.tcp.sendQueueClass = default
**.tcp.tcpAlgorithmClass = default
**.tcp.timestampSupport = true
**.tcp.windowScalingSupport = false


**.numTcpApps = 1
**.tcpApp[*].startTime = 0s
**.tcpApp[*].requestLength = 350B
**.tcpApp[*].replyLength = 5MiB
**.tcpApp[*].numRequestsPerSession = 1
**.tcpApp[*].thinkTime = 3s
**.tcpApp[*].idleInterval = 10s
**.tcpApp[*].reconnectInterval = 50s

**.tcpApp[*].dataTransferMode = "object"

# Racks[0].ComputingServer[0] listens on port 80
*.Racks[0].ComputingServer[0].tcpApp[*].typename = "TCPGenericSrvApp"
*.Racks[0].ComputingServer[0].tcpApp[*].localPort = 80
*.Racks[0].ComputingServer[0].tcpApp[*].localAddress = "" 

# all other hosts connect to  Racks[0].ComputingServer[0]
*.Racks[*].ComputingServer[*].tcpApp[*].typename = "TCPBasicClientApp"
*.Racks[*].ComputingServer[*].tcpApp[*].localPort = -1
*.Racks[*].ComputingServer[*].tcpApp[*].connectAddress = "Basic_dcn_tcp.Racks[0].ComputingServer[0]"
*.Racks[*].ComputingServer[*].tcpApp[*].connectPort = 80

A clue: in INET one can use hosts names as IP addresses.
Moreover, I suggest removing all @display() directives from your NED files because they make all objects (of that type) at the same place. Without @display() simulation environment will chose a proper position of each module.

Upvotes: 1

Related Questions