home *** CD-ROM | disk | FTP | other *** search
/ Hackers Toolkit v2.0 / Hackers_Toolkit_v2.0.iso / HTML / archive / Unix / HOWTOs / MULTICAS < prev    next >
Text File  |  1999-11-04  |  74KB  |  1,783 lines

  1.   Multicast over TCP/IP HOWTO
  2.   Juan-Mariano de Goyeneche <jmseyas@dit.upm.es>
  3.   v1.0, 20 March 1998
  4.  
  5.   This HOWTO tries to cover most aspects related to multicast over
  6.   TCP/IP networks. So, a lot of information within it is not Linux-spe¡
  7.   cific (just in case you don't use GNU/Linux... yet). Multicast is cur¡
  8.   rently an active area of research and, at the time of writing, many of
  9.   the "standards" are merely drafts. Keep it in mind while reading the
  10.   lines that follow.
  11.   ______________________________________________________________________
  12.  
  13.   Table of Contents
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.   1. Introduction.
  68.  
  69.      1.1 What is Multicast.
  70.      1.2 The problem with Unicast.
  71.  
  72.   2. Multicast Explained.
  73.  
  74.      2.1 Multicast addresses.
  75.      2.2 Levels of conformance.
  76.      2.3 Sending Multicast Datagrams.
  77.         2.3.1 TTL.
  78.         2.3.2 Loopback.
  79.         2.3.3 Interface selection.
  80.      2.4 Receiving Multicast Datagrams.
  81.         2.4.1 Joining a Multicast Group.
  82.         2.4.2 Leaving a Multicast Group.
  83.         2.4.3 Mapping of IP Multicast Addresses to Ethernet/FDDI addresses.
  84.  
  85.   3. Kernel requirements and configuration.
  86.  
  87.   4. The MBone.
  88.  
  89.   5. Multicast applications.
  90.  
  91.   6. Multicast programming.
  92.  
  93.      6.1 IP_MULTICAST_LOOP.
  94.      6.2 IP_MULTICAST_TTL.
  95.      6.3 IP_MULTICAST_IF.
  96.      6.4 IP_ADD_MEMBERSHIP.
  97.      6.5 IP_DROP_MEMBERSHIP.
  98.  
  99.   7. The internals.
  100.  
  101.      7.1 IGMP.
  102.         7.1.1 IGMP version 1.
  103.         7.1.2 IGMP version 2.
  104.      7.2 Kernel corner.
  105.  
  106.   8. Routing Policies and Forwarding Techniques.
  107.  
  108.   9. Multicast Transport Protocols.
  109.  
  110.   10. References.
  111.  
  112.      10.1 RFCs.
  113.      10.2 Internet Drafts.
  114.      10.3 Web pages.
  115.      10.4 Books.
  116.  
  117.   11. Copyright and Disclaimer.
  118.  
  119.   12. Acknowledgements.
  120.  
  121.  
  122.  
  123.   ______________________________________________________________________
  124.  
  125.   1.  Introduction.
  126.  
  127.   I'll try to give here the most wide range, up to date and accurate
  128.   information related to multicasting over TCP/IP networks that I can.
  129.   Any feedback is very welcome. If you find any mistakes in this
  130.   document, have any comments about its contents or an update or
  131.   addition, please send them to me at the address listed at the top of
  132.   this howto.
  133.   1.1.  What is Multicast.
  134.  
  135.   Multicast is... a need. Well, at least in some scenarios. If you have
  136.   information (a lot of information, usually) that should be transmitted
  137.   to various (but usually not all) hosts over an internet, then
  138.   Multicast is the answer. One common situation in which it is used is
  139.   when distributing real time audio and video to the set of hosts which
  140.   have joined a distributed conference.
  141.  
  142.   Multicast is much like radio or TV in the sense that only those who
  143.   have tuned their receivers (by selecting a particular frequency they
  144.   are interested on) receive the information. That is: you hear the
  145.   channel you are interested in, but not the others.
  146.  
  147.  
  148.  
  149.   1.2.  The problem with Unicast.
  150.  
  151.   Unicast is anything that is not broadcast nor multicast. All right,
  152.   the definition is not very bright... When you send a packet and there
  153.   is only one sender process -yours- and one recipient process (the one
  154.   you are sending the packet to), then this is unicast. TCP is, by its
  155.   own nature, unicast oriented. UDP supports a lot more paradigms, but
  156.   if you are sending UDP packets and there is only one precess supposed
  157.   to receive them, this is unicast too.
  158.  
  159.   For years unicast transmissions proved to be enough for the Internet.
  160.   It was not until 1993 when the first implementation of multicast saw
  161.   the light in the 4.4 BSD release. It seems nobody needed it until
  162.   then. Which were those new problems that multicast addressed?
  163.  
  164.   Needless to say that the Internet has changed a lot since the "early
  165.   days". Particularly, the appearance of the Web strongly transformed
  166.   the situation: people didn't just want connections to remote hosts,
  167.   mail and FTP. First they wanted to see the pictures people placed in
  168.   their home pages, but later they also wanted to see and hear that
  169.   people.
  170.  
  171.   With today's technology it is possible to afford the "cost" of making
  172.   a unicast connection with everyone who wants to see your web page.
  173.   However, if you are to send audio and video, which needs a huge amount
  174.   of bandwidth compared with web applications, you have -you had, until
  175.   multicast came into scene- two options: to establish a separate
  176.   unicast connection with each of the recipients, or to use broadcast.
  177.   The first solution is not affordable: if we said that a single
  178.   connection sending audio/video consumes a huge bandwidth, imagine
  179.   having to establish hundreds or, may be, thousands of those
  180.   connections.  Both the sending computer and your network would
  181.   collapse.
  182.  
  183.   Broadcast seems to be a solution, but it's not certainly the solution.
  184.   If you want all the hosts in your LAN to attend the conference, you
  185.   may use broadcast. Packets will be sent only once and every host will
  186.   receive them as they are sent to the broadcast address. The problem is
  187.   that perhaps only a few of the hosts and not all are interested in
  188.   those packets. Furthermore: perhaps some hosts are really interested
  189.   in your conference, but they are outside of your LAN, a few routers
  190.   away.  And you know that broadcast works fine inside a LAN, but
  191.   problems arise when you want broadcast packets to be routed across
  192.   different LANs.
  193.  
  194.   The best solution seems to be one in which you send packets to a
  195.   certain special address (a certain frequency in radio/TV
  196.   transmissions). Then, all hosts which have decided to join the
  197.   conference will be aware of packets with that destination address,
  198.   read them when they traverse the network, and pass them to the IP
  199.   layer to be demultiplexed. This is similar to broadcasting in that you
  200.   send only one broadcast packet and all the hosts in the network
  201.   recognize and read it; it differs, however, in that not all multicast
  202.   packets are read and processed, but only those that were previously
  203.   registered in the kernel as being "of interest".
  204.  
  205.   Those special packets are routed at kernel level like any packet
  206.   because they are IP packets. The only difference might reside in the
  207.   routing algorithm which tells the kernel where to route or not to
  208.   route them.
  209.  
  210.  
  211.  
  212.  
  213.   2.  Multicast Explained.
  214.  
  215.   2.1.  Multicast addresses.
  216.  
  217.   As you probably know, the range of IP addresses is divided into
  218.   "classes" based on the high order bits of a 32 bits IP address:
  219.  
  220.  
  221.   ______________________________________________________________________
  222.      Bit -->  0                           31            Address Range:
  223.              +-+----------------------------+
  224.              |0|       Class A Address      |       0.0.0.0 - 127.255.255.255
  225.              +-+----------------------------+
  226.              +-+-+--------------------------+
  227.              |1 0|     Class B Address      |     128.0.0.0 - 191.255.255.255
  228.              +-+-+--------------------------+
  229.              +-+-+-+------------------------+
  230.              |1 1 0|   Class C Address      |     192.0.0.0 - 223.255.255.255
  231.              +-+-+-+------------------------+
  232.              +-+-+-+-+----------------------+
  233.              |1 1 1 0|  MULTICAST Address   |     224.0.0.0 - 239.255.255.255
  234.              +-+-+-+-+----------------------+
  235.              +-+-+-+-+-+--------------------+
  236.              |1 1 1 1 0|     Reserved       |     240.0.0.0 - 247.255.255.255
  237.              +-+-+-+-+-+--------------------+
  238.   ______________________________________________________________________
  239.  
  240.  
  241.  
  242.   The one which concerns us is the "Class D Address". Every IP datagram
  243.   whose destination address starts with "1110" is an IP Multicast
  244.   datagram.
  245.  
  246.   The remaining 28 bits identify the multicast "group" the datagram is
  247.   sent to. Following with the previous analogy, you have to tune your
  248.   radio to hear a program that is transmitted at some specific
  249.   frequency, in the same way you have to "tune" your kernel to receive
  250.   packets sent to an specific multicast group. When you do that, it's
  251.   said that the host has joined that group in the interface you
  252.   specified. More on this later.
  253.  
  254.   There are some special multicast groups, say "well known multicast
  255.   groups", you should not use in your particular applications due the
  256.   special purpose they are destined to:
  257.  
  258.  
  259.   ╖  224.0.0.1 is the all-hosts group. If you ping that group, all
  260.      multicast capable hosts on the network should answer, as every
  261.      multicast capable host must join that group at start-up on all it's
  262.      multicast capable interfaces.
  263.  
  264.  
  265.   ╖  224.0.0.2 is the all-routers group. All multicast routers must join
  266.      that group on all it's multicast capable interfaces.
  267.  
  268.   ╖  224.0.0.4 is the all DVMRP routers, 224.0.0.5 the all OSPF routers,
  269.      224.0.013 the all PIM routers, etc.
  270.  
  271.   All this special multicast groups are regularly published in the
  272.   "Assigned Numbers" RFC.
  273.  
  274.   In any case, range 224.0.0.0 through 224.0.0.255 is reserved for local
  275.   purposes (as administrative and maintenance tasks) and datagrams
  276.   destined to them are never forwarded by multicast routers. Similarly,
  277.   the range 239.0.0.0 to 239.255.255.255 has been reserved for
  278.   "administrative scoping" (see section 2.3.1 for information on
  279.   administrative scoping).
  280.  
  281.  
  282.  
  283.   2.2.  Levels of conformance.
  284.  
  285.   Hosts can be in three different levels of conformance with the
  286.   Multicast specification, according to the requirements they meet.
  287.  
  288.   Level 0 is the "no support for IP Multicasting" level. Lots of hosts
  289.   and routers in the Internet are in this state, as multicast support is
  290.   not mandatory in IPv4 (it is, however, in IPv6). Not too much
  291.   explanation is needed here: hosts in this level can neither send nor
  292.   receive multicast packets. They must ignore the ones sent by other
  293.   multicast capable hosts.
  294.  
  295.   Level 1 is the "support for sending but not receiving multicast IP
  296.   datagrams" level. Thus, note that it is not necessary to join a
  297.   multicast group to be able to send datagrams to it. Very few additions
  298.   are needed in the IP module to make a "Level 0" host "Level
  299.   1-compliant", as shown in section 2.3.
  300.  
  301.   Level 2 is the "full support for IP multicasting" level. Level 2 hosts
  302.   must be able to both send and receive multicast traffic. They must
  303.   know the way to join and leave multicast groups and to propagate this
  304.   information to multicast routers. Thus, they must include an Internet
  305.   Group Management Protocol (IGMP) implementation in their TCP/IP stack.
  306.  
  307.  
  308.  
  309.   2.3.  Sending Multicast Datagrams.
  310.  
  311.   By now, it should be obvious that multicast traffic is handled at the
  312.   transport layer with UDP, as TCP provides point-to-point connections,
  313.   not feasibles for multicast traffic. (Heavy research is taking place
  314.   to define and implement new multicast-oriented transport protocols.
  315.   See section ``Multicast Transport Protocols'' for details).
  316.  
  317.   In principle, an application just needs to open a UDP socket and fill
  318.   with a class D multicast address the destination address where it
  319.   wants to send data to.  However, there are some operations that a
  320.   sending process must be able to control.
  321.  
  322.  
  323.  
  324.   2.3.1.  TTL.
  325.  
  326.   The TTL (Time To Live) field in the IP header has a double
  327.   significance in multicast. As always, it controls the live time of the
  328.   datagram to avoid it being looped forever due to routing errors.
  329.   Routers decrement the TTL of every datagram as it traverses from one
  330.   network to another and when its value reaches 0 the packet is dropped.
  331.   The TTL in IPv4 multicasting has also the meaning of "threshold". Its
  332.   use becomes evident with an example: suppose you set a long, bandwidth
  333.   consuming, video conference between all the hosts belonging to your
  334.   department. You want that huge amount of traffic to remain in your
  335.   LAN. Perhaps your department is big enough to have various LANs. In
  336.   that case you want those hosts belonging to each of your LANs to
  337.   attend the conference, but in any case you want to collapse the entire
  338.   Internet with your multicast traffic. There is a need to limit how
  339.   "long" multicast traffic will expand across routers. That's what the
  340.   TTL is used for. Routers have a TTL threshold assigned to each of its
  341.   interfaces, and only datagrams with a TTL greater than the interface's
  342.   threshold are forwarded. Note that when a datagram traverses a router
  343.   with a certain threshold assigned, the datagram's TTL is not
  344.   decremented by the value of the threshold. Only a comparison is made.
  345.   (As before, the TTL is decremented by 1 each time a datagram passes
  346.   across a router).
  347.  
  348.   A list of TTL thresholds and their associated scope follows:
  349.  
  350.  
  351.   ______________________________________________________________________
  352.   TTL     Scope
  353.   ----------------------------------------------------------------------
  354.      0    Restricted to the same host. Won't be output by any interface.
  355.      1    Restricted to the same subnet. Won't be forwarded by a router.
  356.    <32    Restricted to the same site, organization or department.
  357.    <64    Restricted to the same region.
  358.   <128    Restricted to the same continent.
  359.   <255    Unrestricted in scope. Global.
  360.   ______________________________________________________________________
  361.  
  362.  
  363.  
  364.   Nobody knows what "site" or "region" mean exactly. It is up to the
  365.   administrators to decide what this limits apply to.
  366.  
  367.   The TTL-trick is not always flexible enough for all needs, specially
  368.   when dealing with overlapping regions or trying to establish
  369.   geographic, topologic and bandwidth limits simultaneously. To solve
  370.   this problems, administratively scoped IPv4 multicast regions were
  371.   established in 1994.  (see D. Meyer's "Administratively Scoped IP
  372.   Multicast" Internet draft).  It does scoping based on multicast
  373.   addresses rather than on TTLs. The range 239.0.0.0 to 239.255.255.255
  374.   is reserved for this administrative scoping.
  375.  
  376.  
  377.  
  378.   2.3.2.  Loopback.
  379.  
  380.   When the sending host is Level 2 conformant and is also a member of
  381.   the group datagrams are being sent to, a copy is looped back by
  382.   default.  This does not mean that the interface card reads its own
  383.   transmission, recognizes it as belonging to a group the interface
  384.   belongs to, and reads it from the network. On the contrary, is the IP
  385.   layer which, by default, recognizes the to-be-sent datagram and copies
  386.   and queues it on the IP input queue before sending it.
  387.  
  388.   This feature is desirable in some cases, but not in others. So the
  389.   sending process can turn it on and off at wish.
  390.  
  391.  
  392.  
  393.   2.3.3.  Interface selection.
  394.  
  395.   Hosts attached to more than one network should provide a way for
  396.   applications to decide which network interface will be used to output
  397.   the transmissions. If not specified, the kernel chooses a default one
  398.   based on system administrator's configuration.
  399.  
  400.  
  401.  
  402.  
  403.   2.4.  Receiving Multicast Datagrams.
  404.  
  405.   2.4.1.  Joining a Multicast Group.
  406.  
  407.   Broadcast is (in comparison) easier to implement than multicast. It
  408.   doesn't require processes to give the kernel some rules regarding what
  409.   to do with broadcast packets. The kernel just knows what to do: read
  410.   and deliver all of them to the proper applications.
  411.  
  412.   With multicast, however, it is necessary to advise the kernel which
  413.   multicast groups we are interested in. That is, we have to ask the
  414.   kernel to "join" those multicast groups. Depending on the underlying
  415.   hardware, multicast datagrams are filtered by the hardware or by the
  416.   IP layer (and, in some cases, by both). Only those with a destination
  417.   group previously registered via a join are accepted.
  418.  
  419.   Essentially, when we join a group we are telling the kernel: "OK. I
  420.   know that, by default, you ignore multicast datagrams, but remember
  421.   that I am interested in this multicast group. So, do read and deliver
  422.   (to any process interested in them, not only to me) any datagram that
  423.   you see in this network interface with this multicast group in its
  424.   destination field".
  425.  
  426.   Some considerations: first, note that you don't just join a group.
  427.   You join a group on a particular network interface. Of course, it is
  428.   possible to join the same group on more than one interface. If you
  429.   don't specify a concrete interface, then the kernel will choose it
  430.   based on its routing tables when datagrams are to be sent. It is also
  431.   possible that more than one process joins the same multicast group on
  432.   the same interface.  They will all receive the datagrams sent to that
  433.   group via that interface.
  434.  
  435.   As said before, any multicast-capable hosts join the all-hosts group
  436.   at start-up , so "pinging" 224.0.0.1 returns all hosts in the network
  437.   that have multicast enabled.
  438.  
  439.   Finally, consider that for a process to receive multicast datagrams it
  440.   has to ask the kernel to join the group and bind the port those
  441.   datagrams were being sent to. The UDP layer uses both the destination
  442.   address and port to demultiplex the packets and decide which socket(s)
  443.   deliver them to.
  444.  
  445.  
  446.  
  447.   2.4.2.  Leaving a Multicast Group.
  448.  
  449.   When a process is no longer interested in a multicast group, it
  450.   informs the kernel that it wants to leave that group. It is important
  451.   to understand that this doesn't mean that the kernel will no longer
  452.   accept multicast datagrams destined to that multicast group. It will
  453.   still do so if there are more precesses who issued a "multicast join"
  454.   petition for that group and are still interested. In that case the
  455.   host remains member of the group, until all the processes decide to
  456.   leave the group.
  457.  
  458.   Even more: if you leave the group, but remain bound to the port you
  459.   were receiving the multicast traffic on, and there are more processes
  460.   that joined the group, you will still receive the multicast
  461.   transmissions.
  462.  
  463.   The idea is that joining a multicast group only tells the IP and data
  464.   link layer (which in some cases explicitly tells the hardware) to
  465.   accept multicast datagrams destined to that group. It is not a per-
  466.   process membership, but a per-host membership.
  467.  
  468.  
  469.  
  470.   2.4.3.  Mapping of IP Multicast Addresses to Ethernet/FDDI addresses.
  471.  
  472.   Both Ethernet and FDDI frames have a 48 bit destination address field.
  473.   In order to avoid a kind of multicast ARP to map multicast IP
  474.   addresses to ethernet/FDDI ones, the IANA reserved a range of
  475.   addresses for multicast: every ethernet/FDDI frame with its
  476.   destination in the range 01-00-5e-00-00-00 to 01-00-5e-ff-ff-ff (hex)
  477.   contains data for a multicast group. The prefix 01-00-5e identifies
  478.   the frame as multicast, the next bit is always 0 and so only 23 bits
  479.   are left to the multicast address. As IP multicast groups are 28 bits
  480.   long, the mapping can not be one-to-one. Only the 23 least significant
  481.   bits of the IP multicast group are placed in the frame.  The remaining
  482.   5 high-order bits are ignored, resulting in 32 different multicast
  483.   groups being mapped to the same ethernet/FDDI address. This means that
  484.   the ethernet layer acts as an imperfect filter, and the IP layer will
  485.   have to decide whether to accept the datagrams the data-link layer
  486.   passed to it. The IP layer acts as a definitive perfect filter.
  487.  
  488.   Full details on IP Multicasting over FDDI are given in RFC 1390:
  489.   "Transmission of IP and ARP over FDDI Networks". For more information
  490.   on mapping IP Multicast addresses to ethernet ones, you may consult
  491.   draft-ietf-mboned-intro-multicast-03.txt: "Introduction to IP
  492.   Multicast Routing".
  493.  
  494.   If you are interested in IP Multicasting over Token-Ring Local Area
  495.   Networks, see RFC 1469 for details.
  496.  
  497.  
  498.  
  499.  
  500.   3.  Kernel requirements and configuration.
  501.  
  502.   Linux is, of course (you doubted it?), full Level-2 Multicast-
  503.   Compliant.  It meets all requirements to send, receive and act as a
  504.   router (mrouter) for multicast datagrams.
  505.  
  506.   If you want just to send and receive, you must say yes to "IP:
  507.   multicasting" when configuring your kernel. If you also want your
  508.   Linux box to act as a multicast router (mrouter) you also need to
  509.   enable multicast routing in the kernel by selecting "IP:
  510.   forwarding/gatewaying", "IP: multicast routing" and "IP: tunneling",
  511.   the latter because new versions of mrouted relay on IP tunneling to
  512.   send multicast datagrams encapsulated into unicast ones. This is
  513.   necessary when establishing tunnels between multicast hosts separated
  514.   by unicast-only networks and routers.  (The mrouted is a daemon that
  515.   implements the multicast routing algorithm -the routing policy- and
  516.   instructs the kernel on how to route multicast datagrams).
  517.  
  518.   Some kernel versions label multicast routing as "EXPERIMENTAL", so you
  519.   should enable "Prompt for development and/or incomplete code/drivers"
  520.   in the "Code maturity level options" section.
  521.  
  522.   If, when running the mrouted, traffic generated in the same network
  523.   your Linux box is connected to is correctly forwarded to the other
  524.   network, but you can't see the other's network traffic on your local
  525.   network, check whether you are receiving ICMP protocol error messages.
  526.   Almost sure you forgot to turn on IP tunneling in your Linux router.
  527.   It's a kind of stupid error when you know it but, believe me, its
  528.   quite time-consuming when you don't, and there is no apparent reason
  529.   that explains what is going wrong. A sniffer proves to be quite useful
  530.   in these situations!
  531.  
  532.   (You can see more on multicast routing on section ``Routing Policies
  533.   and Forwarding Techniques''; mrouted and tunnels are also explained in
  534.   sections ``The MBone'' and ``Multicast applications'').
  535.  
  536.   Once you have compiled and installed your new kernel, you should
  537.   provide a default route for multicast traffic. The goal is to add a
  538.   route to the network 224.0.0.0.
  539.  
  540.   The problem most people seem to face in this stage of the
  541.   configuration is with the value of the mask to supply. If you have
  542.   read Terry Dawson's excellent NET-3-HOWTO, it should not be difficult
  543.   to guess the correct value, though. As explained there, the netmask is
  544.   a 32 bit number filled with all-1s in the network part of your IP
  545.   address, and with all-0s in the host part. Recall from section 2.1
  546.   that a class D multicast address has no netwok/host sections. Instead
  547.   it has a 28-bit group identifier and a 4-bit class D identifier. Well,
  548.   this 4 bits are the network part and the remaining 28 the host part.
  549.   So the netmask needed is 11110000000000000000000000000000 or, easier
  550.   to read: 240.0.0.0.  Then, the full command should be:
  551.  
  552.  
  553.        route add 224.0.0.0 netmask 240.0.0.0 dev eth0
  554.  
  555.  
  556.  
  557.  
  558.   Depending on how old your route program is, you might need to add the
  559.   -net flag after the add.
  560.  
  561.   Here we supposed that eth0 was multicast-capable and that, when not
  562.   otherwise specified, we wanted multicast traffic to be output there.
  563.   If this is not your case, change the dev parameter as appropriate.
  564.  
  565.   The /proc filesystem proves here to be useful once again: you can
  566.   check /proc/net/igmp to see the groups your host is currently
  567.   subscribed to.
  568.  
  569.  
  570.  
  571.  
  572.   4.  The MBone.
  573.  
  574.   Using a new technology usually carries some advantages and
  575.   disadvantages.  The advantages of multicast are -I think- clear. The
  576.   main disadvantage is that hundreds of hosts and, specially, routers
  577.   don't support it yet. As a consequence, people who started working on
  578.   multicast, bought new equipment, modified their operating systems, and
  579.   built multicast islands in their local places. Then they discovered
  580.   that it was difficult to communicate with people doing similar things
  581.   because if only one of the routers between them didn't support
  582.   multicast there was nothing to do...
  583.  
  584.   The solution was clear: they decided to build a virtual multicast
  585.   network in the top of the Internet. That is: sites with multicast
  586.   routers between them could communicate directly. But sites joined
  587.   across unicast routers would send their island's multicast traffic
  588.   encapsulated in unicast packets to other multicast islands. Routers in
  589.   the middle would not have problems, as they would be dealing with
  590.   unicast traffic. Finally, in the receiving site, traffic would be de-
  591.   encapsulated, and sent to the island in the original multicast way.
  592.   Two ends converting from multicast to unicast, and then again to
  593.   multicast define what is called a multicast tunnel.
  594.  
  595.   The MBone or Multicast Backbone is that virtual multicast network
  596.   based on multicast islands connected by multicast tunnels.
  597.  
  598.   Several activities take place in the MBone daily, but it deserves to
  599.   be remarked the profusion of tele-conferences with real time audio and
  600.   video taking place across the whole Internet. As an example, it was
  601.   recently transmitted (live) the talk Linus Torvalds gave to the
  602.   Silicon Valley Linux Users Group.
  603.  
  604.   For more information on the MBone, see:
  605.  
  606.   <http://www.mediadesign.co.at/newmedia/more/mbone-faq.html>
  607.  
  608.  
  609.  
  610.   5.  Multicast applications.
  611.  
  612.   Most people dealing with multicast, sooner or later decide to connect
  613.   to the MBone, and then they usually need an mrouted. You'll also need
  614.   it if you don't have a multicast-capable router and you want multicast
  615.   traffic generated in one of your subnets to be "heard" on another.
  616.   mrouted does circunvect the problem of sending multicast traffic
  617.   across unicast routers -it encapsulates multicast datagrams into
  618.   unicast ones (IP into IP)- but this is not the only feature it
  619.   provides. Most important, it instructs the kernel on how to route (or
  620.   not-to-route) multicast datagrams based on their source and
  621.   destination. So, even having a multicast capable router, mrouted can
  622.   be used to tell it what to do with the datagrams (note I said what,
  623.   and not how; mrouted says "forward this to the network connected to
  624.   that interface", but actual forwarding is performed by the kernel).
  625.   This distinction between actual-forwarding and the algorithm that
  626.   decides who and how to forward is very useful as it allows to write
  627.   forwarding code only once and place it into the kernel. Forwarding
  628.   algorithms and policies are then implemented in user space daemons, so
  629.   it is very easy to change from one policy to another without the need
  630.   of kernel re-compilation.
  631.  
  632.   You can get a version of mrouted ported to Linux from:
  633.  
  634.   <ftp://www.video.ja.net/mice/mrouted/Linux/>. This site is mirrored
  635.   all across the world. Be sure to read the
  636.   <ftp://www.video.ja.net/mice/README.mirrors> file to choose the one
  637.   nearest you.
  638.  
  639.   Next, we'll focus specially on multicast applications written to
  640.   connect to the MBone, which have been ported to Linux. The list is
  641.   picked up from Michael Esler's "Linux Multicast Information" page
  642.   <http://www.cs.virginia.edu/~mke2e/multicast/>. I recommend you that
  643.   page for lots of information and resources on multicast and Linux.
  644.  
  645.  
  646.   Audio Conferencing
  647.  
  648.   ╖  NeVoT - Network Voice Terminal <http://www.fokus.gmd.de/step/nevot>
  649.  
  650.   ╖  RAT - UCL Robust-Audio Tool <http://www-mice.cs.ucl.ac.uk/mice/rat>
  651.  
  652.   ╖  vat - LBL visual audio tool <http://www-nrg.ee.lbl.gov/vat/>
  653.  
  654.   Video Conferencing
  655.  
  656.   ╖  ivs - Inria video conferencing system
  657.      <http://www.inria.fr/rodeo/ivs.html>
  658.  
  659.   ╖  nv - Network video tool <ftp://ftp.parc.xerox.com/pub/net-
  660.      research/>
  661.   ╖  nv w/ Meteor - Release of nv w/ support for the Matrox Meteor (UVa)
  662.      <ftp://ftp.cs.virginia.edu/pub/gwtts/Linux/nv-meteor.tar.gz>
  663.  
  664.   ╖  vic - LBL video conferencing tool <http://www-nrg.ee.lbl.gov/vic/>
  665.  
  666.   ╖  vic w/ Meteor - Release of vic w/ support for the Matrox Meteor
  667.      (UVa)
  668.      <ftp://ftp.cs.virginia.edu/pub/gwtts/Linux/vic2.7a38-meteor.tar.gz>
  669.  
  670.   Other Utilities
  671.  
  672.   ╖  mmphone Multimedia phone service
  673.      <http://www.eit.com/software/mmphone/phoneform.html>
  674.  
  675.   ╖  wb - LBL shared white board <http://www-nrg.ee.lbl.gov/wb/>
  676.  
  677.   ╖  webcast - Reliable multicast application for linking Mosaic
  678.      browsers
  679.      <http://www.ncsa.uiuc.edu/SDG/Software/XMosaic/CCI/webcast.html>
  680.  
  681.   Session Tools
  682.  
  683.   I placed session tools later because I think they deserve some
  684.   explanation.  When a conference takes places, several multicast groups
  685.   and ports are assigned to each service you want for your conference
  686.   (audio, video, shared white-boards, etc...) Announces of the
  687.   conferences that will take place, along with information on multicast
  688.   groups, ports and programs that will be used (vic, vat, ...) are
  689.   periodically multicasted to the MBone. Session tools "hear" this
  690.   information and present you in an easy way which conferences are
  691.   taking (or will take) place, so you can decide which interest you.
  692.   Also, they facilitate the task of joining a session. Instead of
  693.   launching each program that will be used and telling which multicast
  694.   group/port to join, you usually just need to click and the session
  695.   tool launches the proper programs suppling them all information needed
  696.   to join the conference.  Session tools usually let you announce your
  697.   own conferences on the MBone.
  698.  
  699.  
  700.   ╖  gwTTS - University of Virginia tele-tutoring system
  701.      <http://www.cs.Virginia.EDU/~gwtts>
  702.  
  703.   ╖  isc - Integrated session controller
  704.      <http://www.fokus.gmd.de/step/isc>
  705.  
  706.   ╖  mmcc - Multimedia conference control
  707.      <ftp://ftp.isi.edu/confctrl/mmcc>
  708.  
  709.   ╖  sd - LBL session directory tool
  710.      <ftp://ftp.ee.lbl.gov/conferencing/sd>
  711.  
  712.   ╖  sd-snoop - Tenet Group session directory snoop utility
  713.      <ftp://tenet.berkeley.edu/pub/software>
  714.  
  715.   ╖  sdr - UCL's next generation session directory
  716.      <ftp://cs.ucl.ac.uk/mice/sdr>
  717.  
  718.  
  719.  
  720.  
  721.   6.  Multicast programming.
  722.  
  723.   Multicast programming... or writing your own multicast applications.
  724.  
  725.   Several extensions to the programming API are needed in order to
  726.   support multicast. All of them are handled via two system calls:
  727.   setsockopt() (used to pass information to the kernel) and getsockopt()
  728.   (to retrieve information regarded multicast behavior). This does not
  729.   mean that 2 new system calls were added to support multicast. The pair
  730.   setsockopt()/getsockopt() has been there for years. Since 4.2 BSD at
  731.   least. The addition consists on a new set of options (multicast
  732.   options) that are passed to these system calls, that the kernel must
  733.   understand.
  734.  
  735.   The following are the setsockopt()/getsockopt() function prototypes:
  736.  
  737.  
  738.        int getsockopt(int s, int level, int optname, void* optval, int* optlen);
  739.  
  740.        int setsockopt(int s, int level, int optname, const void* optval, int optlen);
  741.  
  742.  
  743.  
  744.  
  745.   The first parameter, s, is the socket the system call applies to.  For
  746.   multicasting, it must be a socket of the family AF_INET and its type
  747.   may be either SOCK_DGRAM or SOCK_RAW. The most common use is with
  748.   SOCK_DGRAM sockets, but if you plan to write a routing daemon or
  749.   modify some existing one, you will probably need to use SOCK_RAW ones.
  750.  
  751.   The second one, level, identifies the layer that is to handle the
  752.   option, message or query, whatever you want to call it. So, SOL_SOCKET
  753.   is for the socket layer, IPPROTO_IP for the IP layer, etc...  For
  754.   multicast programming, level will always be IPPROTO_IP.
  755.  
  756.   optname identifies the option we are setting/getting. Its value
  757.   (either supplied by the program or returned by the kernel) is optval.
  758.   The optnames involved in multicast programming are the following:
  759.  
  760.  
  761.   ______________________________________________________________________
  762.                           setsockopt()            getsockopt()
  763.   IP_MULTICAST_LOOP           yes                     yes
  764.   IP_MULTICAST_TTL            yes                     yes
  765.   IP_MULTICAST_IF             yes                     yes
  766.   IP_ADD_MEMBERSHIP           yes                      no
  767.   IP_DROP_MEMBERSHIP          yes                      no
  768.   ______________________________________________________________________
  769.  
  770.  
  771.  
  772.   optlen carries the size of the data structure optval points to.  Note
  773.   that in getsockopt() it is a value-result rather than a value: the
  774.   kernel writes the value of optname in the buffer pointed by optval and
  775.   informs us of that value's size via optlen.
  776.  
  777.   Both setsockopt() and getsockopt() return 0 on success and -1 on
  778.   error.
  779.  
  780.  
  781.  
  782.   6.1.  IP_MULTICAST_LOOP.
  783.  
  784.   You have to decide, as the application writer, whether you want the
  785.   data you send to be looped back to your host or not. If you plan to
  786.   have more than one process or user "listening", loopback must be
  787.   enabled. On the other hand, if you are sending the images your video
  788.   camera is producing, you probably don't want loopback, even if you
  789.   want to see yourself on the screen. In that latter case, your
  790.   application will probably receive the images from a device attached to
  791.   the computer and send them to the socket. As the application already
  792.   "has" that data, it is improbable it wants to receive it again on the
  793.   socket.  Loopback is by default enabled.
  794.  
  795.   Regard that optval is a pointer. You can't write:
  796.  
  797.  
  798.        setsockopt(socket, IPPROTO_IP, IP_MULTICAST_LOOP, 0, 1);
  799.  
  800.  
  801.  
  802.  
  803.   to disable loopback. Instead write:
  804.  
  805.  
  806.        u_char loop;
  807.        setsockopt(socket, IPPROTO_IP, IP_MULTICAST_LOOP, &loop, sizeof(loop));
  808.  
  809.  
  810.  
  811.  
  812.   and set loop to 1 to enable loopback or 0 to disable it.
  813.  
  814.   To know whether a socket is currently looping-back or not use
  815.   something like:
  816.  
  817.  
  818.        u_char loop;
  819.        int size;
  820.  
  821.        getsockopt(socket, IPPROTO_IP, IP_MULTICAST_LOOP, &loop, &size)
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.   6.2.  IP_MULTICAST_TTL.
  829.  
  830.   If not otherwise specified, multicast datagrams are sent with a
  831.   default value of 1, to prevent them to be forwarded beyond the local
  832.   network.  To change the TTL to the value you desire (from 0 to 255),
  833.   put that value into a variable (here I name it "ttl") and write
  834.   somewhere in your program:
  835.  
  836.  
  837.        u_char ttl;
  838.        setsockopt(socket, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, sizeof(ttl));
  839.  
  840.  
  841.  
  842.  
  843.   The behavior with getsockopt() is similar to the one seen on
  844.   IP_MULTICAST_LOOP.
  845.  
  846.  
  847.  
  848.   6.3.  IP_MULTICAST_IF.
  849.  
  850.   Usually, the system administrator specifies the default interface
  851.   multicast datagrams should be sent from. The programmer can override
  852.   this and choose a concrete outgoing interface for a given socket with
  853.   this option.
  854.  
  855.  
  856.        struct in_addr interface_addr;
  857.        setsockopt (socket, IPPROTO_IP, IP_MULTICAST_IF, &interface_addr, sizeof(interface_addr));
  858.  
  859.   >From now on, all multicast traffic generated in this socket will be
  860.   output from the interface chosen. To revert to the original behavior
  861.   and let the kernel choose the outgoing interface based on the system
  862.   administrator's configuration, it is enough to call setsockopt() with
  863.   this same option and INADDR_ANY in the interface field.
  864.  
  865.   In determining or selecting outgoing interfaces, the following ioctls
  866.   might be useful: SIOCGIFADDR (to get an interface's address),
  867.   SIOCGIFCONF (to get the list of all the interfaces) and  SIOCGIFFLAGS
  868.   (to get an interface's flags and, thus, determine whether the
  869.   interface is multicast capable or not -the IFF_MULTICAST flag-).
  870.  
  871.   If the host has more than one interface and the IP_MULTICAST_IF option
  872.   is not set, multicast transmissions are sent from the default
  873.   interface, although the remainding interfaces might be used for
  874.   multicast forwarding if the host is acting as a multicast router.
  875.  
  876.  
  877.  
  878.   6.4.  IP_ADD_MEMBERSHIP.
  879.  
  880.   Recall that you need to tell the kernel which multicast groups you are
  881.   interested in. If no process is interested in a group, packets
  882.   destined to it that arrive to the host are discarded. In order to
  883.   inform the kernel of your interests and, thus, become a member of that
  884.   group, you should first fill a ip_mreq structure which is passed later
  885.   to the kernel in the optval field of the setsockopt() system call.
  886.  
  887.   The ip_mreq structure (taken from /usr/include/linux/in.h) has the
  888.   following members:
  889.  
  890.  
  891.        struct ip_mreq
  892.        {
  893.                struct in_addr imr_multiaddr;   /* IP multicast address of group */
  894.                struct in_addr imr_interface;   /* local IP address of interface */
  895.        };
  896.  
  897.  
  898.  
  899.  
  900.   (Note: the "physical" definition of the structure is in the file above
  901.   specified.  Nonetheless, you should not include <linux/in.h> if you
  902.   want your code to be portable. Instead, include <netinet/in.h> which,
  903.   in turn, includes <linux/in.h> itself).
  904.  
  905.   The first member, imr_multiaddr, holds the group address you want to
  906.   join.  Remember that memberships are also associated with interfaces,
  907.   not just groups. This is the reason you have to provide a value for
  908.   the second member: imr_interface. This way, if you are in a multihomed
  909.   host, you can join the same group in several interfaces. You can
  910.   always fill this last member with the wildcard address (INADDR_ANY)
  911.   and then the kernel will deal with the task of choosing the interface.
  912.  
  913.   With this structure filled (say you defined it as: struct ip_mreq
  914.   mreq;) you just have to call setsockopt() this way:
  915.  
  916.  
  917.        setsockopt (socket, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq));
  918.  
  919.  
  920.  
  921.  
  922.   Notice that you can join several groups to the same socket, not just
  923.   one. The limit to this is IP_MAX_MEMBERSHIPS and, as of version
  924.   2.0.33, it has the value of 20.
  925.   6.5.  IP_DROP_MEMBERSHIP.
  926.  
  927.   The process is quite similar to joining a group:
  928.  
  929.  
  930.        struct ip_mreq mreq;
  931.        setsockopt (socket, IPPROTO_IP, IP_DROP_MEMBERSHIP, &mreq, sizeof(mreq));
  932.  
  933.  
  934.  
  935.  
  936.   where mreq is the same structure with the same data used when joining
  937.   the group. If the imr_interface member is filled with INADDR_ANY, the
  938.   first matching group is dropped.
  939.  
  940.   If you have joined a lot of groups to the same socket, you don't need
  941.   to drop memberships in all of them in order to terminate. When you
  942.   close a socket, all memberships associated with it are dropped by the
  943.   kernel. The same occurs if the process that opened the socket is
  944.   killed.
  945.  
  946.   Finally, keep in mind that a process dropping membership for a group
  947.   does not imply that the host will stop receiving datagrams for that
  948.   group. If another socket joined that group in that same interface
  949.   previously to this IP_DROP_MEMBERSHIP, the host will keep being a
  950.   member of that group.
  951.  
  952.   Both ADD_MEMBERSHIP and DROP_MEMBERSHIP are nonblocking operations.
  953.   They should return immediately indicating either success or failure.
  954.  
  955.  
  956.  
  957.  
  958.   7.  The internals.
  959.  
  960.   This section's aim is to provide some information, not needed to reach
  961.   a basic understanding on how multicast works nor to be able to write
  962.   multicast programs, but which is very interesting, gives some insight
  963.   on the underlying multicast protocols and implementations, and may be
  964.   useful to avoid common errors and misunderstandings.
  965.  
  966.  
  967.  
  968.   7.1.  IGMP.
  969.  
  970.   When talking about IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP, we said
  971.   that the information provided by this "commands" was used by the
  972.   kernel to choose which multicast datagrams accept or discard. This is
  973.   true, but it is not all the truth. Such a simplification would imply
  974.   that multicast datagrams for all multicast groups around the world
  975.   would be received by our host, and then it would check the memberships
  976.   issued by processes running on it to decide whether to pass the
  977.   traffic to them or to throw it out. As you can imagine, this is a
  978.   complete bandwidth waste.
  979.  
  980.   What actually happens is that hosts instruct their routers telling
  981.   them which multicast groups they are interested in; then, those
  982.   routers tell their up-stream routers they want to receive that
  983.   traffic, and so on. Algorithms employed for making the decision of
  984.   when to ask for a group's traffic or saying that it is not desired
  985.   anymore, vary a lot. There's something, however, that never changes:
  986.   how this information is transmitted. IGMP is used for that. It stands
  987.   for Internet Group Management Protocol. It is a new protocol, similar
  988.   in many aspects to ICMP, with a protocol number of 2, whose messages
  989.   are carried in IP datagrams, and which all level 2-compliant host are
  990.   required to implement.
  991.   As said before, it is used both by hosts giving membership information
  992.   to its routers, and by routers to communicate between themselves. In
  993.   the following I'll cover only the hosts-routers relationships, mainly
  994.   because I was unable to find information describing router to router
  995.   communication other than the mrouted source code (rfc 1075 describing
  996.   the Distance Vector Multicast Routing Protocol is now obsoleted, and
  997.   mrouted implements a modified DVMRP not yet documented).
  998.  
  999.   IGMP version 0 is specified in RFC-988 which is now obsoleted. Almost
  1000.   no one uses version 0 now.
  1001.  
  1002.   IGMP version 1 is described in RFC-1112 and, although it is updated by
  1003.   RFC-2236 (IGMP version 2) it is in wide use still. The Linux kernel
  1004.   implements the full IGMP version 1 and parts of version 2
  1005.   requirements, but not all.
  1006.  
  1007.   Now I'll try to give an informal description of the protocol. You can
  1008.   check RFC-2236 for an in-proof formal description, with lots of state
  1009.   diagrams and time-out boundaries.
  1010.  
  1011.   All IGMP messages have the following structure:
  1012.  
  1013.   ______________________________________________________________________
  1014.       0                   1                   2                   3
  1015.       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  1016.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1017.      |      Type     | Max Resp Time |           Checksum            |
  1018.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1019.      |                         Group Address                         |
  1020.      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1021.   ______________________________________________________________________
  1022.  
  1023.  
  1024.  
  1025.   IGMP version 1 (hereinafter IGMPv1) labels the "Max Resp Time" as
  1026.   "Unused", zeroes it when sent, and ignores it when received. Also, it
  1027.   brakes the "Type" field in two 4-bits wide fields: "Version" and
  1028.   "Type". As IGMPv1 identifies a "Membership Query" message as 0x11
  1029.   (version 1, type 1) and IGMPv2 as 0x11 too, the 8 bits have the same
  1030.   effective interpretation.
  1031.  
  1032.   I think it is more instructive to give first the IGMPv1 description
  1033.   and next point out the IGMPv2 additions, as they are mainly that,
  1034.   additions.
  1035.  
  1036.   For the following discussions it is important to remember that
  1037.   multicast routers receive all IP multicast datagrams.
  1038.  
  1039.  
  1040.  
  1041.   7.1.1.  IGMP version 1.
  1042.  
  1043.   Routers periodically send IGMP Host Membership Queries to the all-
  1044.   hosts group (224.0.0.1) with a TTL of 1 (once every minute or two).
  1045.   All multicast-capable hosts hear them, but don't answer immediately to
  1046.   avoid an IGMP Host Membership Report storm.  Instead, they start a
  1047.   random delay timer for each group they belong to on the interface they
  1048.   received the query.
  1049.  
  1050.   Sooner or later, the timer expires in one of the hosts, and it sends
  1051.   an IGMP Host Membership Report (also with TTL 1) to the multicast
  1052.   address of the group being reported. As it is sent to the group, all
  1053.   hosts that joined the group -and which are currently waiting for their
  1054.   own timer to expire- receive it, too. Then, they stop their timers and
  1055.   don't generate any other report. Just one is generated -by the host
  1056.   that chose the smaller timeout-, and that is enough for the router. It
  1057.   only needs to know that there are members for that group in the
  1058.   subnet, not how many nor which.
  1059.  
  1060.   When no reports are received for a given group after a certain number
  1061.   of queries, the router assumes that no members are left, and thus it
  1062.   doesn't have to forward traffic for that group on that subnet. Note
  1063.   that in IGMPv1 there are no "Leave Group messages".
  1064.  
  1065.   When a host joins a new group, the kernel sends a report for that
  1066.   group, so that the respective process needs not to wait a minute or
  1067.   two until a new membership query is received. As you can see this IGMP
  1068.   packet is generated by the kernel as a response to the
  1069.   IP_ADD_MEMBERSHIP command, seen in section ``IP_ADD_MEMBERSHIP''.
  1070.   Note the emphasis in the adjective "new": if a process issues an
  1071.   IP_ADD_MEMBERSHIP command for a group the host is already a member of,
  1072.   no IGMP packets are sent as we must already be receiving traffic for
  1073.   that group; instead, a counter for that group's use is incremented.
  1074.   IP_DROP_MEMBERSHIP generates no datagrams in IGMPv1.
  1075.  
  1076.   Host Membership Queries are identified by Type 0x11, and Host
  1077.   Membership Reports by Type 0x12.
  1078.  
  1079.   No reports are sent for the all-hosts group. Membership in this group
  1080.   is permanent.
  1081.  
  1082.  
  1083.  
  1084.   7.1.2.  IGMP version 2.
  1085.  
  1086.   One important addition to the above is the inclusion of a Leave Group
  1087.   message (Type 0x17). The reason is to reduce the bandwidth waste
  1088.   between the time the last host in the subnet drops membership and the
  1089.   time the router times-out for its queries and decides there are no
  1090.   more members present for that group (leave latency). Leave Group
  1091.   messages should be addressed to the all-routers group (224.0.0.2)
  1092.   rather than to the group being left, as that information is of no use
  1093.   for other members (kernel versions up to 2.0.33 send them to the
  1094.   group; although it does no harm to the hosts, it's a waste of time as
  1095.   they have to process them, but don't gain useful information).  There
  1096.   are certain subtle details regarding when and when-not to send Leave
  1097.   Messages; if interested, see the RFC.
  1098.  
  1099.   When an IGMPv2 router receives a Leave Message for a group, it sends
  1100.   Group-Specific Queries to the group being left. This is another
  1101.   addition. IGMPv1 has no group-specific queries. All queries are sent
  1102.   to the all-hosts group. The Type in the IGMP header does not change
  1103.   (0x11, as before), but the  "Group Address" is filled with the address
  1104.   of the multicast group being left.
  1105.  
  1106.   The "Max Resp Time" field, which was set to 0 in transmission and
  1107.   ignored on reception in IGMPv1, is meaningful only in "Membership
  1108.   Query" messages. It gives the maximum time allowed before sending a
  1109.   report in units of 1/10 second. It is used as a tune mechanism.
  1110.  
  1111.   IGMPv2 adds another message type: 0x16. It is a "Version 2 Membership
  1112.   Report" sent by IGMPv2 hosts if they detect an IGMPv2 router is
  1113.   present (an IGMPv2 host knows an IGMPv1 router is present when it
  1114.   receives a query with the "Max Response" field set to 0).
  1115.  
  1116.   When more than one router claims to act as querier, IGMPv2 provides a
  1117.   mechanism to avoid "discussions": the router with the lowest IP
  1118.   address is designed to be querier. The other routers keep timeouts. If
  1119.   the router with lower IP address crashes or is shutdown, the decision
  1120.   of who will be the querier is taken again after the timers expire.
  1121.  
  1122.  
  1123.   7.2.  Kernel corner.
  1124.  
  1125.   This sub-section gives some start-points to study the multicast
  1126.   implementation of the Linux kernel. It does not explain that
  1127.   implementation. It just says where to find things.
  1128.  
  1129.   The study was carried over version 2.0.32, so it could be a bit
  1130.   outdated by the time you read it (network code seems to have changed A
  1131.   LOT in 2.1.x releases, for instance).
  1132.  
  1133.   Multicast code in the Linux kernel is always surrounded by #ifdef
  1134.   CONFIG_IP_MULTICAST / #endif pairs, so that you can include/ exclude
  1135.   it from your kernel based on your needs (this inclusion/exclusion is
  1136.   done at compile time, as you probably know if reading that section...
  1137.   #ifdefs are handled by the preprocessor.  The decision is made based
  1138.   in what you selected when doing either a make config, make menuconfig
  1139.   or make xconfig).
  1140.  
  1141.   You might want multicast features, but if your Linux box is not going
  1142.   to act as a multicast router you will probably not want multicast
  1143.   router features included in your new kernel. For this you have the
  1144.   multicast routing code surrounded by #ifdef CONFIG_IP_MROUTE / #endif
  1145.   pairs.
  1146.  
  1147.   Kernel sources are usually placed in /usr/src/linux. However, the
  1148.   place may change so, both for accuracy and brevity, I will refer to
  1149.   the root directory of the kernel sources as just LINUX. Then,
  1150.   something like LINUX/net/ipv4/udp.c should be the same as
  1151.   /usr/src/linux/net/ipv4/udp.c if you unpacked the kernel sources in
  1152.   the /usr/src/linux directory.
  1153.  
  1154.   All multicast interfaces with user programs shown in the section
  1155.   devoted to multicast programming were driven across the setsockopt()/
  1156.   getsockopt() system calls. Both of them are implemented by means of
  1157.   functions that make some tests to verify the parameters passed to them
  1158.   and which, in turn, call another function that makes some additional
  1159.   tests, demultiplexes the call based on the level parameter to either
  1160.   system call, and then calls another function which... (if interested
  1161.   in all this jumps, you can follow them in LINUX/net/socket.c
  1162.   (functions sys_socketcall() and sys_setsockopt(),
  1163.   LINUX/net/ipv4/af_inet.c (function inet_setsockopt()) and
  1164.   LINUX/net/ipv4/ip_sockglue.c (function ip_setsockopt()) ).
  1165.  
  1166.   The one which interests us is LINUX/net/ipv4/ip_sockglue.c. Here we
  1167.   find ip_setsockopt() and ip_getsockopt() which are mainly a switch
  1168.   (after some error checking) verifying each possible value for optname.
  1169.   Along with unicast options, all multicast ones seen here are handled:
  1170.   IP_MULTICAST_TTL, IP_MULTICAST_LOOP, IP_MULTICAST_IF,
  1171.   IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP. Previously to the switch, a
  1172.   test is made to determine whether the options are multicast router
  1173.   specific, and if so, they are routed to the ip_mroute_setsockopt() and
  1174.   ip_mroute_getsockopt() functions (file LINUX/net/ipv4/ipmr.c).
  1175.  
  1176.   In LINUX/net/ipv4/af_inet.c we can see the default values we talked
  1177.   about in previous sections (loopback enabled, TTL=1) provided when the
  1178.   socket is created (taken from function inet_create() in this file):
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.   ______________________________________________________________________
  1190.  
  1191.   #ifdef CONFIG_IP_MULTICAST
  1192.           sk->ip_mc_loop=1;
  1193.           sk->ip_mc_ttl=1;
  1194.           *sk->ip_mc_name=0;
  1195.           sk->ip_mc_list=NULL;
  1196.   #endif
  1197.   ______________________________________________________________________
  1198.  
  1199.  
  1200.  
  1201.   Also, the assertion of "closing a socket makes the kernel drop all
  1202.   memberships this socket had" is corroborated by:
  1203.  
  1204.   ______________________________________________________________________
  1205.   #ifdef CONFIG_IP_MULTICAST
  1206.                   /* Applications forget to leave groups before exiting */
  1207.                   ip_mc_drop_socket(sk);
  1208.   #endif
  1209.   ______________________________________________________________________
  1210.  
  1211.  
  1212.   taken from inet_release(), on the same file as before.
  1213.  
  1214.   Device independent operations for the Link Layer are kept in
  1215.   LINUX/net/core/dev_mcast.c.
  1216.  
  1217.   Two important functions are still missing: the processing of input and
  1218.   output multicast datagrams. As any other datagrams, incoming datagrams
  1219.   are passed from the device drivers to the ip_rcv() function
  1220.   (LINUX/net/ipv4/ip_input.c).  In this function is where the perfect
  1221.   filtering is applied to multicast packets that crossed the devices
  1222.   layer (recall that lower layers only perform best-effort filtering and
  1223.   is IP who 100% knows whether we are interested in that multicast group
  1224.   or not). If the host is acting as a multicast router, this function
  1225.   decides too whether the datagram should be forwarded and calls
  1226.   ipmr_forward() appropriately. (ipmr_forward() is implemented in
  1227.   LINUX/net/ipv4/ipmr.c).
  1228.  
  1229.   Code in charge of out-putting packets is kept in
  1230.   LINUX/net/ipv4/ip_output.c.  Here is where the IP_MULTICAST_LOOP
  1231.   option takes effect, as it is checked to see whether to loop back the
  1232.   packets or not (function ip_queue_xmit()).  Also the TTL of the
  1233.   outgoing packet is selected based on whether it is a multicast or
  1234.   unicast one. In the former case, the argument passed to the
  1235.   IP_MULTICAST_TTL option is used (function (ip_build_xmit()).
  1236.  
  1237.   While working with mrouted (a program which gives the kernel
  1238.   information about how to route multicast datagrams), we detected that
  1239.   all multicast packets originated on the local network were properly
  1240.   routed..., except the ones from the Linux box that was acting as the
  1241.   multicast router!! ip_input.c was working OK, but it seemed
  1242.   ip_output.c wasn't.  Reading the source code for the output functions,
  1243.   we found that outgoing datagrams were not being passed to
  1244.   ipmr_forward(), the function that had to decide whether they should be
  1245.   routed or not. The packets were outputed to the local network but, as
  1246.   network cards are usually unable to read their own transmissions,
  1247.   those datagrams were never routed.  We added the necessary code to the
  1248.   ip_build_xmit() function and everything was OK again.  (Having the
  1249.   sources for your kernel is not a luxury or pedantry; it's a need!)
  1250.  
  1251.   ipmr_forward() has been mentioned a couple of times. It is an
  1252.   important function as it solves one important misunderstanding that
  1253.   appears to be widely expanded. When routing multicast traffic, it is
  1254.   not mrouted who makes the copies and sends them to the proper
  1255.   recipients. mrouted receives all multicast traffic and, based on that
  1256.   information, computes the multicast routing tables and tells the
  1257.   kernel how to route: "datagrams for this group coming from that
  1258.   interface should be forwarded to those interfaces". This information
  1259.   is passed to the kernel by calls to setsockopt() on a raw socket
  1260.   opened by the mrouted daemon (the protocol specified when the raw
  1261.   socket was created must be IPPROTO_IGMP). This options are handled in
  1262.   the ip_mroute_setsockopt() function from LINUX/net/ipv4/ipmr.c. The
  1263.   first option (would be better to call them commands rather than
  1264.   options) issued on that socket must be MRT_INIT.  All other commands
  1265.   are ignored (returning -EACCES) if MRT_INIT is not issued first. Only
  1266.   one instance of mrouted can be running at the same time in the same
  1267.   host.  To keep track of this, when the first MRT_INIT is received, an
  1268.   important variable, struct sock* mroute_socket, is pointed to the
  1269.   socket MRT_INIT was received on. If mroute_socket is not null when
  1270.   attending an MRT_INIT this means another mrouted is already running
  1271.   and -EADDRINUSE is returned. All resting commands (MRT_DONE,
  1272.   MRT_ADD_VIF, MRT_DEL_VIF, MRT_ADD_MFC, MRT_DEL_MFC and MRT_ASSERT)
  1273.   return -EACCES if they come from a socket different than
  1274.   mroute_socket.
  1275.  
  1276.   As routed multicast datagrams can be received/sent across either
  1277.   physical interfaces or tunnels, a common abstraction for both was
  1278.   devised: VIFs, Virtual InterFaces. mrouted passes vif structures to
  1279.   the kernel, indicating physical or tunnel interfaces to add to its
  1280.   routing tables, and multicast forwarding entries saying where to
  1281.   forward datagrams.
  1282.  
  1283.   VIFs are added with MRT_ADD_VIF and deleted with MRT_DEL_VIF. Both
  1284.   pass a struct vifctl to the kernel (defined in
  1285.   /usr/include/linux/mroute.h) with the following information:
  1286.  
  1287.   ______________________________________________________________________
  1288.   struct vifctl {
  1289.           vifi_t  vifc_vifi;              /* Index of VIF */
  1290.           unsigned char vifc_flags;       /* VIFF_ flags */
  1291.           unsigned char vifc_threshold;   /* ttl limit */
  1292.           unsigned int vifc_rate_limit;   /* Rate limiter values (NI) */
  1293.           struct in_addr vifc_lcl_addr;   /* Our address */
  1294.           struct in_addr vifc_rmt_addr;   /* IPIP tunnel addr */
  1295.   };
  1296.   ______________________________________________________________________
  1297.  
  1298.  
  1299.  
  1300.   With this information a vif_device structure is built:
  1301.  
  1302.   ______________________________________________________________________
  1303.   struct vif_device
  1304.   {
  1305.           struct device   *dev;                   /* Device we are using */
  1306.           struct route    *rt_cache;              /* Tunnel route cache */
  1307.           unsigned long   bytes_in,bytes_out;
  1308.           unsigned long   pkt_in,pkt_out;         /* Statistics */
  1309.           unsigned long   rate_limit;             /* Traffic shaping (NI) */
  1310.           unsigned char   threshold;              /* TTL threshold */
  1311.           unsigned short  flags;                  /* Control flags */
  1312.           unsigned long   local,remote;           /* Addresses(remote for tunnels)*/
  1313.   };
  1314.   ______________________________________________________________________
  1315.  
  1316.  
  1317.  
  1318.   Note the dev entry in the structure. The device structure is defined
  1319.   in /usr/include/linux/netdevice.h file. It is a big structure, but the
  1320.   field that interests us is:
  1321.   ______________________________________________________________________
  1322.     struct ip_mc_list*    ip_mc_list;   /* IP multicast filter chain    */
  1323.   ______________________________________________________________________
  1324.  
  1325.  
  1326.  
  1327.   The ip_mc_list structure -defined in /usr/include/linux/igmp.h- is as
  1328.   follows:
  1329.  
  1330.   ______________________________________________________________________
  1331.   struct ip_mc_list
  1332.   {
  1333.           struct device *interface;
  1334.           unsigned long multiaddr;
  1335.           struct ip_mc_list *next;
  1336.           struct timer_list timer;
  1337.           short tm_running;
  1338.           short reporter;
  1339.           int users;
  1340.   };
  1341.   ______________________________________________________________________
  1342.  
  1343.  
  1344.  
  1345.   So, the ip_mc_list member from the dev structure is a pointer to a
  1346.   linked list of ip_mc_list structures, each containing an entry for
  1347.   each multicast group the network interface is a member of. Here again
  1348.   we see membership is associated to interfaces.
  1349.   LINUX/net/ipv4/ip_input.c traverses this linked list to decide whether
  1350.   the received datagram is destined to any group the interface that
  1351.   received the datagram belongs to:
  1352.  
  1353.   ______________________________________________________________________
  1354.   #ifdef CONFIG_IP_MULTICAST
  1355.                   if(!(dev->flags&IFF_ALLMULTI) && brd==IS_MULTICAST
  1356.                      && iph->daddr!=IGMP_ALL_HOSTS
  1357.                      && !(dev->flags&IFF_LOOPBACK))
  1358.                   {
  1359.                           /*
  1360.                            *      Check it is for one of our groups
  1361.                            */
  1362.                           struct ip_mc_list *ip_mc=dev->ip_mc_list;
  1363.                           do
  1364.                           {
  1365.                                   if(ip_mc==NULL)
  1366.                                   {
  1367.                                           kfree_skb(skb, FREE_WRITE);
  1368.                                           return 0;
  1369.                                   }
  1370.                                   if(ip_mc->multiaddr==iph->daddr)
  1371.                                           break;
  1372.                                   ip_mc=ip_mc->next;
  1373.                           }
  1374.                           while(1);
  1375.                   }
  1376.   #endif
  1377.   ______________________________________________________________________
  1378.  
  1379.  
  1380.  
  1381.   The users field in the ip_mc_list structure is used to implement what
  1382.   was said in section ``IGMP version 1'': if a process joins a group and
  1383.   the interface is already a member of that group (ie, another process
  1384.   joined that same group in that same interface before) only the count
  1385.   of members (users) is incremented. No IGMP messages are sent, as you
  1386.   can see in the following code (taken from ip_mc_inc_group(), called by
  1387.   ip_mc_join_group(), both in LINUX/net/ipv4/igmp.c):
  1388.  
  1389.   ______________________________________________________________________
  1390.           for(i=dev->ip_mc_list;i!=NULL;i=i->next)
  1391.           {
  1392.                   if(i->multiaddr==addr)
  1393.                   {
  1394.                           i->users++;
  1395.                           return;
  1396.                   }
  1397.           }
  1398.   ______________________________________________________________________
  1399.  
  1400.  
  1401.  
  1402.   When dropping memberships, the counter is decremented and additional
  1403.   operations are performed only when the count reaches 0
  1404.   (ip_mc_dec_group()).
  1405.  
  1406.   MRT_ADD_MFC and MRT_DEL_MFC set or delete forwarding entries in the
  1407.   multicast routing tables. Both pass a struct mfcctl to the kernel
  1408.   (also defined in /usr/include/linux/mroute.h) with this information:
  1409.  
  1410.   ______________________________________________________________________
  1411.   struct mfcctl
  1412.   {
  1413.           struct in_addr mfcc_origin;             /* Origin of mcast      */
  1414.           struct in_addr mfcc_mcastgrp;           /* Group in question    */
  1415.           vifi_t  mfcc_parent;                    /* Where it arrived     */
  1416.           unsigned char mfcc_ttls[MAXVIFS];       /* Where it is going    */
  1417.   };
  1418.   ______________________________________________________________________
  1419.  
  1420.  
  1421.  
  1422.   With all this information in hand, ipmr_forward() "walks" across the
  1423.   VIFs, and if a matching is found it duplicates the datagram and calls
  1424.   ipmr_queue_xmit() which, in turn, uses the output device specified by
  1425.   the routing table and the proper destination address if the packet is
  1426.   to be sent across a tunnel (ie, the unicast destination address of the
  1427.   other end of the tunnel).
  1428.  
  1429.   Function ip_rt_event() (not directly related to output, but which is
  1430.   in ip_output.c too) receives events related to a network device, like
  1431.   the device going up. This function assures that then the device joins
  1432.   the ALL-HOSTS multicast group.
  1433.  
  1434.   IGMP functions are implemented in LINUX/net/ipv4/igmp.c. Important
  1435.   information for that functions appears in /usr/include/linux/igmp.h
  1436.   and /usr/include/linux/mroute.h. The IGMP entry in the /proc/net
  1437.   directory is created with ip_init() in LINUX/net/ipv4/ip_output.c.
  1438.  
  1439.  
  1440.  
  1441.  
  1442.   8.  Routing Policies and Forwarding Techniques.
  1443.  
  1444.   One trivial algorithm to make worldwide multicast traffic available
  1445.   everywhere could be to send it... everywhere, despite someone wants it
  1446.   or not. As this does not seem quite optimized, several routing
  1447.   algorithms and forwarding techniques have been implemented.
  1448.  
  1449.   DVMRP (Distance Vector Multicast Routing Protocol) is, perhaps, the
  1450.   one most multicast routers use now. It is a dense mode routing
  1451.   protocol, that is, it performs well in environments with high
  1452.   bandwidth and densely distributed members. However, in sparse mode
  1453.   scenarios, it suffers from scalability problems.
  1454.  
  1455.   Together with DVMRP we can find other dense mode routing protocols,
  1456.   such as MOSPF (Multicast Extensions to OSPF -Open Shortest Path
  1457.   First-) and PIM-DM (Protocol-Independent Multicast Dense Mode).
  1458.  
  1459.   To perform routing in sparse mode environments, we have PIM-SM
  1460.   (Protocol Independent Multicast Sparse Mode) and CBT (Core Based
  1461.   Trees).
  1462.  
  1463.   OSPF version 2 is explained in RFC 1583, and MOSPF in RFC 1584.  PIM-
  1464.   SM and CBT specifications can be found in RFC 2117 and 2201,
  1465.   respectively.
  1466.  
  1467.   All this routing protocols use some type of multicast forwarding, such
  1468.   as flooding, Reverse Path Broadcasting (RPB), Truncated Reverse Path
  1469.   Broadcasting (TRPB), Reverse Path Multicasting (RPM) or Shared Trees.
  1470.  
  1471.   It would be too long to explain them here and, as short descriptions
  1472.   for them are publicly available, I'll just recommend reading the
  1473.   draft-ietf-mboned-in.txt text. You can find it in the same places RFCs
  1474.   are available, and it explains in some detail all the above techniques
  1475.   and policies.
  1476.  
  1477.  
  1478.  
  1479.   9.  Multicast Transport Protocols.
  1480.  
  1481.   So far we have been talking about multicast transmissions using UDP.
  1482.   This is the usual practice, as it is impossible to do it with TCP.
  1483.   However, intense research is taking place since a couple of years in
  1484.   order to develop some new multicast transport protocols.
  1485.  
  1486.   Several of these protocols have been implemented and are being tested.
  1487.   A good lesson from them is that it seems no multicast transport
  1488.   protocol is general and good enough for all types of multicast
  1489.   applications.
  1490.  
  1491.   If transport protocols are complex and difficult to tune, imagine
  1492.   dealing with delays (in multimedia conferences), data loss, ordering,
  1493.   retransmissions, flow and congestion control, group management, etc,
  1494.   when the receiver is not one, but perhaps hundreds or thousands of
  1495.   sparse hosts.  Here scalability is an issue, and new techniches are
  1496.   implemented, such as not giving acknowledges for every packet received
  1497.   but, instead, send negative acknowledges (NACKs) for data not
  1498.   received. RFC 1458 gives the proposed requirements for multicast
  1499.   protocols.
  1500.  
  1501.   Giving descriptions of those multicast protocols is out of the scope
  1502.   of this section. Instead, I'll give you the names of some of them and
  1503.   point you to some sources of information: Real-Time Transport Protocol
  1504.   (RTP) is concerned with multi-partite multimedia conferences, Scalable
  1505.   Reliable Multicast (SRM) is used by the wb (the distributed White-
  1506.   Board tool, see section ``Multicast applications''), Uniform Reliable
  1507.   Group Communication Protocol (URGC) enforces reliable and ordered
  1508.   transactions based in a centralized control, Muse was developed as an
  1509.   application specific protocol: to multicast news articles over the
  1510.   MBone, the Multicast File Transfer Protocol (MFTP) is quite
  1511.   descriptive by itself and people "join" to file transmission
  1512.   (previously announced) much in the same way they would join a
  1513.   conference, Log-Based Receiver-reliable Multicast (LBRM) is a curious
  1514.   protocol that keeps track of all packets sent in a logging server that
  1515.   tells the sender whether it has to retransmit the data or can drop it
  1516.   safely as all receivers got it. One protocol with a funny name
  1517.   -especially for a multicast protocol- is STORM (STructure-Oriented
  1518.   Resilient Multicast). Lots and lots of multicast protocols can be
  1519.   found searching the Web, along with some interesting papers proposing
  1520.   new activities for multicast (for instance, www page distribution
  1521.   using multicast).
  1522.  
  1523.   A good page providing comparisons between reliable multicast protocols
  1524.   is
  1525.  
  1526.   <http://www.tascnets.com/mist/doc/mcpCompare.html>.
  1527.  
  1528.   A very good and up-to-date site, with lots of interesting links
  1529.   (Internet drafts, RFCs, papers, links to other sites) is:
  1530.  
  1531.   <http://research.ivv.nasa.gov/RMP/links.html>.
  1532.  
  1533.   <http://hill.lut.ac.uk/DS-Archive/MTP.html> is also a good source of
  1534.   information on the subject.
  1535.  
  1536.   Katia Obraczka's "Multicast Transport Protocols: A Survey and
  1537.   Taxonomy" article gives short descriptions for each protocol and tries
  1538.   to classify them according to different features. You can read it in
  1539.   the IEEE Communications magazine, January 1998, vol. 36, No. 1.
  1540.  
  1541.  
  1542.  
  1543.   10.  References.
  1544.  
  1545.   10.1.  RFCs.
  1546.  
  1547.  
  1548.   ╖  RFC 1112 "Host Extensions for IP Multicasting". Steve Deering.
  1549.      August 1989.
  1550.  
  1551.   ╖  RFC 2236 "Internet Group Management Protocol, version 2". W.
  1552.      Fenner.  November 1997.
  1553.  
  1554.   ╖  RFC 1458 "Requirements for Multicast Protocols". Braudes, R and
  1555.      Zabele, S.  May 1993.
  1556.  
  1557.   ╖  RFC 1469 "IP Multicast over Token-Ring Local Area Networks". T.
  1558.      Pusateri.  June 1993.
  1559.  
  1560.   ╖  RFC 1390 "Transmission of IP and ARP over FDDI Networks". D. Katz.
  1561.      January 1993.
  1562.  
  1563.   ╖  RFC 1583 "OSPF Version 2". John Moy. March 1994.
  1564.  
  1565.   ╖  RFC 1584 "Multicast Extensions to OSPF". John Moy. March 1994.
  1566.  
  1567.   ╖  RFC 1585 "MOSPF: Analysis and Experience". John Moy. March 1994.
  1568.  
  1569.   ╖  RFC 1812 "Requirements for IP version 4 Routers". Fred Baker,
  1570.      Editor. June 1995
  1571.  
  1572.   ╖  RFC 2117 "Protocol Independent Multicast-Sparse Mode (PIM-SM):
  1573.      Protocol Specification". D. Estrin, D. Farinacci, A. Helmy, D.
  1574.      Thaler; S. Deering, M. Handley, V. Jacobson, C. Liu, P. Sharma, and
  1575.      L. Wei. July 1997.
  1576.  
  1577.   ╖  RFC 2189 "Core Based Trees (CBT version 2) Multicast Routing".  A.
  1578.      Ballardie. September 1997.
  1579.  
  1580.   ╖  RFC 2201 "Core Based Trees (CBT) Multicast Routing Architecture".
  1581.      A. Ballardie. September 1997.
  1582.  
  1583.  
  1584.  
  1585.   10.2.  Internet Drafts.
  1586.  
  1587.  
  1588.   ╖  "Introduction to IP Multicast Routing". draft-ietf-mboned-intro-
  1589.      multicast- 03.txt. T. Maufer, C. Semeria. July 1997.
  1590.  
  1591.   ╖  "Administratively Scoped IP Multicast". draft-ietf-mboned-admin-ip-
  1592.      space-03.txt. D. Meyer. June 10, 1997.
  1593.  
  1594.  
  1595.  
  1596.   10.3.  Web pages.
  1597.  
  1598.  
  1599.   ╖  Linux Multicast Homepage.
  1600.      <http://www.cs.virginia.edu/~mke2e/multicast.html>
  1601.  
  1602.   ╖  Linux Multicast FAQ.  <http://andrew.triumf.ca/pub/linux/multicast-
  1603.      FAQ>
  1604.  
  1605.   ╖  Multicast and MBONE on Linux.
  1606.      <http://www.teksouth.com/linux/multicast/>
  1607.  
  1608.   ╖  Christian Daudt's MBONE-Linux Page.
  1609.      <http://www.microplex.com/~csd/linux/mbone.html>
  1610.  
  1611.   ╖  Reliable Multicast Links
  1612.      <http://research.ivv.nasa.gov/RMP/links.html>
  1613.  
  1614.   ╖  Multicast Transport Protocols  <http://hill.lut.ac.uk/DS-
  1615.      Archive/MTP.html>
  1616.  
  1617.  
  1618.  
  1619.  
  1620.   10.4.  Books.
  1621.  
  1622.  
  1623.   ╖  "TCP/IP Illustrated: Volume 1 The Protocols". Stevens, W. Richard.
  1624.      Addison Wesley Publishing Company, Reading MA, 1994
  1625.  
  1626.   ╖  "TCP/IP Illustrated: Volume 2, The Implementation". Wright, Gary
  1627.      and W. Richard Stevens. Addison Wesley Publishing Company, Reading
  1628.      MA, 1995
  1629.  
  1630.   ╖  "UNIX Network Programming Volume 1. Networking APIs: Sockets and
  1631.      XTI". Stevens, W. Richard. Second Edition, Prentice Hall, Inc.
  1632.      1998.
  1633.  
  1634.   ╖  "Internetworking with TCP/IP Volume 1 Principles, Protocols, and
  1635.      Architecture". Comer, Douglas E. Second Edition, Prentice Hall,
  1636.      Inc.  Englewood Cliffs, New Jersey, 1991
  1637.  
  1638.  
  1639.  
  1640.   11.  Copyright and Disclaimer.
  1641.  
  1642.   Copyright 1998 Juan-Mariano de Goyeneche.
  1643.  
  1644.   This HOWTO is free documentation; you can redistribute it and/or
  1645.   modify it under the terms of the GNU General Public License as
  1646.   published by the Free Software Foundation; either version 2 of the
  1647.   License, or (at your option) any later version.
  1648.  
  1649.   This document is distributed in the hope that it will be useful, but
  1650.   without any warranty; without even the implied warranty of
  1651.   merchantability or fitness for a particular purpose.  See the GNU
  1652.   General Public License for more details.
  1653.  
  1654.   You can obtain a copy of the GNU General Public License by writing to
  1655.   the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
  1656.   02111-1307, USA.
  1657.  
  1658.   If you publish this document on a CD-ROM or in hardcopy form, a
  1659.   complimentary copy would be appreciated; mail me for my postal
  1660.   address. Also consider making a donation to the Linux Documentation
  1661.   Project or the Free Software Foundation to help support free
  1662.   documentation for GNU/Linux. Contact the Linux HOWTO coordinator, Tim
  1663.   Bynum linux-howto@sunsite.unc.edu, for more information.
  1664.  
  1665.  
  1666.  
  1667.   12.  Acknowledgements.
  1668.  
  1669.   This is the best opportunity I've ever had to thank so many people I
  1670.   feel grateful to. So, I'm afraid this is going to be a large
  1671.   section... It is, in any case, the most important one of this paper
  1672.   (for me, at least...).
  1673.  
  1674.   First, I want to thank Elena Apolinario Fernßndez de Sousa (yes, Elena
  1675.   is the first name; the REST is THE surname ;-) ). I tried to reflect
  1676.   in this Howto all the knowledge I collected while working with her in
  1677.   connecting our Department to the MBone and debugging problems with
  1678.   locally generated CSCW software across multicast tunnels. She was of
  1679.   invaluable help in finding and correcting network problems,
  1680.   discovering and fixing kernel bugs that puzzled us for days, ... and
  1681.   keeping the sense of humor alive while problems appeared and appeared,
  1682.   but solutions didn't. She also read and corrected the drafts for this
  1683.   document and provided important ideas and suggestions. If this howto
  1684.   is here and is usefull for somebody, it will be, in many aspects,
  1685.   thanks to her. Thanks, Elena!
  1686.  
  1687.   There is something I have been lucky enough to find all my (still-not-
  1688.   too-long) live, but, despite being repetitive, has never stopped
  1689.   amazing me.  I'm talking about people that altruistically employ part
  1690.   of their time and/or resources to help other people learn new things;
  1691.   and, what is better, they enjoy doing it. This is not only (but also,
  1692.   too) explain things they already know, but lend their books, provide
  1693.   access to their sources and facilitate you the way to learn all things
  1694.   they know; sometimes, even more... I know quite a few of that people,
  1695.   and I'd like to thank them for all their help.
  1696.  
  1697.   Pablo Basterrechea was my "first source of documentation" while I was
  1698.   in my pre-Internet stage. I learned assembly and advanced structured
  1699.   programming entirely from his books (well, the latter also from his
  1700.   programs...).  Thanks for all, Pablo.
  1701.  
  1702.   In my first course at the University that "primary source of
  1703.   documentation" moved to Pepe Ma±as. He was teaching then Computer
  1704.   Programming there, and soon I became addict to his bookshelf. He lent
  1705.   me his books lots of times without asking for a minimum sign that
  1706.   could assure that I was going to return them back to him, not even my
  1707.   name! My first approach to TCP/IP was also by his hand: he lent me
  1708.   Comer's "Internetworking with TCP/IP, Volume 1" for the whole summer.
  1709.   He did not even know my name by then, but he lent me the book...  That
  1710.   book influenced me a lot, and TCP/IP has become one of my primary
  1711.   fields of interest since that summer.
  1712.  
  1713.   If there are two persons I must thank most, these are (in alphabetic
  1714.   order ;-) ), JosΘ Manuel and Paco Moya. Nobody I asked more things
  1715.   more times (C, C++, Linux, security, Web, OSs, signals & systems,
  1716.   electronics, ... anything!) and, despite my persistence, I always got
  1717.   throughly and friendly responses and help. If I'm using GNU/Linux now,
  1718.   this is, again, thanks to them. I feel particularly lucky with friends
  1719.   like them. THANKS.
  1720.  
  1721.   I±igo Mascaraque also helped (from him I got my first System
  1722.   Administration book) and encouraged me in my beginnings, but never
  1723.   stopped reminding me that, although this was a fascinating world and
  1724.   an important part of my career, I should not forget the other, less-
  1725.   interesting, parts. (I don't forget, I$!).
  1726.  
  1727.   As I am on the topic, I'd like to thank my parents, too. They always
  1728.   tried to make the best opportunities available for me. Many thanks for
  1729.   all.
  1730.  
  1731.   I also feel grateful to Joaquφn Seoane, the first who trusted me
  1732.   enough to give me a root password in the time I was learning system
  1733.   administration by myself, and Santiago Pav≤n, the one who gave me my
  1734.   first opportunity here at DIT.
  1735.  
  1736.   W. Richard Stevens' books have been a real revelation for me (it's a
  1737.   pity they are so expensive...). If he ever reads this paper, I'd like
  1738.   to thank him for them, and encourage him to keep on writing. Anything
  1739.   that comes out of his hands will -undoubtedly- be good for all of us.
  1740.  
  1741.   Finally I'd like to thank Richard Stallman, Linus Torvalds, Alan Cox
  1742.   and all contributors to the Linux kernel and the free software in
  1743.   general, for giving us such a great OS.
  1744.  
  1745.   I'm sure I'm forgetting someone here... Sorry. I'm certain they know
  1746.   I'm grateful to them too, so if they tell me, everybody will know
  1747.   it... :-)
  1748.  
  1749.  
  1750.  
  1751.  
  1752.  
  1753.  
  1754.  
  1755.  
  1756.  
  1757.  
  1758.  
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.