Date: 2008-05-27 08:33 pm (UTC)
I love this stuff. I like explaining things because I learn how to communicate better. Plus it's nice to be helpful. :)

I think the word you're looking for is "encoding" not "encryption". "Encryption" implies that the data has been protected from prying eyes by a cryptographic algorithm. Encoding implies that information has been stored in some kind of predictable way.

You may have heard of ASCII, for example, which is a 7-bit encoding for Latin characters. (It's largely considered a bad encoding because it's an obstacle to internationalization, but that's neither here nor there.)

You usually wouldn't use the word "encoding" for more complicated file formats such as Word's doc format -- you'd use the word format. JPEG files are in JPEG format and contain JPEG-encoded image information.

The difference between an "encoding" and a "protocol" is that the protocol actually contains instructions that a service implementing that protocol must perform. For example, if a web server receives an HTTP message with a "GET" request in it, the web server is required to either deliver the document or give a 404 error. An encoding is just a way of storing and reading data -- it doesn't require you to *do* anything with that data.

I'll try to communicate the intuition of layered protocols.

IP is pretty dumb.

The header is basically an encoding of the following information:

"I'm version 4 of IP."
"My header is xx bytes long"
"If I travel through more than xx routers, please kill me because I'm lost!"
"The sum of all bytes in this packet modulus 2^16 should be 3F2B. Pretend I'm 0000 while doing the calculation. (checksum)"
"My data is xx bytes long"
"I'm coming from 64.1.2.3."
"Send me to 83.7.3.5."
"Oh, and here's some DATA. I have no idea what it is, but you can have it!"

That's pretty much it. No guarantees of delivery. No port number.

The TCP packet goes inside the data of the IP packet.

"I'm going to port 80"
"I'm coming from port 10837."
"I'm part of a larger message. I'm sequence number 3. If you get sequence number 4 before you get me, be sure to look at me first."
"My header is xx bytes long"
"Here's my checksum."
"My data is this long"
"Here's mah data. I don't know what it is, but here you go!"

There's other stuff in TCP, like, "Hey, can you chat?" "Yup, I can chat. Did you hear me?" "Yes, I heard you." "Could you resend sequence #2? I didn't get it."

An HTTP request goes inside the data segment of the TCP packet.

HTTP 1.1
GET /browse/product?id=93847
\n\n

The TCP packet will specify Port 80. A program on the web server has asked the operating system to hand over the data of every TCP packet that was received with a port 80 designation. The program will treat all TCP packets as if they contained HTTP requests, rejecting anything it doesn't understand.
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

Profile

asterroc

April 2017

S M T W T F S
      1
2345678
9101112131415
16171819202122
232425 26272829
30      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 8th, 2025 02:09 am
Powered by Dreamwidth Studios