Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5849231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:58:15+00:00 2026-05-22T12:58:15+00:00

i am trying to build a network simulation with OMNet++. Problem is i dont

  • 0

i am trying to build a network simulation with OMNet++. Problem is i dont know how to configure EtherSwitch and EtherHost devices and give them IP. What is the necessary routing code to rout traffic between switches and routers. IP addresses of the routers’s ports must be like table below;

Router Leg IP
1 —— 1 — 192.168.1.0/24
1 —— 4 — 192.168.4.1
1 —— 5 — 192.168.5.1
2 —— 2 — 192.168.2.0/24
2 —— 5 — 192.168.5.2
2 —— 6 — 192.168.6.2
3 —— 3 — 192.168.3.0/24
3 —— 4 — 192.168.4.3
3 —— 6 — 192.168.6.3

Here image of the required network:

Network

My NED file:

import inet.nodes.inet.Router;
import inet.nodes.inet.StandardHost;
import ned.DatarateChannel;
import inet.nodes.ethernet.EtherSwitch;
import inet.nodes.ethernet.EtherHost;
import inet.networklayer.autorouting.FlatNetworkConfigurator;

network gyte
{
    @display("bgb=457,318");
    types:
    channel geth extends DatarateChannel
    {
        datarate = 1Gbps;
    }

    channel hgeth extends DatarateChannel
    {
        datarate = 512Mbps;
    }

    submodules:
    // Routers
    routers[3]: Router {
        parameters:
            @display("p=208,272,row=id;i=abstract/router");

        gates:
            pppg[3];
    }

    // Switches
    switches[3]: EtherSwitch {
        parameters:
            @display("p=179,162,row");

        gates:
            ethg[3];
    }

    // Hosts
    ehosts[4]: EtherHost {
        parameters:
            @display("p=384,56,row");

        gates:
            ethg;
    }

    // Servers
    eservers[2]: EtherHost {
        parameters:
            @display("i=device/server;p=117,71,row");

        gates:
            ethg;
    }

    configurator: FlatNetworkConfigurator {

        @display("p=22,25");
    }

connections:
    ehosts[0].ethg <--> switchs[0].ethg[0];
    eservers[0].ethg <--> switchs[0].ethg[1];

    ehosts[1].ethg <--> switchs[1].ethg[0];
    eservers[1].ethg <--> switchs[1].ethg[1];

    switchs[0].ethg[2] <--> routers[0].pppg[0];
    switchs[1].ethg[2] <--> routers[1].pppg[0];

    routers[0].pppg[1] <--> routers[1].pppg[1];
    routers[0].pppg[2] <--> routers[2].pppg[0];
    routers[1].pppg[2] <--> routers[2].pppg[1];
    routers[2].pppg[2] <--> switchs[2].ethg[0];

    switchs[2].ethg[1] <--> ehosts[2].ethg;
    switchs[2].ethg[2] <--> ehosts[3].ethg;

}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T12:58:15+00:00Added an answer on May 22, 2026 at 12:58 pm

    Switches dont have an IP address (In reality they have in order to administrate the Switch). Switching (Layer 2) is based on MAC addresses.
    So in the simulation you dont have to configure anything for the Switches.

    In order to assign IP addresses to the hosts and routers and add the routes to the routing tables you can use the “flatnetworkconfigurator” module. Simply put it in your NED file.
    But all IP addresses will be out of one subnet.

    Other solution is to use MRT files. There you specify with linux syntax the IP, subnetmask, gateway etc. for each interface.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to build a GUI application in Java/Swing. I'm mainly used to painting GUIs
I trying to build and compile my xcodeproj in command line and it is
I'm trying to build a grammar with the following: NUMERIC: INTEGER | FLOAT |
I'm currently trying to build a personal website to create a presence on the
I am trying to build a function in C/C++ to sort an array and
I am trying to build an website for my college's magazine. I used the
I am trying to build out a useful 3d game engine out of the
I am trying to build a dependency graph of tables based on the foreign
I'm trying to build a better username/password field for my workplace and would like
I am trying to build an Eclipse application that would work with a linux/motif

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.