udp sockets

T

toobee84

hi,

i am looking around the internet for a while now..... with no helpful
results.

i'm using udp-socket in a program what works fine so far until the
point i try to send a package with a size that exceeds the usual
~1500Byte/package.
the sendto()-call gives me then a "Message too long" error. Do i have
to make the fragmentation of the package myself or does the socket-API
provides any function to split the packages ?

if i have to do it myself how can i set the fragmentation bit in the
header file to tell the "socket" that i'm sending a splitted package?
(i know that i can use raw-sockets to set the whole header but that
have to work with usual SOCK_DGRAM somehow?)

can someone gives me a clue or a answer, i need to send udp-packages
(or split them) with a total size of 10.000 - 30.000 Byte
 
L

Lionel B

hi,

i am looking around the internet for a while now..... with no helpful
results.

i'm using udp-socket in a program what works fine so far until the point
i try to send a package with a size that exceeds the usual
~1500Byte/package.
the sendto()-call gives me then a "Message too long" error. Do i have to
make the fragmentation of the package myself or does the socket-API
provides any function to split the packages ?

if i have to do it myself how can i set the fragmentation bit in the
header file to tell the "socket" that i'm sending a splitted package? (i
know that i can use raw-sockets to set the whole header but that have to
work with usual SOCK_DGRAM somehow?)

can someone gives me a clue or a answer, i need to send udp-packages (or
split them) with a total size of 10.000 - 30.000 Byte

And your C++ *language* question was...?

Please see:

http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.9
 
M

Maxim Yegorushkin

i am looking around the internet for a while now..... with no helpful
results.

i'm using udp-socket in a program what works fine so far until the
point i try to send a package with a size that exceeds the usual
~1500Byte/package.
the sendto()-call gives me then a "Message too long" error. Do i have
to make the fragmentation of the package myself or does the socket-API
provides any function to split the packages ?

What operating system are you using?

If it is Linux, then man udp(7):

http://www.kernel.org/doc/man-pages/online/pages/man7/udp.7.html
<q>
By default, Linux UDP does path MTU (Maximum Transmission Unit)
discovery. This means the kernel will keep track of the MTU to a
specific target IP address and return EMSGSIZE when a UDP packet
write exceeds it. When this happens, the application should
decrease the packet size. Path MTU discovery can be also turned
off using the IP_MTU_DISCOVER socket option or the
/proc/sys/net/ipv4/ip_no_pmtu_disc file; see ip(7) for details.
When turned off, UDP will fragment outgoing UDP packets that
exceed the interface MTU. However, disabling it is not
recommended for performance and reliability reasons.
</q>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top