NETWORK DEVICE AND METHOD FOR MIRRORING PACKETS

Information

  • Patent Application
  • 20070230455
  • Publication Number
    20070230455
  • Date Filed
    September 22, 2006
    17 years ago
  • Date Published
    October 04, 2007
    16 years ago
Abstract
A network device for forwarding packets includes a plurality of interfaces including at least a source interface and a destination interface and a bridge module. The bridge module includes a receiving sub-module, a parsing sub-module, and a sending sub-module. The receiving sub-module receives a packet via the source interface. The parsing sub-module includes a media access control (MAC) table for saving MAC addresses and identifiers of interfaces corresponding to the MAC addresses, parses the packet to retrieve a destination MAC address of the packet, and queries the MAC table to retrieve an identifier of the destination interface. The sending sub-module receives the packet and the identifier of the destination interface, and sends the packet to the destination interface. The parsing sub-module determines whether the network device has an interface mirroring function, and sends the packet to a mirror interface if the network device has the interface mirroring function.
Description

BRIEF DESCRIPTION OF THE DRAWINGS


FIG. 1 is a schematic diagram of a network communication device of an exemplary embodiment of the invention.



FIG. 2 shows a flowchart of a method for mirroring packets of another exemplary embodiment of the invention.


Claims
  • 1. A network device for forwarding packets, comprising: a plurality of interfaces, the plurality of interfaces comprising at least a source interface and a destination interface; anda bridge module, comprising:a receiving sub-module, for receiving a packet via the source interface;a parsing sub-module, comprising a media access control (MAC) table for saving MAC addresses and identifiers of interfaces corresponding to the MAC addresses, for parsing the packet received by the receiving sub-module to retrieve a destination MAC address of the packet and querying the MAC table to retrieve an identifier of the destination interface corresponding to the destination MAC address; anda sending sub-module connected to the parsing sub-module, for receiving the packet and the identifier of the destination interface and sending the packet to the destination interface;wherein the parsing sub-module is further used for determining whether the network device has an interface mirroring function and sending the packet to a mirror interface of the plurality of interfaces if the network device has the interface mirroring function.
  • 2. The network device of claim 1, wherein the sending sub-module is further used for sending an identifier of the source interface to the parsing sub-module.
  • 3. The network device of claim 2, wherein the parsing sub-module is further used for parsing the packet to retrieve a source MAC address of the packet and saving the source MAC address and the identifier of the source interface in the MAC table.
  • 4. The network device of claim 1, wherein the sending sub-module comprises a storage sub-module for saving status data of the interface mirroring function of the network device.
  • 5. The network device of claim 4, wherein the status of the interface mirroring function comprises an enable status and a disable status.
  • 6. The network device of claim 4, wherein the sending sub-module reads the status data from the storage sub-module, and finds whether the network device has the interface mirroring function.
  • 7. The network device of claim 1, wherein the sending sub-module is further used for finding whether the mirror interface is the same as the destination interface of the packet.
  • 8. The network device of claim 1, wherein the network device comprises an integrated access device.
  • 9. A method for mirroring packets for utilization in a network device, comprising: receiving a packet via a source interface, and sending the packet to a parsing sub-module, the parsing sub-module comprising a media access control (MAC) table for saving MAC addresses and identifiers of interfaces corresponding to the MAC addresses;parsing the packet to retrieve a destination MAC address of the packet;querying the MAC table to retrieve an identifier of a destination interface corresponding to the destination MAC address;sending the packet and the identifier of the destination interface to a sending sub-module;sending the packet to the destination interface;determining whether the network device has an interface mirroring function; andsending the packet to a mirror interface.
  • 10. The method for mirroring packets of claim 9, further comprising steps of: sending an identifier of the source interface to the parsing sub-module;parsing the packet to retrieve a source MAC address of the packet;determining whether there is a matching MAC address and a matching identifier in the MAC table with the source MAC address of the packet and the identifier of the source interface; andsaving the source MAC address and the identifier of the source interface in the MAC table if not.
  • 11. The method for mirroring packets of claim 9, wherein the step of determining whether the network device has the interface mirroring function comprises reading status data of the interface mirroring function from a storage sub-module to determine whether the network device has the interface mirroring function.
  • 12. The method for mirroring packets of claim 11, wherein status of the interface mirroring function comprises an enable status and a disable status.
  • 13. The method for mirroring packets of claim 9, further comprising a step of determining whether the mirror interface is the same as the destination interface of the packet.
  • 14. The method for mirroring packets of claim 13, further comprising a step of sending no packets to the mirror interface if the mirror interface is the same as the destination interface.
  • 15. The method for mirroring packets of claim 9, further comprising a step of determining whether an identifier of the destination interface is retrieved.
  • 16. The method for mirroring packets of claim 15, further comprising a step of sending the packet to the sending sub-module to send the packet to all interfaces of the network device.
  • 17. A method for mirroring transmissible packets for further use, comprising: maintaining a media access control (MAC) table comprising MAC addresses of interfaces where transmissible packets are able to transmit thereto and therefrom, and identifiers of said interfaces corresponding to said MAC addresses, respectively;receiving a packet via a source interface;parsing said received packet to retrieve a destination MAC address of a destination interface of said packet;querying said MAC table to retrieve an identifier of said destination interface corresponding to said parsed destination MAC address;sending said packet to all available interfaces including a mirror interface when said parsed destination MAC address of said packet is not in said MAC table; andsending said packet to said destination interface based on said retrieved corresponding identifier of said parsed destination MAC address and then sending said packet to said mirror interface when said parsed destination MAC address of said packet is in said MAC table.
  • 18. The method of claim 17, further comprising steps of: parsing said received packet to retrieve a source MAC address of said source interface after said packet is received via said source interface; andsaving said source MAC address and a corresponding identifier of said source interface in said MAC table when said source MAC address and said corresponding identifier are not available in said MAC table.
Priority Claims (1)
Number Date Country Kind
095111404 Mar 2006 TW national