LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-12-2007, 05:42 PM   #1
thelordmule
LQ Newbie
 
Registered: Jul 2006
Location: Australia
Distribution: Mac OSX 10.6, Ubuntu 10.10
Posts: 23

Rep: Reputation: 0
Does Linux 2.6 socket support SOCK_RDM?


Hi,

Ive been looking around to see if I can use the protocol

Code:
socket(*, SOCK_RDM, 0);
from the man page:
SOCK_RDM Provides a reliable datagram layer that does not guarantee ordering.

I was actually going ahead with SCTP since it also provides an orderless yet reliable delivery but thought this could soften the dev effort.

I havent found anything via my usual sources, except for the MS PGM multicast protocol (not relevant at all).

Help appreciated.
 
Old 08-12-2007, 06:20 PM   #2
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
I believe it does. SOCK_RDM is defined in include/linux/net.h.

Code:
/**
 * enum sock_type - Socket types
 * @SOCK_STREAM: stream (connection) socket
 * @SOCK_DGRAM: datagram (conn.less) socket
 * @SOCK_RAW: raw socket
 * @SOCK_RDM: reliably-delivered message
 * @SOCK_SEQPACKET: sequential packet socket
 * @SOCK_DCCP: Datagram Congestion Control Protocol socket
 * @SOCK_PACKET: linux specific way of getting packets at the dev level.
 *                For writing rarp and other similar things on the user level.
 *
 * When adding some new socket type please
 * grep ARCH_HAS_SOCKET_TYPE include/asm-* /socket.h, at least MIPS
 * overrides this enum for binary compat reasons.
 */
 
Old 08-12-2007, 07:10 PM   #3
thelordmule
LQ Newbie
 
Registered: Jul 2006
Location: Australia
Distribution: Mac OSX 10.6, Ubuntu 10.10
Posts: 23

Original Poster
Rep: Reputation: 0
Thanks for the quick response, but sadly it wasnt what I was looking for.

Yes, header definitions are there, however implementation seems to be missing. Here is some sample code:

Code:
#include <stdio.h>
#include <sys/socket.h>

int main()
{
	int sock_fd = socket( AF_INET, SOCK_RDM, 0 );

	perror("socket: ");

	printf("sock_fd: %d\n", sock_fd);

	return 0;
}
and its output:

Code:
socket: : Socket type not supported
sock_fd: -1
 
Old 08-13-2007, 06:51 AM   #4
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
On further review it does appear that standard 2.6 kernels don't support SOCK_RDM... at least my 2.6.22 kernel packaged by Ubuntu doesn't.

I get an errno 94 back from the socket call which means "Socket type not supported" just like you did.

Also food for thought... I pulled out my copy of Advanced Programming in the UNIX Environment (2nd Edition by Stevens and Lago) and it does not list SOCK_RDM in the table of POSIX.1 socket types. It does say, however, that OS's are free to implement other socket types if they wish.

Last edited by jtshaw; 08-13-2007 at 06:53 AM.
 
Old 08-13-2007, 05:10 PM   #5
thelordmule
LQ Newbie
 
Registered: Jul 2006
Location: Australia
Distribution: Mac OSX 10.6, Ubuntu 10.10
Posts: 23

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jtshaw View Post
On further review it does appear that standard 2.6 kernels don't support SOCK_RDM... at least my 2.6.22 kernel packaged by Ubuntu doesn't.

I get an errno 94 back from the socket call which means "Socket type not supported" just like you did.

Also food for thought... I pulled out my copy of Advanced Programming in the UNIX Environment (2nd Edition by Stevens and Lago) and it does not list SOCK_RDM in the table of POSIX.1 socket types. It does say, however, that OS's are free to implement other socket types if they wish.
Nice find. I actually have that book lost in my personal jungle of literature :P

I find it interesting that after specification for socket has existed for so long no actual POSIX implementation existed, even if it were something like RUDP (RFC 1151). I wonder if anyone was willing to include such reliable UDP implementation for the kernel at any stage. Out of the many that exist out there surely a defacto standard like the Bell labs one could have been included. I'd much favour seeing something like udt3 though :P

I might be interested in actually helping support that kind of project for the kernel. Would kernel.org be the place to goto for such things?
 
  


Reply

Tags
network, programming, socket



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Socket AM2 motherboards with Linux support? Atmchicago Linux - Hardware 16 06-07-2009 10:41 PM
fseek on a socket descriptor to discard socket buffer? Thinking Programming 1 12-06-2005 09:15 PM
cannot read data at server socket, though client socket sends it jacques83 Linux - Networking 0 11-15-2005 01:58 PM
Unable to connect to UNIX socket /tmp/.esd/socket error while using grip dr_zayus69 Linux - Software 4 08-23-2005 07:28 PM
Can dual socket mobo support 2 different cpu at the same time? RayY Linux - Hardware 3 01-19-2005 03:29 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration