multicasting. references r note: some slides come from the slides associated with this book:...

21
Multicasting

Upload: thomasine-barker

Post on 12-Jan-2016

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Multicasting. References r Note: Some slides come from the slides associated with this book: “Mastering Computer Networks: An Internet Lab Manual”, J

Multicasting

Page 2: Multicasting. References r Note: Some slides come from the slides associated with this book: “Mastering Computer Networks: An Internet Lab Manual”, J

References

Note: Some slides come from the slides associated with this book:“Mastering Computer Networks: An Internet

Lab Manual”, J. Liebeherr, M. El Zarki, Addison-Wesley, 2003.

The Kurose & Ross textbook on computer networking

Page 3: Multicasting. References r Note: Some slides come from the slides associated with this book: “Mastering Computer Networks: An Internet Lab Manual”, J

Multicasting

Multicast is an operation that sends a single message from one process to each of the members of a group of processes.

Ideally this is done in such a way that the membership of the group is transparent to the sender.

Page 4: Multicasting. References r Note: Some slides come from the slides associated with this book: “Mastering Computer Networks: An Internet Lab Manual”, J

Multicasting

Multicast communications refers to one-to-many or many-to-many communications.

Unicast Broadcast Multicast

Page 5: Multicasting. References r Note: Some slides come from the slides associated with this book: “Mastering Computer Networks: An Internet Lab Manual”, J

Applications Using Multicasting

For replication Streaming continuous media

Example: The transfer of the audio, video and text of a live lecture to a set of distributed lecture participants

One sender, multiple receivers Shared data applications

Example: whiteboard, teleconferencing Multiple senders, multiple receivers

Web cache updates Email distribution lists Content distribution Software distribution Interactive gaming

Page 6: Multicasting. References r Note: Some slides come from the slides associated with this book: “Mastering Computer Networks: An Internet Lab Manual”, J

Approaches to Multicasting One-to-all unicast

Sender uses a separate unicast transport (e.g., TCP or UDP) connection to each of the receivers.

If using TCP, a connection is made between the sender and a receiver. The data is sent and the connection is then terminated. This is done for the sender and each of the receivers.

multicast receiver (red)

not a multicast receiver (red)

routersforward unicastdatagrams

Page 7: Multicasting. References r Note: Some slides come from the slides associated with this book: “Mastering Computer Networks: An Internet Lab Manual”, J

Approaches to Multicasting Application-level multicasting

This also uses unicast transmission. The sender transmits a copy to a “small” number of

receivers, which then make copies themselves and forward these copies to other receivers which may then duplicate and forward copies to yet additional receivers.

Page 8: Multicasting. References r Note: Some slides come from the slides associated with this book: “Mastering Computer Networks: An Internet Lab Manual”, J

Approaches to Multicasting Explicit multicast

Provide explicit multicast support at the network layer.

A single datagram is transmitted from the sending host.

This datagram (or copy) is then replicated at a network router whenever it must be forwarded on multiple outgoing links in order to reach the receivers.

The data is forwarded in a tree-like fashion. The discovery of the tree is dynamic. Lots of routing algorithms.

There is an Internet protocol called IP multicast for this.

• An IP address represents a group of processes

Page 9: Multicasting. References r Note: Some slides come from the slides associated with this book: “Mastering Computer Networks: An Internet Lab Manual”, J

Approaches to Multicast

Multicastrouters (red) duplicate and forward multicast datagrams

Explicit Multicast

Page 10: Multicasting. References r Note: Some slides come from the slides associated with this book: “Mastering Computer Networks: An Internet Lab Manual”, J

IP Multicast Communication IP multicast is built on top of IP. IP multicast allows the sender to transmit

a single IP packet to a set of computers that form a multicast group.

Being a member of a multicast group allows a computer to receive IP packets sent to the group.

IP multicast is available only via UDP There is no multicast TCP

Page 11: Multicasting. References r Note: Some slides come from the slides associated with this book: “Mastering Computer Networks: An Internet Lab Manual”, J

IP Multicast Communication

IP multicast works as follows: Multicast groups are identified by IP

addresses in the range 224.0.0.0 - 239.255.255.255 (class D address)

Every host can join and leave a multicast group dynamically

– Server does not have to know all the receivers

– Anyone can send to the group

Routers forward multicast datagrams to hosts that have “joined” the multicast group.

• Anyone can join a group

Page 12: Multicasting. References r Note: Some slides come from the slides associated with this book: “Mastering Computer Networks: An Internet Lab Manual”, J

IP Multicast Communication

#define MULTICASTADDR "229.8.2.4" #define PORTNUMBER 5824

if ((socketDesc = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { perror("open error on socket");

exit(1); }

myAddr.sin_family = AF_INET; myAddr.sin_addr.s_addr = htonl(INADDR_ANY); myAddr.sin_port = htons(0); /* The zero says bind to any port */ if (bind(socketDesc, (struct sockaddr *) &myAddr,

sizeof(myAddr)) < 0) { perror("bind error"); exit(1); }

Page 13: Multicasting. References r Note: Some slides come from the slides associated with this book: “Mastering Computer Networks: An Internet Lab Manual”, J

IP Multicast Communication

/* And build MULTICAST address */ destinationAddr.sin_family = AF_INET; destinationAddr.sin_addr.s_addr

=htonl(inet_addr(MULTICASTADDR));destinationAddr.sin_port = htons(PORTNUMBER);

/* Set the socket to permit multicasts on the local LAN */ if (setsockopt(socketDesc, IPPROTO_IP, IP_MULTICAST_TTL,

&limitLanFlag, sizeof(limitLanFlag)) != 0) { perror("setsockopt error"); exit(1); }

Page 14: Multicasting. References r Note: Some slides come from the slides associated with this book: “Mastering Computer Networks: An Internet Lab Manual”, J

IP Multicast Communication

/* Broadcast message */ strcpy(outMessageBuf, "Hello world"); if (sendto(socketDesc, outMessageBuf, strlen(outMessageBuf)+1,

0, (struct sockaddr *)&destinationAddr, sizeof(destinationAddr)) < 0) { perror("socket send error"); exit(1); }

Page 15: Multicasting. References r Note: Some slides come from the slides associated with this book: “Mastering Computer Networks: An Internet Lab Manual”, J

IP Multicast Communication

/* And wait for up to 5 seconds for replies to come back */ /* Set timeOut value for receive to 5 seconds */ timeOut.tv_sec = 5L; timeOut.tv_usec = 0L;

/* Read responses from hosts accepting the multicast until a read finally times-out. */

FD_ZERO(&readReadySet);FD_SET(socketDesc,&readReadySet); msgCount = 0; while (select(socketDesc+1,&readReadySet, NULL, NULL,

&timeOut) > 0) { …….}

Question: What is the networking support needed?

Page 16: Multicasting. References r Note: Some slides come from the slides associated with this book: “Mastering Computer Networks: An Internet Lab Manual”, J

IP Multicast Communication

IGMP: “signaling” protocol to establish, maintain, remove groups on a subnet.

Two new operations Join-IP-Multicast-Group(group-address,

interface) Leave-IP-Multicast-Group(group-address,

interface)

Page 17: Multicasting. References r Note: Some slides come from the slides associated with this book: “Mastering Computer Networks: An Internet Lab Manual”, J

Joining a Multicast Group

Host informs local multicast(mcast) router of desire to join group:

Local router interacts with other routers to receive mcast datagram flowmany protocols (e.g., DVMRP, MOSPF, PIM)

IGMPIGMP

IGMP

wide-areamulticast

routing

Page 18: Multicasting. References r Note: Some slides come from the slides associated with this book: “Mastering Computer Networks: An Internet Lab Manual”, J

IGMP: Internet Group Management Protocol

The host sends IGMP report when application joins mcast group The host need not explicitly “unjoin” group

when leaving The router sends IGMP query at regular

intervals host belonging to a mcast group must reply

to query

query report

Page 19: Multicasting. References r Note: Some slides come from the slides associated with this book: “Mastering Computer Networks: An Internet Lab Manual”, J

Building Mcast Trees Problem Statement: Find a tree (or trees) connecting

routers having local mcast group members Approaches:

Source-based tree• One tree per source• Shortest path trees• Reverse path forwarding

Group-shared tree • Group uses one tree• Minimal spanning (Steiner): NP Complete Problem• center-based trees

Page 20: Multicasting. References r Note: Some slides come from the slides associated with this book: “Mastering Computer Networks: An Internet Lab Manual”, J

Problems with IP Multicast Communication

Security and privacy issues If the reason to use IP multicast is replication then you want

to make sure that the multicast is reliable. Not all multicast applications need strong reliability of the type

provided by TCP. Some can tolerate reordering, delay, etc Reliability needs application support. This suggests that

applications may need to send their acknowledgemens. Ack-implosion if all destinations ack at once We will discuss reliability later

Routers need to maintain state A bad link affects a subgroup IP multicast is probably sufficient for enterprise computing

but not Internet computing We will discuss more on reliable multicast later which does

not necessarily depend on using IP Multicast communication.

Page 21: Multicasting. References r Note: Some slides come from the slides associated with this book: “Mastering Computer Networks: An Internet Lab Manual”, J

Summary

This section briefly summarizes issues in multicasting.