HTTP Request Workshop

Welcome to the HTTP Request Workshop by pekkakorpi-tassi.fi!

Overview

HTTP Request Workshop is available through pekkakorpi-tassi.fi website. During the workshops learners can engage in hands-on learning activities to increase their familiarity with HTTP Requests and surrounding key topics. The workshop consists of following key resources:

  • Main page of the workshop published on pekkakorpi-tassi.fi website.
  • REST API that allow learners to explore and learn about HTTP Requests.
  • Interactive Jupyter Notebook on GitHub helps learners to explore HTTP Requests and associated technologies by running Python code that contains technical arrangements to test the REST API.
  • API documentation for the REST API that acts as a technology demonstrator and as a general example about API documentation.

The constituent parts of the workshop can be used for self-paced learning, although it is primarily meant to be complemented by instructor-led workshops.

The learning environment for the workshops is meant to be learner-specific Jupyter Notebook (previously Python Notebook) that can be opened by local software or online services that allow working with this type of files. Jupyter Notebooks contain text sections written in Markdown syntax rendered as HTML and code sections that contain Python code than can be executed within Jupyter Notebook.

Learning Environment

Interactive Jupyter Notebook (.ipynb) file can be opened in Google Colab or Binder can be used for self-paced learning, although it is primarily meant to be complemented by instructor-led workshops. During the workshops learners can engage in hands-on learning activities and building their own documentation while exploring HTTP Requests.

Foundational Topics

Before we should talk about the HTTP Requests (which are the part of the HTTP protocol that allow two applications - often the client and the server - to exchange messages between one another) it is useful for us to talk about the structure of the Internet and OSI Reference Model. We have included details about HTTP Protocol and URL to Jupyter Notebook. These are some starting resources for the learners about things related to HTTP Requests.

Structure of the Internet

It is important to have a firm grasp on the structure of the Internet if you want to understand how Public IP addresses are related to data transfer over public networks. HTTP Requests transfer data by relying on TCP/IP protocol stack after all. Here we will seek to elaborate on the major components of the Internet so that learners can better understand Public IP addresses, ping, traceroute and HTTP protocol.

Interent is actually a large gathering of interconnected networks called Autonomous Systems (AS). These Autonomous Systems are basically Internet Service Providers’ (ISP) networks, although the whole truth is more nyanced. ISPs maintain and operate their own networks that they connect to the Backbone Network of the country they operate in. ISPs have been allocated Public IP Addresses by ICANN organization that they are able to assign to their Customers (organizations and individuals) when customers connect their networks or devices to ISPs’ networks. Backbone Networks are connected to other networks big and small in other geographical areas by Undersea Cables. This setup is called the Internet, and that is where the network traffic must flow.

These are excellent resources for the learners to observe how the Interent is structured globally:

You can check how Public IPv4 Addresses are distributed in Finland to Autonomous Systems (ISPs and other organizations) from this resource:

OSI Reference Model and Communication Protocols

Open Systems Interconnect (OSI) is a conceptual model that is used to explain how traffic over the Internet happens. It is not a standard or a specification, but explains the roles of different communication protocols in transmitting and receiving network traffic. There are 7 layers in OSI reference model and in this chapter we try to outline the role and functions of each layer in understandable way.

Layer 7 Application

  • Protocols: HTTP (web pages), FTP (files), SMPT (email), SSH (secure shell), RDP (remote desktop), DNS (name resolution), VPN (OpenVPN)
  • Explanation: Application layer refers to applications being run on Operating System. These applications are the source and the destination of network traffic. In context of web pages and web services HTTP is the most common communication protocol of this layer, but it is important to remember, that top level protocols such as HTTP always rely on lower level protocols TCP and Ethernet.
  • DNS protocol is for resolving URLs to IP addresses
  • all of these may use DNS protocol (for resolving URLs to IP addresses)
  • all of these rely on TCP protocol (for data transfer between networks)
  • all of these rely on BGP protocol (routing network traffic over interconnected networks)
  • all of these rely on IP addresses (for discovering which network a device that has an IP address associated to is part of)
  • all of these rely on Ethernet protocol (for network traffic in local network)
  • all of these rely on MAC addresses (for uniquely identifying devices in local network)
  • all of these rely on physical data transfer mediums (copper wires, optical fibres, radio waves)
  • Manifests in: Applications themselves include libraries that implement features required for HTTP protocol

Layer 6 Presentation

  • Protocols: TLS/SSL, different data formats
  • Explanation: Presentation layer work on Applications and Operating Systems. This layer is responsible of transforming data between formats suitable for use by application and suitable to be transmitted. It involves compression, decompression, encryption, de-encryption and splitting up data for transmit and for reassembling data so that it can be used.
  • HTTP protocol relies on TLS/SSL protocol (https://) and TLS certificates to encrypt/descrypt a part of network traffic
  • this layer is involved with data encoding, data compression, MIME types, graphics and image formats, audio and video codes and document formats
  • Manifests in: Media players are able to handle different data formats and TLS (Transport Layer Security) for encryption and decryption

Layer 5 Session

  • Protocols: NetBIOS, PPTP, RPC
  • Explanation: Session layer is responsible of creating, maintaining and tearing down sessions between source and destination applications. It helps to establish communication pipeline between source and destination applications that data can be exchanged through.
  • these protocols and their relevance to other protocols may not be well known or easy to understand
  • protocols such as HTTP, FTP, SMPT and SSH may handle session management on Layer 7 rather than Layer 5 or not require session management in Session Layer
  • Manifests in: Remote Desktop Protocol (RDP) leverages Session layer to manage and maintain client-server connection

Layer 4 Transport

  • Protocols: TCP, UDP
  • Explanation: Transport layer provides end-to-end communication channel that provides features such as error detection, error correction, flow control and resending lost or broken data packets.
  • TCP protocol is the main protocol used for network traffic over interconnected networks
  • UDP protocol is protocol used for data streams (some data loss is acceptable) over interconnected networks
  • Manifests in: Operating Systems have implementations for these protocols and applications are consumers of APIs of these features

Layer 3 Network

  • Protocols: BGP, IP, VPN (IPSec)
  • Explanation: Network layer provides addressing features for networks, finding the path between networks over a collection of networks (routing) and forwarding of data packets between different networks.
  • BGP protocol is for routing network traffic over interconnected networks
  • IP addresses are used for discovering which network a device that has an IP address associated to is part of
  • VPN protocol is used for creating a secure and private communication channel over an existing network (often Internet)
  • Manifests in: network equipment Router works on this layer

Layer 2 Data Link

  • Protocols: Ethernet, MAC
  • Explanation: Data link provides point-to-point communication channel between devices that are directly connected in the same network and provides features such as error detection, error correction, flow control and resending lost or broken data packets.
  • Ethernet protocol is used for network traffic in local network
  • MAC addresses for uniquely identifying devices in local network
  • Manifests in:network equipment Switch works on this layer

Layer 1 Physical

  • Mediums: copper wires, optical fibres, radio waves
  • Explanation: Physical layer refers to physical connection between devices and includes hardware elements that handle the network traffic such as cables, connectors and signalling.
  • underneath everything there is the physical transmission medium (electric current, light, radio waves)
  • Manifests in: RJ45 cables and network equipment such as Modem and Network Interface Card works on this layer

On to the Workshop

Learning environment enables learners to test HTTP Requests against live API over the Internet. For the purposes of this workshop we suggest using one of the two learning environment options:

  • Open Jupyter Notebook of this work shop with Google Colab: http_request_workshop.ipynb
    • You have to login with Google account to be able to execute Python code.
    • This is the recommended method of interacting with Jupyter Notebook.
  • Open Jupyter Notebook of this work shop with Binder: http_request_workshop.ipynb
    • There are yet unresolved errors in this environment with ping and tracert commands of icmplib library.
    • This is the optional method of interacting with Jupyter Notebook.

Disclaimer

All the information in this repository is published in good faith and for general information purpose only. I do not make any warranties about the completeness, reliability and accuracy of this information. Any action you take upon the information you find in this repository, is strictly at your own risk. I will not be liable for any losses and/or damages in connection with the use of materials in this repository.

License

The materials of this workshop - specifically the associated entry on pekkakorpi-tassi.fi website and materials made available through GitHub repository github.com/p3kk4/http_request_workshop (excluding any source code of associated API and API documentation) - are made available under the terms of the Creative Commons Attribution Non Commercial No Derivatives 4.0 International License.