Good article computer network tutorial included in layman's language [graphic] of [computer network to achieve reliable transmission of TCP: three-way handshake sliding window +]

Getting Started with Internet Protocol (I, II) Ruan Yifeng

http://www.ruanyifeng.com/blog/2012/05/internet_protocol_suite_part_i.html

Five (seven) layer Internet protocol (computer network) in layman's language, a graphic reading will understand [] two, three

https://www.jianshu.com/p/6ee3ee9c3cfd

 

Layman illustrates the Computer Network] [achieve reliable transmission of TCP: three-way handshake sliding window +]

 

https://www.cnblogs.com/alva-rabbit-hole/p/10081169.html

 

Computer Network Study Notes

The study notes issue-oriented, leading questions by reading, to enrich their knowledge.

1. The architecture of the computer network?

Official the OSI architecture, including the seven layers: physical layer, data link layer, network layer, transport layer, session layer, presentation layer, application layer.

However, due to various reasons, OSI did not become actual network architecture. Currently use the TCP / IP structure, the structure will be divided into four layers, physical layer, data link layer as one layer, followed by the above network layer, transport layer and application layer.

2. The role of the network layer of each layer

1. Transport Layer

To-end communication for the application process logic, i.e. to realize multiplexing and demultiplexing application process. In order to identify different transport layer application process, specifies the port number of the application process, the system range from 0 to the port number 1024, which is why the node can not directly monitor the port number range. At the same time, also the error control, error control comprises not only the transport layer header information, and contains data portion.

2. Network Layer

It provides a logical communication between the host. The difference between the transport layer: The network layer provides logical communication between hosts, the transport layer provides logical communication between processes

3. Introduction Transport Layer

3.1 TCP, UDP is the difference

a) UDP

  • No transport-layer protocol connections
  • Transmission speed, best effort, no congestion control
  • Header information overhead is small, only 8 bytes, whereas TCP is needed 20. Respectively, source port number, destination port number, length, and checksum

b) TCP

  • Connection-oriented transport layer protocol
  • Each TCP connection has only two endpoints: an endpoint = {IP: Port Number}
  • Reliable transport
  • Flow control, congestion control

3.2 reliable transport of the transport layer

Two ideal transmission conditions: no transmission error to ah; no matter how fast the transmission rate, the receiver can be received even. But the reality does not meet these two conditions.

Way : stop and wait protocol: After each time after transmitting a packet, the receiver sends acknowledgment information, but this will make the channel utilization is not high.

Continuous ARQ protocol: the presence of a sender transmitting window, each receive a confirmation message, a window is moved forward, but often of cumulative identifiable manner.

4 Physical Layer

Effect: the bit-stream between the computers. Shielding and transmission media to the difference of the means of communication, so that the data link layer is not required to consider these issues. The computer simultaneously use more parallel transmission, and multi-line serial communication transmission, physical layer transmission scheme but also to complete the conversion. The main task is to confirm the characteristics of the transmission media interface.

The data link layer

  1. Encapsulated in a frame: IP packet header and trailer +, for delimiting frames
  2. Action: encapsulated in a frame, transparent transmission, error control
  3. Protocol: PPP, broadcast
  4. LAN data link layer is split into two sublayers: Logical Link Control (LLC), Media Access Control (MAC), but many manufacturers adapter only with the MAC protocol, the LLC protocol without
  5. In the LAN, the hardware address is also called the physical address, or MAC address
  6. Bridge works at the data link layer, the effect of a filter frame, the frame is forwarded according to the destination address of the received MAC frame, to expand for LAN data link layer
  7. Adapter card is now said

### 6 Network layer

  1. The network layer provides only simple and flexible, connectionless, best effort delivery of the datagram service
  2. IP protocol is a network layer protocol, as well as three supporting protocols: Address Resolution Protocol (ARP), Internet Control Message Protocol (ICMP), Internet Group Management Protocol (IGMP)
  3. Network requires some intermediate device to connect: the physical layer (transponder), the data link layer (bridge or bridges), network layer (router), above the network layer relay system (gateway)
  4. Due to historical reasons, the use of the network layer router becomes a gateway
  5. Only routers to forward packets (regardless of the destination host number) in accordance with the network number of the destination host is connected, each router has a two or more IP addresses, the router for each network interface has a number of different IP addresses.
  6. The role of the router is connected to different networks, a routing additional address.
  7. The only router for routing IP network number of the destination station address
  8. IP层屏蔽了下层复杂的细节,使用统一的、抽象的IP地址研究主机与主机、主机与路由器之间的通信
  9. ARP:每个主机都设有一个ARP高速缓存(ARP cache),如果不存在,则进行广播,找到后返回ARP响应,得到目的主机的物理地址
  10. 一个IP数据包由首部和数据两部分组成
  11. 因为最大传输单元的限制,数据需要进行分片,片偏移以八个字节为偏移单元
  12. 根据网络地址进行网路寻址
  13. 在单位内部进行子网划分,对外仍表现为没有划分子网的网络
  14. ICMP(Internet Control Message Protocol),用于提高IP数据报交付成功的机会,允许主机或路由器报告差错情况和提供有关异常情况的报告,不是高层协议,而是IP层的协议。ICMP报文作为IP层数据报的数据
  15. ICMP报文分为两种: ICMP差错报告报文和ICMP询问报文
  16. ICMP的应用:PING是应用层直接使用网络层,使用了ICMP回送请求与回送回答报文
  17. 路由寻址时,采用分层次的路由选择协议
  18. 虚拟专用网可以使用本地地址,只能用于一个机构的内部通信,而不能用于和因特网上的主机通信。在因特网中的所有路由器对目的地址是专用地址的数据包一律不进行转发。

###7.传输层

  1. 作用:a.为应用进程提供端到端的逻辑通信;b.对收到的报文进行差错检测
  2. UDP传输前不需要建立连接,是不可靠传输;TCP提供面向连接的服务,提供可靠的、面向连接的运输服务
  3. 进程在计算机中是通过进程标示符(PID)来标识的,不同操作系统是不同的,进程的创建和撤销都是动态的,因此为了表示应用进程,采用了端口号
  4. 端口号是一个16位,只具有本地意义,只是为了标识本计算机应用层中得各个进程。
  5. 端口号分为三类:熟知端口号(0-1024)、登记端口号(1024-49151)、客户端口号(49152-65535)
  6. UDP:与IP数据包相比,仅增加了端口功能、差错校验。
  7. UDP特点:无连接、最大努力交付、不可靠交付、没有拥塞控制、首部开销小8.
  8. UDP数据报:UDP首部(8个字节) + 数据
  9. TCP:面向连接、可靠交付、全双工通信、面向字节流
  10. TCP:每条TCP连接有两个端点,端点叫做套接字(socket)或插口,端口号 + IP地址 = 套接字
  11. 可靠传输–停止等待协议:确认和重传机制,可以在不可靠的传输网络中实现可靠通信
  12. 连续ARQ协议:累计确认,对按需到达的最后一个分组发送确认
  13. TCP:每端须有两个窗口,一个发送窗口,一个接收窗口,确认是依据序号
  14. TCP:TCP首部至少需要20个字节,还包含可变部分
  15. TCP可靠传输的实现:以字节为单位的滑动窗口
  16. 发送缓存:准备发送的数据、已发出但尚未收到确认的数据;接收缓存:按序到达,尚未被读取的数据、不按序到达的数据
  17. 流量控制:数据发送过快,接收方就可能来不及接收,熬成数据的丢书,利用滑动窗口机制可以方便地在TCP连接上实现流量控制。也就是发送方的发送速度不要太快,要让接收方来得及接收
  18. 拥塞控制:对资源的需求量 > 可用资源
  19. 拥塞控制 vs 流量控制:拥塞控制是一个全局性的过程,涉及到所有的主机、所有路由器,以及与降低网络传输性能有关的所有因素;流量控制往往指发送端和接收端之间的点对点通信量的控制
  20. 拥塞控制的方法:a.慢开始 逐步增大发送端的拥塞窗口,使分组注入到网络的速度更加合理,是加倍增加 b. 拥塞避免算法:拥塞窗口缓慢增大,按照现行规律缓慢增长。总的来说就是,开始拥塞窗口较小,然后先按指数速度增长,然后再按照现行速度增长,当出现拥塞时,立即减小拥塞窗口的大小。
  21. 拥塞控制方法2:快重传和快恢复。a.快重传—接收方每收到一个失序的报文段,就立即发出重复确认,快重传bong非取消重传计时器,而是在某些情况下可尽早地重传丢失的报文段
  22. TCP的运输连接分为三个阶段:连接建立、数据传输、连接释放
  23. TCP连接的建立:SYN:连接请求和连接接受报文,ACK:确认号。通过三次握手,建立TCP连接
  24. TCP连接释放:FIN=1:连接释放报文首部。需要经过两次的报文传输,才能做到连接的释放。

###应用层

  1. 应用层:规定应用在通信时所遵循的协议
  2. 域名:采用层次树状结构的命名方法,根域名服务器是树状的,根域名服务器、顶级域名服务器、权限域名服务器、本地域名服务器
  3. FTP:21是连接时使用的端口号;20是数据发送使用的端口号
  4. HTTP协议本身是无状态的,也是无连接的,虽然TCP是面向连接的。HTTP/1.1使用持续连接,服务器在发送响应后连接会保持一段时间
  5. HTTP报文格式:开始行、首部行、实体部分
  6. 搜索引起:全文搜索会采集页面信息,而分类目录搜索利用各网站向搜索引起提供信息
  7. 邮件协议:发送邮件SMTP,读取邮件(POP3、IMAP)
  8. 大多是操作系统使用系统调用在应用程序和操作系统之间传递控制权
  9. 应用进程需要获取网络资源,则可以通过套接字来完成
  10. ICMP协议:因特网控制报文协议,是网络层的一个子协议,用于IP地址与路由器之间传递控制信息,检测网络是否通畅

知识点

  1. 集线器:工作在物理层,作用:对接收到的信息进行整形放大,最后将放大的信号广播到其他所有端口
  2. 子网:子网的划分是单位内部的事情,所以外部使用的是整个子网的路由器地址,也就是所以子网内主机对外共享一个网络地址。这样就存在这样的问题:知道A的IP地址,子网掩码,求A的网络地址
  3. ARP:将IP地址和MAC进行转换,数据链路、物理层是通过MAC地址进行转发的。ARP有一个高速缓存,存储这IP、MAC地址的映射关系,当存在就直接转发,不存在就广播寻找,不在同一个网络上,就寻找路由器的mac地址,交付给该路由器,该路由器把分组交给下一个网络。
  4. 电路交换 vs 分组交换: 电路交换–首先通信双方建立连接通道,在连接过程中始终占用着信道资源;分组交换:通信前不需要先建立通信路径,将数据分为较小的单元,
  5. 封装成帧:在数据前后记入一个控制字符:SOH、EOT;透明传输:如果数据部分存在控制字符,则在其前面加上转移字符ESC(字节填充)
  6. 路由表的内容:网络地址、子网掩码、下一条地址、花费、路由的服务质量、路由中需要过滤的出/入连接列表
  7. 路由器的分组转发算法:a.根据IP数据报得出其网络号,如果当前就是,则直接交付,b.根据路由表,交付给下一跳路由器;c.如路由表有一个默认路由,则数据报传递给默认路由。
  8. 使用UDP的应用层协议:DNS(域名解析服务)、SNMP(简单网络管理协议)、TFTP(简单文件传输协议)、DHCP(动态主机设置协议)
  9. 应用层并不是指运行在网络上的某个特别应用程序,而是指为用户的应用进程提供的服务
  10. 网络层不保证通信的可靠,运输层负责
  11. IGMP(网络组管理协议):发送多播协议

Guess you like

Origin www.cnblogs.com/CodeWorkerLiMing/p/11276280.html