๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๐“ก๐“ธ๐“ธ๐“ถ5: ๐’ฆ๐‘œ๐“‡๐‘’๐’ถ ๐’ฐ๐“ƒ๐’พ๐“‹/Computer Network(COSE342)

[์ปดํ“จํ„ฐ๋„คํŠธ์›Œํฌ] CH2. Application Layer (#1)

Network Application

  1. network application
    • email, web, text messaging, remote login, P2P file sharing, multi-user network games, streaming stored video, voice over IP, real-time video conferencing, social networking, search etc...
  2. Creating a Network Application
    • ์„œ๋กœ ๋‹ค๋ฅธ end systems ์—์„œ ์ž‘๋™ํ•˜๊ณ  network๋ฅผ ํ†ตํ•ด ํ†ต์‹ ํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ
    • network-core devices ์—์„œ๋Š” ํ•„์š” ์—†์Œ. ๊ฑ”๋„ค๋Š” user application ์‹คํ–‰ ์•ˆํ•จ.

 

Client-server paradigm

1. Application Architecture : P2P

  1. ์ƒ์‹œ ์ ‘์† ๊ฐ€๋Šฅํ•œ ์„œ๋ฒ„๊ฐ€ ์—†์ด ์ž„์˜์˜ end systems์ด ์ง์ ‘ ์†Œํ†ตํ•œ๋‹ค.
  2. Peer๊ฐ€ ๋‹ค๋ฅธ Peer์—๊ฒŒ ์„œ๋น„์Šค๋ฅผ ์š”์ฒญํ•˜๊ณ , ๋˜ ์„œ๋น„์Šค๋ฅผ ์ œ๊ณตํ•œ๋‹ค.
    • Self Scalabiity (์ž์ฒด ํ™•์žฅ์„ฑ) : ์ƒˆ๋กœ์šด peer๋Š” ์ƒˆ๋กœ์šด ์„œ๋น„์Šค demands์™€ capacity๋ฅผ ๋™์‹œ์— ๊ฐ€์ ธ์˜จ๋‹ค.
  3. peer๋Š” ๊ฐ„ํ—์ ์œผ๋กœ(intermittently) ์—ฐ๊ฒฐ๋˜๊ณ  IP ์ฃผ์†Œ๊ฐ€ ๊ณ„์† ๋ฐ”๋€๋‹ค.
    • ๋”ฐ๋ผ์„œ ๊ด€๋ฆฌ๊ฐ€ ๊ต‰์žฅํžˆ ๋ณต์žกํ•˜๋‹ค.

  

 

2. Application Architecture : Client-Server

 

  • Server
    1. ํ•ญ์ƒ ์ž‘๋™ํ•˜๊ณ  ์žˆ๋Š” ํ˜ธ์ŠคํŠธ์ž„
    2. IP ์ฃผ์†Œ๊ฐ€ ๋ณ€ํ•˜์ง€ ์•Š๊ณ  ์˜๊ตฌ์ ์ž„
    3. ํ™•์žฅ(scaling)์„ ์œ„ํ•œ data centers๊ฐ€ ์žˆ์Œ
  • Client
    1. ์„œ๋ฒ„์™€ ํ†ต์‹ ํ•˜๋Š” ์ฃผ์ฒด
    2. ๊ฐ„ํ—์ ์œผ๋กœ ์—ฐ๊ฒฐ๋  ์ˆ˜ ์žˆ๋‹ค.
    3. ๋™์ ์ธ(dynamic) IP ์ฃผ์†Œ๋ฅผ ๊ฐ€์งˆ ์ˆ˜ ์žˆ๋‹ค.
    4. client๋ผ๋ฆฌ ์„œ๋กœ ์ง์ ‘ ์—ฐ๊ฒฐํ•ด์„œ ์ง์ ‘ ์†Œํ†ตํ•˜์ง€ ์•Š๋Š”๋‹ค.

 

Process and addressing

1. Process as a Communication Unit

Process : ํ˜ธ์ŠคํŠธ ๋‚ด์—์„œ ์‹คํ–‰๋˜๋Š” ํ”„๋กœ๊ทธ๋žจ

ํ”„๋กœ๊ทธ๋žจ์„ ์‹คํ–‰์‹œ์ผœ ์ถœ๋ ฅํ•˜๋Š” ๊ณผ์ •์ด ํ”„๋กœ์„ธ์Šค

  • Client Process : ํ†ต์‹ ์„ ์‹œ์ž‘ํ•˜๋Š” process
  • Server Process : ์—ฐ๊ฒฐ์„ ๊ธฐ๋‹ค๋ฆฌ๋Š” process
  • P2P ๊ตฌ์กฐ์˜ application์€ client ์™€ server process๋ฅผ ๋‘˜ ๋‹ค ๊ฐ€์ง€๊ณ  ์žˆ๋‹ค.

 

 

2. Process and Socket

  • process๋Š” ๊ทธ๊ฒƒ์˜ socket์„ ํ†ตํ•ด ๋ฉ”์‹œ์ง€๋ฅผ ์ฃผ๊ณ  ๋ฐ›๋Š”๋‹ค.
  • socket์€ ํ•˜๋‚˜์˜ ๋ฌธ๊ณผ ๊ฐ™์€ ๊ฒƒ!!! application์ธต๊ณผ transport๋ฅผ ์—ฐ๊ฒฐํ•ด์ฃผ๋Š” interface ์ด๋‹ค.

 

 

3. Addressing for Communications

  1. ๋ฉ”์‹œ์ง€๋ฅผ ๋ฐ›์œผ๋ ค๋ฉด ํ”„๋กœ์„ธ์Šค๋ฅผ ์„œ๋กœ ๊ตฌ๋ถ„ํ•  ์ˆ˜ ์žˆ๋Š” identifier๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ์–ด์•ผ ํ•œ๋‹ค.
    • ๊ทธ๋ž˜์„œ host device๋Š” ์œ ์ผํ•œ 32-bit์˜ IP address๋ฅผ ๊ฐ–๋Š”๋‹ค.
  2. ๊ทผ๋ฐ ์ด IP ์ฃผ์†Œ๋กœ๋Š” ์ด ํŒจํ‚ท์ด ์–ด๋Š ํ”„๋กœ์„ธ์Šค๋กœ ๊ฐ€์•ผ ํ•˜๋Š”์ง€ ์ถฉ๋ถ„ํ•˜์ง€ ์•Š๋‹ค!
    • ๊ทธ๋ž˜์„œ port number๊ฐ€ ํ• ๋‹น๋œ๋‹ค
  3. ํ”„๋กœ์„ธ์Šค๋Š” ํ†ต์‹ ์„ ์œ„ํ•ด IP Address์™€ Port number๊ฐ€ ๋‘˜ ๋‹ค ํ•„์š”ํ•˜๋‹ค.
    • HTTP server๋Š” port #80์„ ์“ฐ๊ณ  mail server๋Š” port #25๋ฅผ ์“ด๋‹ค.
    • www.korea.ac.kr๋กœ HTTP ๋ฉ”์‹œ์ง€๋ฅผ ๋ณด๋‚ด๋ ค๋ฉด
      IP Address : 163.152.6.10
      port number : 80
      ์œผ๋กœ ๋ณด๋‚ด์•ผ ํ•จ

 

Application-layer protocol

1. Composition elements

  1. Types of messages exchanged
    • ๊ตํ™˜ํ•˜๋Š” ๋ฉ”์‹œ์ง€์˜ ํƒ€์ž…
    • ex. request, response
  2. Message syntax
    • ๋ฉ”์‹œ์ง€์— ์–ด๋–ค fields๊ฐ€ ์žˆ๋Š”์ง€, ์ด fields๊ฐ€ ์–ด๋–ป๊ฒŒ ๊ธฐ์ˆ ๋˜๋Š”์ง€(delineated)
  3. Message semantics(์˜๋ฏธ)
    • fields์— ๋‹ด๊ธด ์ •๋ณด์˜ ๋œป
  4. Rules
    • process๊ฐ€ ์–ธ์ œ ์–ด๋–ป๊ฒŒ ๋ฉ”์‹œ์ง€๋ฅผ ๋ณด๋‚ด๊ณ  ์‘๋‹ตํ•˜๋Š”์ง€

 

  • Open protocols ; ์˜คํ”ˆ ํ”„๋กœํ† ์ฝœ
    • Defined in RFCs (Request For Comments)
    • Allows for interoperability : ์ƒํ˜ธ์šด์šฉ์„ฑ ํ—ˆ์šฉ
      • ์ƒํ˜ธ ์šด์šฉ์„ฑ : ํ•˜๋‚˜์˜ ์‹œ์Šคํ…œ์ด ๋™์ผ ๋˜๋Š” ๋‹ค๋ฅธ ๊ธฐ์ข…์˜ ๋‹ค๋ฅธ ์‹œ์Šคํ…œ๊ณผ ์•„๋ฌด ์ œ์•ฝ ์—†์ด ์„œ๋กœ ํ˜ธํ™˜๋˜์–ด ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” ์„ฑ์งˆ
    • ex. HTTP, SMTP
  • Proprietary protocols ; ๋…์  ํ”„๋กœํ† ์ฝœ
    • ex. Skype

 

 

2. Transport service

  • Apps์€ ์„œ๋กœ ๋‹ค๋ฅธ types์˜ transport service๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค!
  1. Data integrity ; ๋ฐ์ดํ„ฐ์˜ ๋ฌด๊ฒฐ์„ฑ
    • ์–ด๋–ค ์•ฑ์€ 100% ์‹ ๋ขฐ ๊ฐ€๋Šฅํ•œ data transfer ๋ณด์žฅํ•ด์•ผ ํ•จ (ex. file transfer, web transactions)
    • ์–ด๋–ค ์•ฑ์€ ์–ด๋Š ์ •๋„์˜ ์†์‹ค loss๋Š” ์šฉ์ธ ๊ฐ€๋Šฅํ•˜๋‹ค(tolerate). (ex. audio)
  2. Timing
    • ์–ด๋–ค ์•ฑ์€ "effective" ํ•ด์•ผ ํ•ด์„œ ์•„์ฃผ ์ž‘์€ delay๋ฅผ ํ•„์š”๋กœ ํ•œ๋‹ค. (ex. internet telephone, interactive games)
  3. Throughput
    • ์–ด๋–ค ์•ฑ์€ "effective" ํ•ด์•ผ ํ•ด์„œ ์ตœ์†Œํ•œ์˜ throughput์„ ์š”๊ตฌํ•œ๋‹ค. (ex. multimedia)
    • ์–ด๋–ค ์•ฑ์€ ๊ทธ๋“ค์ด ์–ผ๋งˆ๋ฅผ ๋ฐ›๋˜ ๋ชจ๋“  throughput์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค. (elastic apps)

 

3. Internet Transport Protocols

- TCP service

  1. Reliable transport : ์‹ ๋ขฐํ•  ์ˆ˜ ์žˆ๋Š” ์ „์†ก, ์•ˆ์ „ํ•œ ์ „์†ก ๋ณด์žฅ
  2. Flow Control : ํ๋ฆ„ ์ œ์–ด, sender๋Š” receiver๋ฅผ ์ดˆ๊ณผํ•˜์ง€ ์•Š๋Š”๋‹ค. sender <= receiver
  3. Congestion Control : ํ˜ผ์žก ์ œ์–ด, network๊ฐ€ overloaded, ๊ณผ๋ถ€ํ•˜๋์„ ๋•Œ sender๋ฅผ ์กฐ์ ˆํ•˜๋Š” ๊ฒƒ
  4. ์ œ๊ณตํ•˜์ง€ ์•Š๋Š” ๊ฒƒ : timing, minimum throughput guarantee, secuity
  5. Connection-oriented : client์™€ server process ๊ฐ„์˜ setup(์„ค์ •)์ด ํ•„์š”ํ•จ

- UDP service

  1. Unreliable data transfer : ์‹ ๋ขฐ์„ฑ X
  2. ์ œ๊ณตํ•˜์ง€ ์•Š๋Š” ๊ฒƒ : reliability, flow control, congestion control, timing, throughput guarantee, security, connection setup
  3. TCP์— ๋น„ํ•ด ๊ฐ„๋‹จํ•˜๊ณ  ์กฐ๊ฑด์ด ์ ์Œ.

 

Web and HTTP

0. History

1. URI, URL, URN

  1. Uniform Resource Identifier (URI)
    • resource์˜ ์œ„์น˜๋‚˜ ๊ฐ’๊ณผ ๋…๋ฆฝ์ ์ธ resource๋ฅผ ๋‚˜ํƒ€๋‚ธ๋‹ค
    • request method๋ฅผ ์ˆ˜๋ฝํ•˜๋Š” "black box"๋ฅผ ๊ฐ€๋ฆฌํ‚ค๋Š” pointer ๊ฐ™์€ ๊ฒƒ!
  1. Formatted string
    • ์„œ๋ฒ„์™€ ํ†ต์‹ ํ•˜๊ธฐ ์œ„ํ•œ protocol (ex. http)
    • ์„œ๋ฒ„ ์ด๋ฆ„ (ex. www.foo.com)
    • recourse์˜ ์ด๋ฆ„ (ex. coolpic.gif)
  2. Name(URN), Locatior(URL), Identifier(URI)
    • URI : ์ฑ…์˜ ๋‚ด์šฉ์„ ๋Œ€ํ‘œํ•˜๋Š” identifier
    • URL : ์ฑ…์˜ ์œ„์น˜
    • URN : ์ฑ…์—์„œ ISBN number์ฒ˜๋Ÿผ globally uniqueํ•œ name

2. HTTP overview

HTTP (HyperText Transfer Protocol)

 

  • ์›น์€ application-layer์˜ protocol์ž„
  • Client/server model
    • client : HTTP protocol์„ ์‚ฌ์šฉํ•ด์„œ ์›น object๋ฅผ requests, receivesํ•˜๊ณ  display ํ•˜๋Š” ๋ธŒ๋ผ์šฐ์ €
    • server : ์›น ์„œ๋ฒ„๋Š” HTTP protocol์„ ์‚ฌ์šฉํ•ด์„œ request์— ์‘๋‹ตํ•˜๋Š” objects๋ฅผ ์ „์†กํ•œ๋‹ค.

 

Uses TCP

  1. client๊ฐ€ ์†Œ์ผ“์„ ์ƒ์„ฑํ•ด์„œ ์„œ๋ฒ„์— ๋Œ€ํ•œ TCP connection์„ ์‹œ์ž‘ํ•œ๋‹ค. (port 80)
  2. ์„œ๋ฒ„๊ฐ€ client๋กœ ๋ถ€ํ„ฐ TCP Connection์„ accpetsํ•œ๋‹ค.
  3. browser(HTTP Client)์™€ ์›น ์„œ๋ฒ„(HTTP server) ์‚ฌ์ด์— HTTP messages (์‘์šฉ์ธต protocol messages)๋ฅผ ๊ตํ™˜ํ•œ๋‹ค.
  4. TCP ์—ฐ๊ฒฐ์ด ๋‹ซํžŒ๋‹ค.

HTTP๋Š” "stateless" ํ•˜๋‹ค!

  • ์„œ๋ฒ„๋Š” ์ง€๋‚˜๊ฐ„ client request์— ๋Œ€ํ•œ ์ •๋ณด๋ฅผ ๊ธฐ์–ตํ•˜์ง€ ์•Š๋Š”๋‹ค!