1 / 18

Multicast

Multicast. Speaker : Sandra Date : 2012-07-18. What is Multicast?. There are three possible ways of data communication among computers:  (1) unicast transmission is the sending of messages to a single network destination identified by a unique address.

maj
Télécharger la présentation

Multicast

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Multicast Speaker:Sandra Date:2012-07-18

  2. What is Multicast? • There are three possible ways of data communication among computers:  • (1) unicast transmission is the sending of messages to a single network destination identified by a unique address. • (2)broadcast refers to a method of transferring a message to all recipients simultaneously.  broadcast unicast

  3. What is Multicast?(con.) • (3) On a multicast network, you can send a single packet of information from one computer for distribution to several other computers, instead of having to send that packet once for every destination. • Also, when you use multicasting to send a packet, you don't need to know the address of everyone who wants to receive the multicast. multicast

  4. Multicast addresses

  5. Levels of conformance • Level 0 is the "no support for IP Multicasting" level. • Level 1 is the "support for sending but not receiving multicast IP datagrams" level. • Level 2 is the "full support for IP multicasting" level.

  6. Sending Multicast Datagrams • A list of TTL thresholds and their associated scope follows:

  7. The MBone • The purpose of Mbone is to minimize the amount of data required for multipoint audio/video-conferencing. • topology: combination of mesh and star networks. • IP addresses: 224.2.0.0. • routing schemes: DVMRP, MOSPF.

  8. Multicast applications • Many applications transmit the same data at one time to multiple receivers. • Broadcasts of Radio or Video. • Videoconferencing. • Shared Applications. • A network must have mechanisms to support such applications in an efficient manner.

  9. Multicast programming • All of them are handled via two system calls:  • setsockopt() (used to pass information to the kernel) . • getsockopt() (to retrieve information regarded multicast behavior). 

  10. Multicast programming(con.) • The following are the setsockopt()/getsockopt() function prototypes:   • int getsockopt(int s, int level, int optname, void* optval, int* optlen); • int setsockopt(int s, int level, int optname, const void* optval, int optlen);

  11. Multicast programming(con.) • The optnames involved in multicast programming are the following:

  12. IP_MULTICAST_LOOP • You have to decide, as the application writer, whether you want the data you send to be looped back to your host or not. If you plan to have more than one process or user "listening", loopback must be enabled. u_char loop; setsockopt(socket, IPPROTO_IP, IP_MULTICAST_LOOP, &loop, sizeof(loop));

  13. IP_MULTICAST_TTL • if not otherwise specified, multicast datagrams are sent with a default value of 1, to prevent them to be forwarded beyond the local network. To change the TTL to the value you desire (from 0 to 255), put that value into a variable (here I name it "ttl") and write somewhere in your program: u_char ttl; setsockopt(socket, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, sizeof(ttl));

  14. IP_MULTICAST_IF • Usually, the system administrator specifies the default interface multicast datagrams should be sent from. The programmer can override this and choose a concrete outgoing interface for a given socket with this option. struct in_addr interface_addr; setsockopt (socket, IPPROTO_IP, IP_MULTICAST_IF, &interface_addr, sizeof(interface_addr));

  15. IP_ADD_MEMBERSHIP • Recall that you need to tell the kernel which multicast groups you are interested in. • If no process is interested in a group, packets destined to it that arrive to the host are discarded. struct ip_mreq { struct in_addr imr_multiaddr; /* IP multicast address of group */ struct in_addr imr_interface; /* local IP address of interface */ };

  16. IP_DROP_MEMBERSHIP • The process is quite similar to joining a group: struct ip_mreq mreq; setsockopt (socket, IPPROTO_IP, IP_DROP_MEMBERSHIP, &mreq, sizeof(mreq));

  17. Demo • gcc –o mc mc.c • Client:10.21.10.177 • ./mc • Server:10.21.11.138 • ./ms • http://ms11.voip.edu.tw/~sandra/socket/multicast.htm

  18. Reference • Multicast [1][2][3] • Broadcast[1] • Unicast[1] • MBONE[1]

More Related