🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #762

Re: TCP reliability on NeXT

#762
From: Louis A. Mamakos
Date: Sat, 05 Sep 1992 13:57
53 lines
2773 bytes
In article <1992Sep4.163219.1@hei.unige.ch> droux@hei.unige.ch writes:
>
>TCP/IP BERKELEY SOCKETS: Transmission problems with doublicated packets
>-----------------------------------------------------------------------

You omitted the most interesting code of call: that which does read() and
write().

>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
>serious problem since our system is based on realibility of TCP sockets.
>Is there a special option on sockets or another method to avoid these
>problems?

You are mistaken if you believe that TCP maintains any record
boundaries when you preform a write() or read() system call.  It does
not.  It is a stream protocol.  When you perform a read() system call,
it will return to you the number of octets of data returned to you
which may be different than the size of your buffer.  Thus, of the
sending application writes 5000 bytes and the receiving application
does a series of reads, it could return 3000 bytes on one read
followed by 2000 bytes on a subsequent one.

I am aware of no bugs in this area relating to TCP and the reliablity
of the data being transmitted.

>Special Comments:
>1. If the server and the client are running on the same computer, the problem
>   does not occur.

Of course it will act differently, as everything is effectively happening
synchronously since you are never leaving the machine.

>2. If the NeXT (receiver client) is swapping the number of faulty packets is
>   increasing.

Again, probably timing related.

>3. The number of faulty packets is somehow depending on their size.

How do you know the "packet" are faulty?  Remember, the user interface
to TCP has no notion at all of "packets", just streams of data.  It is
very similar to a tty-type device in that respect.

>We would be very happy about some information as our application is part
>of our graduation thesis.

You should investigate a very good book: "UNIX Network Programming" by
Stevens.  It covers this material quite well.

louie
Technical Details
Message-ID: <1992Sep5.135747.20758@ni.umd.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!haven.umd.edu!ni.umd.edu!sayshell.umd.edu!louie
References: <1992Sep4.163219.1@hei.unige.ch>

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!haven.umd.edu!ni.umd.edu!sayshell.umd.edu!louie
From: louie@sayshell.umd.edu (Louis A. Mamakos)
Subject: Re: TCP reliability on NeXT
Message-ID: <1992Sep5.135747.20758@ni.umd.edu>
Sender: usenet@ni.umd.edu (USENET News System)
Nntp-Posting-Host: sayshell.umd.edu
Organization: University of Maryland, College Park
References: <1992Sep4.163219.1@hei.unige.ch>
Date: Sat, 5 Sep 1992 13:57:47 GMT
Lines: 54