Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is tlv (tag-length-value)?

Tags:

tlv

What is TLV?

To put hooks (functions) in the code instead of if/else?

If I have one piece of code running on different platforms, at different places in code, I can put TLV function hooks to identify what platform I am on and do accordingly? Or something like that?

Benefits can be cleaner code? Easy to maintain? When a new platform is added, only TLV code needs to change and not the source code?

I may be completely wrong here.

like image 349
hari Avatar asked Dec 10 '10 20:12

hari


People also ask

What is tag length?

“Optimal title length Google typically displays the first 50–60 characters of a title tag. If you keep your titles under 60 characters, our research suggests that you can expect about 90% of your titles to display properly.

What is TLV C#?

Each NDN packet is encoded in a Type-Length-Value (TLV) format. NDN Interest and Data packets are distinguished by the type value in the first and outmost TLV0.

What is TLV parser?

TLV is a way of storing data to facilitate quick parsing of that data. Typically, you read the type(tag), length and value and then send those datum to a processor function. This processor functions only function will be to process type X.

What is TLV API?

In Call Control, the TLV is used to send data to, and receive data from, the CSP within API messages. A TLV is an internal data structure consisting of the following elements: • Tag - a label identifying the format of the TLV. • Length - the length of the data to follow. • Value - the data.


2 Answers

TLV is Tag-length-value encoding. Often it is better referred to by it's original name, type-length-value.

The first field is the "type" of data being processed, the second field specifies the "length" of the value, the third field contains a "length" amount of data representing the value for the "type".

Multiple pieces of data can be transmitted in the same message by appending more triplets to a previously existing message.

There's a page on wikipedia covering it in just a little more detail. Don't get confused though, each triplet is a "top level" description, there is typically no nesting of items in TLV (although you could come up with a way to do so by encoding TLV triplets in the V of another tag).

like image 182
Edwin Buck Avatar answered Oct 04 '22 03:10

Edwin Buck


TLV is a way of storing data to facilitate quick parsing of that data.

Typically, you read the type(tag), length and value and then send those datum to a processor function. This processor functions only function will be to process type X. Then, you read the next type, it's length and value and send it to the appropriate processor.

It's typically used as an easy way to process data without a lot of extra overhead.

like image 43
KevinDTimm Avatar answered Oct 04 '22 04:10

KevinDTimm