Network Requests (JS)
Network Requests (JS)
1. Introduction
2. What is a Protocol ?
6. HTTP/HTTPS
To understand the “how”, let’s first find out what network requests are and what the
above mentioned terms actually mean.
Protocols
As MDN states: “A protocol is a system of rules that define how data is exchanged
within or between computers.”
A well-known analogy is two people from different countries not speaking each
other’s native language and therefore using a third common language to
communicate.
There are many protocols for different process types. It is easier to categorize them
by defining what OSI level they can be found in.
It does not perform any function in the networking process but describes 7 layers
that the communication between two devices goes through.
1. Physical Layer
Is the lowest layer of the OSI model. What it is concerned with is transmitting data
from the physical layer of the sending device to the physical layer of the receiving
device either electronically or optically. It is all about the actual physical resources
that take part in the data communication process, i.e. cabling, network adapters,
modems, network hubs, etc. Therefore it can have voltage, radio frequency, cabling
specifications. Data at this layer is unstructured.
Defining protocols
So the physical layer is responsible for the physical cable or wireless connection
2. DataLink Layer
It’s also a lower layer where the node-to-node data transfer occurs. The DataLink
layer is where switches operate and it provides a reliable link between two directly
connected nodes to transfer the data
.
This layer is responsible for the following operations:
3. Network Layer
At the Network layer, the focus expands from a point-to-point link to include many
interconnected nodes within a network. Network layer devices operate on packets
and are responsible for routing traffic to its destination based on IP addresses. At
this layer, routers are a crucial component used to quite literally route information
where it needs to go between networks. The router is responsible for sending
packets of information out into the internet and receiving them. These packets origin
and destination is determined by the IP address of your router.
4. Transport Layer
The Transport layer is basically responsible for the logistics of the session.
It has the following functionalities:
5. Session Layer
The Session layer has the task of creating and maintaining sessions between the
operating system on the presentation layer and other, third party machines.
Setup
Termination
Re-connection.
6. Presentation Layer
Plainly said the core responsibility of the Presentation layer us to translate data from
network data to the formats expected by an application. This is the layer where the
Operating System(OS) can be found.
Data encodings and encryption are managed at this layer.
7. Application Layer
The Application layer is where the user inputs data and data is output to the user. It
is a software run the local machine, but not always, since it depends on the network
architecture. The software could run off a server in a remote location and data would
be transferred over the internet, this is the case of the cloud based software.
The Physical, DataLink, Network, Transport layers are considered lower layers and
the Session, Presentation, Application are higher levels.
TCP/IP model predates the OSI model and is more concentrated on the
implementation of networking stacks.
1. Network Access Layer: Ethernet, Token Ring, ATM, and Frame Relay are
examples from the TCP/IP Protocol Suite that operate at this layer.
2. Internet Layer: This layer is primarily covered by the Internet Protocol (IP), but
ARP, IGMP, and ICMP also operate at this layer.
3. Transport Layer: TCP and the User Datagram Protocol (UDP) operate at this
layer.
4. Application Layer: Some protocols that operate at this layer include HTTP,
SMTP, and DNS.
The OSI model is more theoretical, describing the various tasks that must be
accomplished to enable application-layer data to be transmitted via electricity, light,
or radio waves. The TCP/IP model is more practical and maps closely to actual
network protocols. It is a customer server model that is used for data information
transmission. It is a communication protocols suite using which network devices can
be connected to the Internet.
A layer should only be created where the definite levels of abstraction are
needed.
The number of layers should be large so that separate functions should not be
put in the same layer. At the same time, it should be small enough so that
architecture doesn’t become very complicated.
In the OSI model, each layer relies on the next lower layer to perform primitive
functions. Every level should able to provide services to the next higher layer.
Changes made in one layer should not need changes in other laYers.
In TCP/IP, the network remains intact until the source and destination machines
were functioning properly.
TCP offers reliability and ensures that data which arrives out of sequence should
put back into order.
TCP allows you to implement flow control, so the sender never overpowers a
receiver with data.
Post office Protocol (POP): POP3 is designed for receiving incoming E-mails.
Simple mail transport Protocol (SMTP): SMTP is designed to send and distribute
outgoing E-Mail.
File Transfer Protocol (FTP): FTP allows users to transfer files from one
machine to another. Types of files may include program files, multimedia files,
text files, and documents, etc.
Hyper Text Transfer Protocol Secure (HTTPS): Hyper Text Transfer Protocol
Secure, also known as HTTPS, is a common protocol to protect communication
between two computers, one of which is using a browser and the other is
retrieving data from a web server. The client browser (request) and web server
(response) both utilize HTTP to send data between them in a hypertext manner;
HTTPS is similar to HTTP, with the exception that the data transmission takes
place in an encrypted format. So it may be claimed that https prevents hackers
from interpreting or changing data while packets are being transferred.
HTTP/HTTPS
HTTP
HTTPS
Data on websites that use HTTPS cannot be changed since it meets the
requirements for data integrity.
It encrypts data in order to monitor all attackers who aim to access someone's
account and then steal their personal information.