World Wide Web (WWW)
WWW
- idea는 Tim Berners-Lee에 의해 1989년에 제안되었다.
- 1990년 말 Web browser와 HTTP server를 포함하면서 구현되었다.
Hyertext Transfer Protocol (HTTP)
- hypertext와 Web을 용이하게 하는 Application-layer protocol
- client-server computing model의 Request-response protocol
- client web browser는 HTTP 요청 메시지를 server에 전달한다.
- Web server는 HTML file과 다른 어떤것들과 같은 resource를 제공한다.
Example
- 다른 텍스트 파일과 참조와 큰 이미지에 대한 참조를 포함하는 과학 문서 찾기
-> 전체 docuemnt를 알아내기 위한 세 개의 transaction

Web Client (Browser)
-
web browser는 web site로 부터 information resource를 가져와 사용자의 device에 보여준다.
-
가장 인기있는 browser는 chrome, firefox, safari, 그리고 edge이다.
- 1993년 Mosaic, 1994년 Netscape Navigator
- 1995년 Internet Explorer
- 2003년 Apple에서 출시한 Safari
- 2004년 Mozilla에서 출시한 Firefox
- 2008년 google에서 출시한 Chrome, 가장 인기있고 지배적이다.
browser에 세 부분
-
Controller는 문서에 접근해서 interpreter를 사용해서 screen에 보여준다.
-
Interpreter는 HTML, JAVA, JavaScript일 수 있다.
-
client Protocol은 HTTP, FTP, SSH, SMTP 등이 될 수 있다.

Web Server
- web page는 server에 저장된다.
- 각 요청이 도착할때마다, 일치하는 문서가 client에게 보내진다
- 효율성을 높이기 위해, server는 일반적으로 요청된 파일을 memory에 있는 cache에 저장한다.
- 매번 disk에서 가져오지 않고 cahce를가지고 동작
- 인기있는 web server:
- Apache
- Microsoft Internet Information Server(IIS)
Uniform Resource Locator(URL)
- web page는 web page를 구별하기 위해 unique identifier를 가진다.
- 4개의 identifier는 web page를 정의한다 :
- Protocol : web page에 접근하기 위한 client-server program (https:, ftp:, file:)
- Host : server의 IP 주소나 unique name
- Port Number : client-server program에 의해 정의된 port number (HTTP protocl은 80번)
- Path : file의 주소와 이름
Example : http://www.mhhe.com/compsci/forouzan
Web Documents
- static Document
- server에 저장된 고정된 내용의 document
- Languages : HTML, XML, XSL, THTML
- Dynamic Document
- browser가 document를 요청할때마다 web server에 의해 만들어진다. (date and time)
- CGI(Common Gateway Interface) - past
- JSP(Java Server Page), ASP(Active Server Page), ColdFusion - today
- Active Document
- browser가 active document를 요청할때, server는 document나 script를 복사해서 보낸다.
- 그런 다음 document가 client에서 실행된다. (browser에서 실행된다.)
- Languages : java applets, javascript
HTTP (Hypertext Transfer Protocol)
HTML (Hypertext Markup Language)
-
web에서 web page를 검색하기 위해 client-server program을 작성하는 방법을 정의한다.
-
HTTP client는 request할 수 있다; HTTP server는 response를 반환한다.
-
server는 port number 80을사용한다; clientsms 임시 port number를 사용한다.
-
HTTP는 TCP service를 사용한다.
HTTP Connecctions
- Non-Persistent Connection : 새로운 TCP Connection을 사용해서 각 object를 찾는다. - HTTP 1.0
- Persistent Connecction : TCP connection을 만들고 모든 object를 찾는다. - HTTP 1.1

Request Message Format

- sp : 빈칸
- cr : 다음줄 맨 처음으로 커서 이동
- lf : 한줄 바꿈
Request Line
-
method fieled는 request type을 정의한다.
-
URL은 web page에 address와 name을 정의한다.
-
Version : HTTP 1.1

-
GET : server로부터 document를 가져오는것
-
PUT : client로부터 server로 document를 보내는것
-
POST : client로부터 server로 information을 보내는 것
*Request Header Line
-
각 header line은 추가적인 information을 client로부터 server로 보낸다.

Response Message Format

Response Status Code

Response Header Line
- 각 header line은 추가적인 information을 server로 부터 client로 보낸다.

Example
우리가 /usr/bin/image1 path를 통해 image를 검색한다.
Request Message
- Request Line : Method(GET), URL, HTTP Version(1.1)
- Header Line : client는 GIF나 JPEG image를 받을 수 있다.
Response Message
- Request Line : Version, Status Code, Phrase
- Header Line : data, server, content encoding (MIME version, 전자 메일), document의 길이

clients가 server에 post할 web page를 보낸다.
- Request Line : Put Method, URL, HTTP version
- Status Line : Http Version, Status code, Status message

오늘날 web은 client에 대한 information을 기억할 필요가 있다.
- 웹사이트는 전자 상점으로 사용되고 있다.
- 일부 웹 사이트는 등록된 클라이언트만 액세스할 수 있다.
- 포털 사이트 : 사용자가 보고 싶은 웹 페이지를 선택한다.
- 광고 대행사
Cookie
- 원래 Web에서, client는 request를 보내고 server는 respond한다 그리고 들의 relation은 끝난다.
- Cookie는 작은 data file이다.
- web server에 의해 생성되고 처음 전송된다.
- web browser에 의해 client에 저장된다.
- Cookie는 key와 value를 포함한다.
Creating, Storing, and Using of the Cookie
- Creating : 서버에서 만들어짐
- Storing : client와 server에 별도로 저장

Examples of the Cookie
- Electornic Store
- 구매 품목의 번호와 단가와 같은 쇼핑 품목에 대한 정보가 브라우저로 전송된다.
- Registered Clients
- 클라이언트가 처음 등록하면 사용자 정보가 브라우저로 전송된다.
- Portal Site
- 사용자가 좋아하는 페이지를 선택하면 쿠키가 만들어져 브라우저로 전송된다.
- Advertising Agency
- 사용자가 배너 아이콘을 클릭하면 사용자의 아이디와 사용자의 웹에서의 행동이 쿠키에 포함된다.

Example



Web Cashing : Proxy Server
- HTTP request가 어떤 client (browser)로 부터 요청될때, request는 처음 proxxy server로 향한다.
- 만약 proxy server가 이미 일치하는 web page를 가지고 있으면, 그것을 client에게 response한다.
- 그렇지 않으면, proxy server는 client 역할을 하며, Internet에 있는 web server로 요청을 보낸다.
- response가 반환되면, proxy sever는 client에 request에 대해 보내기 전에 그것을 복사하고 cache에 저장한다.
- server에 부하와 network traffic을 감소시키고, response time을 개선한다.
Example of Proxy Server

Proxy Sever 위치
- client computer는 Proxy server로 사용될 수 있다.
- 기업에서, Proxy Server는 컴퓨터 LAN에 설치될 수 있다.
- ISP는 부하를 감소시키기 위해 Proxy server에 설치 될 수 있다.
HTTP Security
- HTTP는 SSL(Secure Socket Layer)를 통해 실행 가능하다. - HTTPS
- HTTPS는 443 port 번호를 통해 data를 전송한다.
- HTTPS는 confidentially, authentication, data integrity를 제공한다.

SSL(Secure Sockets Layer)
- SSL은 internet을 통해 전송되는 confidentiality와 information의 integrity를 보장하는 보안 protocol이다.
TLS(Transport Layer Security)
- TLS는 symmetric(대칭)과 asymmetric(비대칭) cryptography(암호)를사용하는 transport layer security이다.
- TLS는 이러한 cryptographic protocol을 사용하여 안전하지 않은 network를 통해 data를 전송할때 보안을 제공한다.
SSL/TLS
- SSL 이후에 이것을 표준화해서 만든 것이 TLS로 SSL/TLS로 함께 묶어 분류한다.
File Transfer Protocol(FTP)
File Transfer Prtocol
- FTP는 한 host로 부터 다른 host로 파일을 복사하기 위해 TCP/IP에서 제공하는 표준 protocol이다.
- file을 전송하는 동안에 문제점
- 두 시스템이 다른 file name convention을 사용할지도 모른다.
- 두 시스템이 다른 data를 표현하기 위한 방법을 가질지도 모른다.
- 두 시스템ㅁ이 다른 directory 구조를 가질지도 모른다.
-> FTP로 이러한 문제를 해결할 수 있다.
Client-Server Structure of FTP

Two Connection
- Control Connection (21번 포트)
- Data Connection (20번 포트)
Two Connections
Control Connections
-
사용자가 FTP를 시작할때, control connection이 열린다.
-
전체 interactive FTP sesion동안에 연결된 상태로 유지된다.
-
FTP는 local code나 syntax(e.g. window or UNIX)를 NVT sysntax와 반대로 번역하기위해 NVT ASCII character set을 사용한다.

FTP Commands

FRP Respnoses

Data Connection
- 각 file transfer 활동을 위해 열렸다가 닫힌다.

- client는 ephemeral(임시) port를 사용해서 passive open을 발행한다.
- client는 port command를 사용해서 port 번호를 server로 보낸다.
- server는 well-known port 번호 20을 사용해서 active open을 발행하고 ephemeral port 번호를 받는다.
Communication over Data Connection
- File Type : ASCII file, EBCDIC file, or Image file
- Data structter : File Strructure, Reord Structer, Page Structure
- Transmission Mode : Stream mode, Block mode, Compressed mode
- File Transfer
- Retrieving a file : client로부터 server로 전송
- Storing a file : server로부터 client로 전송
- Directory Listing : server로 부터 client로 하위 디렉토리 또는 파일 나열
An Example of FTP
- control connection은 항상 열려있다.
- data connection은 열리고 닫히고를 반복한다.
- 모든 reclod가 전송되면, server는 data connecton Closing을 알린다.
- Client는 QUIT command를 실행하여 service connection을 종료한다.

Security for FTP
TLS를 통한 FTP Connections
- FTP는 secuirty가 큰 문제가 아닐때 설계되었다.
- password와 data connecction은 안전하지 않은 plaintext로 data를 전송했다.
- SSL/TLS은 application과 TCP layer 사이에 추가되었다.
- TLS를 통한 FTP는 128 bit encryption을 제공한다.
- SSL certificate는 server에 대해 생성된다.
Electronic Mail
HTTP, FTP
- server 프로그램은 항상 동작하고, client로 부터 요청을 기다린다.
- request와 response가 존재한다.
E-mail
- Electronic mail(or e-mail)은 사용자가 message를 교환하는 것을 가능하게 한다.
- 이 application의 성격은 지금까지 것들과 다르다.
- e-mail의 client/server programminig 다른 방법으로 구현되어야 한다. : 중개 컴퓨터(server)를 사용하는 것
Archietecture
e-mail을 보내고 받는 시나리오

- UA : 작성하고 보내고 읽는 프로그램
- MTA : 메일을 보내는 부분
- MAA : 메세지를 접근해서 읽는 부분
User Agent
Format of e-mail

e-mail에서 사용되는 Protocols
- e-mail은 세 가지 client-server paradigm을 사용한다.
- 첫번쨰와 두번째는 Message Transfer Agent(MTA)이고, 세 번째는 Message Access Agent(MAA)이다.

Message Transfer Agent : SMTP*
- MTA client와 MTA server로 정의된 프로토콜은 Simple Mail Trasnfer Protocol(SMTP)이다.
- SMTP는 push 프로토콜이다.; client로부터 server로 message를 push한다.
SMTP Commands

SMTP Responses


Three Phase of Mail Transfer

Message Access Agent(MAA) : POP and IMAP
- message는 server부터 client로 전달된다.
- MAA는 Pull 프로토콜이다.; cleint는 servefr로 부터 message를 pull해야 한다.
- 두 message access 프로토콜 : POP3, IMAP4
- POP3 (Post Office Protocol, Version 3)
- Mail access는 사용자가 e-mail을 다운받을때 client에서 시작된다.
- client와 server는 POP3 software를 설치해야한다.
- Two Mode : Delete와 Keep Mode
- IMAP4 (Internet Mail Access Protocol, version 4)
- POP3보다 더 강력하다.
- 사용자는 mail server에있는 mailbox를 create, deleter, rename 할 수 있다.
- 사용자는 부분적으로 e-mail을 다운로드한다.
POP3

MIME(Mutipurpose Internet Mail Extensions)
- e-mail을 통해 non-ASCII data가 보내지는 것을 가능하게 한다.
- text와 language의 type과 binary file, video, audio data를 보낼 수 있다

MIME Header
transformation parameters를 정의하기 위해 원래 e-mail header 부분에 추가된다.

Content Type and Subtype of MIME

- 전송을 위해 0과 1로 message를 인코딩하기 위해 사용되는 method를 정의한다.

- Base64 Conversion
- 8비트씩 나눠서 6비트씩 묶음

Base64Conversion Table

ASCII Codes

Quoted-printable
- data가 대부분 ASCII이고 작은 non-ASCII 부분으로 구성되면 사용된다.
- 만약 8bit에 첫번째 bit가 1이면, Non-ASCII로 여겨진다.
- Non-ASCII는 등호(=)로 시작되는 16진수 두자리로 해석된다.

Web Based Mail

- 읽는 부분만 웹 메일

- 보내고 읽을때 모두 웹 사용
TELNET
- TELENT은 TERminaL NETwork의 약자인 remote logging protocol이다.
- client 측 user는 serve computer로 로그인하고 거기서 사용가능한 서비스를 사용한다.
- TELNET은 (암호화되지 않은) plaintext로 된 logging name과 password가 필요하다.
- 해킹에 취약하기 때문에, TELNET은 Secure Sheel(SSH)로 대체되었다.

Local versus remote logging

Network Virtual Terminal (NVT)
- 각 컴퓨터는 특별한 charset의 조합을 token으로 사용한다.
- end-of-file token for DOS : ctrl + z
- end-of-file token for UNIX : ctrl _ d
- TELNET은 Netowrk virtual Terminal(NVT) charset set이라 불리는 보편적인 interface를 정으히ㅏㄴ다.

Control Charset code

Secure Shell (SSH)
- SSH는 원래 TELNET을 대체하기 위해 설계되었다.
- SSH는 public-key cryptography를 사용하여 안전하지 않은 network를 통해 안전한 network service를 제공하는 protocol이다.
- SSH는 안전한 access와 file transfer와 같은 service를 구현하기 위해 encryption과 authentication mechanism을 사용한다.

SSH가 하는 것이 무엇인가?
- Secure Communication : password, 사용자 이름 및 기타 개인 데이터를 포함한 모든 infromation을 암호화한다.
- Authentication : 인증된 사용자 및 server만 시스템에 접속할 수 있다.
- Data Transfer via Encryption : data의 confidentiality and integrity
- Remote Access : 컴퓨터, server 및 기타 resource에 대한 안전한 remote access
- File Transfer : Secure Copy Program(SCP)와 SSH File Transfer Protocol
- Tunneling : web server, database, email server를 안전하게 access할 수 있다.

- Hacker로부터 막음
Components
SSH는 application-layer protoco이다.
- SSH Transport-Layer Protocol (SSH-TRANS)
- TCP 위에 보안 channel을 만든다.
- privacy or confidentiality, Data Integerity, Server Authnetication, Message 압축
- SSH Authentication Prtocol (SSH-AUTH) - 인증
- SSH Connection Protocol (SSH-CONN) - 연결
- client는 remote logging, file transfer 등과 같은 application을 위해 다수의 logical channel을 만든다.

Application
- SSH for Remote logging : puTTy, Tectia
- SSH for File Transfer : SFTP(Secure FTP), SCP(Secure Copy)
- Port Forwarding - SSH Tunneling
- TELNET이나 SMTP와 같은 일부 application program은 보안 service를 제공하지 않는다.
- SSH는 이러한 application에 속하는 message가 이동할 수 있는 보안 tunnel을 만든다.

SSH Packet Format

- TCP header까지 포함된 것을 암호화 시킴
SSH working process

Differences Between SSH and SSL
- encryption과 authentication을 사용해서 두 장치간에 보안을 향상시킨다.
- SSH는 remotly login에 사용
- SSL은 HTTPS 등에 사용
Domain Name System (DNS)
domain name hierachy와 IP address space
- Internet은 name을 address로 매핑할 수 있는 directory system을 가질 필요가 있다.
- net.knu.ac.kr -> 203.247.32.31 (IP주소로 기억하기 어려우므로)
Domain Name System (DNS)
- DNS는 client-server model에 사용되는 name server의 distributed database에 의해 유지된다.
- 각 domain은 적어도 하나의 권한 있는 DNS server가 있으며, domain에 대한 정보를 게시한다.
- hierachy의 top은 root name server에 의해 제공된다.
name과 address의 매핑 과정

- IP 주소를 알고 있으면 응답해주고 모르면 다른곳에서 찾음
Name Space
Domain Name Space
- 각 주소가 unique name에 매핑하는 name space는 hierachical할 수 있다.
- name은 inverted-tree structure로 정의된다.
- domain은 domain name space의 subtree이다.
- domain name은 점(.)으로 구분된 label의 sequence이다.

Domain Name and Labels

Domains
- domaind은 그 자체로 domain으로 분할될 수 있다.
- domain의 name은 subtree의 맨 위에 있는 node의 이름이다.

Hierachy of Name Space
- Domain은 더 작은 domain들로 분할된다. (subdomain)
- 각 server는 large domain이나 small domain을 담당한다.
- 각 server domain이 필요하고 name sever가 있어야한다.

Zone
- DNS zone은 hierachical domain name structure의 subset이다. (종종 single domain)
- server가 책임이 있거나 권한을 가진 것을 zone이라고 한다.
- domain name server가 권할하는 구역 -> zone
- server는 zone file이라는 database를 만들고 domain 아래의 모든 node에 대한 정보를 저장한다.
- domain에 있는 node에 ip 주소를 가짐

Root Server
- zone이 전체 트리인 server
- 전 세계에 분포되어 있다.

DNS in the Internet
domain name space (tree)는 원래 세 개의 다른 부분으로 나누어졌다.
- generic domains, country domains, inverse domain
Generic domain

Generic Domains Labels

Country Domains

Resoultion
address에 name을 매핑하는 것을 name-address resolution이라고 부른다.
- address를 name에 매핑하거나 name을 address에 매핑해야하는 host는 DNS client를 호출한다.
- DNS의 client 측을 DNS resolver라고 한다.
resolver는 mapping request와 함께 가장 가까운 DNS server에 접근한다.
- 만약 server가 information을 가지고 있으면, resolver를 만족한다.; 그렇지 않으면, resolver가 다른 server에 참조하여 information을 제공한다.
- DNS resolver는 recursive나 iterative와 같이 다양한 query 방식에 의해 분류된다.
- 모든 DNS query는 Domain Name System에 root zone에서 recursive query로 시작해야한다.
Recursive Resolution
- DNS resolver는 단일 DNS server에 쿼리를 보내고, 이 server는 요청자를 대신하여 다른 DNS server에 query를 보낸다.

Iterative Resolution
- DNS resolvuer는 하나 이상의 DNS server의 chain에 쿼리를 보낸다.
- 현재 server가 request를 해결할 수 있을때까지, 각 server는 client를 chain내에 다음 server로 지칭한다.

Record Caching
sever는 domain에 없는 name에 대한 query를 수신하므로, database를 검색해야한다.
- Cahcing은 root server에 부하를 낮추도록 사용된다.
DNS는 caching mechanism을 제공한다.
- DNS query 결과를 cache memory에 일정 기간(Time-to-live) 저장한다.
- 효율성을 향상시키고, 인터넷 전체의 DNS traffic을 낮추고, end-user application에 성능을 높인다.
DNS request로 부터 얻은 결과는 항상 time to live(TTL)과 연관된다.
- TTL은 결과를 폐기하거나 새로 고쳐야하는 만료 시간이다.
Resource Records
Zone file
- Zone file은 DNS server에 저장된 plain text file이다.
- zone file은 zone 내의 모든 domain에 대한 모든 resource record (RR)을 포함한다.

DNS message
DNS Messages : query and response
