Dual purpose on-chip buffer memory for low latency switching
In one embodiment, an apparatus includes a buffer memory, at least one ingress port, at least one egress port, at least one processor, and logic integrated with and/or executable by the at least one processor, the logic being configured to communicate with a software-defined network (SDN) controller, store one or more look-up tables in a first portion of the buffer memory, receive a packet using an ingress port, and determine an egress port for the packet. In another embodiment, a method for switching packets in a SDN includes storing one or more took-up tables in a first portion of a buffer memory of a SDN-capable switching device, receiving a packet using an ingress port of the switching device, and determining an egress port for the packet.
1. An apparatus, comprising:
a buffer memory;
at least one ingress port;
at least one egress port;
at least one processor; and
logic integrated with and/or executable by the at least one processor; the logic being configured to:
communicate with a software-defined network (SDN) controller;
store one or more look-up tables in a first portion of the buffer memory;
receive a packet using an ingress port;
determine an egress port for the packet;
heuristically determine packet flows to create port-to-port mappings between the at least one ingress port and the at least one egress port;
store the port-to-port mappings in the one or more look-up tables;
set a timer upon creating one of the port-to-port mappings;
retire at least one of the port-to-port mappings upon expiration of the timer; and
relearn the at least one of the port-to-port mappings.
2. The apparatus as recited in claim 1 , wherein the logic configured to heuristically determine the packet flows to create the port-to-port mappings is further configured to:
receive a plurality of packets to switch over a predetermined period of time;
determine an ingress port associated with each of the plurality of packets;
determine an egress port associated with each of the plurality of packets; and
determine patterns associated with characteristics of one or more of the plurality of packets, each pattern comprising a consistent ingress port for each of the one or more of the plurality of packets and a consistent egress port for each of the one or more of the plurality of packets.
3. The apparatus as recited in claim 1 , wherein the logic is further configured to:
partition the buffer memory into at least two portions, the first portion of the at least two portions configured to store the one or more look-up tables, each look-up table corresponding to one egress port, and a second portion of the at least two portions configured to buffer egress packets in one or more egress queues, each egress queue corresponding to one egress port;
search a look-up table associated with the egress port for the packet to determine additional switching information for the packet; and
store the additional switching information to the packet and/or a header of the packet.
4. The apparatus as recited in claim 1 , wherein the logic is further configured to:
create a heuristics matrix based on switching a plurality of packets through the apparatus, the heuristics matrix being configured to determine which exception packets to pass through to an egress port and which to drop; and
handle exception packets using the heuristics matrix.
5. The apparatus as recited in claim 1 , wherein the logic is further configured to:
start an egress timer upon receipt of the packet;
process the packet in order to finish processing prior to the egress timer expiring;
determine a packet size from information in a header of the packet when packet size information is available in the header;
begin to route the packet via the egress port once the egress port is determined; and
send the packet to the egress port upon expiration of the egress timer without further processing.
6. A computer program product for switching packets in a software-defined network (SDN), the computer program product comprising a computer readable storage medium having program code embodied therewith, the program code being readable and/or executable by at least one processor to cause the at least one processor to:
store, by the at least one processor, one or more look-up tables in a first portion of a buffer memory of a SDN-capable switching device;
receive, by the at least one processor, a packet using an ingress port of the switching device;
determine, by the at least one processor, an egress port for the packet;
heuristically determine, by the at least one processor, packet flows to create port-to-port mappings between ingress ports and egress ports of the switching device;
store, by the at least one processor, the port-to-port mappings in the one or more look-up tables;
set, by the at least one processor, a timer upon creating one of the port-to-port mappings;
retire, by the at least one processor, at least one of the port-to-port mappings upon expiration of the timer; and
relearn, by the at least one processor, the at least one of the port-to-port mappings.
7. The computer program product as recited in claim 6 , wherein the program code configured to cause the at least one processor to heuristically determine the packet flows to create the port-to-port mappings is further readable and/or executable by the at least one processor to:
receive, by the at least one processor, a plurality of packets to switch over a predetermined period of time;
determine, by the at least one processor, an ingress port of each of the plurality of packets;
determine, by the at least one processor, an egress port for each of the plurality of packets; and
determine, by the at least one processor, patterns associated with characteristics of one or more of the plurality of packets, each pattern comprising a consistent ingress port for each of the one or more of the plurality of packets and a consistent egress port for each of the one or more of the plurality of packets.
8. The computer program product as recited in claim 6 , wherein the program code is further readable and/or executable by the at least one processor to:
partition, by the at least one processor, the buffer memory of a SDN-capable switching device into at least two portions, the first portion of the at least two portions configured to store the one or more look-up tables, each look-up table corresponding to one egress port, and a second portion of the at least two portions configured to buffer egress packets in one or more egress queues, each egress queue corresponding to one egress port;
search, by the at least one processor, a look-up table associated with the egress port for the packet to determine additional switching information for the packet; and
store, by the at least one processor, the additional switching information to the packet and/or a header of the packet.
9. The computer program product as recited in claim 6 , wherein the program code is further readable and/or executable by the at least one processor to:
create, by the at least one processor, a heuristics matrix based on switching a plurality of packets through the switching device, the heuristics matrix being configured to determine which exception packets to pass through to an egress port and which to drop; and
handle, by the at least one processor, exception packets using the heuristics matrix.
10. The computer program product as recited in claim 6 , wherein the program code is further readable and/or executable by the at least one processor to:
start, by the at least one processor, an egress timer upon receipt of the packet;
process, by the at least one processor, the packet in order to finish processing prior to the egress timer expiring;
determine, by the at least one processor, a packet size from information in a header of the packet when packet size information is available in the header;
begin to route, by the at least one processor, the packet via the egress port once the egress port is determined; and
send, by the at least one processor, the packet to the egress port upon expiration of the egress timer without further processing.
11. A method for switching packets in a software-defined network (SDN), the method comprising:
storing one or more look-up tables in a first portion of a buffer memory of a SDN-capable switching device;
receiving a packet using an ingress port of the switching device;
determining an egress port for the packet;
heuristically determining packet flows to create port-to-port mappings between ingress ports and egress ports of the switching device;
storing the port-to-port mappings in the one or more look-up tables;
setting a timer upon creating one of the port-to-port mappings;
retiring at least one of the port-to-port mappings upon expiration of the timer; and
relearning the at least one of the port-to-port mappings.
12. The method as recited in claim 11 , wherein the heuristically determining the packet flows to create the port-to-port mappings comprises:
receiving a plurality of packets to switch over a predetermined period of time;
determining an ingress port of each of the plurality of packets;
determining an egress port for each of the plurality of packets; and
determining patterns associated with characteristics of one or more of the plurality of packets, each pattern comprising a consistent ingress port for each of the one or more of the plurality of packets and a consistent egress port for each of the one or more of the plurality of packets.
13. The method as recited in claim 11 , further comprising:
partitioning the buffer memory of the SDN-capable switching device into at least two portions, the first portion of the at least two portions being configured to store the one or more look-up tables, each look-up table corresponding to one egress port, and a second portion of the at least two portions being configured to buffer egress packets in one or more egress queues, each egress queue corresponding to one egress port;
searching a look-up table associated with the egress port for the packet to determine additional switching information for the packet; and
storing the additional switching information to the packet and/or a header of the packet.
14. The method as recited in claim 11 , further comprising:
creating a heuristics matrix based on switching a plurality of packets through the switching device, the heuristics matrix being configured to determine which exception packets to pass through to an egress port and which to drop;
handling exception packets using the heuristics matrix;
determining a packet size from information in a header of the packet; and
beginning to route the packet via the egress port once the egress port is determined.