[Ch2 Application Layer] Electronic Mail, DNS, P2P applications

2023. 11. 2. 01:17· CS/컴퓨터네트워크
목차
  1. Electronic Mail: SMTP, POP3, IMAP
  2. Electronic mail
  3. SMTP
  4. SMTP vs HTTP
  5. Mail Access Protocols
  6. DNS (Domain Name System)
  7. DNS (Domain Name System)
  8. DNS Structure: Hierarchical
  9. DNS Resolution
  10. DNS Records
  11. DNS protocol, messages
  12. Example: Inserting records & Accessing Web Page
  13. P2P Applications
  14. Pure P2P Architecture
  15. File distribution

Electronic Mail: SMTP, POP3, IMAP

push protocol: a client who wants push(send) data initiate a connection

pull protocol: a client who wants to pull (receives) data initiate a connection

SMTP 👉 push protocol / POP3, IMAP 👉 pull protocol

Electronic mail

Three Major Components

  • Mail User Agents (MUA)
    • creating email msg and transfer it to MTA & retrieving emails
  • Mail Servers or Mail Transfer Agent (MTA)
    • trasfferring (sending / receiving) emails
    • outgoing, incoming msgs stored on server
  • simple mail transfer protocol: SMTP

Mail Servers

  • mailbox: contains incoming msgs for user
  • message queue: queue of outgoing mail msgs
  • SMTP protocol: protocol btw mail servers to send email msgs
    • SMTP client: sending mail server
    • SMTP server: receiving maiil server

SMTP 서버는 항상 2개 (client / server), direct TCP session 이용

 

SMTP

SMTP

  • uses TCP, port 25
  • direct transfer from sending server to receiving server (no intermediate email server)

Sending Msg Scenario (from Alice to Bob)

  1. Alice's UA (user agent) sends msg to her mail server; msg placed in message queue (outgoing)
  2. client side of SMTP opens TCP connection with Bob's mail server
  3. SMTP client sends Alice's msg over the TCP connection
  4. Bob's mail server places the msg in Bob's mailbox
  5. Bob invokes his UA to read msg

in steps 6, using POP3 & IMAP not SMTP -> to retrieve from mailbox, you should use mail access protocol

 

SMTP vs HTTP

SMTP HTTP
push protocol; 
sending mail server pushes the data onto the receiving mail server by initiating a TCP connection.
pull protocol;
client pulls the information available on a server by initiating a TCP connection.
persistent connection (connection 하나에 여러 개의 메일을 보낼 수 있다.) use both persistent and non-persistent connection
By default, uses port 25 By default, uses port 80
requires binary multimedia data to be encoded in 7-bit ASCII doesn't require binary multimedia data to be encoded in 7-bit ASCII
It places all the objects into a single message. It places each object in its own HTTP messages

 

Mail Access Protocols

Mail Access Protocols: retrieval from server

 

POP3 (Post Office Protocol)

  • stateless across sessions
  • download and delete mode & download and keep mode
  • 장점: 정보 보호, 서버 용량 상관 없음
  • 단점: PC가 망가지면 모두 날아감, 동기화 X

IMAP (Internet Mail Access Protocol)

  • stateful
  • keeps all msgs in one place: at server
  • allows user to organize msgs in folders

DNS (Domain Name System)

DNS (Domain Name System)

  • 문자로 된 도메인 네임을 컴퓨터가 이해할 수 있는 IP주소로 변환하는 역할을 하는 시스템
  • distributed, hierarchical database: implemented in heirarchy of many name servers
  • Application-Layer (L5) protocol

DNS Services

  • hostname to IP address translatioin (A)
  • host aliasing (CNAME): alias name -> canonical name
  • mail server aliasing (MX)
  • load distribution(= load balancing): many IP address correspond to one name

Why not Centralize DNS? 👉 doesn't scale!

  • single point of failure
  • traffic volume
  • distant centralized database -> long delay
  • maintenance

 

DNS Structure: Hierarchical

Root DNS Servers

 

TLD (Top-Level Domain) Server

  • responsible for com, org, net .. and all top-level country domains (e.g.: uk, fr, ca)
  • Network Solutions: maintains servers for .com TLD
  • KRNIC (한국인터넷정보센터): maintains servers for .kr

Authoritative DNS Server

  • organization's own DNS server
  • providing authoritative hostname to IP mappings for organization's named hosts
  • maintained by organization or service provider

LDNS (Local DNS Name Server)

  • DNS 특정 계층 구조에 속하지 않음
  • ISP들은 가입자들의 DNS resolution을 대신 처리해주는 LDNS를 가지고 있다 (default name server)
    • ISP 내부의 중복된 DNS resolution을 줄여서 외부 트래픽을 줄일 수 있다
  • DNS reply 결과를 일정 기간 저장하는 일종의 proxy 서버 -> 평균 DNS query 속도 향상

 

DNS Resolution

iterated query

  • contacted server replies with name of server to contact
  • "I don't know this name, but ask this server"

recursive query

  • recursive하게 실제 domain name을 가지고 있는 server까지 query가 이동하여 IP 주소를 얻는 방법
  • root DNS server에 overhead 증가

TTL

  • LDNS 서버가 DNS reply를 받은 후에 해당 내용을 일정 시간 저장하는데, 이 레코드(RR)의 유효 시간을 나타내는 필드
  • once name server learns mapping, it caches mapping
  • TLD servers typically cached in local name servers (LDNS) -> thus root servers not often visited
  • cached entries may be out-of-date
    • update / notify mechanisms

 

DNS Records

DNS: distributed database storing resource records (RR)

RR format: (name, value, type, ttl)

name, type -> request msg, value -> response msg

type = A

  • name = hostname
  • value = IP address

type = NS

  • name = domain
  • value = hostname of authoritative name server for this domain

type = CNAME

  • name = alias name for some 'canonical'(the real) name
  • value = canonical name

type = MX

  • value = name of mail server associated with name

 

DNS protocol, messages

query and reply msgs, both with same message format

  • header
    • identification: 16bit, query & reply to query uses same #
    • flags: QR bit (0 = query, 1 = reply), RD bit (reqursion desired), RA bit (recursion available), AA bit (reply is authoritative)

DNS query & reply 는 대부분 크기가 작고 연속적으로 데이터를 주고 받지 않으므로 일반적으로 UDP를 사용하지만, 큰 용량의 DNS 데이터를 옮길 때는 TCP를 사용할 수도 있다.

 

Example: Inserting records & Accessing Web Page

Example: new startup "NU"

 

Inserting records into DNS

  1. create authoritative server (dns1.nu.com)
    • (www.nu.com, 212.212.212.4, A), (nu.com, mail.nu.com, MA), (mail.nu.com, 212.212.212.10, A)
  2. register name nu.com at DNS registrar (e.g. Network Solutions)
    • provides names, IP addresses of authoritative name server
    • registrar inserts two RRs into .com TLD server
      • (nu.com, dns1.nu.com, NS) (dns1.nu.com, 212.212.212.1, A)

Accessing Web Page of NU: Alice wants to view www.nu.com

  1. Alice's host가 www.nu.com의 IPv4 주소를 묻는 DNS query를 A가 속한 ISP의 LDNS에 보냄
  2. LDNS는 DNS query를 .com TLD DNS 서버에 보냄
  3. .com TLD DNS 서버는 NU 회사의 authoritative DNS 서버의 hostname과 IP주소를 포함한 DNS reply 메시지를 LDNS에 응답
  4. LDNS는 authoritative DNS 서버의 IP 주소로 www.nu.com의 IP주소를 묻는 DNS query를 보냄
  5. authoritative DNS 서버가 www.nu.com의 IP주소를 포함한 DNS reply를 LDNS에 응답
  6. LDNS는 DNS reply 메시지에 www.nu.com의 IP주소를 포함하여 Alice's host에게 전달
  7. Alice's browser가 해당 IP 주소로 TCP 연결을 맺고 HTTP request msg 전송

P2P Applications

Pure P2P Architecture

  • no always-on server
  • arbitrary end systems directly communicate
  • peers are intermittently connected and change IP address

 

File distribution

How much time to distribute file (size F) from one server to N hosts?

  • Assume: host upload/download capacity is limited resource, ignore delay in core NW

Client-Server

  • server: must sequentially send (upload) N file copies
    • time to send one copy = $\frac{F}{U_S}$
    • time to send N copies = $\frac{NF}{U_S}$ 👉 increases linearly in N
  • client: each client must download file copy
    • $d_{min}$ = minimum client download rate
    • minimum client download time = $\frac{F}{d_{min}}$

\[D_{C-S} \geq \max\left\{\frac{NF}{U_{S}}, \frac{F}{d_{\min}}\right\}\]

 

P2P

  • server: must upload at least one copy
    • time to send one copy: $\frac{F}{U_S}$
  • client(Peer): each peer must download file copy
    • minimum peer download time: $\frac{F}{d_{min}}$
  • server and peer: as aggregate must upload NF bits
    • maximum upload rate is $(U_S + \sum u_i)$

\[D_{P2P} \geq \max\left\{\frac{F}{U_S}, \frac{F}{d_{\min}}, \frac{NF}{U_S + \sum U_i}\right\}\]

👉 increases linearly in N, but so does this, as each peer brings service capacity
👉 P2P file distribution -> host의 증가가 latency에 크게 영향을 미치지 않는다.

저작자표시 (새창열림)

'CS > 컴퓨터네트워크' 카테고리의 다른 글

[Ch3] UDP, TCP  (1) 2023.11.21
[Ch2 & Ch3] CDN, UDP & TCP, Mux & Demux  (1) 2023.11.14
[Ch2 Application Layer] Principles of Network Applications, Web and HTTP  (0) 2023.10.30
Week2: Network Performance  (6) 2023.10.20
Week 1: Network Edge, Network Core  (1) 2023.10.17
  1. Electronic Mail: SMTP, POP3, IMAP
  2. Electronic mail
  3. SMTP
  4. SMTP vs HTTP
  5. Mail Access Protocols
  6. DNS (Domain Name System)
  7. DNS (Domain Name System)
  8. DNS Structure: Hierarchical
  9. DNS Resolution
  10. DNS Records
  11. DNS protocol, messages
  12. Example: Inserting records & Accessing Web Page
  13. P2P Applications
  14. Pure P2P Architecture
  15. File distribution
'CS/컴퓨터네트워크' 카테고리의 다른 글
  • [Ch3] UDP, TCP
  • [Ch2 & Ch3] CDN, UDP & TCP, Mux & Demux
  • [Ch2 Application Layer] Principles of Network Applications, Web and HTTP
  • Week2: Network Performance
호프
호프
호프
Untitled
호프
전체
오늘
어제
  • 분류 전체보기 (341)
    • 오류😬 (4)
    • 스터디📖 (96)
      • 웹 개발 기초 (8)
      • Spring (20)
      • ML, DL (30)
      • Node.js (22)
      • React (0)
      • 블록체인 (12)
      • Go (3)
      • Javascript (1)
    • 알고리즘💻 (153)
      • 그리디 (23)
      • Bruteforce&Backtracking (16)
      • DP (17)
      • 이분탐색&정렬&분할정복 (17)
      • 누적합&투포인터 (6)
      • 스택&큐&덱 (19)
      • 그래프(DFS&BFS) (19)
      • 트리 (7)
      • 우선순위큐&다익스트라 (11)
      • 벨만포드&플로이드와샬 (8)
      • map&set&number theory (5)
      • 기타 (5)
    • 프로젝트 (3)
      • 캡스톤 디자인 프로젝트 (3)
    • 블록체인🔗 (3)
      • Solana (2)
      • 개발 (0)
      • Harmony (1)
    • ASC (6)
    • CS (73)
      • 데이터베이스 (12)
      • 클라우드컴퓨팅 (21)
      • 운영체제 (11)
      • 컴퓨터네트워크 (14)
      • 블록체인응용 (15)

블로그 메뉴

  • 홈
  • 태그
  • 방명록

공지사항

인기 글

태그

  • 복습

최근 댓글

최근 글

hELLO · Designed By 정상우.v4.2.1
호프
[Ch2 Application Layer] Electronic Mail, DNS, P2P applications
상단으로

티스토리툴바

단축키

내 블로그

내 블로그 - 관리자 홈 전환
Q
Q
새 글 쓰기
W
W

블로그 게시글

글 수정 (권한 있는 경우)
E
E
댓글 영역으로 이동
C
C

모든 영역

이 페이지의 URL 복사
S
S
맨 위로 이동
T
T
티스토리 홈 이동
H
H
단축키 안내
Shift + /
⇧ + /

* 단축키는 한글/영문 대소문자로 이용 가능하며, 티스토리 기본 도메인에서만 동작합니다.