传输层

   1、介绍传输层服务

     a、传输层与网络层之间的关系

           网络层使用的是IP协议,传输层提供的是TCP/UDP服务

           传输层是基于网络层而开发的,使用的是网络层对上层公开的服务

     b、不同主机之间传输层之间的关系

           传输层不用关心传输层以下的的服务,两个主机的传输层用协议来满足交流,遵守相同的规则

     c、传输层对应用层提供了可靠的TCP传输,也提供了不可靠的UDP传输

2、复用与分用(multiplexing and demultiplexing )

     发送方不同的应用进程都可以使用同一个传输层协议传送数据,分用是指接受方的运输层在接受数据后能提交给相对应的进程

     解决方案:用不同的端口来满足,根据数据包中的端口号,来提交到相对应端口的进程。每个进程对应着一个不同的应用程序

3、应用层是用的协议表

    

4、TCP与UDP结构

   

                                                          

                                                                        UDP数据格式

                                        

                                                                    TCP数据包格式

5、校验和

把需要进行校验的“字串”加(+)起来,把这相加的 结果取反当做
校验和” (Checksum), 比如,相加的结果是0101,那么“校验和”就
1010,验证的时候呢,就是 0101+1010 = 1111 ,取反后, 就是0

——如果验证得“零”( 0),就是正确的!
加的时候,把2个伪部也加上
 6、如何保证可靠性的传输
       a、检错(error detection)
       b、接受反馈(receiver feedback)
       c、超时重发(timeout and repeat)
       d、***(serial number)
7、rdt.3.0
       每次只返回ACK,3.0以前的版本有NAK,如果接受者没有回复,或者丢失了数据包,那么就要重新传数据包
8、发送策略
       a、go-back-n策略 
            当接收方检测出失序的信息帧后,要求发送方重发最后一个正确接收的信息帧之后的所有未被确认的帧。
       b、Selective Repeat策略
            有选择性的重发
            
9、面向连接的TCP
      


                                              tcp传输确认方式
           确定传输延时RTT:

                        EstimatedRTT = (1- a)*EstimatedRTT + a*SampleRTT        

                        DevRTT = (1-b)*DevRTT +b*|SampleRTT-EstimatedRTT|

                        TimeoutInterval = EstimatedRTT + 4*DevRTT

10、TCP流量控制服务

        流量控制服务是一个速度匹配服务

        TCP provides flow control by having the sender maintain a variable called the
receive window. Informally, the receive window is used to give the sender an idea of
how much free buffer space is available at the receiver.

         Suppose that Host Ais sendinga large file to Host B over a TCP connection. Host B allocates a receive buffer to this connection; denote its size by RcvBuffer.

11、TCP连接管理

        简单的说,就是握手,交流,断开连接

        FIN是断开连接,如果为0表示正在连接,如果为1,表示要断开连接。

        ACK确认,确认方式有很多,请看上面ACK确认回复。

        SYN请求连接

12、拥塞控制

       congestion but rather focus on the simpler issue of understanding what happens as hosts increase their transmission rate and the network becomes congested.

       ATM ABR congestion control is a rate-based approach. That is, the sender
explicitly computes a maximum rate at which it can send and regulates itself accordingly.
ABR provides three mechanisms for signaling congestion-related information
from the switches to the receiver:

 

参考文献:<<Computer Networking A Top-Down Approach 6th Editon.pdf>>