Understanding the domain associations
http://publib.boulder.ibm.com/infocenter/aix/v7r1/index.jsp?topic=%2Fcom.ibm.aix.progcomm%2Fdoc%2Fprogcomc%2Fskt_bind.htm
Internet domain:
Produces an association composed of local and foreign addresses and local and foreign ports.UNIX domain:
Produces an association composed of local and foreign path names.NDD domain (Network Device Driver of the operating system):
Provides an association composed of local device name (operating system NDD name) and foreign addresses, the form of which depends on the protocol being used.
They talk about association composed of local and foreign addresses
.
What exactly does that mean.
I can understand the local address, but what's with the fo开发者_StackOverflow社区reigh addresses, how does it find them, and which are they, and how does it create their association?
The local and foreign socket addresses are simply the address of your program (the local one) and the address of the other program you are communicating with (the foreign one).
Different programs use different mechanisms to determine that foreign address. For example:
- To view a Web page, you type in a desired URL or click on a link; the URL contains a name, and the address associated with the name is looked up and connected to in order to retrieve the resource.
- To look up an address from a name, your computer will contact a name server at a different designated address. The address of the name server is itself often obtained from another protocol, DHCP.
- To locate a DHCP server, your computer will send a broadcast message to all machines on the local network, then wait for a server to reply.
Associations can also vary depending upon whether a protocol is connection-based or connectionless.
- In a connection-based protocol such as TCP, this association is called a connection; messages are exchanged between the network subsystems of the two machines to negotiate the set-up of the connection, and this connection persists until explicitly closed.
- In a connectionless protocol such as UDP, a simple facility to send and receive individual messages to or from any addressing-compatible endpoint is provided; any associations are entirely at the convenience of the software using the protocol.
精彩评论