Re: TCP-IP questions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jun 08, 2003 at 10:59:05PM +0000, Bryan K. wrote:
> a) When read(2) returns, is it sure that the other side has recieved the 
> whole buffer passed to read(2)?

(I think you meant write(2), then read(2) -- in that case, no, nothing
is guaranteed. If not, you'll have to rephrase your question. :)

> b) If i have a loop which write(2) one byte at each itteration, the kernel 
> sends many tcp packets each one containing one byte of userfull data?

I believe the kernel is free to block these together however it feels
appropriate. I believe sendmsg(2) is probably the best way to ensure the
kernel sends each packet individually, if that is what you desire.

> c) An ACK is sent when the kernel receives a tcp packet or when a userspace 
> read(2) from the socket occurs?

This is far too complex to cover in a mail list, I think -- your best
bet is to run to the local bookstore, and buy W. Richard Steven's TCP/IP
Illustrated, vol 1. I don't care what price they mark on the back --
pay it. :) It is worth every cent.

The gist of it -- ACKs are sent when the tcp/ip stack 'feels like it',
based on historicaly analysis of trying to avoid duplicate packets but
allowed for robust behavior in the face of lost packets.

Mostly, this detail won't be visible to your application.

-- 
A: No.
Q: Should I include quotations after my reply?

Attachment: pgp00435.pgp
Description: PGP signature


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux