home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.programmer:4545 comp.protocols.tcp-ip:4315
- Newsgroups: comp.unix.programmer,comp.protocols.tcp-ip
- Path: sparky!uunet!mcsun!sunic!ugle.unit.no!Steinar.Haug
- From: Steinar.Haug@delab.sintef.no (Steinar Haug)
- Subject: Re: TCP reliability
- In-Reply-To: droux@hei.unige.ch's message of 4 Sep 92 16:35:05 +0200
- Message-ID: <STEINAR.HAUG.92Sep5115614@delab.sintef.no>
- Sender: news@ugle.unit.no (NetNews Administrator)
- Organization: SINTEF DELAB, Trondheim, Norway.
- References: <1992Sep4.163505.1@hei.unige.ch>
- Date: 5 Sep 92 11:56:14
- Lines: 50
-
- > We are currently implementing a distributed system providing the use of
- > different computers (different UNIX workstations) connected by Internet.
- > Our System is based on a server - client model using berkeley sockets.
- >
- > These two entities are communicating through AF_INET family
- > sockets of SOCK_STREAM type. Our Problem is, that a receiver implemented on
- > a NeXT receives much more packets than the sender implemented on
- > a Sun workstation sends (1.3 : 1).
- >
- > As TCP is known as sequenced, reliable and two-way connection based, this
- > fact is surprising to us. Is it possible to avoid this ?
-
- Yes, TCP is sequenced and reliable. But it does *not* provide "record" (i.e.
- packet) boundaries which are visible to the application. You must build these
- on top of TCP yourself if you need them. (Or you could use UDP, which *will*
- allow you to preserve packet boundaries - but then you must build the
- necessary reliability yourself on top of UDP. Much easier to make a small
- layer on top of TCP which does what you want.)
-
- The operating system is free to turn one or more of your write() calls into
- as many packets as it sees fit. I.e.,
-
- - one write call may turn into many packets (write 50000 bytes and you will
- get approx. Ethernet 34 packets)
-
- - many write calls may turn into one packet (call write many times with 1 byte
- buffers, and the OS will probably try to coalesce your writes into bigger
- packets)
-
- Similarly, on the receiving side, each read() may return less data than you
- asked for - this is also perfectly acceptable.
-
- > The data exchange is made by normal read() and write() calls followed by an
- > acknowledgement. We transmitt packets of 5000 bytes of unstructered data.
- > If a sender send 300 packets (as a concrete example) the receiver receives
- > over 400 packets and about 120 of them are invalid. We consider this as a
-
- I'm not sure I understand what you mean by saying "120 of them are invalid".
- Could you be more specific? In the first place, what do you mean by a packet?
- Is it one write() call, or is it for instance an Ethernet packet? From your
- description it sounds more like one write() call.
-
- TCP *is* reliable, if correctly implemented. I have used TCP on Suns for
- years, and it works just fine. I have no reason to believe that it does not
- work correctly on the NeXT...
-
- Steinar Haug, system/networks administrator
- SINTEF DELAB, University of Trondheim, NORWAY
- Email: Steinar.Haug@delab.sintef.no,
- sthaug@idt.unit.no, steinar@tosca.er.sintef.no
-