1 Principles of Network Applications


1.1 Application Architectures

Client-Server

Peer-to-Peer

Hybird of C/S and P2P

--Skype
client-server: find the address of the remote client
client-client: direct communication
--Instant messaging

Similar with Skype

1.2 Application Requirements(From Transport Layer Services)

1. About Data Loss
2. Timing
3. Throughput
4. Security

2 Application-Layer Protocols


2.1 Web and HTTP

1. Properties of HTTP 

Uses TCP

Nonpersistent HTTP: One TCP connection for One object transmission

RTT: time for a small packet from client to server and back.

Response time: RTT(TCP connection) + RTT(HTTP request) + file transmission

Persistent HTTP: Multiple Objects on One TCP connection

HTTP is stateless:

server maintains no information about past client requests.

2. HTTP Request messages:

Request line: method path protocol

Header lines

Entity body

3. HTTP Response messages:

Status line: protocol statuscode statusphrase

Header lines

Data

4. Cookies

As we have disscussed above, HTTP is stateless, so if we want to keep states of users, we must utilize the process of HTTP to get it.

Most of Web Sites use cookies.

Four components:

1) cookie header line in HTTP request message

2) cookie header line in HTTP response message

3) cookie file kept on user's host, managed by user browser

4) cookie file kept on server database of Web sites

To sum up, HTTP is stateless for it does not store the information of user states. But we can store the cookies in user hosts and servers and let the HTTP messages carry states.

5. Web cache

Why caching

1) reduce response time

2) reduce traffic

With HTTP:

Use conditional GET: If-modified-since, Not-modified

2.2 FTP

FTP seperate control and data connections, see following:
out-of-band: 是控制和数据分离,当有紧急情况(控制数据须要传输时,控制传输具有较高的优先级)
1) client build control connection, server build data connection
2) FTP is stateful


2.3 Email

1. SMTP: reliably transfer email messages(TCP connection)

 
Compare with HTTP
HTTP: pull(GET); No such restriction;
each object encapsulated in its own response msg
SMTP: push(transfer); 7-bit ASCII;
multiple objects sent in multiple msg
Message Format: 7-bit ASCII
header lines (if extention, add some lines to declare the file type)
body

2. POP3

Store email locally.

3. IMAP

Store on mail server.

4. The difference of them

This part I most quoted from the page.
SMTP is the basis. POP3(locally, stateless) and IMAP(on the server, stateful-folder) are used to access the mails.

2.4 DNS

TLD: Top-Level-Domain com, cn, org ...

1. DNS records

hostname is the name of a host - ibm
domain is part of URL you can consider as. - ibm.com
alias name is URL - www.ibm.com
canonical name is real name - servereast.backup2.ibm.com

2. DNS Protocol, Message

query and reply messages
header: identification and flags
some fields

3. An Example: Inserting records into DNS

(networkutopia.com,dns1.networkutopia.com, NS)

(dns1.networkutopia.com,212.212.212.1, A)

Then others can find your web site at IP 212.212.212.1

2.5 P2P

There are some properties of P2P: 
1) no always-on server
2) end systems directly communicate
3) peers change IP

1. File Distribution

C/S is "N copies upload and N copies download", but P2P is "One copy uploads and N copies download".


BitTorrent  
tracker: track peers participating in torrent.  - an individual
torrent: group of peers exchanging chunks of a file. - a group
The processes of bit torrent consist of pulling chunks and sending chunks. 
- When downloading chunks, the peer will request a list of chunks from its neighbors, and choose the rarest chunks first. (从最稀缺的内容開始)
- When uploading chunks, the peer will send chunks to four neighbors currently sending it chunks at highest rate.(投桃报李)
So one file will be held by several peers in the network and each peer can both download and upload. And there are some prescriptions for peers to down and up.

2. Searching for Information

Query blood
is a method to find resource in a P2P network. Because the graph of P2P network may not be connected by each node. So a query must be broadcasted in the network to find a resource.
It may cause DoS attack. 
The TCP connection built in the process of blooding form a hierarchical searching graph.

3. Skype

Almost similar with BitTorrent and Query blood.




End.



[Network]Application Layer的更多相关文章

  1. 课程一(Neural Networks and Deep Learning),第四周(Deep Neural Networks) —— 3.Programming Assignments: Deep Neural Network - Application

    Deep Neural Network - Application Congratulations! Welcome to the fourth programming exercise of the ...

  2. ALPN(Application Layer Protocol Negotiation)

    ALPN (Application Layer Protocol Negotiation)是TLS的扩展,允许在安全连接的基础上进行应用层协议的协商.ALPN支持任意应用层协议的协商,目前应用最多是H ...

  3. Neural Networks and Deep Learning(week4)Deep Neural Network - Application(图像分类)

    Deep Neural Network for Image Classification: Application 预先实现的代码,保存在本地 dnn_app_utils_v3.py import n ...

  4. [Network]Transport Layer

    1 Principles behind Transport Layer Services 1.1 Multiplexing/Demultiplexing Multiplexing at sender ...

  5. Core abstraction layer for telecommunication network applications

    A new sub-system, the core abstraction layer (CAL), is introduced to the middleware layer of the mul ...

  6. [Network] 计算机网络基础知识总结

    计算机网络学习的核心内容就是网络协议的学习.网络协议是为计算机网络中进行数据交换而建立的规则.标准或者说是约定的集合.因为不同用户的数据终端可能采取的字符集是不同的,两者需要进行通信,必须要在一定的标 ...

  7. 【Network】Calico, Flannel, Weave and Docker Overlay Network 各种网络模型之间的区别

    From the previous posts, I have analysed 4 different Docker multi-host network solutions - Calico, F ...

  8. Overlay network 覆盖网络

    From Wikipedia, the free encyclopedia An overlay network is a computer network that is built on top ...

  9. How Network Load Balancing Technology Works--reference

    http://technet.microsoft.com/en-us/library/cc756878(v=ws.10).aspx In this section Network Load Balan ...

随机推荐

  1. QT源码分析(从QApplication开始)

    QT源码分析 转载自:http://no001.blog.51cto.com/1142339/282130 今天,在给同学讲东西的时候,谈到了Qt源代码的问题,才发现自己对Qt机制的了解是在太少了,而 ...

  2. J2SE学习小结

    开始接触Java的学习,Java 2 Standard Edition为Java2平台的标准版,其包括了构成Java语言核心的类,此番学习算是学习了Java体系中的基础部分. 学习框架大致整理如下: ...

  3. 编写自己的单点登录(SSO)服务

    王昱 yuwang881@gmail.com   博客地址http://yuwang881.blog.sohu.com 摘要:单点登录(SSO)的技术被越来越广泛地运用到各个领域的软件系统其中.本文从 ...

  4. cocos2dx--两个场景切换各函数调用顺序

    场景A切换到场景B,有切换特效 调用顺序例如以下:(AAABABABA) A:构造函数 A:onEnter A:onEnterTransitionDidFinish B:构造函数 A:onExitTr ...

  5. Android 吸入动画效果详解

    1,背景 吸入(Inhale)效果,最初我是在iOS上面看到的,它是在Note程序中,用户可能添加了一页记录,在做删除时,它的删除效果是:这一页内容吸入到一个垃圾框的图标里面.请看下图所示: ==== ...

  6. Django学习之manage.py使用

    1.django-admin.py startproject mysite 开始一个项目,会初始化一些项目的结构文件 2.python manage.py runserver ip:port 如: p ...

  7. 利用Node.js实现模拟Session验证的登陆

    1.身份验证和用户登陆 在一般的Web应用上,假设要实现用户登陆,最经常使用,也是最简单的方法就是使用Session,主要的思路是在Session中保留一些用户身份信息,然后每次在Session中取, ...

  8. 移动app接口编程技术-学习实现之PHP进阶 数组

    数组创建,初始化 <?php //请创建一个数组变量arr,并尝试创建一个索引数组 /** * 不带初始值的创建.创建后赋予值 * 注:下标一定是整数 */ $arr = array(); $a ...

  9. 学习日记之命令模式和Effective C++

    命令模式(Command): 讲一个请求封装为一个对象.从而使你可用不同的请求对客户进行參数化.对请求队列或记录请求日志.以及支持可撤销的操作. 命令模式长处: (1),它能较easy地设计一个命令队 ...

  10. 4.windows和Linux下创建oracleusername表空间,表,插入数据,用户管理表等操作

    进入超级管理员,运行下面命令 Window下创建数据库.表空间,用户,插入数据等操作 -- 01 创建表空间 -- 注意表空间的路径 依据实际安装环境进行调整 CREATE TABLESPACE ts ...