You are on page 1of 11

 53 percent of site visitors will leave a page that takes longer than three seconds to load 

 Existent HTTP Versions


o HTTP 0.9 (Initial version of HTTP — a simple client-server, request-response, telenet-
friendly protocol)
o HTTP 1.0 (Provided header fields including rich metadata about both request and
response (HTTP version number, status code, content type))
o HTTP 1.1 (This is the HTTP version currently in common use.  Introduced critical
performance optimizations and feature enhancements — persistent and pipelined
connections, chunked transfers, compression/decompression, content negotiations,
virtual hosting (a server with a single IP Address hosting multiple domains), faster
response and great bandwidth savings by adding cache support)
·         HTTP 2.0 (HTTP/2 is binary, instead of textual. HTTP/2 is fully multiplexed. This means
that HTTP/2 can send multiple requests for data in parallel over a single TCP connection ,
while Most modern browsers limit TCP connections to one server. It uses header
compression  to reduce overhead)
o HTTP 3 (is the upcoming third major version of the Hypertext Transfer Protocol used to
exchange binary information on the World Wide Web)

Why do we need DNS?


DNS (Domain Name Server) is mainly used to convert human meaningful name (domain
name) to computer meaningful name (IP address) in Internet.
Usa TCP o UDP usa ambas dependiendo de lo que este haciendo, para respuesta usualmente
tienen UDP por ser rápido. Es el mismo puerto para ambos protocolos.

DNS hierarchy – Types of servers


DNS Resolver: that stores a central database of DNS nameservers and
manages DNS requests for all the clients on your network. This one could be a local
server you have in your company, or could be a public server, or your ISP’s, for
example: Google has one.
DNS Root Server:

Types of records
A record takes a name and returns a v4 IP.
AAAA takes a name and returns a v6 IP.
MX takes a name and returns an ordered list of servers to accept mail for that domain.
SRV and TXT records are just textual fields that have been adapted for any number of things.
The PTR record takes an IP address and returns a name, sometimes.
The NS record takes a name and returns a list of servers that are knowledgeable about the records in
that domain, where subqueries should be directed. (NSLOOKUP)
start of authority (SOA) record is information stored in a domain name system (DNS) zoneabout
that zone and about other DNS records. Each zone contains a single SOA record.

Zone and zone transfers


Primary : Tiene acceso a definir los records .
Secondary: Son los que responden a las peticiones del resolver. Son ogales, tiene toda la
informacion pero el primario puede editar.
DNS resolves more than just IP addresses. That system is extensible to multiple record types.

Public DNS, which is commonly used for internet connections has a number of its problems related
to malicious behaviour initiated by hackers.
The internal DNS, used within enterprises, has problems relating to configuration mistakes and
errors that can prove difficult to solve if you’re not aware of what to look out for.

 3 types of DNS queries—recursive, iterative, and non-recursive


 3 types of DNS servers—DNS Resolver, DNS Root Server and Authoritative
Name Server
 10 types of common DNS records—including A, AAAA, CNAME, MX and NS

Recursive Query

In a recursive query, a DNS client provides a hostname, and the DNS Resolver “must”
provide an answer—it responds with either a relevant resource record, or an error
message if it can't be found.

The resolver starts a recursive query process, starting from the DNS Root Server, until it
finds the Authoritative Name Server (for more on Authoritative Name Servers see DNS
Server Types below) that holds the IP address and other information for the requested
hostname.

Iterative Query

In an iterative query, a DNS client provides a hostname, and the DNS Resolver returns
the best answer it can. If the DNS resolver has the relevant DNS records in its cache, it
returns them. If not, it refers the DNS client to the Root Server, or another Authoritative
Name Server which is nearest to the required DNS zone. The DNS client must then
repeat the query directly against the DNS server it was referred to. A pata. Va paso a
paso, todos los request tienen que Volver hasta browser y luego pedir de nuevo.

Non-Recursive Query

A non-recursive query is a query in which the DNS Resolver already knows the answer.
It either immediately returns a DNS record because it already stores it in local cache, or
queries a DNS Name Server which is authoritative for the record, meaning it definitely
holds the correct IP for that hostname. In both cases, there is no need for additional
rounds of queries (like in recursive or iterative queries). Rather, a response is
immediately returned to the client.
Domain (Akamai. Com) encapsulates hostnames (smtp, ns1, mail, www), also is the
hostname assigned to the computer, it has an ip address assigned, a physical machine
in front of it.

Glue Records: 

What glue records do is to allow the TLD's servers to send extra information in their response to
the query for the example.com zone - to send the IP address that's configured for the name
servers, too. It's not authoritative, but it's a pointer to the authoritative servers, allowing for the
loop to be resolved

Zones
Los registros DNS están contenidos en archivos de zona, que son simples archivos de texto que
agrupan todos los registros referentes a la zona de la cual se ocupa el servidor en cuestión. Cuando
un cliente realiza una solicitud, el servidor receptor obtiene la información necesaria de este archivo.
Normalmente, un mismo dominio funciona con varios servidores: además del servidor web, que
provee la página web, a menudo también un servidor FTP y uno o incluso varios servidores de
correo electrónico

What is HTTP?
HTTP (Hypertext Transfer Protocol) is the set of rules for transferring files, such as text, graphic
images, sound...

HTTP request/response flow.

Communication between clients and servers is done


by requests and responses:

1. A client (a browser) sends an HTTP request to the web


2. An web server receives the request
3. The server runs an application to process the request
4. The server returns an HTTP response (output) to the browser
5. The client (the browser) receives the response
Request Methods
GET
The GET method is used to retrieve information from the given server using a given
URI. Requests using GET should only retrieve data and should have no other effect on
the data.
POST
A POST request is used to send data to the server, for example, customer information,
file upload, etc. using HTML forms.
PUT
Replaces all current representations of the target resource with the uploaded content.
DELETE
OPTIONS

Request and Response Headers

Header: Additional inf or parameters client and server sent along with a request or
answer.
Request Headers: HTTP request, and that doesn't relate to the content of the message.
Request headers.
Like Accept, Accept-*, or If-*allow to perform conditional requests; others
like Cookie, User-Agent or Referer precise the context so that the server can tailor the
answer.

GET /home.html HTTP/1.1


Host: developer.mozilla.org
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:50.0)
Gecko/20100101 Firefox/50.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Referer: https://developer.mozilla.org/testpage.html
Connection: keep-alive
Upgrade-Insecure-Requests: 1
If-Modified-Since: Mon, 18 Jul 2016 02:36:04 GMT
If-None-Match: "c561c68d0ba92bbeb8b0fff2a9199f722e3a621a"
Cache-Control: max-age=0
Mencionar: Req: Host, Accept, cache-control

Response Header: used to give a more detailed context of the response.

HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Connection: Keep-Alive
Content-Encoding: gzip
Content-Type: text/html; charset=utf-8
Date: Mon, 18 Jul 2016 16:06:00 GMT
Etag: "c561c68d0ba92bbeb8b0f612a9199f722e3a621a"
Keep-Alive: timeout=5, max=997
Last-Modified: Mon, 18 Jul 2016 02:36:04 GMT
Server: Apache
Set-Cookie: mykey=myvalue; expires=Mon, 17-Jul-2017 16:06:00 GMT; Max-
Age=31449600; Path=/; secure
Transfer-Encoding: chunked
Vary: Cookie, Accept-Encoding
X-Backend-Server: developer2.webapp.scl3.mozilla.com
X-Cache-Info: not cacheable; meta data too large
X-kuma-revision: 1085259
x-frame-options: DENY

Caching
Age
The time, in seconds, that the object has been in a proxy cache.

Cache-Control
Directives for caching mechanisms in both requests and responses.

Clear-Site-Data
Clears browsing data (e.g. cookies, storage, cache) associated with the
requesting website.

Expires
The date/time after which the response is considered stale.

Pragma
Implementation-specific header that may have various effects anywhere along the
request-response chain. Used for backwards compatibility with HTTP/1.0 caches
where the Cache-Control header is not yet present.

Warning
General warning information about possible problems.

no-cache
A cache must not use the response to satisfy a subsequent request without successful
revalidation with the origin server.
no-store
The cache should not store anything about the client request or server response.

Response Codes
is a 3-digit integer where the first digit of the Status-Code defines the class of response and
the last two digits do not have any categorization role .

1xx Informational:
100 Continue: Only a part of the request has been received by the server, but as long as it has not
been rejected, the client should continue with the request.

2xx Successful
200 OK: It was okay.
201 Created: The request is complete, and a new resource is created 

3xx Redirection
301 Moved Permanently: The page has moved to a new url.
302 Found: The resource has been changed to a new url temporarily.
304 Not modified: Hace redireccion al cache.

4xx Client error:


401 Unauthorized: The requested page needs a username and a password.
403 Forbidden: Access is forbidden to the requested page.
404 Not Found: The server cannot find the requested page.

5xx Server Client:


500 Internal Server Error: The request was not completed. The server met an unexpected
condition.

=Each one of these has their own RFC=

HTTP Caching
By the use of this cache response headers we can make caching possible, this is crucial for
improving web performance, how?
Making the request/response flow (or round trip) faster, which will make you customers to stay
in your web page. 10 miliseconds when it comes to loading a web page are important.
But does this consist of?
Lets say you go to a restaurant you love, and ask the same meal everyday. But, the
waitress is smart, and as she knows what ur gonna order beforehand, so she already
has it made for you.
Happens the same way with caching, this is a service which temporarily stores some
data so it can be easier and faster for you to get what you need. In a CDN, some
servers keep “copies” of content so it can be reused whenever someone needs it.
Why is Akamai best option as a CDN?
counting with more than 260000 servers over the world, you can be sure there will be
one nearby your client,

Headers: Cache Control: max-age, expires no sirve de nada si hay un max-age.

Para usar expires:


Cache control = private
Expires = 16/11/2019
Last-mofied: date
Esta es la mejor forma de cachear por headers.
Preguntas

1. Dns resolver es un dispositivo fisico o es algo logico/virtual? Se implementa, se


configura o lo tiene el procesador?
Es un servicio, no es hardware. El de google es 8.8.8.8 o 8.8.4.4, este es publico,
usualmente en una empresa con propios dns servers se utilizan los locales antes que los
públicos, pero yo lo puedo cambiar. Se configura, pero es mas un servicio que un
dispositivo.

2. Ventaja de Akamai sobre la competencia:


R/ Buscar SLA (garantia, Akamai ofrece esto como ventaja sobre el resto) (availability/.uptime)
Tiene servidores alrededor de todo el mundo.

3. Cuando nos metemos a un pagina del buscador de google, hace el mismo proceso de
DNS que si lo hiciera directamente con URL?
R/ SII, es lo mismo.

4. Donde esta host.txt?


Cambia dependiendo del SO.

5. What else is sent along with the IP address at the end?


Al final solo la IP, pero las dos primeras el ns & A record.

6. Where does the zone lives?


El ANS tiene la primaria, zona primaria puede estar un servidor o varios.

7. Is there a particular record to help me do the zone transfer ?


R/ SOA uses its serial number. It has main info to do the zone transfer.

8. Que inf tiene el SOA record?

 the name of the server that supplied the data for the zone.
 the administrator of the zone; the current version of the data file
 the number of seconds a secondary name server should wait before checking for updates
 the number of seconds a secondary name server should wait before retrying a failed zone
transfer
 the maximum number of seconds that a secondary name server can use data before it must
either be refreshed or expire
 a default number of seconds for the time-to-live file on resource records
9. ISP mantiene cache, pero cualquier resolver lo tiene? Los locales y los públicos también?
Si, todos lo tienen.

10. Por que se les pone la dirección de loopback en HOSTs txt


Hace loopback a la misma compu, para que busque en si misma.
11. What happens if the SN (Serial Number) on the primary DNS is lower than SN on the
secondary DNS?
If the secondary DNS has a higher SN than the primary DNS a zone transfer will not
happen. To fix this, the SOA SN for a zone would need to be changed to a serial number
higher than SOA serial number on the secondary server.

Contenido estatico: Aquel que se mantiene,


Contenido dinamico: aquel que se genera automáticamente en el momento que alguien solicita su
visualización, por tanto, puede cambiar dependiendo de quién lo solicite o en qué momento lo haga.

Cache privado: Solo es para el usuario final, pero individual. Ej: Correo, cuentas, etc.
Usualmente no se cachea.
Shared: Los que se comparten entre todos en un grupo, sin mporter quien lo pueda ver. Lets say
google guarda algo en cache para un grupo privilegiado.
Public: Todo, cualquiera lo ve.

PROXY

A forward proxy, often called a proxy, proxy server, or web proxy, is a server that
sits in front of a group of client machines. When those computers make requests to
sites and services on the Internet, the proxy server intercepts those requests and
then communicates with web servers on behalf of those clients, like a middleman.
Reverse
A reverse proxy is a server that sits in front of web servers and forwards client (e.g.
web browser) requests to those web servers. Reverse proxies are typically
implemented to help increase security, performance, and reliability. In order to
better understand how a reverse proxy works and the benefits it can provide, let’s
first define what a proxy server is.

Post no selecciona a donde va


Put se debe especificar el path, a que parte del server se manda.
Buscar get vs put y saber otros métodos

You might also like