socket, UDP, SO_MAX_MSG_SIZE ??? 
Author Message
 socket, UDP, SO_MAX_MSG_SIZE ???

I'm implementing an application layer on top of UDP using the
socket module, and I'm trying to determine the local machine's
SO_MAX_MSG_SIZE. This option doesn't appear to be
available in the socket module.

I don't really know much about maximum UDP packet sizes.
Do they generally default to the IP 65K limit? And if not, what's
an alternate route for determining the max msg size?

C//



Thu, 06 Nov 2003 13:04:55 GMT  
 socket, UDP, SO_MAX_MSG_SIZE ???


Quote:

> I'm implementing an application layer on top of UDP using the
> socket module, and I'm trying to determine the local machine's
> SO_MAX_MSG_SIZE. This option doesn't appear to be
> available in the socket module.

> I don't really know much about maximum UDP packet sizes.
> Do they generally default to the IP 65K limit? And if not, what's
> an alternate route for determining the max msg size?

> C//

Just been playing games with this ratty stuff in C++ on Windows, and I
found out the following:

IP packet size is generally ~1500 bytes by default. Don't know if that's
a given on all tcp/ip stacks or just Windows specific (I got the
impression that it was a standard default though).

UDP might only support max packet size of 512 bytes since anything larger
might be subject to fragmentation - again, ymmv. The 1500 bytes mentioned
above might be the max packet size before fragmentation otoh.

I think that the IP 64k max size is just the maximum possible size for an
IP packet and the default is typically set _much_ lower - typical max
seems to be 8k at most. (Windows uses a registry setting to set the max
ip size - by default 1500 bytes).

UDP on Windows is a poor stepchild - very little documentation.

People on comp.protocols.snmp and the net-snmp project at sourceforge
might be better equipped to answer your specific question about how to
determine actual max packet size on various machines. This is because
snmp uses udp so these people would probably want/need to find this info
too. FWIW, net-snmp runs on a fair number of platforms and if you dig
through their (imho vastly over factored) C source, you can probably find
the info. There is also a python wrapper for net-snmp called (I think)
pysnmp and it lives on sourceforge too.

HTH

Dave LeBlanc



Sat, 08 Nov 2003 00:38:56 GMT  
 socket, UDP, SO_MAX_MSG_SIZE ???
Hi,

Quote:

> IP packet size is generally ~1500 bytes by default. Don't know if
> that's a given on all tcp/ip stacks or just Windows specific (I got
> the impression that it was a standard default though).

Sounds like you're getting confused with the size of the network
packet, e.g. on Ethernet.  A large IP packet will be fragmented into
many parts to travel across the underlying network.

    $ ifconfig | grep MTU
              UP BROADCAST LOOPBACK RUNNING  MTU:3584  Metric:1
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              UP POINTOPOINT RUNNING  MTU:2500  Metric:1

Ralph.



Tue, 02 Dec 2003 03:14:22 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. UDP sockets & UDP tunneled within TCP

2. UDP sockets w/ db-sockets

3. UDP Sockets

4. UDP extension to sockets package?

5. UDP Sockets?

6. UDP Sockets?

7. how to use UDP with sockets

8. UDP socket example

9. Raw Udp Sockets!

10. REXX sockets UDP

11. UDP Socket Problem under Windows

12. Any Scheme Implementation with UDP sockets support?

 

 
Powered by phpBB® Forum Software