On 10/04/2010 04:39 AM, Roger Oberholtzer wrote:
On Fri, 2010-10-01 at 14:48 -0400, Jerry Feldman wrote:
The entire IP suite is packet driven, TCP, UDP, ICMP. The difference between UDP and TCP is that TCP sets up a connection between the two ends with a guarantee that the entire message (1 or more packets) will be delivered. UDP on the other hand is a datagram where packets are sent to the destination without any checking. A lot of network management protocols, such as SNMP, use UDP and provide end-to-end delivery. That way if a remote host goes down, the application can manage the time outs rather than the packet protocol. What TCP does is to send several packets out up to a window size (usually 7). Each packet is numbered. If the sender detects an error by not receiving the appropriate responses, it may resend packets that fail to arrive. Packets can arrive at the destination out of order, and it is the receiver's responsibility to assemble the packets in the correct order before presenting the data to the application.
Obviously all things that arrive over the Ethernet interface are in discrete packets. I am referring to what the Berkeley socket interface exposes via read/write and recvfrom/sendto. At that level, TCP is a stream of values that bear no correspondence to the packets in which they were delivered over the Ethernet interface. Still, what I was interested in would have be a layer on top of TCP. As Per reminded me, fdopen may provide that layer. I will next determine at what cost I can get this 'service'.
Yes. The application can do a lot of things including change the buffer
size. The issue might be terminology. The IP protocol suite has nothing
to do with Ethernet directly although there are things like ARP packets.
The Internet Protocol is a packet oriented protocol. TCP is an
end-to-end connection protocol where UDP is connectionless. IP will work
over Ethernet (the most ubiquitous), Token Ring, and other hardware
protocols. The Berkeley Socket Interface is the application level
commands (eg. system calls and library function). IP is tunneled through
Ethernet on a LAN, but Ethernet is restricted to a physical subnet. When
you send an IP packet, whether TCP or UDP, it tunnels through Ethernet
to the gateway where the gateway may tunnel through more Ethernet
gateways or through other WAN protocols.
--
Jerry Feldman