IP fragmentation

classic Classic list List threaded Threaded
2 messages Options
Vic
Reply | Threaded
Open this post in threaded view
|

IP fragmentation

Vic
Hi all,

I have trouble getting the IP fragmentation to work. I try to transfer 4000 byte of data, therefor I call the function "tcp_write(tpcb, test_data, sizeof(test_data), 0);". test_data is defined as "uint8_t test_data[4000];" and filled with "DEADBEEF" test pattern. In ip.c at the point

#if IP_FRAG
  /* don't fragment if interface has mtu set to 0 [loopif] */
  if (netif->mtu && (p->tot_len > netif->mtu)) {
    return ip_frag(p, netif, dest);
  }
#endif /* IP_FRAG */

This point is passed 3 times but ip_frag is never executed because p->tot_len is smaller than the MTU. For the first and second p it is 1486 and for the last p 1148.
I defined the TCP_MSS as 1446 and the MTU is 1500.

Is there anything I have to consider when transferring data larger than MSS? Have anybody a clue for me what could be wrong?
Vic
Reply | Threaded
Open this post in threaded view
|

Re: IP fragmentation

Vic
Sorry guys I totally misunderstood the fragmentation. My problem has nothing to do with it.
What I try is to send more data than one frame can carry. But the pbuf given as argument to my low level driver consists of a chain of two pbufs. One for the header and the other one for the data. For my understanding it must be a chain of six pbufs (3x header and 3x data).
At the moment the tcp_recv callback function receives three packets without a p->next instead of receiving one packet divided into three frames with a p->next.