aboutsummaryrefslogtreecommitdiff
path: root/pipermail/nel/2001-March/000338.html
blob: eff916688826838aa3fa7c1995e6cfdf9e7f423d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
 <HEAD>
   <TITLE> [Nel] newbies about packet schema</TITLE>
   <LINK REL="Index" HREF="index.html" >
   <LINK REL="made" HREF="mailto:jaleco%40svr1.gameone.com.tw">
   <LINK REL="Previous"  HREF="000337.html">
   <LINK REL="Next" HREF="000352.html">
 </HEAD>
 <BODY BGCOLOR="#ffffff">
   <H1>[Nel] newbies about packet schema</H1>
    <B>jaleco</B> 
    <A HREF="mailto:jaleco%40svr1.gameone.com.tw"
       TITLE="[Nel] newbies about packet schema">jaleco@svr1.gameone.com.tw</A><BR>
    <I>Tue, 6 Mar 2001 12:05:42 +0800</I>
    <P><UL>
        <LI> Previous message: <A HREF="000337.html">[Nel] problems compiling nel/net/new_message.h</A></li>
        <LI> Next message: <A HREF="000352.html">[Nel] newbies about packet schema</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#338">[ date ]</a>
              <a href="thread.html#338">[ thread ]</a>
              <a href="subject.html#338">[ subject ]</a>
              <a href="author.html#338">[ author ]</a>
         </LI>
       </UL>
    <HR>  
<!--beginarticle-->
<PRE>This is a multi-part message in MIME format.

------=_NextPart_000_0010_01C0A635.C4605920
Content-Type: text/plain;
	charset=&quot;big5&quot;
Content-Transfer-Encoding: quoted-printable

I have read artice for winsock program,=20
if folling article is true, that snow ball netowrk driver , should =
change it's packet schema.
any one can give me suggect ?

original from =
<A HREF="http://www.cyberport.com/~tangent/programming/winsock/intermediate.html#d=">http://www.cyberport.com/~tangent/programming/winsock/intermediate.html#d=</A>
isable-nagle
Inexperienced Winsockers usually try disabling the Nagle algorithm when =
they are trying to impose some kind of packet scheme on a TCP data =
stream. That is, they want to be able to send, say, two packets, one 40 =
bytes and the other 60, and have the receiver get a 40-byte packet =
followed by a separate 60-byte packet. (With the Nagle algorithm =
enabled, TCP will often coalesce these two packets into a single 100 =
byte packet.) Unfortunately, this is futile, for the following reasons:

  1.. Even if the sender manages to send its packets individually, the =
receiving TCP/IP stack may still coalesce the received packets into a =
single packet. This can happen any time the sender can send data faster =
than the receiver can deal with it.=20
  2.. Winsock Layered Service Providers (LSPs) may coalesce or fragment =
stream data, especially LSPs that modify the data as it passes.=20
  3.. Turning off the Nagle algorithm in a client program will not =
affect the way that the server sends packets, and vice versa.=20
  4.. Routers and other intermediaries on the network can fragment =
packets, and there is no guarantee of &quot;proper&quot; reassembly with stream =
protocols.=20
  5.. If packet arrives that is larger than the available space in the =
stack's buffers, it may fragment a packet, queuing up as many bytes as =
it has buffer space for and discarding the rest. (The remote peer will =
resend the remaining data later.)=20
  6.. Winsock is not required to give you all the data it has queued on =
a socket even if your recv() call gave Winsock enough buffer space. It =
may require several calls to get all the data queued on a socket.=20


------=_NextPart_000_0010_01C0A635.C4605920
Content-Type: text/html;
	charset=&quot;big5&quot;
Content-Transfer-Encoding: quoted-printable

&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;&gt;
&lt;HTML&gt;&lt;HEAD&gt;
&lt;META http-equiv=3DContent-Type content=3D&quot;text/html; charset=3Dbig5&quot;&gt;
&lt;META content=3D&quot;MSHTML 5.50.4522.1800&quot; name=3DGENERATOR&gt;
&lt;STYLE&gt;&lt;/STYLE&gt;
&lt;/HEAD&gt;
&lt;BODY bgColor=3D#ffffff&gt;
&lt;DIV&gt;&lt;FONT size=3D2&gt;I have read artice for winsock program, =
&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size=3D2&gt;if folling article is true, that snow ball netowrk =
driver ,=20
should change it's packet schema.&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size=3D2&gt;any one can give me suggect ?&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size=3D2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size=3D2&gt;original from &lt;A=20
href=3D&quot;<A HREF="http://www.cyberport.com/~tangent/programming/winsock/intermediat=">http://www.cyberport.com/~tangent/programming/winsock/intermediat=</A>
e.html#disable-nagle&quot;&gt;<A HREF="http://www.cyberport.com/~tangent/programming/winso=">http://www.cyberport.com/~tangent/programming/winso=</A>
ck/intermediate.html#disable-nagle&lt;/A&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;P&gt;Inexperienced Winsockers usually try disabling the Nagle algorithm =
when they=20
are trying to impose some kind of &lt;A=20
href=3D&quot;<A HREF="http://www.cyberport.com/~tangent/programming/winsock/intermediat=">http://www.cyberport.com/~tangent/programming/winsock/intermediat=</A>
e.html#packetscheme&quot;&gt;packet=20
scheme&lt;/A&gt; on a TCP data stream. That is, they want to be able to send, =
say, two=20
packets, one 40 bytes and the other 60, and have the receiver get a =
40-byte=20
packet followed by a separate 60-byte packet. (With the Nagle algorithm =
enabled,=20
TCP will often coalesce these two packets into a single 100 byte =
packet.)=20
Unfortunately, this is futile, for the following reasons:&lt;/P&gt;
&lt;OL&gt;
  &lt;LI&gt;Even if the sender manages to send its packets individually, the =
receiving=20
  TCP/IP stack may still coalesce the received packets into a single =
packet.=20
  This can happen any time the sender can send data faster than the =
receiver can=20
  deal with it.=20
  &lt;LI&gt;Winsock Layered Service Providers (LSPs) may coalesce or fragment =
stream=20
  data, especially LSPs that modify the data as it passes.=20
  &lt;LI&gt;Turning off the Nagle algorithm in a client program will not =
affect the=20
  way that the server sends packets, and vice versa.=20
  &lt;LI&gt;Routers and other intermediaries on the network can fragment =
packets, and=20
  there is no guarantee of &quot;proper&quot; reassembly with stream protocols.=20
  &lt;LI&gt;If packet arrives that is larger than the available space in the =
stack's=20
  buffers, it may fragment a packet, queuing up as many bytes as it has =
buffer=20
  space for and discarding the rest. (The remote peer will resend the =
remaining=20
  data later.)=20
  &lt;LI&gt;Winsock is not required to give you all the data it has queued on =
a socket=20
  even if your &lt;CODE&gt;recv()&lt;/CODE&gt; call gave Winsock enough buffer =
space. It may=20
  require several calls to get all the data queued on a socket.=20
&lt;/LI&gt;&lt;/OL&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;

------=_NextPart_000_0010_01C0A635.C4605920--



</pre>






<!--endarticle-->
    <HR>
    <P><UL>
        <!--threads-->
	<LI> Previous message: <A HREF="000337.html">[Nel] problems compiling nel/net/new_message.h</A></li>
	<LI> Next message: <A HREF="000352.html">[Nel] newbies about packet schema</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#338">[ date ]</a>
              <a href="thread.html#338">[ thread ]</a>
              <a href="subject.html#338">[ subject ]</a>
              <a href="author.html#338">[ author ]</a>
         </LI>
       </UL>
</body></html>