Ch ng 2 (ti p).ươ ế
Giao th c t ng ng d ng (application layer)
Quang Dieu Tran, PhD
Faculty of Information Technology
University of Communication and Transport
(Branch in Ho Chi Minh City)
Email: dieutq@gmail.com
Website: sites.google.com/sites/tranlectures
Chapter 2. The Application Layer 2
Discussion
Web programming with ASP.
Visual Basic programming.
Object oriented programming.
Event driven programming.
Component driven programming.
TCP Socket programming.
Simple web server.
Chapter 2. The Application Layer 3
Winsock
Chapter 2. The Application Layer 4
HTTP example
1a. http client thi t l p liên k t ế ế
TCP v i http server (process)
t i đa ch www.uct2.edu.vn,
c ng 80 (ng m đnh v i http
server).
2. http client g i http request
message (bao g m c URL)
t i TCP connection socket
1b. http server ch p nh n k t n i ế
r i thông báo v i client.
3. http server nh n request
message, t o ra http response
message có ch a các đi
t ng đc yêu c u r i g i ượ ượ
vào socket.
time
Giả sử người dùng truy cập URL: www.uct2.edu.vn/index.htm
(trang web có text và 10 hình ảnh jpeg)
0. http server tại máy phục vụ
www.uct2.edu.vn chờ yêu cầu
kết nối TCP tại cổng 80.
Chapter 2. The Application Layer 5
5. http client nh n response
message có ch a html file,
hi n th html. Sau đó, phân
tích html file, tìm URL c a 10
hình nh jpeg trong tài li u.
6. B c 1-5 đc l p l i v i ướ ượ
t ng hình nh.
4. http server ng t liên k t. ế
time