Computer network infrastructure study notes (application layer) night train Star Fan's blog

 

 

 

1. What is the application layer?

A: The transport layer provides end to end communication services for the application process, but the application process between different network applications, but also require different communication rules. The application layer of the communication protocol defined between a plurality of application processes in the different hosts. Many application layer protocol is based on client - server model, the client is requesting party service, the server is a service provider.

2. The Domain Name System (DNS)

Domain Name System DNS (Domain Name System) is the use of the Internet naming system, used to convert people to use the machine name to an IP address. Domain name to resolve iP address for a number of domain name servers that are distributed on the Internet to complete.

  1. The Internet domain structure

      Such as: mail.cctv.com three domain names. secondary domain. Top Level Domains

  Now top-level domains TLD (Top Level Domain) is divided into three categories:

    1. The top-level domain nTLD: such as cn for China, us US

    2. gTLD gTLD: as com (companies), net (network service), int (international organizations)

    3. Infrastructure domain: There is only one arpa, for reverse DNS

  2. Domain Name Server

  Domain name resolution is working to complete the IP address. include:

    1. The root domain name server (root name server): the highest level of domain name servers know the domain name servers for all top-level domains and IP addresses.

    2. The top-level domain servers: responsible for managing all registration of second-level domain in the top-level domain servers.

    3. domain name server authority: the domain name server is responsible for a zone.

    4. The local domain name server: you can set up their own server for managing the distribution of their own domain name.

  Example: m.xyz.com host wants to know the IP address of the domain name y.abc.com (iterative query mode):

    1. Host m.xyz.com recursive queries Xianxiang its local domain name server dns.xyz.com

    2. The local domain name server uses an iterative query. It first in one root name server queries

    3. root name server IP address tells a local domain name server, the next top-level domain server should query the dns.com

    4. The local domain name server queries to the top-level domain server dns.com

    5.顶级域名服务器dns.com告诉本地服务器dns.com,下一次应查询的权限域名服务器dns.abc.com的IP地址

    6.本地域名服务器向权限域名服务器dns.abc.com进行查询

    7.权限域名服务器告诉本地服务器,所查询主机的IP地址

    8.本地域名服务器最后将结果告诉主机m.xyz.com

    递归的查询方式是本地--根---顶级----权限---顶级----根----本地的查询

  3.文件传输协议

      文件传输协议FTP(File Transfer Protocol)是因特网使用最广泛的文件传输协议。

      FTP使用TCP可靠的运输服务,使用客户服务器模式。一个FTP文件服务器可以为多个用户进程提供服务。在进行文件传输时,FTP的客户和服务器之间要建立两个并行的TCP连接:控制连接和数据连接。

3.万维网WWW

  万维网WWW(World Wide Web)是一个大规模、联机式的信息储藏所,可以方便由因特网的一个站点连接到另一个站点。

  1.统一资源定位符URL

    URL是用来表示从因特网上得到的资源位置和访问这些资源的方法。、

    格式:<协议>://<主机>:<端口>/<路径>

  2.使用HTTP的URL

    对于万维网的网点的服务要使用HTTP协议。HTTP的URL的一般形式:

    http://<主机>:<端口>/<路径>

  如:http://www.tsinghua.edu.cn

  3.超文本传输协议HTTP

  Http协议定义了浏览器怎样向万维网服务器请求万维网文档,以及服务器怎样把文档传送给服务器。

  如,用户点击了链接指向”清华大学院系设置“的页面,其URL为http://www.tsinghua.edu.cn/chn/yxsz/index.htm.下面是点击后发生的事件:

    1.浏览器分析连接指向界面的URL

    2.浏览器向DNS请求解析www.tsinghua.edu.cn的IP地址

    3.域名系统DNS解析出清华大学服务器的IP地址为166.11.4.100

    4.浏览器与服务器建立TCP连接

    5.浏览器发出取文件命令:GET/chn/yxsz/index.htm

    6.服务器www.tsinghua.edu.cn给出响应,把文件index.htm发送给浏览器

    7.释放TCP

    8.浏览器显示”清华大学院系设置“文件index.html文件

  4.万维网的文档

    万维网使用超文本标记语言HTML(HyperText MakeUp Language)来显示各种万维网页面。

    静态文档:指在文档创作完毕后就存放在万维网服务器中,在被用户浏览的过程中,内容不会改变。

    动态文档:指文档的内容是在浏览器访问万维网服务器是才由应用程序创建的

    活动文档技术:可以使浏览器屏幕连续更新。活动文档程序可与用户直接交互,并可以连续第改变屏幕显示

  5.万维网的信息检索系统

    1.全文检索搜索和分类目录搜索

    2.google搜索技术

4.电子邮件

  一个邮件系统应该具有三个构件:用户代理、邮件服务器以及邮件发送协议(如SMTP)和邮件读取协议(如POP3)。

  简单邮件传送协议SMTP(Simple Mail Transfer Protocol)

  通用因特网邮件扩充MIME(Multipurpose Internet Mail Extension)

  邮局协议POP3(Post Office Protocol)

5.动态主机配置协议DHCP

  动态主机配置协议DHCP(Dynamic Host Configuration Protocol)给运行服务器软件而位置固定的计算机指派一个永久地址,而当这计算机重启时其地址不会改变。

6.简单网络管理协议SNMP

  网络管理包括对硬件、软件和人力的使用、综合、与协调,以便对网络资源进行监视、测试、配置、分析、评价和控制,这样就能以合理的介个满足网络的一些需求,如实时运行性能、服务质量等。

  简单网络管理协议SNMP(Simple Network Management Protocol)由三部分组成,即:

    1.SNMP本身,负责读取和改变个代理中的对象名和其状态数值。

    2.管理信息结构SMI,定义命名对象和定义对象类型(包括长度和范围)的通用规则,以及把对象和对象的字进行编码的基本编码规则BER

    3.管理信息库MIB,在被管理的实体中创建了命名对象,并规定了其类型

 

 

在通信之前,TCP 会先通过三次握手的机制来确认两端口之间的连接是否可用。而UDP不需要确认是否可用,直接传。

三次握手机制:

一开始客户端和服务端都市关闭状态,但是在某个时刻,客户端需要和服务端进行通信,此时双方都会各自准备好端口,服务器段的端口会处于监听状态,等待客户端的连接。客户端可会知道自己的端口号,和目的进程的端口号,这样才能发起请求。

第一次握手:客户端想与服务器进行连接了,所以状态变为主动打开,同时发送一个连接请求报文给服务器段SYN=1,并且会携带x个字节过去。发送完请求连接报文后,客户端的状态就变为了SYN_SENT,可以说这个状态是等待发送确认(为了发送第三次握手时的确认包)

第二次握手:服务端接收到连接请求报文后,从LSTTEN状态变为被动打开状态,然后给客户端返回一个报文。这个报文有两层意思,一是确认报文,而可以达到告诉客户端,我也打开连接了。发完后,变为SYN_RCVD状态(也可以说是等待接受确认状态,接受客户端发过来的确认包)

第三次握手:客户端得到服务器端的确认和知道服务器端也已经准备好了连接后,还会发一个确认报文到服务器端,告诉服务器端,我接到了你发送的报文,接下来就让我们两个进行连接了。客户端发送完确认报文后,进入ESTABLISHED,而服务器接到了,也变为ESTABLISHED

TCP释放连接时的四次挥手

通信完成后,连接就会被释放,通过四次挥手机制来完成这个事情。

TCP断开链接的过程和建立链接的过程比较类似,只不过中间的两部并不总是会合成一步走,所以它分成了4个动作,张三挥手(fin)——李四伤感地微笑(ack)——李四挥手(fin)——张三伤感地微笑(ack)。之所以中间的两个动作没有合并,是因为tcp存在「半关闭」状态,也就是单向关闭。

 

有两张很好的动图传不上去。。。

 

盗图:

 

姑且做一篇博客。

 

 

 

Guess you like

Origin blog.csdn.net/weixin_44740377/article/details/90343291