What Happens When You Type A URL In Your Browser And Press Enter

The Web Browser

http://www.holbertonschool.com/index.html
  • http:// tells the browser that we want to access a page using the Hyper Text Transfer Protocol (HTTP). This is a protocol that browsers use to interact with web pages. Other protocol have other purposes, for example ftp:// (File Transfer Protocol) is a protocol used to transfer files across the Internet. https:// is another protocol we will discuss later, but in short, it's the secured version of http://.
  • www is a subdomain of holbertonschool.com; this part refers to a specific location (server) inside the domain where resources are located.
  • holbertonschool.com is the domain name; it represents the server where all the data for "holbertonschool.com" resides.
  • /index.html is the path to the file that will be displayed by the browser.

TCP/IP

  1. Supports flexible architecture: We can connect two devices with totally different architecture using the TCP/IP model.
  2. End-node verification: The end-nodes(source and destination) can be verified, and connection can be made for the safe and successful transmission of data.
  3. Dynamic Routing: The TCP/IP model facilitates the dynamic routing of the data packets through the shortest and safest path. Due to dynamic routing, the path taken by the data packet can not be predicted, and thus it improves data security.
  1. Replacing a protocol is not easy.
  2. The roles and functionalities of each layer are not documented and specified properly, as it is described in the OSI model.
  1. Physical Layer
  2. Data-Link Layer
  3. Internet Layer
  4. Transport Layer
  5. Application Layer

1. Physical Layer

2. Data-Link Layer

3. Internet Layer

4. Transport Layer

  1. TCP: TCP stands for Transmission Control Protocol. It is a connection-oriented protocol. It performs sequencing and segmentation of data. It also performs flow and error control in data transmission. There is an acknowledgement feature in TCP for the received data. It is a slow but reliable protocol. It is suitable for important and non-real time data items.
  2. UDP: UDP stands for User Datagram Protocol. It is a connection-less protocol. It does not perform flow and error control in data transmission. There is no acknowledgement feature in UDP for the received data. It is a fast but unreliable protocol. It is suitable for real-time data items.

5. Application Layer

DNS

Domain name records

  • A record holds the IPv4 address of a domain and is the most important of these records. One domain or sub-domain can have a single IP while one IP can have multiple domains pointing to it.
  • AAAA record is essentially the same as A record but for IPv6 addresses.
  • PTR record finds a domain name in a reverse-lookup when the IP is already known. IP addresses usually have one PTR record each, but multiple PTR records can point to the same domain.
  • CNAME record, or canonical name, forward a domain or sub-domain to another domain without providing an IP address. These can be used as aliases to domains.
  • MX record is the mail exchange record that directs mail to an email server. It indicates how email should be routed to its destination.
  • TXT record lets a domain administrator store text notes in the record. These are commonly used to gauge the trustworthiness and verify ownership of a domain.
  • NS record indicates the authoritative name servers. A domain often has multiple name servers, primary and secondary, to prevent outages in case of failures.

Domain Name Resolution Steps

chrome://net-internals/#dns

DNS Caching

Quick Recap

  1. The full URL went from holbertonschool.com to https://www.holbertonschool.com
  2. There is a green padlock icon next to the URL.
  3. The title “Holberton School of Software Engineering in San Francisco” appears in the title of the browser’s window
  4. The Holberton School web page is now being displayed.

HTTPS, SSL, and TLS

How does it work?

The TLS Handshake

  1. Client sends Client Hello message. This packet includes the version of TLS, length of the packet, the ciphers (types of encryption) the client can handle, and a random string of bytes that is used to create a master key.
  2. Server replies with Server Hello message. This packet includes the cipher the server selected to use, a random string of bytes used to create a master key, and information about the server's certificate of trust.
  3. Server sends the Certificate to the client. This include information about the insurer (for example, VeriSign), company name, terms of use, dates of validity, and the server's public key.
  4. Server sends Certificate Status to the client. Shows whether or not the certificate has been verified successfully. Server also sends Hello Done, marking the end of the introduction between the two.
  5. Client generates a master (or “secret”) key using the random string of bytes, encoding it with the server’s public key.
  6. Client sends it’s public key, along with the master key to the server. This is part of the asymmetric encryption key exchange.
  7. Server receives this key and generates a symmetric key to be used during the session. Symmetric keys are a lot faster and more efficient than asymmetric keys. It’s less secure, but by this point, client and server have been linked with asymmetric keys so the secure connection has already been established. The symmetric key is also generated on the client-side.
  8. Client sends change cipher spec to server to announce a change from asymmetric to symmetric encryption, along with Client Finished.
  9. Server sends change cipher spec and Server Finished message (that is now encrypted with the symmetric key)
  10. Server sends client a new session ticket and the transmissions will not be encrypted across the network.
  • Your browser has a public key.
  • You make a request to holbertonschool.com.
  • When the request hits holberton’s server, it says, “This is a secure website. Before I send you any resources I need to establish authentication and encryption.”
  • TLS handshake occurs
  • Secure session has been established. Green padlock shows up in the address bar, and https appears at the beginning of the URL.

HTTP

HTML

Application Servers

function say_hello(Name, Day, Item) { return "Hello <name>, it is <day>, would you like to buy a <item>? }

Database Servers

Redundancy

Availability

  • Round Robin: if you have 3 servers (A, B and C), the first request goes to A, second to B, third to C, fourth to A, etc.
  • Least Connections: choose the server to the one who has the least amount of connections
  • Random: literally random.
  • Least latency: choose the server that is fastest.

Security

  • Port 80: HTTP
  • Port 443: HTTPS
  • Port 53: DNS

--

--

Tunisian software engineer

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store