[erlang-questions] clarify: gen_udp Set outbound ip address

mog <>
Tue Nov 13 15:13:21 CET 2007


> >
> >gen_udp:open(Port, [binary, {active, false}, {reuseaddr, true}, {ip,
> >Addr}, {add_membership, {Addr, LAddr}}]).
> >
> >Where Addr is my multicast Ip, LAddr is my network ip, so sent messages
> >are received as 192.168.1.50 instead of 224.0.1.185.
> 
> Hm, I'm afraid I still can't parse the "message received as address"
> part:-) - are you referring to the source address of the multicast
> packets you send out? If so, why would you expect it to be anything
> other than the unicast address of the sender? Sending packets with a
> multicast source address should be almost as bad as sending with a
> broadcast source address, and such packets will probably be dropped by
> most receiving stacks.


So udp packets have the following structure.
+-------------------+
| Source Address    |
| Dest Address      |
| Etc               |
+-------------------+
so I have machine A which is in the multicast loop, 224.0.1.185, and its
local address 192.168.1.50 and machine B which is not, lets say
192.168.1.30.

so Machine B sends Machine A a packet which looks like 
+-------------------------------+
| Source Address: 192.168.1.30  |
| Dest Address:   224.0.1.185   |
+-------------------------------+
which is right it is 192.168.1.30 and it sent a packet to machine A via
its multicast address.

when I respond, so machine A sends message to machine B it looks like
this
+-------------------------------+
| Source Address: 192.168.1.50  |
| Dest Address:   192.168.1.30  |
+-------------------------------+
which is not what i want. I want this

+-------------------------------+
| Source Address: 224.0.1.185   |
| Dest Address:   192.168.1.30  |
+-------------------------------+

Now im not talking about the protocol im using im talking about the
lowest level udp/ip part of the packet that erlang builds for me.

thanks for your time everyone 

Mog
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20071113/6852fef0/attachment.bin>


More information about the erlang-questions mailing list