Beruflich Dokumente
Kultur Dokumente
1 2
3 4
Ordering
Reliability
Four ordering semantics:
Reliability deals with recovery from commu- 1. No ordering
nication failures
{ Easy to implement, but hard to use
{ e.g., buer over
ows and bit errors
2. FIFO ordering
{ Message from one member are delivered in order
Much more dicult to implement reliability sent
for group communication eciently
3. Causal ordering
{ All messages that are related are ordered
Thus, many group communication mecha-
nisms are unreliable 4. Total ordering
{ Dicult to implement, but easy to use
5 6
7 8
Group Structure
Two choices
1. Closed groups IP Multicasting
{ Only group members can send to the group
2. Open groups IP multicasting implements a simple model
{ Non-members can also send to the group
of group communication
11 12
IP Multicast Groups
IP Multicast Model (cont'd) Two types of multicast groups
1. Permanent
Group Structure
{ Can have zero or more hosts with well-known IP
{ A single host may belong to many groups address (e.g., 224.0.0.1)
. A host may join or leave a group at any time 2. Transient
during the lifetime of the group
{ All multicast groups except permanent ones
{ A host need not be a member of a group to send
a message to the group
{ Groups may overlap Note that groups are dened by the IP ad-
dress
{ Note on membership to the group
13 14
IP Multicast Addressing
Mapping Multicast Addresses to
Accomplished through the use of IP class D
addresses Ethernet Addresses
{ Four high order bits are set to 1110 Multicast IP packets ultimately resolve down
to Ethernet destinations
{ Remaining 28 bits identify specic multicast groups
{ To create a unique Ethernet address the low or-
. Ranges from 224.0.0.0 to 239.255.255.255 der 23 bits of the IP address are mapped to the
Ethernet address
{ Address 224.0.0.0 is permanently unassigned
{ Note the potential for con
ict since there are 28
{ Address 224.0.0.1 is a permanent group to ad- signicant bits in a Class D IP address, but only
dress all multicast hosts on a directly connected the lower 23 are used: : :
subnetwork
15 16
IP Multicast Administration
(IGMP)
Host Participation
The Internet Group Management Protocol
A host can be in one of three states when (IGMP) handles administrative tasks related
participating on a multicasting network: to hosts and gateways
{ IGMP resides upon the IP layer
1. Participate fully by belonging to a multicast group
and sending/receiving multicast datagrams
{ Similar in spirit to ICMP, i.e., sent in IP datagrams
2. Be congured to send, but not receive, multicast
datagrams
IGMP keeps hosts/gateways informed about
3. Not participate in mulitcasting at all status and conguration of multicast groups
{ Accomplished by continuously querying hosts and
waiting for responses to be sent by one of the hosts
in the group
17 18
options
19 20
Example Receiver
Server program
int main (void) {
Example Sender
struct sockaddr_in local;
struct ifreq interface_addr;
struct inaddr in_addr;
struct
struct
ip_mreq mcast_addr;
sockaddr_in sa;
Multicast data to receiver(s)
int sd = socket (PF_INET, SOCK_DGRAM, 0);
int main (int argc, char *argv[]) {
// Determine interface address.
struct sockaddr_in sa;
strcpy (interface_addr.ifr_name, INTERFACE);
ioctl (sd, SIOCGIADDR, &interface_addr); struct hostent *hp;
int sd = socket (AF_INET, SOCK_DGRAM, 0);
mcast_addr.imr_multiaddr.s_addr = inet_addr (MCAST_ADDR); sa.sin_family = AF_INET;
sa = &interface_addr.ifr_addr; sa.sin_port = htons (UDP_PORT);
mcast_addr.imr_interface.s_addr = sa->sin_addr.s_addr;
sa.sin_addr.s_addr = inet_addr (MCAST_ADDR);
// Join group
hp = gethostbyname (argv[1]);
setsockopt (sd, IPPROTO_IP, IP_ADD_MEMBERSHIP, memcpy (&sa.sin_addr, hp->h_addr, hp->h_length);
(char *) &mcast_addr, sizeof mcast_addr);
// Multicast data to receiver(s) via sendto();
// Initialize local port number.
memset ((void *) &local, 0, sizeof local);
local.sin_family = AF_INET; local.sin_port = htons (UDP_PORT);
local.sin_addr.s_addr = htonl (INADDR_ANY);
21 22
23 24