Wednesday, July 15, 2009

[AIT09] Classifier

This question is from Nakrop.

1. What are the based class of class Classifier?

2. What are two key variables of the C++ class Classifier? What are their purposes?

3. "Function classify(p) is the most important function of a classifier"
Do you agree with this statement? If you agree, please give your reasons.

4. What are the default values of shift_ and mask_ ?
Which function use these variables?

6 comments:

Anonymous said...

[Karin,107985]
The base class for classifier is NsObject.
You can see in file "classifier.h" at
the class constructor==>
class Classifier : public NsObject {
}

Anonymous said...

[Nawat, 108113]

I can answer the question 4. I have seen it in file classifier.cc (I don't know the full path since I found them at NS2.26SourceOriginal in line 55).

The default value of two variables are shift_=0 and mask_=0xffffffff (4294967295 in decimal).

The mask_ and shift_ variable are used by both Classifier(), and mshift().

Unknown said...

(Hasanain/106000)
1)The base class of the class Classifier is NsObject.
2)In C++ these are slot_ and default_target_. Variable slot_ is a linked list of pointers whose entries are a pointer to downstream NsObject and default_target_ is also a pointer which points to a receiving NsObject for packets.
3)Well function classify standalone can not perform all as because functions in a classifier are classified into packet forwarding and configuration. It belongs to packet forwarding but has its own significance which makes it more important over others because it provides the place where the classification criterion is defined.
4)By looking into the file ~ns/tcl/lib/ns-default.tcl, we can see that default value of shift_ is “0” and mask_ is “0xffffffff” and these values are being used by function mshift(val)

Unknown said...

1)NsObject is the base class of class classifier.
2)slot_ and default_target_ are the two Key variables in the C++ class classifier. The main objective of variable slot_ is a linklist of the pointer who point out the downstrem NSObjects.while default_target_ point out the receiving NSObject for packet which do not match with any predefine criterian.

3)"Function classify(p) is the most important function of a classifier"
yes I am strongly agree with this statement because without this function we cant classify the criteria. classify(p) returns the NSObject pointer installed in the slot where criteria matches with input paket p*.

4) The function Classifier() and mshift() are using these variables mask_ and shift_.
Dear Nawat, the full path of
NS2.26SourceOriginal is

~ns/tcl/lib/ns-default.tcl

The default values of shift_ and mask_ are same as Nawat told 0 and 0xffffffff respectively.

Tech News said...

Thein Tun Aung/st108032

Nsobject is the base class for classifier.
The default value of shift_=0
and the default value of mask_ =
0xffffffff .
There are default value at ~ns/tcl/lib/ns-default.tcl .

Rujipol , 108109 said...

[Rujipol, 108109]
1. Classifier's base class is NsObject
2. shift_ and mask_
3. Yes, because it is the part where filter the packet directions.
4. default of shift_ = 0 and mask_ = 0xffffffff. The function is classify(p) which invoke mshift()