05-26-2011
TCP and UDP are different facilities under IP, but UNIX sockets are local to the host and simpler, like pipes.
TCP creates a reliable one on one session between a client and server, with full duplex streams of data.
UDP is a user-level packet facility, without 'reliability' but with broadcast and mixed correspondent capability as well as a 'connection' facility, just a fd with a filter and default correspondent. For instance, DNS uses UDP, and a DNS server sits there receiving packets, and for every packet in, makes a packet out. The packet in may be a request for local data, a request for remote data or a response to a past inquiry sent by this server to other DNS servers. The server sends a response to the inquiry, or if tasked with recursion, an inquiry for the inquiry. For responses, the server sends them on to the requestor and caches them locally. The server does all this with one not-connected UDP socket.
7 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
? (1 Reply)
Discussion started by: 98_1LE
1 Replies
2. HP-UX
Hi,
I am having some error handling issues with and fd passed between Independent processes using unix domain sockets (On HPUX).
Here is the scnerio
=================
Step 1: TPC/Client (connect()) ---Connects to ------TCP/Server(Gateway) (server gets fd)
Step 2: ... (2 Replies)
Discussion started by: Debasisb2002
2 Replies
3. UNIX for Advanced & Expert Users
If I use sockets for IPC, and can easily distribute my applications.
UNIX Message Queues are local to the processor.
As I understand it, Message Queues still incur system call overhead, just like socket calls.
What advantage does a UNIX Message Queue provide versus a TCP or UDP Socket,... (2 Replies)
Discussion started by: zen29sky
2 Replies
4. UNIX for Advanced & Expert Users
Is there a performance advantage of one of these over the other? Obviously, it makes no sense to use normal TCP sockets or UDP sockets w/ the overhead they carry. But what about UNIX domain sockets vs FIFOs? I'd think they'd be very similar, in terms of performance and in terms of how they're... (2 Replies)
Discussion started by: mgessner
2 Replies
5. Shell Programming and Scripting
Hi
I'm reading <learning the bash shell>. And in the section - 3.1. The .bash_profile, .bash_logout, and .bashrc Files
bash allows two synonyms for .bash_profile: .bash_login, derived from the C
shell's file named .login, and .profile, derived from the Bourne shell and Korn
shell files... (1 Reply)
Discussion started by: password636
1 Replies
6. Solaris
What are the advantages for Sun Fire 490 over Sun Fire 480 R just from a server performance perspective? Or, are they both just about the same? (1 Reply)
Discussion started by: jtamminen
1 Replies
7. Red Hat
Hi guys, new user here, so please be gentle.
I need to build a lot of servers at work on a weekly basis with various versions of RH and additional applications.
We use PXE/Kickstart to do this with selections made from a simple menu structure.
However, I keep hearing about Cobbler and... (0 Replies)
Discussion started by: hankpym
0 Replies
udp(7) Miscellaneous Information Manual udp(7)
NAME
udp - Internet user datagram protocol (UDP)
SYNOPSIS
#include <sys/socket.h> #include <netinet/in.h>
The following is the socket call for AF_INET sockets:
s = socket(AF_INET, SOCK_DGRAM, 0); The following is the socket call for AF_INET6 sockets:
s = socket(AF_INET6, SOCK_DGRAM, 0);
DESCRIPTION
UDP is a simple, unreliable datagram protocol that is used to support the SOCK_DGRAM abstraction for the Internet Protocol family. UDP
sockets are connectionless, and are normally used with the sendto() and recvfrom() functions, though the connect() function may also be
used to fix the destination for future packets, in which case the recv() or read() and send() or write() functions may be used.
UDP address formats are identical to those used by TCP. In particular, UDP provides a port identifier in addition to the normal Internet
address format. Note that the UDP port space is separate from the TCP port space (that is, a UDP port may not be "connected" to a TCP
port). In addition, IPv4 broadcast packets may be sent (assuming the underlying network supports this) by using a reserved "broadcast
address"; this address is network interface dependent. There is no broadcast address in IPv6.
Options at the IP transport level may be used with UDP; see the ip() reference page.
ERRORS
If a socket operation fails, errno may be set to one of the following values: An attempt was made to create a socket with a port that has
already been allocated. An attempt was made to create a socket with a network address for which no network interface exists. The socket
is already connected. This error occurs when trying to establish connection on a socket or when trying to send a datagram with the desti-
nation address specified. The system ran out of memory for an internal data structure. The destination address of a datagram was not
specified, and the socket has not been connected.
RELATED INFORMATION
Functions: getsockopt(2), recv(2), send(2), socket(2)
Files: netintro(7), inet(7), ip(7) delim off
udp(7)