Index
Web application is an application that is reachable via WEB browser, but native application is an application which only works upon the device that is installed the application.
WEB Application is distinguished from Web site, in the way it works; it dynamically interacts with its users.
WEB Application only works on the internet but it makes it possible to use it without downloading and installation. It is also easy to maintain it.
TCP/IP((TCP(Transmission Control Protocol)/IP(Internet Protocol)) protocol is one of the most representative protocols to communicate with other computers; it refers to the common language how the computers communicate and trade their data on the internet.
IP address:
IP is the address that is used to identify itself; througth IP address, we can connect to a WEB Application with our devices such as computer. Every computer connecting to the internet gets its own IP address.
IP address consists of 4 chunks which are separated with dot(.); it is called IPv4.
MAC address: MAC address is a serial number assigned to devices by their producers(makers). Combinating with IP address and MAC address, we can use network communication(the Internet).
IP Address is divided by network part and host part; network part contains the information about what network it is connected and host part navigates what computer it is.
TCP and UDP Protocol
TCP: 3-way handshake:
Step1: To connect TCP Sender to Receiver, Synchronize Sequence Number(SYN) is sent to Receiver with a segment.
Step2: Receiver responses to the Sender upon the request. It sends back SYN/ACK(Acknowledgement) set to the receiver, which is the response that the segment is acceptable and valid.
Step3: The Sender sends back the ACK that it got received to the receiver to approve that the trusted and safe communication can be started between the sender and receiver.
UDP: UDP starts communication without 3-hand shake process for rapid communcation and response.
Port
Port number the number for identifying specific application that shares same IP; which means it is assigned to uniquely identify a connection endpoint and to direct data to a specific service.
0~65,535 port numbers can be used, but 0~1023 are already assigned for major protocols(Well-known port: 80: HTTP, 443: HTTPS, etc.)
URL and DNS
URL(Uniform Resource Locator)
URL is a Web address that specifies its location on a computer network and a mechanism for retrieving it.
Domain name
Domain name is used instead of IP address for easy-memorization.
DNS(Domain Name System)
To match a domain name to an IP address, we need DNS.
Here's how it works:
Request Initiation: When you type a domain name (e.g., example.com) into your web browser or application, a DNS lookup is triggered to resolve the domain name into an IP address. This lookup is initiated by your device's operating system.
Local DNS Cache Check: Your device first checks its local DNS cache to see if it has recently resolved the requested domain name. If the IP address is found in the cache and is still valid (not expired), the lookup process ends, and the IP address is used to establish the connection.
Recursive DNS Resolver: If the IP address is not found in the local cache or has expired, the request is sent to a recursive DNS resolver. This resolver is typically provided by your Internet Service Provider (ISP) or a third-party DNS resolver.
Root DNS Servers: The recursive resolver doesn't have the requested IP address information, so it starts the resolution process by contacting a Root DNS Server. The Root DNS Servers maintain the addresses of all top-level domain (TLD) name servers, such as .com, .org, .net.
TLD Name Servers: The Root DNS Server responds to the recursive resolver with the IP address of the appropriate TLD name server responsible for the requested domain's extension (e.g., .com).
Authoritative DNS Servers: The recursive resolver then contacts the TLD name server and requests the IP address of the authoritative DNS server for the specific domain being queried (e.g., example.com).
Authoritative DNS Server: The recursive resolver contacts the authoritative DNS server and requests the IP address for the requested domain name.
DNS Response: The authoritative DNS server sends back the IP address of the requested domain to the recursive resolver.
Caching and Response: The recursive resolver caches the IP address obtained from the authoritative DNS server for future use and returns the IP address to your device.
Connection Establishment: Your device receives the IP address from the recursive resolver and uses it to establish a connection with the web server hosting the requested domain. The requested webpage or application data is then retrieved and displayed on your device.
1. Request
1. Headers
2. Body
2. Response
1. Status line
2. Headers
3. Body
Start-line: A start-line tells the requests to be implemented(request), or its status of whether successful or a failure(Response). This start-line is always a single line.
HTTP Headers: An optional set of HTTP headers specifying the request, or describing the body part.
A blank line indicating all meta-information for the request has been sent and separation from the body part.
An optional body containing data associated with the request (like content of an HTML form), or the document associated with a response. The presence of the body and its size is specified by the start-line and HTTP headers.
GET
The GET method requests a representation of the specified resource. Requests using GET should only retrieve data.
HEAD
The HEAD method asks for a response identical to a GET request, but without the response body.
POST
The POST method submits an entity to the specified resource, often causing a change in state or side effects on the server.
PUT
The PUT method replaces all current representations of the target resource with the request payload.
DELETE
The DELETE method deletes the specified resource.
CONNECT
The CONNECT method establishes a tunnel to the server identified by the target resource.
OPTIONS
The OPTIONS method describes the communication options for the target resource.
TRACE
The TRACE method performs a message loop-back test along the path to the target resource.
PATCH
The PATCH method applies partial modifications to a resource.
(MDN: https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods)
We can connect each directory's name with (/) and add parameters with (?).
Ex)
GET/api.openweathermap.org/data/2.5/weather?id={cityid}&appid={your api key}