摘要 |
Provided in an embodiment of the present invention are a method and apparatus for allocating internet protocol (IP) addresses. The method comprises: determining, according to multicast application information, multiple equivalent sets of multiple exchangers; determining, according to the multiple equivalent sets, multiple aggregatable sets, wherein all multicast groups in the aggregatable set can be aggregated into a forwarding table entry; allocating an IP address to each multicast group in the multiple aggregatable sets, wherein the IP address allocated to each multicast group in a kth aggregatable set of the multiple aggregatable sets has a same minimum prefix length, and k is an integer not less than 1. Thus, multicast groups in each aggregatable set can be compressed into a forwarding table entry, thereby increasing multicast extensibility. |