Internship Report
Internship Report
Internship Report
1
Dr. Vishnuvardhan Road, Bengaluru – 560060
EXTERNAL VIVA
Name of the Examiners Signature with date
1.
2.
2
UG Programs accredited by NBA-ECE, CSE, ISE, Mech, Civil, IEM, E&IE
Dr. Vishnuvardhan Road, Bengaluru – 560060
Declaration
RUTHU DINESH
1JS15EC081
3
Acknowledgement
I extend my sincere thanks and heartfelt gratitude to my internal guide, Mrs. Shubha
B, Asst. Professor, Dept. of ECE, for providing me an invaluable support throughout the
period of my Industrial Training.
I would like to sincerely thank all those people who supported in the part of this
industrial training at Whizchip Design Technologies while presenting this Industrial
training and also during preparation of this report.
RUTHU DINESH
1JS15EC081
4
CONTENTS
SL NO. PAGE NO
1. Working of Company 7
2. Preface 8
2.1. Purpose of this document 8
2.2. Overview 8
3. Introduction 9
4. Background of the invention 10
5. Performance metrics of packet classification 11
6. Abstract 12
7. Problems in classifying the packets 13
8. Literature survey 14
9. Definitions, Acronyms and Abbreviations 15
10. Block diagram 16
11. Received packet 18
12. Inspecting the packet for tag 20
13. Tagging the packet 'P' with the current time 22
14. For checking the port numbers 24
15. Understanding VLANs 28
16. VLAN port assignment 32
17. Conclusion 34
5
1. ABOUT THE COMPANY
Business Objectives:
Towards customers
Strive continuously to assist our customers to reduce cost and increase
predictability in their complex chip design projects by
6
Towards our colleagues
Enabling our deserving engineers by setting up a platform to have world class
technology exposure
Core Values:
• Credibility
• Innovation
• Collaboration
• Customer Orientation
7
2. PREFACE:
2.1. Purpose of this document
This document is a Technical Design Document for Packet Classification
Engine. It provides guidance which is intended to assist the relevant
management in producing a project specific technical design document. It
is also useful background reading for anyone involved in developing or
monitoring the Packet Classification Engine.
2.2. Overview
The process of categorizing packets into “flows” in an Internet router is
called packet classification. All packets belonging to the same flow obey
a pre-defined rule and are processed in a similar manner by the router.
Routers classify packets to determine which flow they belong to, and to
decide what service they should receive. Classification may, in general,
be based on an arbitrary number of fields in the packet header.
Performing classification quickly on an arbitrary number of fields is
known to be difficult, and has poor worst-case performance. In this
document, we consider a classifier taken from real network. We find that
the classifier contain considerable structure and redundancy that can be
exploited by the classification algorithm.
Packet classification is one of the most important tasks by the networking
equipment. This device is used to sort the packets. A packet has five
fields where these have to be matched with a rule. The incoming packets
are placed in a flow which is determined by the matched rule. Packet’s
priority is decided by the matched rule. Classifying the packet is the
difficult task. All the packets are processed at same speed and the rule
sets can contain ten thousand of rules. The packet classification uses
classification engine that consumes more power. Power is the major
constraint in the networking device.
8
3. INTRODUCTION
9
4. BACKGROUND OF THE INVENTION
10
5. PERFORMANCE METRICS OF PACKET CLASSIFICATION
• Search speed — Faster links requires faster classification. For example, links
running at 10Gbps can bring 31.25 million packets per second (assuming
minimum sized 40 byte TCP/IP packets).
• Low storage requirements — Small storage requirements enable the use of fast
memory technologies like SRAM (Static Random Access Memory). SRAM can
be used as an on-chip cache by a software algorithm and as on-chip SRAM for a
hardware algorithm.
• Ability to handle large real-life classifiers.
• Fast updates — As the classifier changes, the data structure needs to be
updated. Data structures are categorized into those which can add or delete
entries incrementally, and those which need to be reconstructed from scratch
each time the classifier changes. When the data structure is reconstructed from
scratch, it is called “pre-processing”. The update rate differs among different
applications: a very low update rate may be sufficient in firewalls where entries
are added manually or infrequently, whereas a router with per-flow queues may
require very frequent updates.
• Scalability in the number of header fields used for classification.
• Flexibility in specification — A classification algorithm should support
general rules, including prefixes, operators (range, less than, greater than, equal
to, etc.) and wildcards. In some applications, non-contiguous masks may be
required.
11
6. ABSTRACT
12
7. PROBLEMS IN CLASSIFIYING THE PACKETS
The criteria for classifying packet is called rule R, and the set of finite rules R1,
R2...Rn contained in forwarding machine is called rule database or classifier.
The fields of rule and packet header are related, For example, the rules that
implement IPv4 consist of 5 fields (source IP address, destination IP address,
protocol type, source port, and destination port). The incoming packet to router
matches specific rule if the distinct fields in the packet match the corresponding
fields in that rule. Since a packet may match more than one rule in the database,
assigning a cost to each rule can avoid this ambiguity. The packet classification
problem is how to determine the lowest-cost matching for the incoming packet.
The packet must match at least one rule. There are three matching types.
1. Exact match: The values of rule fields and Packet header fields must be
identical.
2. Prefix match: The rule fields values must be prefix for the header fields
values.
3. Range match: The header field’s values must lie in the range specified by
the rule.
13
8. LITERATURE SURVEY
14
9. DEFINITION, ACRONYMS AND ABBREVIATIONS
15
10. BLOCK DIAGRAM
P0
PACKET
P1
CLASSIFIER
P2
PACKET
P3
INDEX
LOOK UP MEMORY:
VLAN PN
P0
P1
P2
.
.
16
The packet index memory is organized as a 32-bit memory address. It is based
on length and location of the packets.
The first bit value is an entry bit of 0 or 1 that is to be stored into or accessed
from the memory cell.
The operation of the packet memory is supported by the packet index memory.
The memory is often organized to fit the needs of particular computer
architecture.
Flows are specified by rules applied to incoming packets. We call a collection
of rules a classifier.
Each rule specifies a flow that a packet may belong to based on some criteria
applied to the packet header.
1 150 0x4000
The bit value is one, so the entry is valid.
Then go to all the 0x4000 location.
Pick up the data from 150 locations that is starting at 0x4000.
This is one full packet.
0 150 0x4000
The bit value is zero.
Therefore, entry is invalid.
The look-up memory can be used or accessed randomly.
It acts as a very quick storage for all the information and data.
It has 12-bit VLANs and 20-bit port numbers.
Same port numbers may be assigned to various VLANs.
17
VLAN PORT NO.
VLAN 1 P0
VLAN 2 P1
VLAN 3 P2
VLAN 4 P3
After a packet is received from the network by the network interface device and
processed by the link layer, the processed packet is delivered to the network
layer.
Then it will check the packet for errors, IP checksum error etc.
If the packet is error-free, there are two possible scenarios:
1. The packet is destined to this host.
2. The packet is destined to some other host.
START
INITIALIZATION
PACK DATA
A
18
A
WAIT
NO
RECEIVED?
READ
ENCODE
COMMAND
NO
TRANSMIT?
YES
TRANSMIT
PACKET
19
12. INSPECTING THE PACKET FOR TAG
If we have more than one VLAN on the port, it is necessary to tell which packet
belongs to which VLAN on the other end.
To do this we are “tagging” a packet with a VLAN tag. VLAN tag is inserted in
the Ethernet frame as shown below:
START
RECEIVED PACKET
20
A
CHECK NO. OF
HEADERS
CHECK UNIQUE
VALUE
FORWARD
PACKET
VLAN tagging is used to tell which packet belongs to which VLAN on the
other side.
To make recognition easier, a packet is tagged with a VLAN tag in the
Ethernet frame.
To add a tag to a packet, we use tag keyword.
Once a tag is applied to a packet by a matching rule, it is never removed.
It can, however, be replaced with a different tag.
A packet is only assigned to one tag at a time.
21
13. Tagging the packet 'P' with the current time
Start
Is queue Yes
Drop P
full?
No
Push P to queue
Stop
NA def=0
22
If the port number matches with the tag then the packet is accepted.
Else a default VLAN ID is added.
The frame has a four-byte VLAN tag added, which includes the VLAN ID.
Tag
Received a
packet
No
Does packet
carry tag?
VLAN ID
No
Is VLAN ID Discard
valid?
Yes
A 23
A
Does the
No device
send
tagged
packets?
Yes
Remove tag
Retain original tag
Send it out
24
Start
Disconnect
If
connection
is valid?
Connected
End
You can mark classified packets to indicate their traffic class. You can colour
packets by marking the IP precedence or DSCP field in the packets IP header or
the Experimental field in the MPLS label header.
Network Type
The network type influences the method used for differentiating between traffic
classes and providing differentiated services for each class. An IP network can
choose to differentiate traffic based on either IP precedence or IP DSCP values.
25
On the other hand, an MPLS-based core infrastructure would use the EXP
values to differentiate between the various classes. Similarly, a Layer 2-based
core such as an Ethernet-switched network may use the 802.1p bits for the same
purpose. Hence it becomes very important for the SP to mark traffic at the
network edge using the appropriate scheme that is being used in the network
core.
Traffic Type
The traffic type has a bearing on the method used for providing differentiated
services. Certain traffic types might not support a given method if used for the
purpose of differentiating classes. A good example is using MPLS EXP as a
scheme for providing differentiation for VoIP traffic that is not labeled (and
placed in the global routing table) in an MPLS-based core. Since this traffic is
not label switched and instead is carried as pure IP (unlabeled) traffic, the
scheme for providing differentiated services would indeed fail. Hence it is
imperative to clearly identify the various traffic types to be transported in the
network and appropriately choose the correct scheme for deployment. In certain
cases, more than one method can be used for this purpose. For instance, it is
common to deploy an EXP and IP precedence plus DSCP-based scheme in the
core, for supporting the various traffic types in a given environment.
26
CoS bits. The network core uses the EXP markings to apply the necessary
priorities for traffic.
27
15. Understanding VLANs
28
VLANs are often associated with IP sub networks. For example, all the end
stations in a particular IP subnet belong to the same VLAN. Interface VLAN
membership on the switch module is assigned manually on an interface-by-
interface basis. When you assign switch module interfaces to VLANs by using
this method, it is known as interface-based, or static, VLAN membership.
Traffic between VLANs must be routed. Switch modules that are running the IP
services image can route traffic between VLANs by using Switch Virtual
Interfaces (SVIs). To route traffic between VLANs, an SVI must be explicitly
configured and assigned an IP address. For more information, see the “Switch
Virtual Interfaces” section and the “Configuring Layer 3 Interfaces” section.
This section includes:
Supported VLANs
Normal-Range VLANs
Extended-Range VLANs
VLAN Port Membership Modes
UNI-ENI VLANs
Supported VLANs
VLANs are identified with a number from 1 to 4094. VLAN IDs 1002 through
1005 are reserved for Token Ring and FDDI VLANs. VLAN IDs greater than
1005 are extended-range VLANs and are not stored in the VLAN database.
Although the switch module supports a total of 1005 (normal-range and
extended-range) VLANs, the number of routed ports, SVIs, and other
configured features affects the use of the switch module hardware.
29
Normal-Range VLANs
Normal-range VLANs are VLANs with VLAN IDs 1 to 1005. You can add,
modify or remove configurations for VLANs 2 to 1001 in the VLAN database.
(VLAN IDs 1 and 1002 to 1005 are automatically created and cannot be
removed.)
Configurations for VLAN IDs 1 to 1005 are written to the file vlan.dat (VLAN
database), and you can display them by entering the show vlan privileged
EXEC command. The vlan.dat file is stored in flash memory.
You can set these parameters when you create a new normal-range VLAN or
modify an existing VLAN in the VLAN database:
VLAN ID
VLAN name
VLAN type (Ethernet, Fiber Distributed Data Interface [FDDI], FDDI network
entity title [NET], TrBRF, or TrCRF, Token Ring, Token Ring-Net)
VLAN state (active or suspended)
30
For extended-range VLANs, you can configure only MTU, private VLAN,
remote SPAN VLAN, and UNI-ENI VLAN parameters.
Extended-Range VLANs
You can create extended-range VLANs (in the range 1006 to 4094) to enable
service providers to extend their infrastructure to a greater number of customers.
The extended-range VLAN IDs are allowed for any switch port commands that
allow VLAN IDs. Extended-range VLAN configurations are not stored in the
VLAN database, but they are stored in the switch module running configuration
file, and you can save the configuration in the startup configuration file by using
the copy running-config startup-config privileged EXEC command.
The configured VLANs with interfaces assigned as access and trunk ports on switches
could look like this:
31
The port modes are defined as follows:
Access Port — the frames received on the interface are assumed to not
have a VLAN tag and are assigned to the specified VLAN. Access ports
are used primarily for hosts and can only carry traffic for a single VLAN.
Trunk Port — the frames received on the interface are assumed to have
VLAN tags. Trunk ports are for links between switches or other network
devices and are capable of carrying traffic for multiple VLANs.
32
When we enable port-based VLANs, all ports in the system are added to the
default VLAN. By default, the default VLAN ID is “VLAN 1”.
The default VLAN is not configurable.
If we want to use the VLAN ID, “VLAN 1” as a configurable VLAN, we can
assign a different VLAN ID to the default VLAN.
Also, we must specify a valid VLAN ID that is not already in use.
For example, if we have already defined VLAN 10, we cannot try to use
“10” as a new VLAN ID for the default VLAN.
No
No
33
17. CONCLUSION
To classify a packet as belonging to a flow often requires network system
to maintain large data structures. A key challenge is to design packet
classification engine that can be implemented efficiently on network
processor platforms. We argue that the design of such engine/system will
need to exploit the structure and characteristics of packet classification
rules.
34