OMNET PROJECT SOURCE CODE

OMNET PROJECT SOURCE CODE we are going to explain about the green computing network and terrestrial communication network concept with their sample code is also as follows,

Green computing network:

Green computing network is widely used mainly due to its characteristics to reduce the energy consumption of the network.Main purpose of green computing is also to investigate new computer systems, computing model and applications with the low-cost and also low-power-consumption and promote the sustainable development of economy and society

 

Architecture of green computing:
Architecture of green computing:

Advantages of green computing:

  • To improve environment condition
  • Reduce toxic materials
  • Cost effective
  • Reduce energy consumption
  • Reduce the amount of pollution in air or surroundings
  • Help to promote the effective utilization of natural resources
  • Reduces pressure also on paper industry etc.

Research topics in green computing:

  • Energy-efficient multimedia system
  • Energy harvesting, storage and recycling climate and also ecosystem monitoring
  • Green high-performance computing and also applications
  • Energy aware resource allocation and also scheduling mechanisms
  • Design and also analysis of the smart power grid etc

Sample Omnet++ Project source for green computing network.

GreenComputing::GreenComputing():
	BaseModule(),
	battery(NULL)
{}

GreenComputing::GreenComputing(unsigned stacksize):
	BaseModule(stacksize),
	battery(NULL)
{}

void GreenComputing::registerWithBattery(const std::string& name, int numAccounts) {
	battery = FindModule<BaseBattery*>::findSubModule(findHost());

	if(!battery) {
		opp_warning("No battery module defined!");
	} else {
		deviceID = battery->registerDevice(name, numAccounts);
	}
}

void GreenComputing::draw(DrawAmount& amount, int account) {
	if(!battery)
		return;

	battery->draw(deviceID, amount, account);
}

void GreenComputing::drawCurrent(double amount, int account) {
	if(!battery)
		return;
	DrawAmount val(DrawAmount::CURRENT, amount);
	battery->draw(deviceID, val, account);
}
void GreenComputing::drawEnergy(double amount, int account) {
	if(!battery)
		return;
	DrawAmount val(DrawAmount::ENERGY, amount);
	battery->draw(deviceID, val, account);
}

Terrestrial communication network:

A terrestrial communication system, facilitating audio, video, data, and also any other type of communication within a local geographical area, and also with an extremely large number of communication channels being made available simultaneously at a very low cost.

Terrestrial network communication technology trends:

  • Uses of single number IP address.
  • Access to all types of telecommunication services.
  • Reliable wireless access even also in the failure of one or more networks.
  • Single device can able to communicate also with different networks.
  • A single bill for all services also with reduced cost.

Research Topics in Terrestrial network communication

  • Adaptive handover strategies.
  • Cross layer mechanisms.
  • Dynamic spectrum allocation also in radio network.
  • Dynamic channel allocation, admission, load and also congestion control.
  • MIMO systems, smart antennas and also space-time coding.
  • Software and also cognitive radios etc.

Omnet++ Project source code for Terrestrial network communication

void VoDUDPServer::initialize(int stage)
{
    if (stage != 3)
        return;    
    serverPort = par("localPort");
    inputFileName = par("TERRES_trace_file").stringValue();
    traceType = par("traceType").stringValue();
    fps = par("fps");
    double one = 1.0;
    TIME_SLOT = one / fps;
    numStreams = 0;
    socket.setOutputGate(gate("udpOut"));
    socket.bind(serverPort);
    if (!inputFileName.empty())
    {     
        if (traceType == "SVC")
        {
            infile.open(inputFileName.c_str(), ios::in);
            if (infile.bad()) /* Or file is bad */
                throw cRuntimeError("Error while opening input file (File not found or incorrect type)");

            infile.seekg(0, ios::beg);
            long int i = 0;
            while (!infile.eof())
            {
                svcPacket tmp;
                tmp.index = i;
                infile >> tmp.memoryAdd >> tmp.length >> tmp.lid >> tmp.tid >> tmp.qid >>
                    tmp.frameType >> tmp.isDiscardable >> tmp.isTruncatable >> tmp.frameNumber
                    >> tmp.timestamp >> tmp.isControl;
                svcTrace_.push_back(tmp);
                i++;
            }
            svcPacket tmp;
            tmp.index = LONG_MAX;
            svcTrace_.push_back(tmp);
        }
        else
        {
            tracerec t;
            struct stat buf;
            FILE *fp;
    cMessage* timer = new cMessage("Timer");
    double start = par("startTime");    double offset = (double) start + simTime().dbl();
    scheduleAt(offset, timer);
}