Abstract:
The embodiments of disclosure disclose a method and device for forwarding data based on index allocation; the method includes that: the index allocation is performed, and a mapping relationship between a data forwarding priority and an index is established; according to the mapping relationship between the data forwarding priority and the index, high priority data of a data forwarding service is written into an address with a low index in a Ternary Content Addressable Memory (TCAM); and the data with the high priority of the data forwarding service is forwarded first.