Chapter 4 Flashcards
Most common encoding standard?
ASCII
What is the problem with unicode?
All devices that were built before unicode couldnt communicate
How does one specify which charsets to use?
Accept-Charset: iso-8859-1
How do you show how many octets there will be in a UTF encoding string
0 = lower 7 bits represent the character
10 = continuation character
110 = 1 octet will follow
1110 = 2 octets will follow
11110
111110
1111110
1111110
What is the limit of bytes per character in UTF-8?
4 bytes per character
What is mean by “UTF-8 is self synchronising”?
If there is a mistake skip over all of the 10 starting octets and go to a 0 or 11* octet
What does *;q=0.1 mean in Accept-Charset?
- = wildcard. q = quality(preference)
What are the 3 basic constructor types in ASN.1?
CHOICE, SEQUENCE, SET
In what representation are X.509 certificates defined?
ASN.1
Whats the difference between XML and ASN.1
ASN.1 provides abstract description of what the data looks like.
ASN.1 is more compact ( thus less resource intensive )
Which is easier to inspect, ASN.1 or XML and why?
XML because ASN.1 message may contain binary data
What does ASN provide in terms of the message to be sent?
It provides an abstraction of the message
What does BER use as a type descriptor at the start of any value?
A octet
SOAP is a ……….. representation
application oriented
What representation is used for web services?
WSDL ( Web service description language )
When does the presentation layers negotiate which representation to use?
Before the actual data is sent
What does MIME data consist of?
Header and payload
What are the 2 important headers for MIME?
Content-Type
Content-Transfer-Encoding
What are the MIME types?
application
Audio
example
image
message
model
multipart ( composite payloads)
Text
video
How do you specify which character set to use in MIME?
charset=
Is the data represented by the presentation layer already encoded?
Yes
What is the mime type for audio/music?
audio/mpeg
Whats the problem with universal formats?
Should it have minimal/ most common features or a truly universal format.
Problems with data exchange?
Formats ( interoperability)
Large datasets migration
integrity
How can we solve data exchange challenges?
Use container formats.
Use data serialization.
Interchange formats (ASN XML)
What is the difference between lossy and loss less compressions?
Lossy = looses some info during compression
Lossless
On what level does compression happen?
Layer 6
What is run length encoding?
Shortening “runs” by compressing it
Example of RLE ( Run length encoding with characters)
Ng[[[[[[[[[[[[[[[[[[[[[[[[[[[[
Ng[[[[[[[[[[[[[[[[[[[[[[[[[[[[
(N,G,”<ESC>",28,[)</ESC>
No “</ESC” but for some reason this puts it there
(N,G,<ESC>,28,[) What is <ESC></ESC></ESC>
A character to denote that a run will occur
Steps of bit-based RLE
1: count consecutive bits (assuming starting with 0) (if there are no 0;s == 0
2: Encode run lengths
Bit-based RLE Example:
Original: 000011100000111000000
Original: 000011100000111000000
1: 4,3,5,3,6
2: 0100(4) 0011(3) 0101(5) 0011(3) 0110(6)
How does Lempel-Ziv compression work?
Replace repeated patterns with shorter codes. Computational complexity may play a factor
Watch video on Huffman codes
What is the main idea behind huffman codes?
Most used characters = shortest code
How do we construct a huffman tree?
1: Treat each letter as a single node tree.
2: Join 2 trees at a time until only 1 left
3: combine the 2 trees that are used least frequently
Is huffman code self-synchronising?
No
Why is the lower layer we usually could encrypt at level 2 and not layer 1?
Cause layer 1 doesnt add any headers.
What is the problem with link encryption? ( Layer 2 encryption)
Youd have to decrypt at every single node