Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multihoming problem




On Feb 27, 2008, at 8:47 AM, Hamish Allan wrote:

INADDR_ANY has different meanings for send and receive. For send, it
means "on the primary interface". So if you want to send on more than
one interface, you have to send it separately to each. For receive
(bind), it means "listen on all interfaces". For your purposes, you'll
need a separate socket for each interface.

This is correct, but there is one more factor that may help you.

Routing in TCP/IP is based on the destination IP address.
If you bind to INADDR_ANY, outgoing packets will be routed
to any directly attached IP subnets that match the destination
address, and if none match will be sent to the next hop router
for the primary interface.

For broadcasting, you can set the destination IP to the subnet
broadcast address to determine which interface should broadcast,
or alternatively use bpftransmit to send raw frames from the data
link layer.

Kind Regards,

- Peter
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/macnetworkprog/email@hidden

This email sent to email@hidden
References: 
 >Multihoming problem (From: "peiyuan" <email@hidden>)
 >Re: Multihoming problem (From: "Hamish Allan" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.