Article 5EJ4P [SOLVED] Question about broadcast and multicast in linux (Network Programming)

[SOLVED] Question about broadcast and multicast in linux (Network Programming)

by
strewberry
from LinuxQuestions.org on (#5EJ4P)
I'm sorry, I think I found out the problem.
============================Old=============================
Dear all, good day. I'm sorry for my English as English is not my native language.

I wrote a broadcast and multicast network programming in Linux - Ubuntu, and I observed something weird and I'm seeking for the answer.

For the broadcast network programming, I have a sender that will send a frame to a broadcast IP address and a port number 1234. In the same OS, I have another two terminal that listening to the broadcast IP address and port number. However, only one of the terminal(named as T.A) received the message while another terminal(named as T.B) did not. When I execute the sender's program again, T.B this time received the broadcast message.

When comes into the multicast, I have a sender that sending a frame to a multicast IP address and a port number 1234. In the same OS, I have another two terminal that listening to the multicast IP address and port number 1234. But this time, both of the terminals received the multicast message, this is different than what is happening in the broadcast.

I understand the different between the broadcast and multicast. But I doesn't understand why for the broadcast, only 1 terminal will received the first message while another terminal will received the second message; but in multicast, both terminals receiving the multicast message at the same time.

Looking forward for the clue to clear my doubt.

Thank you,

Best regards,
Berry.latest?d=yIl2AUoC8zA latest?i=LplZZNZ6X9g:YuchiRPLbFg:F7zBnMy latest?i=LplZZNZ6X9g:YuchiRPLbFg:V_sGLiP latest?d=qj6IDK7rITs latest?i=LplZZNZ6X9g:YuchiRPLbFg:gIN9vFwLplZZNZ6X9g
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments