SlideShare une entreprise Scribd logo
1  sur  58
Télécharger pour lire hors ligne
Understanding the Web through HTTP
Olivia Brundage
Agenda
• Overall Flow of Data
• How HTTP Requests Work
• Introduction to HTTPS
Meet Datum!
He’s just a baby now, but let’s see how he grows into a big
data through the OSI (Open System Interconnection)
model.
Physical Layer
Datum’s home town.
He communicates with
everyone through a physical
medium (like wires).
His language is bits (0’s and
1’s).
Trailer
Data Link Layer
To talk to neighbors,
Datum’s bits gets
encapsulated as a
frame so that the
receiver know the start
and end of the message.
This layer provides node-
to-node data transfer.Header DATA
1010 101001000100111
Bit pattern that
specifies the start
of the frame
Bit pattern that
specifies the end of
the frame
Frame
Network Layer
In order to reach the outside
world, Datum has to be
transformed into a packet.
Routers are responsible
directing data to the correct
machine.
This is where you’ll find IP
addresses.
IP
Transport Layer
To reach his destination, Datum
must be transported via a
segment or datagram.
Segments are sent through the
Transmission Control Protocol
(TCP), which is for a connection-
oriented transmission.
Datagrams are sent through the
User Datagram Protocol (UDP),
which is for a connectionless
transmission (e.g., streaming).
IP
Session Layer
Upon arriving at his
destination, Datum must
create an open session to
the client, so that they can
continue their business.
Once here, Datum evolves
into his final form: Data.
IP
Presentation Layer
Datum is now on the full
screen!
This layer takes all your
backend code, CSS files,
etc and delivers them to
the final layer.
IP
Application Layer
This layer is the end-user
product and contains
high-level APIs like
resource sharing and
remote file access.
This is also the layer you
develop in!
IP
What’s with this abstraction?
• Gives us a framework on how data transforms
throughout the network.
• But it’s a little too specific; real networks are a lot muddier
than this.
OSI vs TCP/IP
TCP/IP combines some layers of the OSI, making it more
succinct to the messier way of real life.
Where does HTTP fit into this?
First, let’s go over what HTTP is
• HTTP stands for hyper-text transfer protocol.
• This protocol is in plain-text and is stateless.
• This protocol resides in the application layer.
Let’s break down these requests!
Make the Request!
You type the URL (Uniform Resource Locator) in the
browser:
http://www.google.com
Hey, wait! What’s an URL?
http://www.domain.com:1234/path/to/resource?a=b&x=y
protocol
host
port
resource path
query
Now, time to get the IP address!
After you type the address, another application layer
protocol is used to get the IP address:

the Domain Name System (DNS)
What’s the IP to Google’s server?
Google’s IP is 65.246.5.22
Domain Name Server Web Browser
HTTP makes the Request Racket
Generic Structure of HTTP Requests
message = <start-line>

*(<message-header>)

CRLF # Carriage Return Line Feed (i.e., new line)

[<message-body>]
• Start line contains the initial request
• Message headers give more details about the request you’re making
(i.e., the host, how to maintain the connection, how to handle cookies,
etc).
NB: GET requests do not contain a message body, but POST requests can.
tl/dr:
A simple request looks likes:
VERB RESOURCE-URL PROTOCOL

MESSAGE-HEADERS
GET / HTTP/1.1

HOST: www.google.com

CONNECTION: keep-alive
HTTP Main Verbs
• GET: fetches a resource determined by the URL
• The server sends the resource in the message body if the status code is 200
• POST: creates a new resource where the requests specifies the data needed
for the resource
• Params are carried in the body of the request instead of the header; making
this a more ‘secure’ type of request
• PUT: updates a resource
• DELETE: deletes a resource
NB: PUT and DELETE can be considered a specialized versions of POST
Lesser-known Verbs
• HEAD: Requests only the server headers. Primarily used
for checking if the resource has changed via timestamps.
• TRACE: Retrieves the hops that a request takes to round
trip the serve. Used for network diagnostic purposes.
• OPTIONS: Retrieves the server capabilities. For the
client-side, it can be used to modify the request based
on what the server can support.
HTTP Packet gets ready for Transportation!
HTTP
Request
HTTP Packet
TCP Packet
The TCP information maintains the session.

Now to the IP layer!
TCP
TCP now hands it over to the Internet Protocol
• Local/Sender Address: Your PC’s IP
• Receiver Address: Google’s Server IP
• Post Service Nodes: Routers
HTTP
Request
IP
IP further encapsulates the data
TCP
TCP
IP Packet
Now we head over to the last layer!
Trailer
HTTP
Request
Header
The Network Interface Layer makes the Ethernet
frame.
IP TCP
IP Packet
Ethernet Frame
We can finally send this HTTP request out!
The HTTP request is out!
So let’s recap.
But there’s still more to HTTP!!
Some important notes about the response:
• The server will send the status code along with the
message payload.
• The status code tells the client how to interpret the server
response.
1xx: Informational Messages
• This is just a provisional code and provides informational
messages like:
• Keep this connection alive (i.e., still sending
information)
• Tell the client to continue sending it’s message
• Ignore the next response
• This class was introduces in HTTP/1.1. Version 1.0
ignores this message.
2xx: Successful
Your request made it!
Request was completely successful.
Message successful, but there was no message
body
3xx: Redirection
Your request needs to directed elsewhere.
Resource has moved to a new URL.
Resource has not been modified since last
request.
4xx: Client Error
When the server thinks the client made a bad request.
Request can’t be fulfilled due to bad syntax.
Specifically used when authentication has failed.
Request was valid, but the server won’t
respond.
Resource can’t be found. Try again later?
Method isn’t supported (like using a GET on a
form that requires a POST method)
5xx: Server Error
Server failed creating the request
The infamous, generic server error.
The server doesn’t recognize the request
method or can’t fulfill it.
The server was acting as a proxy and received
something bad from the upstream server.
The server was acting as a proxy and did not
receive a timely response from the upstream server.
Want more status codes?
Here’s your source: https://httpstatusdogs.com/
Overall HTTP Interaction
So where does HTTPS come into play?
That is: 

HTTP over TLS, HTTP over SSL, and HTTP Secure
What HTTPS Is
• HTTPS provides authentication to the website and
protection of the privacy and integrity of the exchanged
data
• Security is brought to you by the Secure Sockets Layer
(SSL) or the improved Transport Layer Security (TLS).
• Encryption is brought to you by Public Key
Encryption and Symmetric Key Encryption.
• This security component happens between HTTP
request and TCP (before they connect).
HTTPS Happens Before the Connection is Made
How HTTPS Works
• Client/Server Hellos
• Authenticate Client and Server with Cryptography
• Generate session keys
• Further interactions will be based on the encrypted
session keys
Questions?
Resources
• “What is the role of the OSI layers when making a request to a website?” 

https://www.quora.com/What-is-the-role-of-OSI-layers-when-we-open-
a-webpage
• “HTTP: The Protocol Every Web Developer Must Know - Part 1"

https://code.tutsplus.com/tutorials/http-the-protocol-every-web-
developer-must-know-part-1--net-31177
• “HTTP: The Protocol Every Web Developer Must Know - Part 2"

https://code.tutsplus.com/tutorials/http-the-protocol-every-web-
developer-must-know-part-2--net-31155
• "Understanding HTTP Basics"

http://learn.onemonth.com/understanding-http-basics

Contenu connexe

Tendances

HTTP & HTML & Web
HTTP & HTML & WebHTTP & HTML & Web
HTTP & HTML & Web
Peter R. Egli
 
Linux Apache Php Mysql Lamp1273
Linux Apache Php Mysql Lamp1273Linux Apache Php Mysql Lamp1273
Linux Apache Php Mysql Lamp1273
hussulinux
 

Tendances (20)

21 HTTP Protocol #burningkeyboards
21 HTTP Protocol #burningkeyboards21 HTTP Protocol #burningkeyboards
21 HTTP Protocol #burningkeyboards
 
Web technology Unit-I Part D - message format
Web technology Unit-I  Part D - message formatWeb technology Unit-I  Part D - message format
Web technology Unit-I Part D - message format
 
Class 1 - World Wide Web Introduction
Class 1 - World Wide Web IntroductionClass 1 - World Wide Web Introduction
Class 1 - World Wide Web Introduction
 
HTTP Protocol Basic
HTTP Protocol BasicHTTP Protocol Basic
HTTP Protocol Basic
 
PHP Training: Module 1
PHP Training: Module 1PHP Training: Module 1
PHP Training: Module 1
 
Http methods
Http methodsHttp methods
Http methods
 
Web server
Web serverWeb server
Web server
 
HTTP
HTTPHTTP
HTTP
 
HTTP request and response
HTTP request and responseHTTP request and response
HTTP request and response
 
Http-protocol
Http-protocolHttp-protocol
Http-protocol
 
HTTP & HTML & Web
HTTP & HTML & WebHTTP & HTML & Web
HTTP & HTML & Web
 
Lec 7(HTTP Protocol)
Lec 7(HTTP Protocol)Lec 7(HTTP Protocol)
Lec 7(HTTP Protocol)
 
HTTP
HTTPHTTP
HTTP
 
HTTP - The Protocol of Our Lives
HTTP - The Protocol of Our LivesHTTP - The Protocol of Our Lives
HTTP - The Protocol of Our Lives
 
HTTP
HTTPHTTP
HTTP
 
Http
HttpHttp
Http
 
HTTP
HTTPHTTP
HTTP
 
Http protocol
Http protocolHttp protocol
Http protocol
 
Get and post methods
Get and post methodsGet and post methods
Get and post methods
 
Linux Apache Php Mysql Lamp1273
Linux Apache Php Mysql Lamp1273Linux Apache Php Mysql Lamp1273
Linux Apache Php Mysql Lamp1273
 

En vedette (6)

Web protocols for java developers
Web protocols for java developersWeb protocols for java developers
Web protocols for java developers
 
Intro to web services
Intro to web servicesIntro to web services
Intro to web services
 
HTTP/2 Comes to Java - What Servlet 4.0 Means to You
HTTP/2 Comes to Java - What Servlet 4.0 Means to YouHTTP/2 Comes to Java - What Servlet 4.0 Means to You
HTTP/2 Comes to Java - What Servlet 4.0 Means to You
 
Spring Framework - MVC
Spring Framework - MVCSpring Framework - MVC
Spring Framework - MVC
 
Internet of Things - The Tip of an Iceberg
Internet of Things - The Tip of an IcebergInternet of Things - The Tip of an Iceberg
Internet of Things - The Tip of an Iceberg
 
Introduction to Development for the Internet
Introduction to Development for the InternetIntroduction to Development for the Internet
Introduction to Development for the Internet
 

Similaire à Understanding the Web through HTTP

Computer network (10)
Computer network (10)Computer network (10)
Computer network (10)
NYversity
 
internet programming and java notes 5th sem mca
internet programming and java notes 5th sem mcainternet programming and java notes 5th sem mca
internet programming and java notes 5th sem mca
Renu Thakur
 
Web Server Technologies I: HTTP
Web Server Technologies I: HTTP Web Server Technologies I: HTTP
Web Server Technologies I: HTTP
webhostingguy
 
Hypertext Transfer Protocol
Hypertext Transfer ProtocolHypertext Transfer Protocol
Hypertext Transfer Protocol
Rajan Pandey
 

Similaire à Understanding the Web through HTTP (20)

Compute rNetwork.pptx
Compute rNetwork.pptxCompute rNetwork.pptx
Compute rNetwork.pptx
 
Web technology-guide
Web technology-guideWeb technology-guide
Web technology-guide
 
Api 101
Api 101Api 101
Api 101
 
Hypertexttransferprotocolhttp 131012171813-phpapp02
Hypertexttransferprotocolhttp 131012171813-phpapp02Hypertexttransferprotocolhttp 131012171813-phpapp02
Hypertexttransferprotocolhttp 131012171813-phpapp02
 
Computer network (10)
Computer network (10)Computer network (10)
Computer network (10)
 
Application layer protocols
Application layer protocolsApplication layer protocols
Application layer protocols
 
15 Application layer.pptx
15 Application layer.pptx15 Application layer.pptx
15 Application layer.pptx
 
An Introduction to HTTP
An Introduction to HTTPAn Introduction to HTTP
An Introduction to HTTP
 
Httpbasics 1207412539273264-9-converted
Httpbasics 1207412539273264-9-convertedHttpbasics 1207412539273264-9-converted
Httpbasics 1207412539273264-9-converted
 
Le Wagon - Web 101
Le Wagon - Web 101Le Wagon - Web 101
Le Wagon - Web 101
 
Http
HttpHttp
Http
 
Basic concept of internet
Basic concept of internetBasic concept of internet
Basic concept of internet
 
internet programming and java notes 5th sem mca
internet programming and java notes 5th sem mcainternet programming and java notes 5th sem mca
internet programming and java notes 5th sem mca
 
Http_Protocol.pptx
Http_Protocol.pptxHttp_Protocol.pptx
Http_Protocol.pptx
 
Http VS. Https
Http VS. HttpsHttp VS. Https
Http VS. Https
 
Advanced Web Design And Development BIT 3207
Advanced Web Design And Development BIT 3207Advanced Web Design And Development BIT 3207
Advanced Web Design And Development BIT 3207
 
Web Server Technologies I: HTTP
Web Server Technologies I: HTTP Web Server Technologies I: HTTP
Web Server Technologies I: HTTP
 
Web Server Technologies I: HTTP & Getting Started
Web Server Technologies I: HTTP & Getting StartedWeb Server Technologies I: HTTP & Getting Started
Web Server Technologies I: HTTP & Getting Started
 
Hypertext Transfer Protocol
Hypertext Transfer ProtocolHypertext Transfer Protocol
Hypertext Transfer Protocol
 
Taking a Quantum Leap with Html 5 WebSocket
Taking a Quantum Leap with Html 5 WebSocketTaking a Quantum Leap with Html 5 WebSocket
Taking a Quantum Leap with Html 5 WebSocket
 

Dernier

Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Monica Sydney
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
ayvbos
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
ydyuyu
 
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Monica Sydney
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
JOHNBEBONYAP1
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
pxcywzqs
 
一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理
F
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
gajnagarg
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
ydyuyu
 

Dernier (20)

Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
 
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
 
Call girls Service in Ajman 0505086370 Ajman call girls
Call girls Service in Ajman 0505086370 Ajman call girlsCall girls Service in Ajman 0505086370 Ajman call girls
Call girls Service in Ajman 0505086370 Ajman call girls
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime BalliaBallia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
 
一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
 
Best SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasBest SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency Dallas
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
 
Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
 

Understanding the Web through HTTP

  • 1. Understanding the Web through HTTP Olivia Brundage
  • 2. Agenda • Overall Flow of Data • How HTTP Requests Work • Introduction to HTTPS
  • 3. Meet Datum! He’s just a baby now, but let’s see how he grows into a big data through the OSI (Open System Interconnection) model.
  • 4. Physical Layer Datum’s home town. He communicates with everyone through a physical medium (like wires). His language is bits (0’s and 1’s).
  • 5. Trailer Data Link Layer To talk to neighbors, Datum’s bits gets encapsulated as a frame so that the receiver know the start and end of the message. This layer provides node- to-node data transfer.Header DATA 1010 101001000100111 Bit pattern that specifies the start of the frame Bit pattern that specifies the end of the frame Frame
  • 6. Network Layer In order to reach the outside world, Datum has to be transformed into a packet. Routers are responsible directing data to the correct machine. This is where you’ll find IP addresses. IP
  • 7. Transport Layer To reach his destination, Datum must be transported via a segment or datagram. Segments are sent through the Transmission Control Protocol (TCP), which is for a connection- oriented transmission. Datagrams are sent through the User Datagram Protocol (UDP), which is for a connectionless transmission (e.g., streaming). IP
  • 8. Session Layer Upon arriving at his destination, Datum must create an open session to the client, so that they can continue their business. Once here, Datum evolves into his final form: Data. IP
  • 9. Presentation Layer Datum is now on the full screen! This layer takes all your backend code, CSS files, etc and delivers them to the final layer. IP
  • 10. Application Layer This layer is the end-user product and contains high-level APIs like resource sharing and remote file access. This is also the layer you develop in! IP
  • 11. What’s with this abstraction? • Gives us a framework on how data transforms throughout the network. • But it’s a little too specific; real networks are a lot muddier than this.
  • 12. OSI vs TCP/IP TCP/IP combines some layers of the OSI, making it more succinct to the messier way of real life.
  • 13. Where does HTTP fit into this?
  • 14. First, let’s go over what HTTP is • HTTP stands for hyper-text transfer protocol. • This protocol is in plain-text and is stateless. • This protocol resides in the application layer.
  • 15. Let’s break down these requests!
  • 16. Make the Request! You type the URL (Uniform Resource Locator) in the browser: http://www.google.com
  • 17. Hey, wait! What’s an URL? http://www.domain.com:1234/path/to/resource?a=b&x=y protocol host port resource path query
  • 18. Now, time to get the IP address! After you type the address, another application layer protocol is used to get the IP address:
 the Domain Name System (DNS) What’s the IP to Google’s server? Google’s IP is 65.246.5.22 Domain Name Server Web Browser
  • 19. HTTP makes the Request Racket
  • 20. Generic Structure of HTTP Requests message = <start-line>
 *(<message-header>)
 CRLF # Carriage Return Line Feed (i.e., new line)
 [<message-body>] • Start line contains the initial request • Message headers give more details about the request you’re making (i.e., the host, how to maintain the connection, how to handle cookies, etc). NB: GET requests do not contain a message body, but POST requests can.
  • 21. tl/dr: A simple request looks likes: VERB RESOURCE-URL PROTOCOL
 MESSAGE-HEADERS GET / HTTP/1.1
 HOST: www.google.com
 CONNECTION: keep-alive
  • 22. HTTP Main Verbs • GET: fetches a resource determined by the URL • The server sends the resource in the message body if the status code is 200 • POST: creates a new resource where the requests specifies the data needed for the resource • Params are carried in the body of the request instead of the header; making this a more ‘secure’ type of request • PUT: updates a resource • DELETE: deletes a resource NB: PUT and DELETE can be considered a specialized versions of POST
  • 23. Lesser-known Verbs • HEAD: Requests only the server headers. Primarily used for checking if the resource has changed via timestamps. • TRACE: Retrieves the hops that a request takes to round trip the serve. Used for network diagnostic purposes. • OPTIONS: Retrieves the server capabilities. For the client-side, it can be used to modify the request based on what the server can support.
  • 24. HTTP Packet gets ready for Transportation! HTTP Request HTTP Packet TCP Packet The TCP information maintains the session.
 Now to the IP layer! TCP
  • 25. TCP now hands it over to the Internet Protocol • Local/Sender Address: Your PC’s IP • Receiver Address: Google’s Server IP • Post Service Nodes: Routers
  • 26. HTTP Request IP IP further encapsulates the data TCP TCP IP Packet Now we head over to the last layer!
  • 27. Trailer HTTP Request Header The Network Interface Layer makes the Ethernet frame. IP TCP IP Packet Ethernet Frame We can finally send this HTTP request out!
  • 28. The HTTP request is out!
  • 30. But there’s still more to HTTP!!
  • 31. Some important notes about the response: • The server will send the status code along with the message payload. • The status code tells the client how to interpret the server response.
  • 32.
  • 33. 1xx: Informational Messages • This is just a provisional code and provides informational messages like: • Keep this connection alive (i.e., still sending information) • Tell the client to continue sending it’s message • Ignore the next response • This class was introduces in HTTP/1.1. Version 1.0 ignores this message.
  • 35. Request was completely successful.
  • 36. Message successful, but there was no message body
  • 37. 3xx: Redirection Your request needs to directed elsewhere.
  • 38. Resource has moved to a new URL.
  • 39. Resource has not been modified since last request.
  • 40. 4xx: Client Error When the server thinks the client made a bad request.
  • 41. Request can’t be fulfilled due to bad syntax.
  • 42. Specifically used when authentication has failed.
  • 43. Request was valid, but the server won’t respond.
  • 44. Resource can’t be found. Try again later?
  • 45. Method isn’t supported (like using a GET on a form that requires a POST method)
  • 46. 5xx: Server Error Server failed creating the request
  • 47. The infamous, generic server error.
  • 48. The server doesn’t recognize the request method or can’t fulfill it.
  • 49. The server was acting as a proxy and received something bad from the upstream server.
  • 50. The server was acting as a proxy and did not receive a timely response from the upstream server.
  • 51. Want more status codes? Here’s your source: https://httpstatusdogs.com/
  • 53. So where does HTTPS come into play? That is: HTTP over TLS, HTTP over SSL, and HTTP Secure
  • 54. What HTTPS Is • HTTPS provides authentication to the website and protection of the privacy and integrity of the exchanged data • Security is brought to you by the Secure Sockets Layer (SSL) or the improved Transport Layer Security (TLS). • Encryption is brought to you by Public Key Encryption and Symmetric Key Encryption. • This security component happens between HTTP request and TCP (before they connect).
  • 55. HTTPS Happens Before the Connection is Made
  • 56. How HTTPS Works • Client/Server Hellos • Authenticate Client and Server with Cryptography • Generate session keys • Further interactions will be based on the encrypted session keys
  • 58. Resources • “What is the role of the OSI layers when making a request to a website?” 
 https://www.quora.com/What-is-the-role-of-OSI-layers-when-we-open- a-webpage • “HTTP: The Protocol Every Web Developer Must Know - Part 1"
 https://code.tutsplus.com/tutorials/http-the-protocol-every-web- developer-must-know-part-1--net-31177 • “HTTP: The Protocol Every Web Developer Must Know - Part 2"
 https://code.tutsplus.com/tutorials/http-the-protocol-every-web- developer-must-know-part-2--net-31155 • "Understanding HTTP Basics"
 http://learn.onemonth.com/understanding-http-basics