Web Development Course: HTTP

Been awhile!! Work has been crazy as we’re trying to launch a product by an unrealistic deadline that continues to get pushed back by 2 wks so been super busy. I took a little break from learning React and Data Structures and started watching this CS lecture video series by Harvard on web development. It covers topics like HTTP, PHP, SQL, JS, Ajax, Security, etc. Not sure if I’ll get to finish it anytime soon but I watched a bit of the first lecture on HTTP. The video is 2 hours and 40 minutes long and my ADD kicks in every so often to sit through the whole thing so figured I’d break it up in little chunks.
I used to think to myself that I have to have good/solid content that’s worth posting but what the heck, half the battle is being consistent and I’ll post SOMETHING since the point is to make it a habit to motivate myself.

Here is my summary from last night:

From a user’s perspective
What happens when a user types in a URL in the web browser such as google.com? The address gets “translated” into an unique IP address in the format of w.x.y.z consisting of numbers from 0~255. The address you type in has something like http in front of it (if omitted, the browser’s been made user friendly to type it in for you), a protocol by which a message/request is viewed by the browser. A “virtual envelope” is created with your request (such as an image you’re trying to view), your computer’s IP address as the sender and the web site’s IP address to which you’re sending your request.

How does your computer know where to send these requests to? How are IP addresses mapped to specific servers? Your ISP, internet service provider such as Comcast, has DNS, Domain Name System, that looks up its hierarchical chain to see where the IP resides. Hierarchical meaning that if it doesn’t know exactly where something should go, it knows someone else who knows someone else that knows, etc.  — it can go through up to 30 different routers all over the world. Then once say, the Google server receives your request, it looks for a particular path such as “/ (root path)” indicated in your address, retrieves the requested data, puts it in a virtual envelope, flips the IP addresses, and sends it your way. You then can view Google.com’s search page.

From a website owner’s perspective

You create a website and want show it off to the world. How do you accomplish this? Like above, your site gets visited by users on its IP address. Can you use the IP address of your laptop at home aka as a server to host your site? Technically yes, but probably no. The IP addresses you have on your computer is first of all private and probably not unique. Even if you can find a way around this, once you get a lot of traffic to your router, your ISP will most likely shut you down entirely.

That is why we use hosting services like GoDaddy and my personal favorite, Namecheap. You also need to purchase a domain name like grace.com which has to be known to DNS of your server host (can be the same place you purchase your domain name) which will do the rest of the work of routing things for you.

So how does these requests and messages physically or electronically travel to one computer to another? Simply put, we use what’s called TCP/IP for data transmission, a language spoken by the computers. The IP is the part from which IP addresses are derived; it assigns numbers, addresses, to computers. More on this later, I’m sure.

The server can receive many types of requests such as email, not just a request to view a certain web page. Email can live on the same server as other services, therefore, specific “port numbers” are needed to direct these requests appropriately (e.g. 80 for websites and 25 for email).

That is it for tonight! My apologies if I misunderstood some of the concepts but overall it’s meant to be for basic intro. Will be studying more when time permits.



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s