Page 1 of 1

MTU/MRU

Posted: Thu Jul 16, 2009 3:46 pm
by zigg
As I understand it, the MTU for dswifi is 1460 (SGIP_MTU_OVERRIDE in sgIP_Config.h).

Is the MRU the same? More to the point, what is the biggest UDP payload I can expect to recvfrom() (MRU - IP - UDP)?

(edited; MRU doesn't include Ethernet headers)

Re: MTU/MRU

Posted: Thu Jul 16, 2009 5:48 pm
by elhobbs
If I understand your question correctly - then I believe it is limited by the cache size that dswifi is initialized with. 128k is the default. so it will something less than that. and obviously less than or equal to the the buffer that you pass to recvfrom. it is a 2 mbit connection so if you are calling it every frame you are looking at ~4k at most... but probably a lot less.

Re: MTU/MRU

Posted: Thu Jul 16, 2009 6:07 pm
by zigg
Well, not precisely. MTU/MRU dictate the maximum size of a single packet.

MTU is the biggest packet that can be sent—this is where the 1420-byte TCP sends I got was coming from (or at least I believe so) since the MTU appears to be 1460 and the IP+TCP headers add up to 40 bytes if TCP options aren't used.

MRU would tell me how big a buffer I should allocate in order to be able to accept a packet of indeterminate size from another host. In the case of UDP I would subtract 20 IP header bytes and 8 UDP header bytes from this number to get the maximum receivable UDP payload.