Summary of the invention
The objective of the invention is to add agreement, a kind of method of smooth switching IPTV band is provided, experience for the time-delay of an even switching channels of user by optimizing multicast.
For reaching above-mentioned purpose, the present invention adopts following technical scheme,
A kind of method of smooth switching IPTV band, port status in CAM (Content-Addressable Memory) table of switch is divided into first state (representing with Enable) and second state (representing with Wait), under the Enable state, switch is normally transmitted the data flow of this purpose MAC (Media Access Control, medium access control) address; Under the Wait state, receive only the data of this target MAC (Media Access Control) address and do not transmit the data of MAC Address.
When switch passes through IGMP (Internet Group Multicast Protocol at certain port, igmpinternet) intercepts (Snooping) after the requirement of adding group, add the MAC Address of this multicast group correspondence and go into content-addressable memory, the port in this content-addressable memory is placed the Wait state, start timer.
After timer is covered,, then this port status is placed the Enable state if do not receive the leave group message bag.
Adopt this bright technical scheme by setting the clocking value of timer, experience for the good time-delay of an even switching channels of user.
Embodiment
A kind of method of smooth switching IPTV band, the multicast information that in the IPTV multicasting technology, has adopted IGMP to eavesdrop to suppress on LAN switch diffusion.By the IGMP session between LAN switch eavesdropping main frame and the router.When switch heard that the IGMP of the particular multicast group of main frame reports, it just added the list item of the MAC Address of multicast correspondence in content-addressable memory, and the port numbers of this main frame is increased to this list item.When switch was heard the igmp leave group message of main frame, it just eliminated the port numbers of this main frame from the content-addressable memory item.
Port status in the content-addressable memory of switch is divided into first state (representing with Enable) and second state (representing with Wait), and under the Enable state, switch is normally transmitted the data flow of this target MAC (Media Access Control) address; Under the Wait state, receive only the data of this target MAC (Media Access Control) address and do not transmit the data of MAC Address.When switch certain port by IGMP snooping after the requirement of adding group, this port is placed the Wait state, start timer.If the program source of IPTV is in same metropolitan area network, the time value of timer is generally 0.5~2s, gets 1.5s in the present embodiment.After timer is covered,, then this port status is placed the Enable state, be the data of this port forwarding multicasting group if do not receive the leave group message bag.
For example, as shown in Figure 1, be provided with set-top box 1, set-top box 2, set-top box 3 and be connected on port 2, port 3 and the port 4 of LAN switch.The port numbers of LAN switch CPU is 0, and for linking to each other, be located in the IPTV private network by program source by router and IPTV private network for the port one of LAN switch CPU.
Wish to add multicast group A when set-top box 1, unsolicited IGMP member relation of its multicast reports to this group, promptly sends to add (join) bag, has multicast MAC destination address in the report, is assumed to be 0x0100.5E01.0203.The item that does not have this multicast mac address on the initial content-addressable memory that is to say that the user below this switch does not have watching this channel.When the CPU of LAN switch receives the IGMP report of set-top box 1 multicast, set up the content-addressable memory item,
The result who forms this content-addressable memory item is that to make any destination address in back be that the multicast frame of 0x0100.5E01.0203 all will be suppressed on port 0, port one, the port 2, no longer to other ports diffusions of switch.As shown in Figure 2.
At this moment, the program of channel A needs the upstream router of router to send out request, and Media Stream just can send from upstream node, and this time is long.
And when the set-top box 2 of port 3 below the switch wants to add channel A, set-top box 2 also sends the Join bag, because had the content-addressable memory item of this group A on the switch, switch only need also add this content-addressable memory item to port 3 and just can directly flow to port 3 forwarding multicastings.At this moment, the list item of the port 3 in content-addressable memory can start a timer, is in the Wait state after timer is covered, and multicast packet is not transmitted to port 3.As shown in Figure 3.
After timer is covered, can be made as Enable to the port 3 in this content-addressable memory item, multicast packet is transmitted (as shown in Figure 4) to this port.If before timer is covered, receive the Leave message bag of port 3, then directly in the content-addressable memory item, delete port 3.