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)
- Alice's UA (user agent) sends msg to her mail server; msg placed in message queue (outgoing)
- client side of SMTP opens TCP connection with Bob's mail server
- SMTP client sends Alice's msg over the TCP connection
- Bob's mail server places the msg in Bob's mailbox
- 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
- 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)
- 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
- Alice's host가 www.nu.com의 IPv4 주소를 묻는 DNS query를 A가 속한 ISP의 LDNS에 보냄
- LDNS는 DNS query를 .com TLD DNS 서버에 보냄
- .com TLD DNS 서버는 NU 회사의 authoritative DNS 서버의 hostname과 IP주소를 포함한 DNS reply 메시지를 LDNS에 응답
- LDNS는 authoritative DNS 서버의 IP 주소로 www.nu.com의 IP주소를 묻는 DNS query를 보냄
- authoritative DNS 서버가 www.nu.com의 IP주소를 포함한 DNS reply를 LDNS에 응답
- LDNS는 DNS reply 메시지에 www.nu.com의 IP주소를 포함하여 Alice's host에게 전달
- 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 (0) | 2023.10.20 |
Week 1: Network Edge, Network Core (0) | 2023.10.17 |