Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

[RFC] Web low level

by Martin90 (Sexton)
on Mar 17, 2015 at 22:46 UTC ( #1120390=perlquestion: print w/replies, xml ) Need Help??

Martin90 has asked for the wisdom of the Perl Monks concerning the following question:


I would like to study a little bit of foundation, low level dependencies that makes the www works - from first signal that comes to the server, or even earlier where my machine ip is recognized and request is being send (ip systems, connections, performance of www, etc). I plan to do more serious apps/scripts for websites and I think this knowledge may be valuable and allows me to understand things better and write better software for it. It's like you don't have to be an mechanical engineer to drive a car but, knowing what's under the hood helps you drive better ;)

So, which subjects should I consider ? I was thinking about TCP/IP and HTTP. As for the TCP/IP I've started to read "TCP/IP Illustrated, Volume 1" but I think I went in the wrong direction. That book is full of definitions only, and probably too low level for the websites only.

Looking forward for your opinions ;) Where should I start, what to read ?

PS: I was trying to add this subject to "Meditations" node since it is not particularly related to perl but I it looks like don't have permission to post there.


Replies are listed 'Best First'.
Re: [RFC] Web low level
by Corion (Patriarch) on Mar 17, 2015 at 22:51 UTC

    tomhukins gave a talk on HTTP Clients and Perl, in which he touches on the topics of interest and gives a good overview. I would look at the RFCs he mentions and then work my way down to TCP/IP.

Re: [RFC] Web low level
by hippo (Bishop) on Mar 17, 2015 at 23:02 UTC

    You could do a lot worse than start with what happens when ... ? There ought to be enough detail in there to get you going.

Re: [RFC] Web low level
by trippledubs (Deacon) on Mar 18, 2015 at 03:41 UTC
Re: [RFC] Web low level
by Anonymous Monk on Mar 17, 2015 at 23:13 UTC

    Reading the DNS, TCP/IP, and HTTP RFCs would give you the authoritative information on the specs. Depending on whether you like this kind of stuff, they're either long and a bit dry, or really interesting :-) Also, sometimes it's difficult to figure out which RFCs are the core ones and which ones are just extensions that don't get much use. So perhaps Wikipedia is a slightly gentler start: Domain Name System, Internet protocol suite, and Hypertext Transfer Protocol. Also, it will help you a great deal if at the same time you learn how to use Wireshark; reading the specs will help you interpret the traces and playing with real-life traces should help show the practical application of what you're reading.

Re: [RFC] Web low level
by FloydATC (Deacon) on Mar 18, 2015 at 09:50 UTC


    If you're anything like me, download and install Wireshark. This lets you see exactly what goes on. The book will probably make much more sense when you've seen things with your own eyes. Learn to recognize the handshakes, understand why they work that way and what can go wrong. Get a firm understanding of ports and sessions, then you'll see why the rest of the TCP/IP book is probably of little use to you as an app/script developer.

    A racecar driver only needs to know so much about how roads are constructed.

    -- FloydATC

    Time flies when you don't know what you're doing

      A racecar driver only needs to know so much about how roads are constructed.

      Its like telephone, you don't need to know the line voltage of the twisted pair..., just how to push buttons :)

Re: [RFC] Web low level
by atcroft (Abbot) on Mar 18, 2015 at 14:12 UTC

    For HTTP specifically, I would recommend Web Client Programming with Perl, which is available through the O'Reilly Open Books Project. While it may seem a little dated,

    • chapters 2 and 3 illustrate how HTTP really works at the request/response level,
    • chapter 4 leads the reader through making the requests manually (creating a socket connection to the remote server and making the request), and
    • chapter 5 introduces the LWP module.

    Hope that helps.

      While it may seem a little dated(...)

      This book is 18 years old now, in such fast growing field as internet it really matters. Anyway, I will check it out. I also choose "High Performance Browser Networking" by Ilya Grigorik it covers http (v.2.0 also) and is from 2013.

      Can you propose some extra resources for http servers written in perl ? Thanks.

        I think the enormous weight of the expertise here will fall on published code and not published learning materials. To that end, I recommend reading all the code you can: "http" ( server OR client ); focus on things that are newer and more highly rated/reviewed/recommended. Test suites are often the best place to start when trying to understand new code.

Re: [RFC] Web low level
by Martin90 (Sexton) on Mar 18, 2015 at 12:25 UTC

    Thank you for a lot of good resources and opinions ;)

    In fact my main goal is first to understand how HTTP and WebSocket server operate, how it is possible that we can write a full featured HTTP server using only perl, and host a website on it sucessfully(with no performance losses) and without apche or nginx. This matter really intrest me, and if I'll understand it in details I may be willing to write my own http server with perl ;)

    So, once again, http server written in perl only - just like hypnotoad in Mojolicious framework. How it is possible that there is no performance losses and programmers gladly use it over let's say nginx or apache or whatever else written in pre-compiled languages like C ? What should I understand first to get into this subject ?

    Regards ;)

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1120390]
Approved by Marshall
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (2)
As of 2023-03-26 12:50 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (63 votes). Check out past polls.