Re: Getting mbuf length
Re: Getting mbuf length
- Subject: Re: Getting mbuf length
- From: email@hidden (David E. Gelhar)
- Date: 24 Nov 2008 08:01:57 -0500
I guess I misunderstood the difference between "IP fragmentation" and "HTTP request
is too big to fit into a single IP packet." If I have the latter case, shouldn't
I just receive the rest of the HTTP request in a subsequent call to my bottleneck?
An IP packet that's too big to transmit across a given link-layer medium (for
example, an ethernet frame) can itself be split into fragments ("IP fragmentation").
The "more fragments" bit in the IP header is your indication that this is happening.
This is distinct from the process of TCP splitting up a stream of incoming data
into packets ("segments") for transmission.
Note also that there are *no* guarantees about how the TCP implementation chooses
to split things up: it might choose to put 10 bytes of data in one packet, 20
in the next, and 1000 in the third. Yes, it's unlikely to do that, but the point
is that if you are making assumptions that there's any definite mapping between
application-level constructs (like "one HTTP request" or "the contents of a write()
syscall") and TCP packet boundaries you're asking for trouble. TCP guarantees
delivery of a reliable *stream of bytes* from end-to-end, nothing more or less.
The following is a really important point:
An IP filter that wants to parse application level protocols like HTTP needs to
be prepared to deal with all the protocol details of IP, TCP and HTTP.
IP packets can be dropped, retransmitted, duplicated, corrupted, or arrive out
of order. The job of TCP is to sort out the duplicated/misordered/missing packets
into a reliable byte stream; if you want to (accurately) read application data
from an IP filter, you'll need to duplicate what TCP does. (ps. don't forget to
validate the TCP checksum).
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden