Introduction to networking - CH.3.1 Web and Http
Introduction to networking
Web and HTTP
Web page have objects - they can be HTML, JPEG, Java applet, Audio files ...
Each Object is addressed by a URL:
www.abc.com/cde/def.jpg
- www.abc.com - host name
- cde/def.jpg - path name
HTTP - Hypertext transfer protocol
- Is a Application Layer protocol
- Is a Client-server mode
- Client - web browser
- Server - Web server
- Have HTTP 1.0/HTTP1.1
- Using TCP
- nonpersistent HTTP
- At most one object is sent over a TCP connection
- persistent HTTP
- Multiple objects can be send over a TCP connection
Remember: Definition of RTT: time to send a small packet to travel from client to server and back.
HTTP messages
- Request - Command: Get, Post, Head
- response
Keeping user-server state: How can I know you are logged in??
Use cookie
- Cookie header line of HTTP response message
- cookie header line in HTTP request message
- Cookie file kept on user’s host, managed by user’s browser
- Back-end database at Web site
What cookie can bring
- authorization (What is the difference of authorization & authentication?)
- recommendation
- user session state (Logged in / out)
Typical information encoded in cookies
- User ID
- IP addresses
- Expiration time of the cookie
- ...
Web cache
- Use to increase the performance of client
- Reduce work load of server
- Support conditional GET