3. Multicast Reception State Maintained by Systems (Stato di ricezione multicast mantenuto dai sistemi)
3. Multicast Reception State Maintained by Systems (Stato di ricezione multicast mantenuto dai sistemi)
3.1. Socket State (Stato del socket)
For each socket on which IPMulticastListen has been invoked, the system records the desired multicast reception state for that socket. That state conceptually consists of a set of records of the form:
Per ogni socket su cui è stato invocato IPMulticastListen, il sistema registra lo stato di ricezione multicast desiderato per quel socket. Tale stato consiste concettualmente in un insieme di record della forma:
(interface, multicast-address, filter-mode, source-list)
The socket state evolves in response to each invocation of IPMulticastListen on the socket, as follows:
Lo stato del socket evolve in risposta a ogni invocazione di IPMulticastListen sul socket, come segue:
-
If the requested filter mode is INCLUDE and the requested source list is empty, then the entry corresponding to the requested interface and multicast address is deleted if present. If no such entry is present, the request is ignored.
-
Se la modalità filtro richiesta è INCLUDE e l'elenco di sorgenti richiesto è vuoto, la voce corrispondente all'interfaccia e all'indirizzo multicast richiesti viene eliminata se presente. Se non è presente tale voce, la richiesta viene ignorata.
-
If the requested filter mode is EXCLUDE or the requested source list is non-empty, then the entry corresponding to the requested interface and multicast address, if present, is changed to contain the requested filter mode and source list. If no such entry is present, a new entry is created, using the parameters specified in the request.
-
Se la modalità filtro richiesta è EXCLUDE o l'elenco di sorgenti richiesto non è vuoto, la voce corrispondente all'interfaccia e all'indirizzo multicast richiesti, se presente, viene modificata per contenere la modalità filtro e l'elenco di sorgenti richiesti. Se non è presente tale voce, viene creata una nuova voce, utilizzando i parametri specificati nella richiesta.
3.2. Interface State (Stato dell'interfaccia)
In addition to the per-socket multicast reception state, a system must also maintain or compute multicast reception state for each of its interfaces. That state conceptually consists of a set of records of the form:
Oltre allo stato di ricezione multicast per socket, un sistema deve anche mantenere o calcolare lo stato di ricezione multicast per ciascuna delle sue interfacce. Tale stato consiste concettualmente in un insieme di record della forma:
(multicast-address, filter-mode, source-list)
At most one record per multicast-address exists for a given interface. This per-interface state is derived from the per-socket state, but may differ from the per-socket state when different sockets have differing filter modes and/or source lists for the same multicast address and interface. For example, suppose one application or process invokes the following operation on socket s1:
Esiste al massimo un record per indirizzo multicast per una data interfaccia. Questo stato per interfaccia è derivato dallo stato per socket, ma può differire dallo stato per socket quando socket diversi hanno modalità filtro e/o elenchi di sorgenti diversi per lo stesso indirizzo multicast e la stessa interfaccia. Ad esempio, supponiamo che un'applicazione o un processo invochi la seguente operazione sul socket s1:
IPMulticastListen ( s1, i, m, INCLUDE, {a, b, c} )
requesting reception on interface i of packets sent to multicast address m, only if they come from source a, b, or c. Suppose another application or process invokes the following operation on socket s2:
richiedendo la ricezione sull'interfaccia i dei pacchetti inviati all'indirizzo multicast m, solo se provengono dalla sorgente a, b o c. Supponiamo che un'altra applicazione o processo invochi la seguente operazione sul socket s2:
IPMulticastListen ( s2, i, m, INCLUDE, {b, c, d} )
requesting reception on the same interface i of packets sent to the same multicast address m, only if they come from sources b, c, or d. In order to satisfy the reception requirements of both sockets, it is necessary for interface i to receive packets sent to m from any one of the sources a, b, c, or d. Thus, in this example, the reception state of interface i for multicast address m has filter mode INCLUDE and source list {a, b, c, d}.
richiedendo la ricezione sulla stessa interfaccia i dei pacchetti inviati allo stesso indirizzo multicast m, solo se provengono dalle sorgenti b, c o d. Per soddisfare i requisiti di ricezione di entrambi i socket, è necessario che l'interfaccia i riceva i pacchetti inviati a m da una qualsiasi delle sorgenti a, b, c o d. Pertanto, in questo esempio, lo stato di ricezione dell'interfaccia i per l'indirizzo multicast m ha modalità filtro INCLUDE ed elenco sorgenti {a, b, c, d}.
After a multicast packet has been accepted from an interface by the IP layer, its subsequent delivery to the application or process listening on a particular socket depends on the multicast reception state of that socket [and possibly also on other conditions, such as what transport-layer port the socket is bound to]. So, in the above example, if a packet arrives on interface i, destined to multicast address m, with source address a, it will be delivered on socket s1 but not on socket s2. Note that IGMP Queries and Reports are not subject to source filtering and must always be processed by hosts and routers.
Dopo che un pacchetto multicast è stato accettato da un'interfaccia dal livello IP, la sua successiva consegna all'applicazione o al processo in ascolto su un particolare socket dipende dallo stato di ricezione multicast di quel socket [e possibilmente anche da altre condizioni, come a quale porta del livello di trasporto è associato il socket]. Quindi, nell'esempio sopra, se un pacchetto arriva sull'interfaccia i, destinato all'indirizzo multicast m, con indirizzo sorgente a, verrà consegnato sul socket s1 ma non sul socket s2. Si noti che le query e i report IGMP non sono soggetti al filtraggio della sorgente e devono essere sempre elaborati da host e router.
Filtering of packets based upon a socket's multicast reception state is a new feature of this service interface. The previous service interface [RFC1112] described no filtering based upon multicast join state; rather, a join on a socket simply caused the host to join a group on the given interface, and packets destined for that group could be delivered to all sockets whether they had joined or not.
Il filtraggio dei pacchetti in base allo stato di ricezione multicast di un socket è una nuova funzionalità di questa interfaccia di servizio. La precedente interfaccia di servizio [RFC1112] non descriveva alcun filtraggio basato sullo stato di unione multicast; piuttosto, un'unione su un socket faceva semplicemente sì che l'host si unisse a un gruppo sulla data interfaccia e i pacchetti destinati a quel gruppo potevano essere consegnati a tutti i socket, indipendentemente dal fatto che si fossero uniti o meno.
The general rules for deriving the per-interface state from the per-socket state are as follows: For each distinct (interface, multicast-address) pair that appears in any socket state, a per-interface record is created for that multicast address on that interface. Considering all socket records containing the same (interface, multicast-address) pair,
Le regole generali per derivare lo stato per interfaccia dallo stato per socket sono le seguenti: Per ogni coppia distinta (interfaccia, indirizzo multicast) che appare in qualsiasi stato del socket, viene creato un record per interfaccia per quell'indirizzo multicast su quell'interfaccia. Considerando tutti i record del socket contenenti la stessa coppia (interfaccia, indirizzo multicast),
-
if any such record has a filter mode of EXCLUDE, then the filter mode of the interface record is EXCLUDE, and the source list of the interface record is the intersection of the source lists of all socket records in EXCLUDE mode, minus those source addresses that appear in any socket record in INCLUDE mode. For example, if the socket records for multicast address m on interface i are:
-
se uno qualsiasi di tali record ha una modalità filtro EXCLUDE, allora la modalità filtro del record di interfaccia è EXCLUDE e l'elenco di sorgenti del record di interfaccia è l'intersezione degli elenchi di sorgenti di tutti i record del socket in modalità EXCLUDE, meno quegli indirizzi di sorgente che appaiono in qualsiasi record del socket in modalità INCLUDE. Ad esempio, se i record del socket per l'indirizzo multicast m sull'interfaccia i sono:
from socket s1: ( i, m, EXCLUDE, {a, b, c, d} )
from socket s2: ( i, m, EXCLUDE, {b, c, d, e} )
from socket s3: ( i, m, INCLUDE, {d, e, f} )
then the corresponding interface record on interface i is:
allora il record di interfaccia corrispondente sull'interfaccia i è:
( m, EXCLUDE, {b, c} )
If a fourth socket is added, such as:
Se viene aggiunto un quarto socket, come:
from socket s4: ( i, m, EXCLUDE, {} )
then the interface record becomes:
allora il record di interfaccia diventa:
( m, EXCLUDE, {} )
-
if all such records have a filter mode of INCLUDE, then the filter mode of the interface record is INCLUDE, and the source list of the interface record is the union of the source lists of all the socket records. For example, if the socket records for multicast address m on interface i are:
-
se tutti tali record hanno una modalità filtro INCLUDE, allora la modalità filtro del record di interfaccia è INCLUDE e l'elenco di sorgenti del record di interfaccia è l'unione degli elenchi di sorgenti di tutti i record del socket. Ad esempio, se i record del socket per l'indirizzo multicast m sull'interfaccia i sono:
from socket s1: ( i, m, INCLUDE, {a, b, c} )
from socket s2: ( i, m, INCLUDE, {b, c, d} )
from socket s3: ( i, m, INCLUDE, {e, f} )
then the corresponding interface record on interface i is:
allora il record di interfaccia corrispondente sull'interfaccia i è:
( m, INCLUDE, {a, b, c, d, e, f} )
An implementation MUST NOT use an EXCLUDE interface record to represent a group when all sockets for this group are in INCLUDE state. If system resource limits are reached when an interface state source list is calculated, an error MUST be returned to the application which requested the operation.
Un'implementazione NON DEVE utilizzare un record di interfaccia EXCLUDE per rappresentare un gruppo quando tutti i socket per questo gruppo sono nello stato INCLUDE. Se i limiti delle risorse di sistema vengono raggiunti quando viene calcolato un elenco di sorgenti dello stato dell'interfaccia, DEVE essere restituito un errore all'applicazione che ha richiesto l'operazione.
The above rules for deriving the interface state are (re-)evaluated whenever an IPMulticastListen invocation modifies the socket state by adding, deleting, or modifying a per-socket state record. Note that a change of socket state does not necessarily result in a change of interface state.
Le regole di cui sopra per derivare lo stato dell'interfaccia vengono (ri)valutate ogni volta che un'invocazione IPMulticastListen modifica lo stato del socket aggiungendo, eliminando o modificando un record di stato per socket. Si noti che una modifica dello stato del socket non comporta necessariamente una modifica dello stato dell'interfaccia.