473,385 Members | 1,353 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

UDP Server

Nak
Hi there,

I have made a UDP server and client class in VB.NET but am experiencing
problems with receiving datagrams beyond a certain size (though I am unsure
of the exact limit). I wish to send quite significant amounts of data via
UDP and certain sources on the internet recommend that I do *not* use the
"udpclient" class but make a new class which uses the "sockets" class and
receive the data asynchronously. Does anyone know of any examples around
that are capable of this? VB.NET / C#, I don't mind, thanks in advance.

Nick.
Nov 20 '05 #1
5 3195
Nak
Hi again,

I've just come across a free sockets library called indy, i'm hoping
that this is capable of recieving large UDP datagrams, but am unsure as yet
as I can't find the relevant information on how to get the thing working.
If anyone else has used this, please let me know! :-)

Nick.

"Nak" <a@a.com> wrote in message
news:eo**************@TK2MSFTNGP09.phx.gbl...
Hi there,

I have made a UDP server and client class in VB.NET but am experiencing problems with receiving datagrams beyond a certain size (though I am unsure of the exact limit). I wish to send quite significant amounts of data via
UDP and certain sources on the internet recommend that I do *not* use the
"udpclient" class but make a new class which uses the "sockets" class and
receive the data asynchronously. Does anyone know of any examples around
that are capable of this? VB.NET / C#, I don't mind, thanks in advance.

Nick.

Nov 21 '05 #2
Hi,

I think a UDP packet has the maximum size of a UDP datagram is 65507
bytes.(about 64 kb)

Theoretically, the maximum size of an IP datagram is 65535 bytes, imposed
by the 16-bit total length field in the IP header.(See the figure below)

A summary of the contents of the internet header follows:

0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Version| IHL |Type of Service| Total Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Identification |Flags| Fragment Offset |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Time to Live | Protocol | Header Checksum |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Source Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Destination Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Options | Padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Example Internet Datagram Header

With an IP header of 20 bytes and a UDP header of 8 bytes, this leaves a
maximum of 65507 bytes of user data in a UDP datagram.

Since this is caused by the nature of the UDP, to workaround the problem,
we would better to split the data based on 64kb, i.e. if we need to
transport the data over 64kb, we can split it into a few udp packets, and
then rearrange them in the server side. To indicate the data order, we need
to spare a few bytes in the head of the udp packet, so that in the server
side we know how to rearrange them. All this relied on how you implement
the algorithm.

Hope this helps.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #3
Nak
Hi Peter,

I was fearing this, and hoping that the UDP protocol would spit my data
into the necessary sizes. *But* I still believe there is a problem here,
just mainly down to what I read on Code Project regarding a bug with the
"Receive" method of the UDPClient.

http://www.codeproject.com/buglist/udpclientbug.asp

I just hope that doing as you suggest will have the desired effects and
enable me to perform file transfer via UDP, I've implemented MD5 Hashing to
check that data arrives correctly but this is a whole lot more to implement,
oh well, such is life!! Thanks for the advice Peter, I shall try that now.

Nick.

""Peter Huang"" <v-******@online.microsoft.com> wrote in message
news:9R**************@cpmsftngxa06.phx.gbl...
Hi,

I think a UDP packet has the maximum size of a UDP datagram is 65507
bytes.(about 64 kb)

Theoretically, the maximum size of an IP datagram is 65535 bytes, imposed
by the 16-bit total length field in the IP header.(See the figure below)

A summary of the contents of the internet header follows:

0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Version| IHL |Type of Service| Total Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Identification |Flags| Fragment Offset |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Time to Live | Protocol | Header Checksum |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Source Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Destination Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Options | Padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Example Internet Datagram Header

With an IP header of 20 bytes and a UDP header of 8 bytes, this leaves a
maximum of 65507 bytes of user data in a UDP datagram.

Since this is caused by the nature of the UDP, to workaround the problem,
we would better to split the data based on 64kb, i.e. if we need to
transport the data over 64kb, we can split it into a few udp packets, and
then rearrange them in the server side. To indicate the data order, we need to spare a few bytes in the head of the udp packet, so that in the server
side we know how to rearrange them. All this relied on how you implement
the algorithm.

Hope this helps.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #4
Hi Nick,

Yes it is a known issue, and the problem has been resolved in the Everett
(VS.NET 2003).
If you still have any concern on this issuem, please feel free to post here.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #5
Nak
Hi Peter,
Yes it is a known issue, and the problem has been resolved in the Everett
(VS.NET 2003).
If you still have any concern on this issuem, please feel free to post

here.

Unfortunately developing for 1.1 of the framework is still not possible
for myself, but I shall do *soon*. Thanks allot for your help though, at
least I know what needs to be done now.

Nick.
Nov 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Phil | last post by:
I am using a Pascal like language (Wealth-Lab) on W2K and call this server: class HelloWorld: _reg_clsid_ = "{4E797C6A-5969-402F-8101-9C95453CF8F6}" _reg_desc_ = "Python Test COM Server"...
6
by: Nathan Sokalski | last post by:
I want to set up SQL Server on Windows XP Pro so that I can use the database capabilities of ASP and IIS. I am probably using some incorrect settings, but I am not sure what they are. Here is what...
9
by: Grim Reaper | last post by:
My work let me put SQL Server 7.0 Enterprise Edition on my laptop. I have never setup a server from the beginning, so I am a little new at creating server groups. Alright, I am trying to create...
0
by: Chris Halcrow | last post by:
Hi I've spent ALL DAY trying to re-install SQL Server 2000 on Windows XP. I continually get the error 'cannot configure server' just at the end of the installation. I've tried the following: ...
0
by: Zorba.GR | last post by:
IBM DB2 Connect Enterprise Edition v8.2, other IBM DB2 (32 bit, 64 bit) (MULTiOS, Windows, Linux, Solaris), IBM iSoft Commerce Suite Server Enterprise v3.2.01, IBM Tivoli Storage Resource Manager...
2
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when...
2
by: Mike | last post by:
Hi, I am strugling with a simple problem which I can't seem to resolve. I have an asp.net page which contains a server-control (flytreeview, which is a kind of a tree to be exact). The tree is...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
14
by: Developer | last post by:
Hello All, i have recently installed VS2005 and was trying to install SQL sever 2000. I have Win XP' SP2. But when I tried installing, it only installed client tools and not the database. Can...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.