Re: How much RAM needed for low end Ethernet application?
From: Adam Dunkels (adam_at_sics.nospam.se)
Date: 03/02/05
- Next message: Adam Dunkels: "Re: How much RAM needed for low end Ethernet application?"
- Previous message: Ulf Samuelsson: "Re: How much RAM needed for low end Ethernet application?"
- In reply to: Richard H.: "Re: How much RAM needed for low end Ethernet application?"
- Next in thread: Richard H.: "Re: How much RAM needed for low end Ethernet application?"
- Reply: Richard H.: "Re: How much RAM needed for low end Ethernet application?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 02 Mar 2005 19:36:45 +0000
On Wed, 02 Mar 2005 09:53:24 -0700, Richard H. wrote:
> Adam Dunkels wrote:
>> the fact that the Ethernet controller had buffer memory.
>
> Yes, often more than the MCU. While I wouldn't leap to use it as
> general-purpose storage, it seems a convenient resource for packet
> construction, and avoids the need to transfer it in a subsequent step.
How many Ethernet controllers are able to address this memory directly?
I wrote a device driver for the CS8900a and I seem to remember that it
only provided a sequential interface to its packet buffer (i.e., read and
write bytes from the start of the packet to the end, no "random" access).
>> Do you mean storing connection state inside the Ethernet controller's
>> memory? I guess it would be quite possible to do so, although there
>> would be a performance hit with every incoming packet since the list of
>> connections would have to be scanned to check which connection that
>> should receive the packet.
>
> Ick. That's a bit more aggressive than I was thinking, but it's an
> interesting thought for extremely limited systems.
>
> No, I'm actually thinking along the lines of keeping only the essential
> variables in SRAM per-session and building the rest on-the-fly as the
> header is being written to the NIC. Off-the-cuff... remote IP & port,
> session sequence & ack numbers, header flags, session MSS & window size,
> add up to ~17 bytes per TCP session. (And of course, the ARP table,
> which ideally has just the default gateway instead of many same-subnet
> peers.)
Hmmm, maybe I don't get it, but aren't you placing the entire TCP
connection state in the Ethernet controller's SRAM then?
>> Yes, definitely. Adding the ability to have multiple outstanding TCP
>> segments does however complicate both the sending code and the ACK
>> processing code, and would lead to both increased code size and
>> slightly increased RAM requirements (since more state needs to be
>> kept).
>
> Yes. ISTR that Bentham had an interesting approach for handling static
> data in TCP/IP Lean, where certain info was either stored in the session
> table or through trickery in the Sequence numbering that pointed to the
> "file" object and offset, allowing retransmissions to be re-built
> as-needed from the static source data instead of buffering. (Workable
> only where data can be trivially reconstructed from the source.)
Yes, that is a nice trick and saves four bytes of per-connection state.
However, if I remember correctly, his stack did not do retransmissions but
relied on the remote host to do retransmissions. This actually works in
some situations, where both hosts are sending data simultaneously (like an
HTTP GET / response situation) but does not work for unidirectional
transfers.
> This would seem to support large windowing with no re-TX buffering
> (i.e., max throughput on high-latency links with little resource
> overhead on the device)
Hmmm, I don't think it can be extended *that* easily. One problem arises
when doing retransmissions: there is no way of knowing what sequence
number to retransmit. Unless you store it in RAM, but that sort of defeats
the purpose of the trick :-)
Regards,
/adam
-- Adam Dunkels, Swedish Institute of Computer Science http://www.sics.se/~adam/, <adam@sics.nospam.se>
- Next message: Adam Dunkels: "Re: How much RAM needed for low end Ethernet application?"
- Previous message: Ulf Samuelsson: "Re: How much RAM needed for low end Ethernet application?"
- In reply to: Richard H.: "Re: How much RAM needed for low end Ethernet application?"
- Next in thread: Richard H.: "Re: How much RAM needed for low end Ethernet application?"
- Reply: Richard H.: "Re: How much RAM needed for low end Ethernet application?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|