Web Fundamentals

5,800 views

Published on

Understand the basics of worldwide web and internet. How HTTP works and DNS schemes

Published in: Technology
0 Comments
6 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
5,800
On SlideShare
0
From Embeds
0
Number of Embeds
45
Actions
Shares
0
Downloads
243
Comments
0
Likes
6
Embeds 0
No embeds

No notes for slide

Web Fundamentals

  1. 1. Web Fundamentals 4 th September 2007 WWW, Internet, and other weird stuff
  2. 2. This is not a presentation <ul><li>But more of a Discussion </li></ul><ul><li>Maximum questions </li></ul><ul><li>Maximum answers (if possible) </li></ul><ul><li>You are allowed to sleep </li></ul><ul><li>You will get a copy of these slides </li></ul><ul><li>But slides are less important. </li></ul><ul><li>Exercises will be there </li></ul>
  3. 3. What is Internet? <ul><li>Internet is a global network of smaller networks. </li></ul><ul><li>Internet is the largest network. </li></ul><ul><li>It is owned by NOBODY </li></ul><ul><li>Smaller network: 1-1000 computers </li></ul><ul><li>Satellites, Submarine Optical cables </li></ul><ul><li>Backbone </li></ul><ul><li>The biggest name is Cisco </li></ul>
  4. 4. What is (the) Web? <ul><li>You mean World Wide Web? </li></ul><ul><li>Collection of interlinked hypertext documents. </li></ul><ul><li>That means Hyperlinked documents </li></ul><ul><li>Hyperlinks? </li></ul><ul><li>URL </li></ul>
  5. 5. HTTP? <ul><li>HTTP is an application level protocol for transferring data through WWW. </li></ul><ul><li>Hyper Text Transfer Protocol </li></ul><ul><li>HTTP 0.9 / 1.0 / 1.1 / 1.2 </li></ul><ul><li>HTTPS (S for Secure) </li></ul><ul><li>HTML – Header, content. </li></ul><ul><li>They say HTTP is stateless. </li></ul>
  6. 6. DNS <ul><li>DNS is like post office </li></ul><ul><li>Some post offices will be knowing some addresses </li></ul><ul><li>DNS servers will have addresses like this www.google.com => 64.67.33.200 </li></ul><ul><li>Multiple Name servers for reliability </li></ul>
  7. 7. Domain Name <ul><li>Netkode.com </li></ul><ul><li>Mail.netkode.net </li></ul><ul><li>Abc.mail.netkode.net </li></ul><ul><li>http://mail.netkode.net/ </li></ul><ul><li>http://mail.netkode.net:80/ </li></ul><ul><li>http://mail.netkode.net:80/inbox/index.jsp </li></ul>Port
  8. 8. A simple web request Browser Name Server Internet Web Server IIS, Apache, Lighttpd etc. BIND, PowerDNS, djbdns HTTP Response DNS Lookup http://bookmarks.rediff.com/recent/ bookmarks.rediff.com => 210.210.93.86
  9. 9. Cookies <ul><li>Comes in different flavors </li></ul><ul><li>Through HTTP Headers </li></ul><ul><li>Persistent Cookie </li></ul><ul><li>Session Cookie </li></ul><ul><li>Secure Cookie </li></ul><ul><li>HTTP Only Cookie </li></ul><ul><li>3 rd Party Cookie </li></ul>
  10. 10. How Cookies work? 2) Response from Web server 3) 2 nd request from browser 1) Request from Browser GET /index.html HTTP/1.1 Host: bookmarks.rediff.com HTTP/1.1 200 OK Content-type: text/html Set-Cookie: name=value; expires=date; path=/; domain=.rediff.com   (content of page) GET /popular/ HTTP/1.1 Host: bookmarks.rediff.com Cookie: name=value Accept: */* expires=Fri, 31-Dec-2027 23:59:59
  11. 11. Session <ul><li>One type of state management mechanism </li></ul><ul><li>A number of continuous request response sequences. </li></ul><ul><li>The key is called SESSIONID </li></ul><ul><li>PHPSESSID, ASPNETSESSIONID, jsessionid, SESSION_ID, mySESSID </li></ul>GET /popular/ HTTP/1.1 Host: bookmarks.rediff.com Cookie: PHPSESSID=4dy1q2e3d44c5dj343s3aq9
  12. 12. Moral of the story <ul><li>Programming languages are like religions </li></ul><ul><li>All say same things </li></ul><ul><li>Pray to same gods </li></ul><ul><li>Keep up your spirits </li></ul>
  13. 13. Session Security <ul><li>Session id is like your browser’s password </li></ul><ul><li>‘non-guessable’ session id- even you can’t </li></ul><ul><li>Random numbers? </li></ul><ul><li>‘Yet to solve’ mathematical problem. </li></ul><ul><li>X is your ultra top secret algorithm. </li></ul>X sessionid CPU temperature Current date time Other junk stuff
  14. 14. Session Security <ul><li>And this algorithm can be as simple as MD5 or SHA1 </li></ul><ul><li>These are called random hash code </li></ul><ul><li>Irreversible id => pseudo random id </li></ul><ul><li>Irreversible (only theoretically) </li></ul>
  15. 15. Forms <ul><li>Method for data transfer from client to server (part of HTTP methods) </li></ul><ul><li>GET and POST </li></ul><ul><li>GET </li></ul><ul><ul><li>Through URL </li></ul></ul><ul><ul><li>Limited data </li></ul></ul><ul><li>POST – through HTTP Headers </li></ul><ul><ul><li>More (complex) data </li></ul></ul>
  16. 16. HTTP Error codes <ul><li>1xx – Informational </li></ul><ul><li>2xx – Success </li></ul><ul><ul><ul><li>200 OK </li></ul></ul></ul><ul><li>3xx – Redirection </li></ul><ul><ul><ul><li>304 Not Modified </li></ul></ul></ul><ul><li>4xx – Client Error </li></ul><ul><ul><ul><li>404 Not Found </li></ul></ul></ul><ul><li>5xx – Server Error </li></ul><ul><ul><ul><li>500 Server Error </li></ul></ul></ul>
  17. 17. Multi Tier App Web Server Internet Web Server - Static File Serving - Caching - Proxying Database Server - Storage of Data - Retrieval - Some Biz logic Database Server Application Server App Server - Biz Logic - Processing - Modifying Data J2EE, ASP.NET, PHP, RoR, Python Apache/TomCat, IIS, lightTPD MS SQL, MySQL, Oracle
  18. 18. Simple Question <ul><li>Netkode.com is hosted on 64.64.1.7 IP </li></ul><ul><li>Will http://www.netkode.com </li></ul><ul><ul><ul><ul><ul><li>Or </li></ul></ul></ul></ul></ul><ul><li>http://64.64.1.7/ will load the page faster? </li></ul>
  19. 19. Believe me <ul><li>3 Tier Architecture is NOT MVC (Model View Controller) </li></ul><ul><li>Multi tier is an architecture concept </li></ul><ul><li>MVC is a software design concept </li></ul><ul><li>Excuse me. MVC? </li></ul>
  20. 20. MVC <ul><li>Presentation – View </li></ul><ul><li>Logic – Controller </li></ul><ul><li>Business Objects - Model </li></ul>
  21. 21. <ul><li>Which all are valid URLs </li></ul><ul><li>http://cnn_india.com/index.asp </li></ul><ul><li>https://cnnindia.com:8080/ </li></ul><ul><li>http:// cnnindia.in /news 2007.asp </li></ul><ul><li>http://wwww.cnn-india.co.in/ </li></ul>
  22. 22. More Questions?
  23. 23. Thank You

×