Getting IPv6 extension header fields

32 views
Skip to first unread message

Hajar Hantouti

unread,
Jun 10, 2016, 1:41:21 AM6/10/16
to ns-3-users
Hello ,
I'am implementing a new Ipv6 extension header , attaching it to packets . at reception of these packets I want to access the new extension header fields.
till now I can retrieve the Extension header , but not able to access fields . I was inspired by Packet::Print function , but I get compilation errors using GetAttributeName and GetAttribute. Here is the Print code that I'm using:
 std::string attrName = item.tid.GetAttributeName (j);
 std
::string value;
 
bool ok = chunk->GetAttribute (attrName, value);
 NS_ASSERT
(ok);
os
<< attrName << "=" << value;
                   
another issue with using GetAttributeFullName , when tring to show the attrNAme I get a build faild error :
std::cout<<"fieald name"<<attrName<<std::endl;
the error is  :
assert failed. cond="i < information->attributes.size ()", file=../src/core/model/type-id.cc, line=652

Thank you for helping me find out the accurate methods to use and the cause for the build error or pointing for reading links.

Cordially Hajar


Hajar Hantouti

unread,
Jun 14, 2016, 7:52:53 AM6/14/16
to ns-3-users
Hello ,
I think I know the source of the build error , actually the portion of code that I'm inspired by is an  #if 0 portion of code that is not compiled in execution , so the build error is caused even in the print method . in depth and still don't know the reason , and how to access header fields. do someone have ideas ?

Tommaso Pecorella

unread,
Jun 14, 2016, 10:33:21 AM6/14/16
to ns-3-users
Hi,

you're right, that code is commented.
What do you mean by "access header fields" ? Where do you want to access them ?

Cheers,

T.

Hajar Hantouti

unread,
Jun 14, 2016, 10:38:15 AM6/14/16
to ns-3-users
Hello ,
Thank you for your response.
My goal is to get a field of the Extention header , and based on this information do some treatment. afterwards I aim to modify the field.

Cordially.
Hajar

Tommaso Pecorella

unread,
Jun 14, 2016, 11:33:59 AM6/14/16
to ns-3-users
Hi,
to be honest I'm quite annoyed by vague answers. It's like asking someone what he/she does for a living and having an answer like "oh, I see people, do things". The first time it's funny, the second time you think that pushing them in the face is an option (albeit a not socially acceptable one).

Now, why I think that your information is vague ? Because it is.

"do some treatment" - of course. WHERE ?
What kind of option header is it, an HbH or an E2E ?
Do you need to process it in-place or to pass this information to some other layer (e.g., routing) ?

Anyway, extension headers are processed in Ipv6Extension::ProcessOptions. Check the function and you'll see why you had to be more precise.

T.

baddi youssef

unread,
Jun 21, 2016, 8:10:07 AM6/21/16
to ns-3-...@googlegroups.com

hi,

   as presented in NS3 documentation you can easily add IPv6 extension with IPv6 Extension API (see ipv6-extension.cc):  "IPv6 Extension base If you want to implement a new IPv6 extension, all you have to do is implement a subclass of this class and add it to an Ipv6ExtensionDemux".

  and to process any treatment you can implement ProcessOptions method

Cordially 
-------------------------------------------------------------------------
                   BADDI YOUSSEF   
                     ENSIAS, RABAT
                 Tel: +212 672 43 54 15
---------------------------------------------------------------------------
Reply all
Reply to author
Forward
0 new messages