title: ns-3 wlan grid TCP not working while UDP is
body: <p>I am trying to set up a Multihop AdHoc 802.11g Network in ns-3.<br>
  To get started I used the example 'wifi-simple-adhoc-grid.cc'.</p>
  
  <p>The example uses UDP, but I want to use TCP. Therefore I switched</p>
  
  <pre><code>TypeId tid = ns3::UdpSocketFactory::GetTypeId();
  Ptr&lt;Socket&gt; recvSink = Socket::CreateSocket (c.Get (sinkNode), tid);
  InetSocketAddress local = InetSocketAddress (Ipv4Address::GetAny (), 80);
  recvSink-&gt;Bind (local);
  recvSink-&gt;SetRecvCallback (MakeCallback (&amp;ReceivePacket));
  </code></pre>
  
  <p>to</p>
  
  <pre><code>TypeId tid = ns3::TcpSocketFactory::GetTypeId();
  Ptr&lt;Socket&gt; recvSink = Socket::CreateSocket (c.Get (sinkNode), tid);
  InetSocketAddress local = InetSocketAddress (Ipv4Address::GetAny (), 80);
  recvSink-&gt;Bind (local);
  recvSink-&gt;SetRecvCallback (MakeCallback (&amp;ReceivePacket));
  
  Ptr&lt;Socket&gt; source = Socket::CreateSocket (c.Get (sourceNode), tid);
  InetSocketAddress remote = InetSocketAddress (i.GetAddress (sinkNode, 0), 80);
  </code></pre>
  
  <p>Sending Packets is no Problem, but ReceivePacket is never called, which means, that socket Sink receives no packets.</p>
  
  <p>The whole code: <a href="https://gist.github.com/3023757" rel="nofollow">https://gist.github.com/3023757</a></p>
  
  <p><a href="https://gist.github.com/3023751" rel="nofollow">Routes output</a> by: </p>
  
  <pre><code>Ptr&lt;OutputStreamWrapper&gt; routingStream = Create&lt;OutputStreamWrapper&gt; 
  ("wifi-multihop.routes", std::ios::out)
  </code></pre>