Is the soucre code to the TCP/IP stack(s) available or is it
possible to extract/inject packets at different layers within the
stack to facilitate custom processing? There are a handful of
protocols we are considering for implementation that I think
would be difficult to do without access to the source code. Here
are a couple of examples. I don’t have full details, but you’ll
get the idea…
- One of these protocols uses UDP for transport. The packet
breaks down kind of like you’d expect with a 20 byte IP
header, 20 byte UDP header, 20 byte protocol specific header
and then the payload. The catch here is the payload is only a
few bytes so most of the packet just consists of packet
headers. Not all that efficient. To help with this, after a
transaction is established the header portion is replaced with
(I think) a 4 byte transaction ID in all future packets
associated with the transaction. When a packet is received,
the stack recognizes it is one of these “compressed” affairs,
uses the transaction ID to retrieve a locally-stored copy of
the header which is used to build an “uncompressed” version of
the packet. The uncompressed version is then propagated up
the stack as usual.
I’m not sure if the entire header (IP/UDP/other) is
represented by the transaction ID or if just the (UDP/other)
portion is. In the first case I guess it would be the
ethernet driver that would have to expand the header then pass
it up to the IP layer. In the second case, the IP layer would
have to expand it and pass it to the UDP layer.
Anyway, like I said, I’m sketchy on the details of this
protocol. I haven’t seen a spec, I’ve only had it described
to me and I’ve probably described it to you incorrectly. The
key point is, its unlikely the off-the-shelf stacks will know
when or how to do this compression trick so we’d have to add
it. Assuming the source code is not available, is it possible
to extract packets at the IP layer say, modify them and stick
them back in?
2) Another protocol we are potentially interested in is the
Stream Control Transmission Protocol described in
RFC-2960. This protocol is at the same level as UDP and TCP in
that it sits between IP and the application. Is it possible to
extract incoming packets at the IP layer based on protocol
number and insert outbound SCTP packets back into the stack at
the IP layer?