Introduction to Networking Basics

Introduction to Networking Basics

Introduction to Networking Basics

1. Basic Concepts

Introduction to Networking Basics
The HTTP protocol stands for Hyper Text Transfer Protocol, which is used to transfer hypertext from World Wide Web (WWW) servers to local browsers.
HTTP is a protocol based on TCP/IP for transmitting data (HTML files, image files, query results, etc.).
HTTP is an object-oriented protocol belonging to the application layer. Due to its simplicity and speed, it is suitable for distributed hypermedia information systems.
The HTTP protocol works on a client-server architecture. The browser, as an HTTP client, sends all requests to the HTTP server, i.e., the web server, via a URL.
The web server sends response information back to the client based on the received request.
Introduction to Networking Basics

2. Main Features

Introduction to Networking Basics
1. Simple and Fast
2. Flexible
3. Connectionless
4. Stateless
5. Supports B/S and C/S models.
Introduction to Networking Basics

3. HTTP Requests

Introduction to Networking Basics
The request message sent by the client to the server includes the following format:

Format: Request Method + Space + URL + Space + HTTP Version + Enter

For example: GET /wp-content/themes/runoob/assets/css/qa.css?1.41 HTTP/1.1

Introduction to Networking Basics

4. HTTP Response Message

Introduction to Networking Basics
Generally, after the server receives and processes the request sent by the client, it will return an HTTP response message.
The HTTP response also consists of four parts: status line, message header, blank line, and response body.
Introduction to Networking Basics

5. HTTP Status Codes

Introduction to Networking Basics
Status codes consist of three digits, with the first digit defining the category of the response, which is divided into five categories:
1xx: Informational – Indicates that the request has been received and is continuing to be processed
2xx: Success – Indicates that the request has been successfully received, understood, and accepted
3xx: Redirection – Further action must be taken to complete the request
4xx: Client Error – Indicates that there is a syntax error in the request or that the request cannot be fulfilled
5xx: Server Error – Indicates that the server failed to fulfill a valid request
Common status codes:
200 OK // Client request succeeded
400 Bad Request // Client request has syntax error and cannot be understood by the server
401 Unauthorized // Request is unauthorized, this status code must be used with the WWW-Authenticate header
403 Forbidden // Server received the request but refuses to provide service
404 Not Found // Requested resource does not exist, e.g., entered an incorrect URL
500 Internal Server Error // Server encountered an unexpected error
503 Server Unavailable // Server cannot currently handle the request from the client, may recover after some time
Introduction to Networking Basics

6. HTTP Request Methods

Introduction to Networking Basics
According to HTTP standards, various request methods can be used for HTTP requests.
HTTP 1.0 defines three request methods: GET, POST, and HEAD.
HTTP 1.1 adds five new request methods: OPTIONS, PUT, DELETE, TRACE, and CONNECT.
Introduction to Networking Basics
8. Does the browser disconnect after sending a request to the web server and receiving a response?
Answer: Yes, the characteristic of the HTTP protocol is connectionless, meaning the browser does not maintain a long-term connection with the web server. Once the client request receives a response, the connection will be disconnected.
Introduction to Networking Basics
9. What is the difference between Fiddler and tcpdump commands?
Answer: Fiddler can only capture HTTP and HTTPS protocol packets. Tcpdump is a packet capture command built into Linux systems that can capture all data flowing through the network card, resulting in a larger amount of captured content.
Add Xiao Tang’s WeChat for free resources
[Resume, interview questions, etc. resource package]

Introduction to Networking Basics

Introduction to Networking Basics

Introduction to Networking Basics

Introduction to Networking Basics

Introduction to Networking Basics

Introduction to Networking Basics

Leave a Comment