Nnnnnnnnn
Application Layer - Web, HTTP 본문
Application Layer - Web, HTTP
World wide web? 인터넷 상 문서(page)들이 거미줄처럼 얽혀있는 것이다. page들 간에 hyperlink처럼 다른 page로 가는 point 같은 것이 있고 이를 통해 거미줄처럼 연결. 일종의 그래프.
Web page = HTML file(어디에 무엇을 배치할지-레이아웃) + referenced objects.(hypertext markup language를 통해 페이지를 찾아간다.)
HTTP
Hypertext Transfer Protocol - HTML 기반, 연결된 object 가져와서 전체 화면을 구성한다.
Web's application layer protocol
Client / server model
client : browser
server : web server
uses TCP:
Client initiates TCP connection to server, port 80
Server accepts TCP connection from client
HTTP messages exchanged between browser and web server
TCP connection closed
FTP나 SMTP는 누구와, 어떤 순서로 상호작용하는지 중요하지만 HTTP는 x.
Two types of HTTP messsages : request, response.
HTTP request message : ASCII(human-readable format)
Uploading form input
Post method :
Web page often includes form input
Input is uploaded to server in entity body ex)네이버 검색창에 입력하는 경우. 프로그램에게 보내라고 post.
Post /inventory-check.cgi HTTP/1.1
URL method:
Uses Get method
Input is uploaded in URL field of request line
GET www.joes-hardware.com/inventory-check.cgi?Item=bandsaw (input 파라미터에 넣음)
HTTP response status codes
200 ok : request succeeded, requested object later than in this msg
301 Moved Permanently : requested object moved, new location specified later in this msg
400 Bad Request : request msg not understood by server
404 Not Found : request document not found on this server
505 HTTP Version Not Supported
User-server state : cookies
cookies란, 쉽게 말해 나의 인증코드 값이다. 이 값은 저장이 되어있다. 예를 들어 회원가입을 하면 나에게 key를 주면 이 key는 cookie라고 볼 수 있다. HTTP는 사용자 정보를 저장하지 않아 들어갈때마다 계속 사용자 정보를 줘야한다. 이를 편하게 하기 위해 cookie를 사용한다.
cookies and privacy - cookies permit sites to learn a lot about you
you may supply name and e-mail to sites
Web caches ( proxy server )
Goal : satisfy client request without involving origin server.
컨텐츠가 점점 커지고 있고, 망 속도가 따라가지 못하고 있으므로 많이 사용하는 것은 가까운 곳에 미리 놓아놓는 방식. 동일한 데이터를 사용하는 사용자가 많을 때 효과가 많다.
Proxy server에 없으면 원본 server에 요청해서 받아와 client에 준다. 있다면 proxy가 주기 때문에 훨씬 빠르다. 그러나 origin이 바뀐 경우, proxy가 과거의 내용을 가지고 있기 때문에 오래된 버전을 제공할 가능성이 있다.
-> 단문 message를 통해 날짜, 시간 등을 체크해서 바뀐 여부 체크 후, (msg는 빠르기 때문에) 바뀐 경우에만 proxy가 다시 origin으로 가게 된다.
'Network' 카테고리의 다른 글
Application Layer - DNS (0) | 2018.03.30 |
---|---|
Application Layer - FTP, SMTP (0) | 2018.03.28 |
P2P (0) | 2018.03.28 |
Network Core and Protocol Layers (0) | 2018.03.28 |