diff -r -u qoe-monitor-0.2-RC/model/container.cc ns-allinone-3.16/ns-3.16/src/qoe-monitor/model/container.cc
--- qoe-monitor-0.2-RC/model/container.cc	2013-02-26 16:58:53.000000000 +0100
+++ ns-allinone-3.16/ns-3.16/src/qoe-monitor/model/container.cc	2014-01-20 10:51:01.928148430 +0100
@@ -40,7 +40,7 @@
 
     m_codecId = CODEC_ID_NONE;
     m_codecType = type;
-    m_sampleFormat = SAMPLE_FMT_NONE;
+    m_sampleFormat = AV_SAMPLE_FMT_NONE;
     m_bitRate = 0;
     m_sampleRate = 0;
     m_channels = 0;
@@ -87,7 +87,7 @@
       }
 
     /* Let's find out stream's information */
-    if ((ret = av_find_stream_info(m_inputFormatContext)) < 0)
+    if ((ret = avformat_find_stream_info(m_inputFormatContext, NULL)) < 0)
       {
         std::cout << "Container: Cannot find stream information\n";
         return false;
@@ -165,6 +165,7 @@
   {
     /* At first, I fill the queues with fresh data */
     m_rtpHeaderQueue.push(rtpHeader);
+    std::cout << "length inserted: " << length << "\n";
     m_packetLengthQueue.push(length);
 
     for (unsigned int i = 0; i < length; i++)
@@ -203,7 +204,7 @@
   }
 
   void
-  Container::SetSampleFormat(enum SampleFormat format)
+  Container::SetSampleFormat(enum AVSampleFormat format)
   {
     m_sampleFormat = format;
   }
@@ -238,7 +239,7 @@
     return m_codecType;
   }
 
-  enum SampleFormat
+  enum AVSampleFormat
   Container::GetSampleFormat()
   {
     return m_sampleFormat;
diff -r -u qoe-monitor-0.2-RC/model/container.h ns-allinone-3.16/ns-3.16/src/qoe-monitor/model/container.h
--- qoe-monitor-0.2-RC/model/container.h	2013-02-26 16:58:53.000000000 +0100
+++ ns-allinone-3.16/ns-3.16/src/qoe-monitor/model/container.h	2013-12-23 11:30:13.275857856 +0100
@@ -75,7 +75,7 @@
     void
     SetCodecType(enum AVMediaType codecType);
     void
-    SetSampleFormat(enum SampleFormat format);
+    SetSampleFormat(enum AVSampleFormat format);
     void
     SetBitRate(int bitRate);
     void
@@ -93,7 +93,7 @@
     GetCodecId();
     enum AVMediaType
     GetCodecType();
-    enum SampleFormat
+    enum AVSampleFormat
     GetSampleFormat();
     int
     GetBitRate();
@@ -159,7 +159,7 @@
 
     enum CodecID m_codecId;
     enum AVMediaType m_codecType;
-    enum SampleFormat m_sampleFormat;
+    enum AVSampleFormat m_sampleFormat;
     int m_bitRate;
     int m_sampleRate;
     int m_channels;
diff -r -u qoe-monitor-0.2-RC/model/mpeg4-container.cc ns-allinone-3.16/ns-3.16/src/qoe-monitor/model/mpeg4-container.cc
--- qoe-monitor-0.2-RC/model/mpeg4-container.cc	2013-02-26 16:58:53.000000000 +0100
+++ ns-allinone-3.16/ns-3.16/src/qoe-monitor/model/mpeg4-container.cc	2014-01-20 10:35:09.127423750 +0100
@@ -68,7 +68,7 @@
             sizeof(m_outputFormatContext->filename), "%s", m_filename.c_str());
 
         /* Now the output format is OK. I need to add a multimedia stream to it */
-        AVStream* outputStream = av_new_stream(m_outputFormatContext, 0);
+        AVStream* outputStream = avformat_new_stream(m_outputFormatContext, NULL);
 
         // Check sul risultato
         if (!outputStream)
@@ -76,6 +76,7 @@
             std::cout << "Mpeg4Container: I could not allocate the stream\n";
             return false;
           }
+        outputStream->id = 0;
 
         /* Start output stream configuration by means of STREAM COPY and CODEC CONTEXT COPY */
         if (avcodec_copy_context(outputStream->codec, &m_copyCodecContext))
@@ -105,7 +106,7 @@
           }
 
         /* Setup output parameters (see row 485 of output-example.c) */
-        if (av_set_parameters(m_outputFormatContext, NULL) < 0)
+        if (0)//av_set_parameters(m_outputFormatContext, NULL) < 0)
           {
             std::cout << "Mpeg4Container: invalid parameters\n";
             return false;
@@ -126,7 +127,7 @@
         m_fileOpen = true;
 
         /* Write output file header */
-        av_write_header(m_outputFormatContext);
+        avformat_write_header(m_outputFormatContext, NULL);
 
         return true;
       }
@@ -156,6 +157,7 @@
     outputFrame.duration = 0;
     outputFrame.pos = -1;
 
+    std::cout << "packetSize=" << packetSize << "\n";
     uint8_t* tempBuffer = (uint8_t*) calloc(packetSize, sizeof(uint8_t));
     assert(tempBuffer != NULL);
 
diff -r -u qoe-monitor-0.2-RC/model/multimedia-application-receiver.cc ns-allinone-3.16/ns-3.16/src/qoe-monitor/model/multimedia-application-receiver.cc
--- qoe-monitor-0.2-RC/model/multimedia-application-receiver.cc	2013-02-26 16:58:53.000000000 +0100
+++ ns-allinone-3.16/ns-3.16/src/qoe-monitor/model/multimedia-application-receiver.cc	2014-01-17 14:49:23.348001783 +0100
@@ -22,8 +22,8 @@
 namespace ns3
 {
 
-#define _MULTIMEDIA_APPLICATION_RECEIVER_DEBUG 0
-#define _MULTIMEDIA_APPLICATION_RECEIVER_JITTER_DEBUG 0
+#define _MULTIMEDIA_APPLICATION_RECEIVER_DEBUG 1
+#define _MULTIMEDIA_APPLICATION_RECEIVER_JITTER_DEBUG 1
 
   MultimediaApplicationReceiver::MultimediaApplicationReceiver(Ptr<Node> node,
       SimulationDataset* simulationDataset, Time jitterBufferLength) :
@@ -84,11 +84,14 @@
         &MultimediaApplicationReceiver::OnReceive, this));
   }
 
+extern Ptr<Packet> ppp;
+
   void
   MultimediaApplicationReceiver::OnReceive(Ptr<Socket> socket)
   {
+    //std::cout << "eugen in MultimediaApplicationReceiver::OnReceive\n";
 #if _MULTIMEDIA_APPLICATION_RECEIVER_DEBUG
-    std::cout << "OnReceived called\n";
+    //std::cout << "OnReceived called\n";
 #endif
 
     Ptr<Packet> packet;
@@ -96,7 +99,8 @@
     NalUnitHeader nalHeader;
 
     /* The receiver side business logic goes here */
-    while (packet = socket->Recv())
+    //while (packet = socket->Recv())
+    packet = ppp;
       {
         packet->RemoveHeader(rtpHeader);
 
@@ -123,6 +127,7 @@
                     _RECEIVER_PACKET_BUFFER_LENGTH);
                 m_fileRebuilder->SetNextPacket(rtpHeader, m_packetBuffer,
                     packetSize);
+                exit (1);
               }
             else if (m_fileType == SimulationDataset::VIDEO)
               {
@@ -150,7 +155,7 @@
                 else if (nalHeader.GetType() == nalHeader.FU_A)
                   {
 #if _MULTIMEDIA_APPLICATION_RECEIVER_DEBUG
-                    std::cout << "FU.A fragment received at: " << Simulator::Now().GetSeconds () << " seconds\n";
+                    std::cout << "FU.A fragment received at: " << Simulator::Now().GetPicoSeconds () << " pseconds\n";
                     std::cout << "  receiver rtp header info: ";
                     rtpHeader.Print(std::cout);
 #endif
diff -r -u qoe-monitor-0.2-RC/model/multimedia-application-receiver.h ns-allinone-3.16/ns-3.16/src/qoe-monitor/model/multimedia-application-receiver.h
--- qoe-monitor-0.2-RC/model/multimedia-application-receiver.h	2013-02-26 16:58:53.000000000 +0100
+++ ns-allinone-3.16/ns-3.16/src/qoe-monitor/model/multimedia-application-receiver.h	2014-01-14 18:31:42.132589855 +0100
@@ -83,9 +83,10 @@
     /* File type */
     SimulationDataset::FileType m_fileType;
 
-  private:
+  public:
     void
     OnReceive(Ptr<Socket> socket);
+  private:
     virtual void
     StartApplication(void);
     virtual void
diff -r -u qoe-monitor-0.2-RC/model/multimedia-application-sender.cc ns-allinone-3.16/ns-3.16/src/qoe-monitor/model/multimedia-application-sender.cc
--- qoe-monitor-0.2-RC/model/multimedia-application-sender.cc	2013-02-26 16:58:53.000000000 +0100
+++ ns-allinone-3.16/ns-3.16/src/qoe-monitor/model/multimedia-application-sender.cc	2014-01-17 14:49:46.200115062 +0100
@@ -19,6 +19,9 @@
 
 #include "multimedia-application-sender.h"
 
+#include "../../nanonetworks/model/simple-nano-device.h"
+//#include "../../nanonetworks/model/message-process-unit.h"
+
 namespace ns3
 {
 
@@ -224,10 +227,24 @@
           }
 
         /* Finally, I send the extracted packet over the socket */
-        m_socket->Send(firstPacket);
+        //m_socket->Send(firstPacket);  m_node is of type ptrNode
+        //std::cout << "eugen MultimediaApplicationSender::SendPacket\n";
+        //std::cout << "eugeny " << m_node->GetDevice(0)->GetObject<SimpleNanoDevice> () << std::endl;
+        m_node->GetDevice(0)->GetObject<SimpleNanoDevice> ()->SendPacket (firstPacket);  // here I need Ptr<SimpleNanoDevice> -> SendPacket
+
+        /*
+        Ptr<MessageProcessUnit> mpu = CreateObject<MessageProcessUnit> ();
+        mpu->SetDevice(m_node->GetDevice(0)->GetObject<SimpleNanoDevice> ());
+        m_node->GetDevice(0)->GetObject<SimpleNanoDevice> ()->SetMessageProcessUnit(mpu);
+        mpu -> m_interarrivalTime = 5000;
+
+        UniformVariable random;
+        double startTime = random.GetValue(0.0, 0.1);
+        Simulator::Schedule(Seconds(startTime), &MessageProcessUnit::CreteMessage, mpu);
+        */
 
 #if _MULTIMEDIA_APPLICATION_SENDER_DEBUG
-        std::cout << "- MultimediaApplicationSender: Packet sent at: " << Simulator::Now().GetSeconds() << " seconds \n";
+        std::cout << "- MultimediaApplicationSender: Packet sent at: " << Simulator::Now().GetPicoSeconds() << " pseconds \n";
         std::cout << "- MultimediaApplicationSender: Sender rtp header info:";
         firstHeader.Print(std::cout);
 #endif
diff -r -u qoe-monitor-0.2-RC/model/multimedia-file-rebuilder.cc ns-allinone-3.16/ns-3.16/src/qoe-monitor/model/multimedia-file-rebuilder.cc
--- qoe-monitor-0.2-RC/model/multimedia-file-rebuilder.cc	2013-02-26 16:58:53.000000000 +0100
+++ ns-allinone-3.16/ns-3.16/src/qoe-monitor/model/multimedia-file-rebuilder.cc	2014-01-20 11:07:17.140984244 +0100
@@ -115,7 +115,9 @@
                 (m_isFirstStart))
               {
                 /* Last fragment. First I check if some fragments have been lost */
+                std::cout << "eugen isEnd1\n";
                 CheckLostFragments(rtpHeader);
+                std::cout << "eugen isEnd2\n";
 
                 m_fragmentsQueue.push(fragment);
                 m_lastFragmentRtpHeader = rtpHeader;
@@ -151,6 +153,7 @@
 
                 /* Now I should have the whole packet available in the buffer. The overall length is
                  * provided by currentOffset */
+                std::cout << "co=" << currentOffset << "\n";
                 m_outputContainer->SetNextPacket(fakeHeader, m_packetBuffer, currentOffset);
                 m_lastRtpHeader = fakeHeader;
                 m_isFirstStart = false;
@@ -186,7 +189,9 @@
               {
                 /* Generic fragment (neither start, nor end).
                  * First, I must check if some fragments have been lost */
+                std::cout << "eugen else1\n";
                 CheckLostFragments(rtpHeader);
+                std::cout << "eugen else2\n";
               }
 
             m_fragmentsQueue.push(fragment);
@@ -238,6 +243,7 @@
       }
 
     /* Now I can send the received packet to the output context */
+                std::cout << "pS=" << packetSize << "\n";
     m_outputContainer->SetNextPacket(rtpHeader, buffer, packetSize);
     m_lastRtpHeader = rtpHeader;
   }
@@ -258,9 +264,11 @@
     unsigned int nextPacketId = startingId + currentNumberOfFragments;
 
     unsigned int i = startingId;
+    std::cout << "startingId=" << startingId << ", nextPacketId=" << nextPacketId << "\n";
     do
       {
         totalPacketLength += copyPacketTrace[i].m_packetSize;
+        std::cout << "m_pS=" << copyPacketTrace[i].m_packetSize << "\n";
         i++;
       }
     while (i < nextPacketId);
@@ -282,6 +290,7 @@
     RtpProtocol lostHeader = RtpProtocol(RtpProtocol::UNSPECIFIED,
                                          nextPacketId - 1, currentTimestamp, 0);
 
+    std::cout << "tPL=" << totalPacketLength << "\n";
     m_outputContainer->SetNextPacket(lostHeader, tempBuffer, totalPacketLength);
 
     m_lastRtpHeader = lostHeader;
@@ -327,7 +336,7 @@
   {
     unsigned int currentFragmentId = rtpHeader.GetPacketId();
     unsigned int lastFragmentId = m_lastFragmentRtpHeader.GetPacketId();
-
+    std::cout << "eugen check lost fragments, crt=" << currentFragmentId << ", last=" << lastFragmentId << "\n";
     if (currentFragmentId != (lastFragmentId + 1))
       {
         /* At least one fragment has been lost. Now I have to seek within
diff -r -u qoe-monitor-0.2-RC/model/wav-container.cc ns-allinone-3.16/ns-3.16/src/qoe-monitor/model/wav-container.cc
--- qoe-monitor-0.2-RC/model/wav-container.cc	2013-02-26 16:58:53.000000000 +0100
+++ ns-allinone-3.16/ns-3.16/src/qoe-monitor/model/wav-container.cc	2013-12-23 17:51:47.578926558 +0100
@@ -74,7 +74,7 @@
             sizeof(m_outputFormatContext->filename), "%s", m_filename.c_str());
 
         /* Now the output format is OK. I need to add a multimedia stream to it */
-        AVStream* outputStream = av_new_stream(m_outputFormatContext, 1);
+        AVStream* outputStream = avformat_new_stream(m_outputFormatContext, NULL);
 
         // Check sul risultato
         if (!outputStream)
@@ -82,6 +82,7 @@
             std::cout << "WavContainer: I could not allocate the stream\n";
             return false;
           }
+        outputStream->id = 1;
 
         /* Start output stream configuration by means of STREAM COPY and CODEC CONTEXT COPY */
         if (avcodec_copy_context(outputStream->codec, &m_copyCodecContext) || !m_copyCodecContextAvailable)
@@ -134,7 +135,7 @@
           }
 
         /* Setup output parameters (see row 485 of output-example.c) */
-        if (av_set_parameters(m_outputFormatContext, NULL) < 0)
+        if (0)//av_set_parameters(m_outputFormatContext, NULL) < 0)
           {
             std::cout << "WavContainer: invalid parameters\n";
             return false;
@@ -144,7 +145,7 @@
 
         if (!(m_outputFormat->flags & AVFMT_NOFILE))
           {
-            if (url_fopen(&m_outputFormatContext->pb, m_filename.c_str(), AVIO_FLAG_WRITE)
+            if (avio_open(&m_outputFormatContext->pb, m_filename.c_str(), AVIO_FLAG_WRITE)
                 < 0)
               {
                 std::cout << "WavContainer: Could not open output file\n";
@@ -155,7 +156,7 @@
         m_fileOpen = true;
 
         /* Write output file header */
-        av_write_header(m_outputFormatContext);
+        avformat_write_header(m_outputFormatContext, NULL);
 
         return true;
       }
@@ -262,7 +263,7 @@
     if (!(m_outputFormat->flags & AVFMT_NOFILE))
       {
         /* close the output file */
-        url_fclose(m_outputFormatContext->pb);
+        avio_close(m_outputFormatContext->pb);
         m_fileOpen = false;
       }
 
