PDA

View Full Version : bsd socket question



DATA
09-15-2003, 07:57 AM
hi,

I am new at socket programming(bsd).Need some help.

man socket

*. it says SOCK_SEQPACKET is a sequenced reliable 2 way connection based data transmission path for datagrams.

there is also a SOCK_RDM that provides a reliable datagram layer that doesnt guaruntee ordering.

However it says that SOCK_SEQPACKET is not supported by the AF_INET family.

how do we do reliable UDP datagrams transmission and rearrange out of order packets for hosts communicating on the internet?

2. the same man page says SOCK_STREAM may support an out of band transmisson mechanism. What does it mean?

*. What are the socket(2),connect(2),read(2),send(2),recv(2). I mean what does the number in () indicate. It is not the number of arguments passed. What is it?

Thanks.

Data.

mbravo
09-16-2003, 03:10 AM
Hello DATA,

For *) I can't say definitely, but from what I know, there's no way to make a reliable ordered UDP connection, since UDP is an inherently unreliable protocol (hence it's name) and all reliability, sequencing and reordering is usually to be done by the application.

For 2), out-of-band data for SOCK_STREAM is a TCP feature; when your application needs to send something that is not related to the current stream of data, say, some kind of flag indicating urgent action to the other side, it can do so with this feature (it's also called TCP URGENT), on the same socket.

And *) is the easiest - these numbers are man page sections. Often, there are several entries in the mandb on a word, so to pull a description of a function as opposed, say, to a command-line utility, you call "man 2 socket" instead of "man socket" to be sure what sectyion of man database your docs come from.

Hope this helps somewhat

DATA
09-16-2003, 04:01 AM
hi mrbravo,

thanks-i get it now.

As for question *. I think there are advantages of using reliable UDP over TCP if such udp packets give less over head than tcp packets and when it is applaction specific. May be I will have to write my own APPLICATION as you said to handle it.

Regards Data.


Hi fever,back at uni :) Good old hols are over.