[Network]Application Layer
1 Principles of Network Applications
1.1 Application Architectures
Client-Server
Peer-to-Peer
Hybird of C/S and P2P
--Skypeclient-server: find the address of the remote clientclient-client: direct communication--Instant messagingSimilar with Skype
1.2 Application Requirements(From Transport Layer Services)
1. About Data Loss2. Timing3. Throughput4. 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 connection2) FTP is stateful
2.3 Email
1. SMTP: reliably transfer email messages(TCP connection)
Compare with HTTPHTTP: pull(GET); No such restriction;
each object encapsulated in its own response msgSMTP: push(transfer); 7-bit ASCII;
multiple objects sent in multiple msgMessage Format: 7-bit ASCIIheader lines (if extention, add some lines to declare the file type)body2. 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 - ibmdomain is part of URL you can consider as. - ibm.comalias name is URL - www.ibm.comcanonical name is real name - servereast.backup2.ibm.com2. DNS Protocol, Message
query and reply messagesheader: identification and flagssome fields3. 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 server2) end systems directly communicate3) 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".
BitTorrenttracker: track peers participating in torrent. - an individualtorrent: group of peers exchanging chunks of a file. - a groupThe 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 bloodis 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.
[Network]Application Layer的更多相关文章
- 课程一(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 ...
- ALPN(Application Layer Protocol Negotiation)
ALPN (Application Layer Protocol Negotiation)是TLS的扩展,允许在安全连接的基础上进行应用层协议的协商.ALPN支持任意应用层协议的协商,目前应用最多是H ...
- Neural Networks and Deep Learning(week4)Deep Neural Network - Application(图像分类)
Deep Neural Network for Image Classification: Application 预先实现的代码,保存在本地 dnn_app_utils_v3.py import n ...
- [Network]Transport Layer
1 Principles behind Transport Layer Services 1.1 Multiplexing/Demultiplexing Multiplexing at sender ...
- 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 ...
- [Network] 计算机网络基础知识总结
计算机网络学习的核心内容就是网络协议的学习.网络协议是为计算机网络中进行数据交换而建立的规则.标准或者说是约定的集合.因为不同用户的数据终端可能采取的字符集是不同的,两者需要进行通信,必须要在一定的标 ...
- 【Network】Calico, Flannel, Weave and Docker Overlay Network 各种网络模型之间的区别
From the previous posts, I have analysed 4 different Docker multi-host network solutions - Calico, F ...
- Overlay network 覆盖网络
From Wikipedia, the free encyclopedia An overlay network is a computer network that is built on top ...
- 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 ...
随机推荐
- js传真实地址 C:\fakepath
js给action传真是地址的时候,处于安全,传到action中 浏览器会改变路径变为C:\fakepath\ftp.txt,但是原始路径却是 C:\Documents and Settings\Ad ...
- 多线程——实现Callable接口
前两篇博客(多线程--继承Thread类.多线程--实现Runnable接口 )介绍了java使用线程的两种方法.这篇博客继续介绍第三种方法--实现Callable接口. 先说一下Runnable和C ...
- java中synchronized的使用方法与具体解释
Java语言的keyword.当它用来修饰一个方法或者一个代码块的时候,可以保证在同一时刻最多仅仅有一个线程运行该段代码. 一.当两个并发线程訪问同一个对象object中的这个synchronized ...
- [C#基础] 数据类型
预定义类型 C#提供了16种预定义类型,其中包括13种简单类型和3种非简单类型. 预定义的简单类型包括以下3种: 11种数值类型 不同长度有符号和无符号的整数类型(8种) 浮点数类型float和dou ...
- C语言常用的宏
01: 防止一个头文件被重复包含 #ifndef COMDEF_H #define COMDEF_H //头文件内容 #endif 02: 重新定义一些类型,防止由于各种平台和编译器的不同,而产生的类 ...
- TestComplete实测Flex
1.TestComplete提供了已经编译好的Flex界面,可以直接使用: http://support.smartbear.com/samples/testcomplete9/flex/orders ...
- ZOJ3805:Machine
In a typical assembly line, machines are connected one by one. The first machine's output product wi ...
- eclipse package,source folder,folder差别及相互转换
在eclipse下, package, source folder, folder都是目录. 它们的差别例如以下: package:当你在建立一个package时,它自己主动建立到source ...
- IE常见的CSS的BUG(二)
之前介绍过IE浏览器的几种BUG解决的方法,今天我们继续研究IE的BUG.尽管IE6即将被淘汰,但是了解这些也对将来解决问题也是有一定帮助的.好了,闲话不多说,咱们继续看IE的BUG. 1.IE6下P ...
- oracle 之 内存—鞭辟近里(四)
oracle 之 内存—鞭辟近里(四) 今天是2013-07-11日,首先我非常感谢我的哥们也是我的网友杨工,非常感谢他能在大数据库内帮我执行一下我所需要的信息.就是他说的网络真是一个互助友爱的平台. ...