Sie sind auf Seite 1von 15

Packet Classification

TELETELE 9751_ Assignment1


What is Packet Classification?
The Process of identifying packets for deciding how to forward packets to its
destination or choosing quality of service (QoS).

Switches do :
Examines state of the incoming packet.
Determines which output port to forward to.

Application of packet classification :


Switches/routers
Load balancers
Address translators
Monitoring
Metering
Firewalls
Packet Classification?
Key: Extracted from packet header

Database: contains rules to determine which output port


should be selected.

Entry: information which is read from database.


Rules for classification
Exact matching :All rules care about the same key digits, Key will match at most
one rule.
Lookup table
Linked lists
Hashing
CAM
Partial matching: Key may match multiple rules
Ternary CAM
TRIES

Arbitrary matching
Firewall
Single lookup table
layers are processed separately
Nave solution
Sparsely populated large RAM
Size becomes infeasible with larger keys
Consumes resources
Linked lists
Length of data is K+E+log2D bits

Disadvantage
Timing to query information is long :
average time D/2
worst case time: D
Advantage :
Efficient use of space
Easy to update the list and Easy to relocate item to head of list
Hashing
Mathematical mapping from large value to smaller one

Smaller value can then be used to directly index a table.

Multiple large values may map into same smaller value


causing collisions.
Collisions can be reduced by selecting the right mapping function

CRCs make decent hashing functions for Ethernet switches


Content Addressable memory - CAM
Words store labels, include comparison logic, and may store data
Key is compared to all words in parallel, selecting matching word

Matching process:
1. Key is distributed to all words simultaneously.
2. Comparison operations are done in parallel.
3. Words with matching labels generate match signal

PROS and CONS


High speed
Low storage capacity/density
High power consumption & consequently power supply/RF noise
Niche memory => not improved through competitive pressures
Hybrid Classifiers
It uses fast selective classifier (like a cache) first and if that fails, revert to
another slower but comprehensive classifier.

Examples :
Hash then CAM
CAM then trie
Partial Matching
Can use exact matching techniques but at the cost of slower performance

Types:
Ternary CAM
TRIES
Partial Matching - Ternary CAM
A new state was introduced, dont care bits generally specified as a mask so
ternary comparison: 0, 1, X (Dont care = 0 or 1)

Word mask: word-specific, stored with label


Key mask: apply to all words, reiterate search with shrinking prefix

PROS and CONS:


Increase efficiency
High energy consumption, high manufacturing cost
Partial Matching - TRIES
Trie (from retrieval): a tree where each node corresponds to a string that is
defined by the path to that node from the root.
Even if trie uses lots of RAM, most recently used nodes will be stored in
(processors) cache => Faster for recently used queries.
Multi-bit strides
Can have a large number of sub nodes

Stride size = number of bits used to branch out from each node, e.g. stride of
1 = binary, stride of 3 = octal
Stride size can vary with depth in TRIE

PROS and CONS


Reduces number of nodes traversed, increasing speed
Requires larger tables that may be sparsely occupied
Path-compressed tries
When keys are sparse, many trie nodes have only one descendent
Slow: Many steps lead to one result.
Large: Many steps in memory.

Rather than use every key bit to determine subtree, record in node which bits
should be used. At leaves, compare (in parallel) all bits of leaf (requiring
additional storage) with key.

If mis-match, then use previous best match. Provides path compression by


recording only genuine branches.
Thank You

Das könnte Ihnen auch gefallen