Re: Network Stream behaving strangely.

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: C# Learner (csharp_at_learner.here)
Date: 03/22/04


Date: Mon, 22 Mar 2004 09:20:00 +0000

Ofer Achler wrote:

> C# Learner wrote:
>
> It worked! thank you!! I was soo frustrated!!!

Great :-)

>> A problem with your code is that it isn't able to handle the fact that
>> a Read() attempt might return less data than you're asking it for.
>> This /could/ cause your issue as stated above.
>
> It has, it has!! i thought the packet size issue would be resolved
> because i can specify how much the stream can read, apperantly, thats
> not true =)

I believe this can happen due to the nature of TCP/IP.

On http://floppsie.comp.glam.ac.uk/Glamorgan/gaius/security/5tcpip.html
it reads:

12. Fragmentation and reassembly

* IP datagrams may be fragmented en route
     o if intermediate nodes cannot cope with a large datagram (MTU
       (maximum transmission unit) is smaller than datagram size)
* IP datagrams may be reassembled en route
     o although not a good idea as routing is dynamic. (So datagrams may
       not always travel the same route)

> [...]
>
> I took this code and modified it a little (it doesn't quite work as it
> is) and am planning to release it in a GPL program, i assume that's ok.

Sure, no problem.

> [...]
>
> Thanks, youve been a good helpl :)

No problem -- I'm glad it helped :-)



Relevant Pages

  • Re: MTU for cable modem connection to shaw.ca
    ... MTU of 576 bytes would avoid IP fragmentation, but it is by no means a ... I believe it *is* a guarantee, but am open to seeing an authoritative ... "All hosts must be prepared to accept datagrams of up to 576 octets ... Certainly, link layers can cut the size of a packet down, but I do not ...
    (comp.dcom.lans.ethernet)
  • Re: Creating fragmentation using sockets (on ethernet)
    ... fragmentation. ... programs using sockets API ... send datagrams larger than 1500 bytes (well, technically, anything above ... And make sure Jumbo packets are switched OFF. ...
    (comp.os.linux.development.system)
  • Re: Creating fragmentation using sockets (on ethernet)
    ... fragmentation. ... programs using sockets API ... You must be asking about IP fragmentation since ethernet doesn't have ... send datagrams larger than 1500 bytes (well, technically, anything above ...
    (comp.os.linux.development.system)
  • Re: Creating fragmentation using sockets (on ethernet)
    ... I want to test fragmentation issues on some system. ... You must be asking about IP fragmentation since ethernet doesn't have ... The easiest way to generate fragmented IP packets is to use UDP to send ... send datagrams larger than 1500 bytes (well, technically, anything above ...
    (comp.os.linux.development.system)