Two network interfaces

Ian Caddy ianc at goanna.iinet.net.au
Wed Mar 19 02:50:19 UTC 2008


Hi Leon,


Leon Pollak wrote:
> Hello, all, again.
> 
> I am sure that there are people who knows the answer, therefore I am 
> apologizing for resending my last message. May be it was missed somehow:

I saw this but thought others might have more detailed information to 
add, but I guess not... ;-)

> 
> I searched the docs and did not find any considerations about the mbuf 
> capacity and mbuf cluster capacity. The manual says that it's default values 
> are 64K and 128K.
> I was sure that for the simple ping it will be enough, but....

mbufs and mbus clusters complex things and there is no simple way to say 
exactly how much you will need.  It depends on a number of factors, such 
as number of sockets you are going to have open, number of interfaces, 
amount of traffic that will be coming in those interfaces, even if you 
aren't interested in it, such as broadcast packets.

Even a simple TCP packet will use a multiple of mbufs just to send one 
byte of data.  First the mbus will be allocated for the data, then 
another mbuf is allocated for the TCP header, then maybe another one for 
the IP header and so on.  When it gets down to the Ethernet driver, 
there are usually a number of mbufs chained together that all need to be 
sent.  They can not be released until the packet has gone.  On the 
receive side your driver might allocate a number of mbufs for potential 
receive packets, etc.

> 
> Now, I begin to understand the importance of the issue and will be very glad 
> for the link to the place where are any considerations about these numbers.

I don't know of one, basically you should provide all the memory you can 
spare to this as running out of mbufs is never good.


>> By the way: Could you fix the networking problem you had some weeks ago?
> No, I left it for now, as missing the first after power-up 1-2 packets is not 
> so serious bug.

That is a shame, but I understand that it was not critical.  I was also 
wondering how it turned out.

> On Tuesday, 11 בMarch 2008, Chris Johns wrote:
>> Thomas is correct with the need to correctly size the network buffers. When 
>> getting new hardware up and running I tend to over allocate to remove this  
>>from being a problem. 
> Well, the same question remains: what is overallocate?

Over allocate would be to give it as much memory as you can spare.  We 
provide 512Kbytes for mbufs and the same for mbuf clusters, and haven't 
had any problems, but we only have one MAC.

Hope this helps.

regards,

Ian Caddy

-- 
Ian Caddy
Goanna Technologies Pty Ltd
+61 8 9444 2634




More information about the users mailing list