OMNET++ DEVICE TO DEVICE COMMUNICATION

OMNET++ DEVICE TO DEVICE COMMUNICATION communication is generally non-transparent to the cellular network and it can occur on cellular spectrum (i.e., inband) or unlicensed spectrum (i.e., outband). D2D communication in cellular networks is defined as direct communication between two mobile users without traversing the Base Station (BS) or core network.

Advantages of D2D communication network:

  • Reduce delay.
  • Improve spectral efficiency.
  • Improving system throughput.
  • Energy efficiency.
  • Increase fairness.

Classification of D2D communication network:

  • Inband D2D.
    • Underlay.
    • Overlay.
  • Outband D2D.
    • Autonomous.
    • Controlled.
Architecture of d2d communication networks
Architecture of d2d communication networks

Research areas on D2D communication network:

  • Increase bit-rate.
  • Resource management.
  • Improving substantially the capacity of network coding.
  • D2D with LTE architecture.
  • Improving energy efficiency of the network.

Sample code for OMNET++ DEVICE TO DEVICE COMMUNICATION:

void D2D::fromIpUe(IPv4Datagram * datagram)
{
    // Remove control info from IP datagram
    delete(datagram->removeControlInfo());

    // obtain the encapsulated transport packet
    cPacket * transportPacket = datagram->getEncapsulatedPacket();

    // 5-Tuple infos
    unsigned short srcPort = 0;
    unsigned short dstPort = 0;
    int transportProtocol = datagram->getTransportProtocol();
    // TODO Add support to IPv6
    IPv4Address srcAddr  = datagram->getSrcAddress() ,
                destAddr = datagram->getDestAddress();

    int headerSize = datagram->getHeaderLength();

    // inspect packet depending on the transport protocol type
    switch (transportProtocol)
    {
        case IP_PROT_TCP:
            TCPSegment* tcpseg;
            tcpseg = check_and_cast<TCPSegment*>(transportPacket);
            srcPort = tcpseg->getSrcPort();
            dstPort = tcpseg->getDestPort();
            headerSize += tcpseg->getHeaderLength();
            break;
        case IP_PROT_UDP:
            UDPPacket* udppacket;
            udppacket = check_and_cast<UDPPacket*>(transportPacket);
            srcPort = udppacket->getSourcePort();
            dstPort = udppacket->getDestinationPort();
            headerSize += UDP_HEADER_BYTES;
            break;
    }

    FlowControlInfo *controlInfo = new FlowControlInfo();
    controlInfo->setSrcAddr(srcAddr.getInt());
    controlInfo->setDstAddr(destAddr.getInt());
    controlInfo->setSrcPort(srcPort);
    controlInfo->setDstPort(dstPort);
    controlInfo->setSequenceNumber(seqNum_++);
    controlInfo->setHeaderSize(headerSize);
    printControlInfo(controlInfo);

    datagram->setControlInfo(controlInfo);
  
    send(datagram,stackGateOut_);
}