Article View: comp.unix.programmer
Article #112Re: TCP/IP connections, how does the blocking work?
From: Barry Margolin
Date: Fri, 24 Jul 1992 17:03
Date: Fri, 24 Jul 1992 17:03
31 lines
2015 bytes
2015 bytes
In article <13700@mindlink.bc.ca> Frank@mindlink.bc.ca (Frank I. Reiter) writes:
>If the originating process attempts to write a few megabytes more than the
>receiving process has read, will it block, what causes it to block, and how far
>ahead is it likely to get before it does block?
>
>I want to make sure I will not be placing undo stress on the receiving machine
>by causing it to try to buffer data not yet read by the process it is intended
>for. Can the receiving machine cause the sending machine to cause the sending
>process to block?
The simple answer is "yes". With properly functioning TCP/IP
implementations, you don't have to worry about the sender sending faster
than the receiver can handle.
The receiving machine provides a "window" to the sender, which is (to
simplify greatly) the amount of data it may send before waiting for an
acknowledgement. If the receiving machine is buffering data that the
process hasn't yet read, it will normally reduce the window and stop
acknowledging, to tell the sender not to send any more. When room in the
buffers becomes available it will open the window and the sender can start
again.
On the sending machine, when it has reached the limit specified by the
window, the kernel will start buffering data locally. When these kernel
buffers fill up, the sending process will be blocked.
--
Barry Margolin
System Manager, Thinking Machines Corp.
barmar@think.com {uunet,harvard}!think!barmar
Technical Details
Message-ID:
<14pd53INNftj@early-bird.think.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!usc!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!agate!linus!think.com!barmarReferences:
<13700@mindlink.bc.ca>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!agate!linus!think.com!barmar From: barmar@think.com (Barry Margolin) Newsgroups: comp.unix.programmer Subject: Re: TCP/IP connections, how does the blocking work? Date: 24 Jul 1992 17:03:31 GMT Organization: Thinking Machines Corporation, Cambridge MA, USA Lines: 31 Distribution: world Message-ID: <14pd53INNftj@early-bird.think.com> References: <13700@mindlink.bc.ca> NNTP-Posting-Host: telecaster.think.com