Live data from Hacker News

Understanding IP, TCP, and HTTP

objc.io

11–20 of 62 posts

Re: Understanding IP, TCP, and HTTP

#11

Earlier quoted context omitted.

Just out of curiosity, what do you do? Is this knowledge germane to where you work? I've just recently become interested in this stuff, so I'm curious to get a lay of the land.

I do ... software development? ;-) There isn't really any particular category for what I do, though I tend to do more of the lower-level/backend stuff of projects, and knowing how the stuff that you build on works internally certainly is useful in optimizing and debugging. As for getting an understanding of how TCP/IP works, I think Stevens' classic TCP/IP Illustrated still is a good book to get started, even if some…

The networking section of Unix and Linux System Administration Handbook has some excellent explanations of TCP/IP and many other networking topics.

Re: Understanding IP, TCP, and HTTP

#13

It's nice to see this recent increased emphasis on Web/mobile developers understanding the technologies that link it all together. The next thing I would add is a high level overview of the sockets API. While these topics aren't critical to most day-to-day lives of developers, they are certainly useful to understand.

I had one developer with over 6 years of server-side experience who made a server/client setup where the server would open a connection to the client, pass connection info to the client, close the connection, and then have the client open a connection back to the server to return results.

When I explained how TCP worked, in that the client could connect to the server and maintain an open socket to pass info continuously he was blown away. He had no idea this was possible. Explaining UDP was a lot harder.

So, I welcome any education on basic TCP/IP functionality!

Re: Understanding IP, TCP, and HTTP

#14
post #6

It's nice to see this recent increased emphasis on Web/mobile developers understanding the technologies that link it all together. The next thing I would add is a high level overview of the sockets API. While these topics aren't critical to most day-to-day lives of developers, they are certainly useful to understand.

This is a very readable online book on networking and sockets: http://beej.us/guide/bgnet/output/html/multipage/index.html Talk about understanding the sockets API ;-) here's the content section for chapter 5: 5.1. getaddrinfo() — Prepare to launch! 5.2. socket() — Get the File Descriptor! 5.3. bind() — What port am I on? 5.4. connect() — Hey, you! 5.5. listen() — Will somebody please call me?

Beej is where I learned socket programming. A great guide.

Re: Understanding IP, TCP, and HTTP

#15
post #8

Earlier quoted context omitted.

> "minimum payload size" (whatever that is) I'll give them the benefit of the doubt and say he got his terms wrong. The IPv6 RFC states that IPv6 requires a minimum MTU of 1280 bytes. I guess that's what he meant. https://www.ietf.org/rfc/rfc2460.txt Packet Size Issues IPv6 requires that every link in the internet have an MTU of 1280 octets or greater. On any link that cannot convey a 1280-octet packet in one piece,…

Which wouldn't really make me any more confident in the reliability of the whole thing?! Confusing lower-level fragmentation and reassembly with IPv6 fragmentation is not exactly a mistake you'd be likely to make when you understand what that actually means, I would think.

It would be one you would make as you were learning it, which is honestly what half the blogs that cross here are. It just happens that the neat thing this person learned today was about some networking protocols they use every day.

Re: Understanding IP, TCP, and HTTP

#16
post #8

Earlier quoted context omitted.

> "minimum payload size" (whatever that is) I'll give them the benefit of the doubt and say he got his terms wrong. The IPv6 RFC states that IPv6 requires a minimum MTU of 1280 bytes. I guess that's what he meant. https://www.ietf.org/rfc/rfc2460.txt Packet Size Issues IPv6 requires that every link in the internet have an MTU of 1280 octets or greater. On any link that cannot convey a 1280-octet packet in one piece,…

Which wouldn't really make me any more confident in the reliability of the whole thing?! Confusing lower-level fragmentation and reassembly with IPv6 fragmentation is not exactly a mistake you'd be likely to make when you understand what that actually means, I would think.

Let's not guess and help correct the article, shall we? Documentation, manpage, textbook and programming books can contain errors.

On the flip side, I like to see more people helping critiquing these articles so newbies like me can get the most out of it (though I already took computer network...).

Re: Understanding IP, TCP, and HTTP

#17
post #5

If you want to further your understanding of network protocols, there's an excellent open textbook available here: http://cnp3book.info.ucl.ac.be/

Also https://www.coursera.org/course/comnetworks is helpful. I use this to prepare interview, just so I don't have to dig my textbook.

Re: Understanding IP, TCP, and HTTP

#18
I've heard that a good way to gauge a person's general technological literacy is to simply ask "what happens when I type a URL in a browser and hit Enter?" Obviously, the question is deliberately open-ended, and any step in the process can be broken down into more detailed steps (up to a point). I'd like to see an article that initially shows high-level steps (e.g. DNS request, HTTP request, server processing, HTTP response, parsing and rendering), but allows each step to be expanded progressively with increasing detail.

Re: Understanding IP, TCP, and HTTP

#19
> There’s a misconception that restarting the (HTTP) request will fix the problem. That is not the case. Again, TCP will resend those packets that need resending on its own.

But that's not true if the connection is interrupted at the socket level, right?

For example, if the device switches from 3G to Wi-Fi, or from Wi-Fi to wire, then I believe, its hardware address changes, its IP address changes and the socket becomes stale. But the TCP connection, would it be closed right away or would it hang until some timeout? (And does it depend on the OS?)

Re: Understanding IP, TCP, and HTTP

#20

How I love it when people without deep knowledge of some subject write authoritative sounding articles. Without guarantee of completeness, to avoid the spread of misinformation: - IPv6 fragmentation has nothing to do with some "minimum payload size" (whatever that is) - there simply is no fragmentation being done by routers, the sender still can fragment however it pleases, and presumably will do so whenever it has t…

I love it when people without deep knowledge of a subject try to learn about it and explain themselves to others.
Post reply on HN