Chap. 1 Introduction

분산시스템의 소개

∙Computer + Networks = 'Distributed System' based on Data Communication

① Client/Server system: server와 client가 존재

② P2P system (peer-to-peer): All peers are servers

⇒ highly 'scalable/decentralized(분권적)' architecture

Ex) Original "Napster" design

① when peer connects, it informs central             server:

- IP address & content

② Alice queries for "Hey Jude"

③ Alice requests file from Bob

중앙집중식/분산 시스템

① 'Centralized' system: One big computer

IBM

Mainframe

(대형)

Host

(Big Processes)

Dummy terminal

(No processing power,

Just I/O)

Terminal

Server

② 'Distributed' system: A group of small 'computers' connected to the 'computer network'

Unix/Linux or

Windows

Network

Clients

Servers

PC/PDA etc.

LAN or WAN

(c.f.) Parallel system (병렬 시스템)

P1

Pn

I.N

Memory

HDD

HDD

I. N

P1

Pn

Mem.1

Mem.n

shared disk

HDDn

HDD1

I. N

P1

Pn

Mem.1

Mem.n

shared nothing

(MPP)

shared memory

(SMP)

∙Which one is better and Why?

	장점	단점
Host/Terminal	-Security: 전용 OS (MVS, SNA) (ex) 금융권 -Reliablity	-Expensive: Seller's market -Extensibility -Character-based user interface
Client/Server	-Cheaper: Buyer's market, 개방형 OS -Extensibility(확장성) -GUI: User-friendly -Downsizing: Parallel processing (Server - Server 간) Load Balancing (Client - Server 간)	-Complicate: Heterogeneous computers and networks -Security: 개방형 구조(Unix, TCP/IP)

∙Client/Server 시스템 변화

① 1-tier: 메인프레임 중심

② 2-tier: Client/Server 개방형 시스템

③ 3-tier: 미들웨어 시스템 등장

⇒ 2-tier 시스템에 대해 보완을 하기 위해

- Two-tier C/S Architecture

Application 1

Application m

…

User 1

Client

User m

Remote DBMS1

DB 1

DB n

…

Remote DBMSn

DB Server

JDBC/NET8

TCP/IP

Wired Network

Ex) PowerBuilder, Delphi, Visual Basic, etc

⇒ C/S 시스템

- Three-tier C/S Architecture (on the Web)

Presentation 1

Presentation m m

Appl. Logic 1

Appl. Logic k

…

…

Middleware

User 1

Client

Appl. Server

User m

Data Mgmt 1

DB 1

DB n

…

Data Mgmt n

DB Server

Protocol 1

Protocol 2

Protocol 3

Web Server

TCP/IP

Wired/Wireless Network

Ex) Middleware: EJB(Sun)/.NET(MS)을 지원하는 WAS (Web Appl. Server)

⇒ NEIS 시스템

Ex)

Browser

Browser

Servlet 1

Servlet m

…

…

CORBA ORB

User 1

Client

Appl. Server

User m

Remote Obj 1

DB 1

DB n

…

Remote Obj n

DB Server

HTTP

IIOP

JDBC/NET8

Web Server

TCP/IP

Wired/Wireless Network

callback

callback

The History of the Computers

Server OS의 필요조건

∙Server: 여러 사용자가 "동시에" 사용하는 computer

⇒ 'Multiprocess' OS

① Authorization: login 절차 - 인증

② Process management

- Time sharing, CPU scheduling

- Concurrency control: mutual exclusion/synchronization, deadlock, IPC

③ Memory management: virtual memory, paging, swapping

④ Storage management

- File system: allocation, protection

- Disk scheduling

⑤ Network management

- LAN/WAN connection

- Protocols: TCP/IP, IPX/SPX, NetBEUI 등

- Applications: E-mail, ftp, telnet, Web, DB 등

Computer Networks

∙Physical Connection: 물리적인 연결 장비들

- Hardware - LANs & WANs (Packet Switching Network)

S

S

R

R

R

R

R

R

R

S

R

S

KNUE

leased line

NSFNet

U. C. at

Berkeley

U. C. at

L. A.

210.93.99.64

211.34.193.6

CNU

KORNet

(KT)

e.g., routing (> tracert in Windows)

Network Structure

∙Layering of a Network S/W: 네트워크를 운영하기 위한 SW 구조

- Divide the communication problem into layer.

⇒ Let each layer concentrate on providing a particular function.

⇒ Well defined interfaces must be provided between layers.

∙OSI(Open Systems Interconnection) 7-layer Model (P.7 Fig. 1.3 참조)

ISO(International Standard Organization)'s model

			TCP/IP (P.5 Fig. 1-2 참조)
7	Application (응용 계층)		응용 계층
6	Presentaion (표현 계층)	FTP, HTTP, ... ←
5	Session (세션 계층)
4	Transport (전송 계층)	TCP/UDP ←	트랜스포트 계층
3	Network (네트웍 계층)	IP ←	인터넷 계층
2	Data link (링크 계층)		네트웍 액세스 계층
1	Physical (물리 계층)

∙Host-to-host communication

TCP

UDP

H/W

interface

IP

Process

Host

H/W

interface

H/W

interface

IP

Router

H/W

interface

H/W

interface

IP

Router

TCP

UDP

H/W

interface

IP

Process

Host

PSDN

Ethernet

Token Ring

e.g., 'physical (MAC) address' and 'IP address' (> ipconfig /all in Windows)

Ⅱ. Data Communication

Typical Data Communications (p.2 참고)

① Information sharing

ex) Exchange E-mail

〃    file

WWW (browsers and a server)

Distributed DB

② Resource sharing

ex) Remote login: Use a remote computer (a super computer etc.)

Share peripheral devices (a printer, a storage device etc.)

Client/Server Process

∙Communication between a 'client' process and a 'server' process.

PA

API

PB

API

Network software

Network software

Kernel

Kernel

Network

Ex) FTP/Telnet (ftp/telnet client - ftpd/telnetd)

HTTP (Web browser - Web server)

etc.

c.f.) P2P (peer-to-peer)

∙Process : A program that is being executed by the computer's OS (a kernel process).

- A 'program' can execute several 'processes'.

- The birth and death of a process: process states

start

ready

execute

wait

end

spend time

slice

disk/comm

I/O

c.f.) 쓰레드(thread) - 'Light Weight Process'

- 프로세스 내에서 독립적으로 수행되는 하나의 순차적인 제어의 흐름 (a flow of control).

⇒ 하나의 프로세스 내에서 쓰레드를 이용하여 여러 개의 독립적인 일을 병행처리.

(Multi Thread Process)

- 프로세스는 서로 완전히 독립적으로 수행함.

⇒ 쓰레드는 서로 완전히 독립적이 아니고, 변수나 파일들을 서로 공유할 수 있음.

- Windows, Java 등에서 제공.

∙Client/Server Process

PC

Kernel

Network software

API

PS

Kernel

API

Network software

R

R

LAN

comedu(203.247.208.60)

cc-sun(134.75.204.2)

FTP Client

>ftp cc-sun

inetd

ftp

WAN

R

FTP Server

PC

PS

Web Browser

Web Server

Gateway

Web Browser

Gateway

Gateway

-kernel이 client

process를 생성

-inetd process가 clients의 요청을 기다림.

-ftp 요청이 오면 ftp process를 실행.

-connection 후 통신 시작.

- A 'server' is a process that is waiting to be contacted by a 'client' process so that the server can do something for the client.

ex) inetd -> ftpd, telnetd로 하여금 service 해 줄 수 있도록 fork()해 줌.

∙ How it works?

① Ps starts (booting시) and goes to sleep waiting for Pc to request a service.

② Pc sends a request across the N/W.

ex) - Return the time-of-day.

- Print a file on a printer.

- Read or write a file on the server's system

- Allow to login to and use the server's system

- Fetch the remote HTML files

③ When Ps finishes, the server waiting for the client request to arrive.

ex) lpd - Printer daemon, printing service

FTP: ftpd - File transfer service

SMTP: sendmail - Mailer daemon, mail service

TELNET: telnetd - Telnet daemon, remote login service

HTTP: httpd - Web server, WWW service

∙Two types of servers

① 'Iterative' servers: Ps handles the request itself in a known, short amount of time.

ex) return the time-of-day.

② 'Concurrent' servers : Ps invokes another process to handle each client request so that Ps can wait for the next client request.

ex) Print a file on a networked printer.

Read and write a file on the server's system.

Send data from the server's database on the Web. - CGI(Common Gateway Interface)

e.g.,  # ls /usr/sbin	; system demons

# ps -ef	; booting시 구동된 demons

HTTP

∙Overview

Browser

Client

Server

User

HTML files

Web Server

①request

②response

HTTP

- Web browser (client process)와 Web server (server process) 간의 data 전송 규약 (protocol).

- Default port no.: 80

∙Request

- Format

Request Line

Request Header Field

Entity Body

① Request Line

<METHOD>	: 요청방식 - GET/POST

<RESOURCE IDENTIFIER>	: 요청하는 file

<HTTP VERSION>

<cr/lf>	;  a carriage-return/line-feed char.

② Request Header Field: 부가적 정보 전송 (attribute: value 형태)

NAME: VALUE<crlf>

③ Entity Data: optional 정보 전송

Ex) Request Format

GET /index.html HTTP/1.1

accept-language:ko

host:127.0.0.1

accept:*/*

user-agent:Mozilla/4.0(compatible; MSIE 5.0; Windows NT 5.0)

connection:Keep-Alive

accept-encoding:gzip, deflate

∙Response

- Format

Response Header

Header Field

Entity Body

① Response Header

<HTTP Version>

<result code>	: success/fail 표시

OK - 200, error no. - 404 (can't find)

[<explanation>]

<cr/lf>

② Field: server의 속성과 HTML 문서에 관한 정보 전송 - NAME: VALUE<crlf>

③ Entity Body: user가 요청한 *.html file

Ex) Response Format

HTTP/1.1 200 OK

Date: Mon, 26 Nov 2001 06:57:11 GMT

Content-type: text/html

<HTML>

<HEAD><TITLE><\TITLE><\HEAD>

<BODY>

…

<\BODY>

<\HTML>

강의순서

Chap. 2: Processes in the Unix

Chap. 6: Berkeley Sockets

Chap. 4: Computer Networks

Chap. 5: TCP/IP Protocol

∙Objective: How to write network programs

∙Prerequisites: Unix commands & C