1 Principles behind Transport Layer Services


1.1 Multiplexing/Demultiplexing

Multiplexing at sender side, Demultiplexing at receiver side.


How Demultiplexing
Index with: IP + Port num

This part indicates that transport layer processes data with multiplexing, which function the multiple processes communicate in the network simultaneously without critical collisions. 
Now we can actually go in to UDP, but I'd like to put the principles in one section. Other Principles below are more relative withTCP.


1.2 Reliable Data Transfer

Reliability is one of the most important problem of Network. And it is obvious that there is no absolute reliability, though we are trying to find a more reliable way for data transmitting. 
So, most of the implementation of reliable data transferring is built on unreliable data transferring. It is an altitude to make it more reliable.



1. rdt1.0: reliable transfer over a reliable channel

It seems to be an ideal version of rdt.

2. rdt2.0: channel with bit errors

use checksum to detect errors: stop-and-wait
ACK: receiver tells sender that the pkt OK
NAK: receiver tells sender that the pkt BAD, and sender retransmit
So the rdt adds error detection and
receiver feedback

a fatal flaw: if ACK and NAK corrupt or duplicate.

3. rdt2.1: sequence number

Here are just two num 0 and 1. 
Sender must get the ACK/NAK before moving to next state.
Receiver must check if the pkt is duplicate, here num 0 and 1.
But the receiver can not know if the last ACK/NAK received OK at sender.

4. rdt2.2: a NAK-free protocol

Mostly same with rdt2.1 except without NAK
1) receiver send ACK for last pkt received OK
2) duplicate ACK at sender results in same action as NAK

5. rdt3.0: channel with errors and loss

new assumption: channel can lose pkts.
Sender wait amount of time for ACK. timeout->retransmit->multiple pkt, receiver must detect.

6. Pipeling


There are two types of pipeling protocols:
1) Go-back-N
Sender
There is N size window:

Timer for each pkt, timeout to retransmit. And the sender expects to get the pkt[nextseqnum]. 
Receiver:
Only send ACK for correctly-received pkt with highest sequence number - pkt[expectedseqnum].
If receiving out-of-order pkt, 
discard,
re-ACK with highest in-order sequence number.


2) Selective Repeat:
It promote some disadvantages of GBN of discarding the disorderred pkts. It buffers the pkts and move the windows until the lowerbound is ACKed(sender) or received(received)



1.3 Flow Control (talked in TCP)

1.4 Congestion Control

This is different from flow control. Congestion is said that too many sources sending much data too fast fornetwork to handle(but flow control is said to send and receiver).
There are several ways to congestion control, end systems lead(TCP) or network lead. I just want detail the congestion control in TCP below.

2 Transport Layer Protocols


2.1 UDP

1. Properties

1) connectionless: simple, small header, no congestion control

2) lost, deliver out of order

2. Checksum

An example

3. Segment Format

2.2 TCP

1. overview

end-to-end
reliable, in-order
pipeline
data: MSS
connection
flow control

2. RTT and Time out

1) RTT



2) Time out
timeout = RTT + safety margin
a. margin

b. timeout


3. rdt

sender
ACK received: update the Sendbase to ACK=y
time out: send with smallest sequence number

receiver

a. Formal: delay ACK

b. Higher than expected sequence: duplicated ACK of expected sequence

c. fill gaps: ACK of sequence at lower end of gap.

4. Retransmit

With the discussion above, if loss happens, there will likely be many duplicate ACKs. So sender will detect loss and begin tofast retransmit

Fast retransmit: resend segment before timer expire

5. Flow control

sender will not overflow the buffer of receiver.

Get the point above, sender limits unACKed data smaller thanspare room of receiver.

6. Connection Management

a. initiation work

seq num

flow control, buffer, rcvwindow

b. three way handshake

build:

1) client->server: SYN, initial seq num

2) server->client: SYNACK segment, server allocate buffers, specify initial seq num

3) client->server: reply ACK segment, may with data

close:

1) client->server: FIN

2) server->client: ACK first, after closing connection, send FIN

3) client->server: ACK

4) server: get ACK close.

7. Congestion control

To sum up the details of congestion control in TCP is that: send windows vary with the condition of congestion in the network. If the network is congested, the send will decrease the window size. If not the window will be enlarged. So the intension of sending
is according to the network condition.

How sender perceive congestion:

1) loss event: time out or 3 duplicate ACKs

Slow start

1) when connection begins, CongWin = 1 MSS

2) CongWin increase exponentially until loss event.

Loss

1) 3 dup ACKs:

Reno: CongWin half, win grow linear  -- 3 dup ACKs indicate the network capable of delivering some segments.

Tahoe: same with time out

2) timeout: CongWin set to 1 MSS, win grow exponentially to a threshold then linearly. -- timeout is a more alarming condition

End.




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

  1. Transport layer and Network layer

    http://stackoverflow.com/questions/13333794/networking-difference-between-transport-layer-and-networ ...

  2. [Network]Application Layer

    1 Principles of Network Applications 1.1 Application Architectures Client-Server Peer-to-Peer Hybird ...

  3. Transport Layer Protocols

    1 End-to-end Protocols(端到端协议) 传输层协议往往是主机对主机(host-to-host)或者说是端到端(end-to-end).通常希望传输层协议可以提供如下service: ...

  4. Host Controller transport layer and AMPs

    The logical Host Controller Interface does not consider multiplexing/routing over the Host Controlle ...

  5. 传输层-Transport Layer(上):传输层的功能、三次握手与四次握手、最大-最小公平、AIMD加法递增乘法递减

    第六章 传输层-Transport Layer(上) 6.1传输层概述 在之前的几章内容中,我们自底向上的描述了计算机网络的各个层次,还描述了一些处于不同层次下的经典网络协议(如以太网.无线局域网.或 ...

  6. 传输层-Transport Layer(下):UDP与TCP报头解析、TCP滑动窗口、TCP拥塞控制详解

    第六章 传输层-Transport Layer(下) 上一篇文章对传输层的寻址方式.功能.以及流量控制方法做了简短的介绍,这一部分将介绍传输层最重要的两个实例:TCP协议和UDP协议,看一看之前描述的 ...

  7. Elasticsearch client node 启动时出现警告:exception caught on transport layer 及java.net.NoRouteToHostException: No route to host

    发现该问题源自发现kibana不能打开sense,并且看见elasticsearch插件处于服务不可用状态,但是在client node上curl localhost:9200发现能够返回ES基本信息 ...

  8. 计算机网络自顶向下方法第3章-传输层 (Transport Layer).1

    3.1 概述和运输层服务 运输层协议为运行在不同主机上的应用进程之间提供了逻辑通信(logic communication)功能. 3.1.1 运输层和网络层的关系 网络层提供了主机之间的逻辑通信,而 ...

  9. 计算机网络自顶向下方法第3章-传输层 (Transport Layer).2

    3.5 面向连接的运输: TCP 3.5.1 TCP连接 TCP是因特网运输层的面向连接的可靠的运输协议. TCP连接提供全双工服务(full-duplex service). TCP连接是点对点的连 ...

随机推荐

  1. android的ViewPager和Animation有些使用(二)

    Animation部分 android的animation分scale,rotate,tranlateAnimation,alpha这些类型的 start animation这里有几种方法: < ...

  2. Linux 该文件命令查看内容

    Linux系统,请使用以下命令来查看文件的内容: cat tac  从最后一行開始显示.能够看出 tac 是 cat 的倒著写! nl   显示的时候,顺道输出行号! more 一页一页的显示文件内容 ...

  3. jsp的原则执行

    什么时候server一对JSP页面运行时,第一个请求,server向上JSP引擎首先JSP页的文件翻译成Java文件.那么这Java文件编译的字节码文件..而当这个JSP页面再次被请求运行时,JSP引 ...

  4. 【iOS开发-60】案例学习:多组数据的tableView设置、添加右側组索引、多层数据模型设置以及valueForKeyPath

    效果: 这里的数据模型有两层:每一组汽车是一层模型,每一组里面的每一行汽车品牌也是一层模型. (1)我们先创建一个WSCars模型. 在WSCars.h中: #import <Foundatio ...

  5. composite template 组合模式

      1. 主要优点 组合模式的主要优点如下: (1) 组合模式可以清楚地定义分层次的复杂对象,表示对象的全部或部分层次,它让客户端忽略了层次的差异,方便对整个层次结构进行控制. (2) 客户端可以一致 ...

  6. OPhone SDK初体验

    OPhone SDK初体验 write by 九天雁翎(JTianLing) -- blog.csdn.net/vagrxie 讨论新闻组及文件 背景说明 中国伟大的垄断龙头,世界上也是顶尖的中移动最 ...

  7. [LeetCode]Word Ladder 最短距离字符串转换 (Dijkstra)

    要求最短距离.采纳dijkstra查找节点之间的最短路径. 当心:假设是一个枚举字典22是否元素可以,如果转换,暂停. 提高:每串,带您历数它的字符值事件,对于的长度n一个字符串枚举n*26次要. 设 ...

  8. javascript实现倒计时-------Day28

    先来两张图片,看一看今天写什么: 看到图片右上角是什么了么看到图片以下是什么了么 相信这个大家都不会陌生吧.那些生活中等着秒杀,等着抢小米人们,焦躁等待的你曾一秒一秒的盯着它看么,我不知道答案,可我知 ...

  9. 基于lua的网页脚本开发语言cgilua(转)

    这里为大家介绍基于lua脚本实现的网页开发语言,cgilua 介绍 cgilua使用Lua是一个用于创建动态网页的服务器端脚本语言.纯LUA脚本和LUA页(LP)的支持,cgilua.Lua脚本是一个 ...

  10. 安装gcc 3.4

    安装   gcc 3.4 f**k,不是为了编译0.11内核.我才懒得鸟3.4的版本号 源代码编译被我实践--"不归路",各种报错,我起码不止是了4个版本号的gcc,各种不兼容.各 ...