OMNET OPTICAL NETWORK

OMNET OPTICAL NETWORK Communications between computers, telephones and also other electronic devices using light.An optical network is far more reliable and also has far greater potential transmission capacity than networking in the electrical domain.

Advantages of optical network:

  • Optical fiber networks have high capacity.
  • Can be used also for providing the high bandwidth services.
  • Even in wireless, infrared means also high bandwidth connectivity.

Technologies in optical network:

  • Code division multiplexing.
  • Wavelength division multiplexing.
  • Time division multiplexing.
OMNET OPTICAL NETWORK
OMNET OPTICAL NETWORK

Optical network topologies are:

  • Ring.
  • Dual bus.
  • Torus.
  • Hybercube.

Sample code for optical network:

Define_Module(OBS_OpticalCrossConnect);

OBS_OpticalCrossConnect::~OBS_OpticalCrossConnect(){
	free(schedulingTable);
}

void OBS_OpticalCrossConnect::initialize(){
   // All input gates initialized to -1
   schedulingTable = (int*)calloc(gateSize("in"),sizeof(int));
   int i;
   for(i=0;i<gateSize("in");i++){
      schedulingTable[i] = -1;
      WATCH(schedulingTable[i]);
   }
}

void OBS_OpticalCrossConnect::handleMessage(cMessage *msg){
   //Pretty easy algorithm: check if input gate has a scheduled connection and send the message to assigned output gate.
   cGate *gate = msg->getArrivalGate();

   if(schedulingTable[gate->getIndex()] == -1) delete msg; // Output gate not assigned. Drop burst
   else
      send(msg,"out",schedulingTable[gate->getIndex()]);
}

void OBS_OpticalCrossConnect::setGate(int inGate,int outGate){
   Enter_Method("programming gate connection %d -> %d",inGate,outGate);

   if(schedulingTable[inGate] != -1) opp_error("Attempting to schedule an already scheduled input channel. Channel id: %d",inGate);
   schedulingTable[inGate] = outGate;
}

void OBS_OpticalCrossConnect::unsetGate(int inGate){
   Enter_Method("unprogramming gate %d",inGate);
   schedulingTable[inGate] = -1;
}