Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

i have read about RAW sockets that they are UNIX domain sockets and don't generally go over the wire unlike TCP or UDP. They are used for interprocess communication. Also they are used in the implementation of new transport layer protocols and are also used in ICMP(for ping).

share|improve this question
1  
jftr raw sockets are not unix domain sockets –  Ulrich Dangel Mar 2 '13 at 16:28

2 Answers 2

up vote 0 down vote accepted

unix domain sockets are intentionally present to reduce transport overhead. they allow to exchange data between applications and thus related to application layer in [tcp/ip model][1]. There is no need for transport protocol to ensure ordering, reliability or flow control. you do not need network access layer as recipient of a message transfer is a process in the same machine.

share|improve this answer

Raw sockets and Unix sockets are not the same thing. A raw IP socket gives you direct access to IP packets. It does go over the wire (or at least over the IP layer). All applications (such as ping) that send or receive IP packets that aren't a UDP or TCP connection must use raw sockets.

A Unix domain socket is local to the machine, it is a means of communication between processes running on the same machine.

Neither type of sockets give you access to the physical layer. Unix domain sockets don't have a physical layer, and raw IP sockets carry IP packets. Accessing physical layer requires a different type of socket, neither IP nor Unix. This might be called a “raw” socket sometimes, but the name is rather misleading since this is as different from a raw IP socket as it is different from a Unix socket. Under Linux, Ethernet or other physical layer packets (e.g. for ARP) are accessed through netlink sockets.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.