由于CSDN的问题图片无法正常显示,原文以PDF格式上传

Introduction to IP

network edge

Introduction:

hosts: clients and servers
• servers often in data centers
• part of the network with the users and computers (网络边缘结构)
access networks, physical* media: wired, wireless communication links(物理层结构)
network core:
• the “middle” of the network
• interconnected routers
• network of networks
(网络核心结构)

Network basics bits and bytes

A bit is a “binary digit” – a single 0 or 1.

A byte is a group of eight bits – can be thought of as a number from 0 to 255 (or -128 to 127) or as two digits of “hexadecimal” (eg A0, FF, 10).

一个字节是一组8位的组,可以看作是0到255(或-128到127)的数字,或者是“十六进制”的两个数字(如A0、FF、10)。

Network basics – packets

将数据进行打包处理,优势是可以对大量数据进行统一管理。例如错误查询。
延迟公式:

Physical media

Physical media represent the actual hardware that carries the data. Think about physical wires or radio transmissions

the network core

Introduction

packet-switching: hosts break application-layer messages into packets
数据包交换:主机将应用层消息分解成数据包。(将数据包从一个路由器转发到另一个路由器,最后抵达目的地)
store and forward: entire packet must arrive at router before it can be transmitted on next link
存储和转发:整个数据包必须到达路由器,然后才能通过下一个链路传输

Packet Switching: queueing delay, loss

if arrival rate (in bits) to link exceeds transmission rate of link for a period of time: packets will queue, wait to be transmitted on link packets can be dropped (lost) if memory (buffer) fills up
若到达速率超过传输速率,数据包将排队,如果内存溢出,数据将丢失

Two key network-core functions

routing: determines source destination route taken by packets
路由:决定数据包所采取的源目的地路由
forwarding: move packets from router’s input to appropriate router output
转发:将数据包从路由器的输入移动到适当的路由器输出

(承上启下)

Internet structure

End systems connect to Internet via access ISPs
终端系统通过接入isp连接到互联网
Access ISPs in turn must be interconnected
依次访问isp必须相互连接
Resulting network of networks is very complex
由此产生的网络网络非常复杂
补充——ISP:网络运营商,由主干,地区,和本地ISP组成的集群。

packet delay

• (A) Time a packet waits behind other packets
(queueing delay) 排队延迟:数据包排队等待处理
(B) Time a router takes to write the bits from a packet into an outgoing optical fibre.
(transmission delay) 传输延迟:在传输路径中由于直接物理原因损耗的延迟(例如在光纤中传播的时间)
© Time it takes packets to travel down an optical fibre to the next router.
(propagation delay) 传播延迟 :在转播路径中由于直接物理原因损耗的延迟(例如路由器和光纤接口处的延迟)
(D) Time it takes a router to determine which of its outputs to send a packet down.
(nodal processing) 节点延迟 :数据在路由器中转发的时候,路由器对其进行处理的延迟

Packet loss

queue (aka buffer) preceding link in buffer has finite capacity 缓冲区容量有限
packet arriving to full queue dropped (aka lost) 队列已满导致数据包被丢弃
lost packet may be retransmitted by previous node, by source end system, or not at all
丢失的数据包可以从其上一个路由重新发出,或被直接丢弃。

Throughput

rate (bits/time unit) at which bits transferred between sender/receiver
比特在收发器之间传输的速率(比特/时间单位)
in practice: Rc or Rs is often bottleneck
哪个大哪个就是 bottleneck

Protocol “layers”

TCP/IP model

application: supporting network applications
• FTP, SMTP, HTTP 网络层协议
transport: process-process data transfer
• TCP, UDP 传输层协议
network: routing of datagrams from source to destination
• IP, routing protocols 路由协议
link: data transfer between neighboring network elements
• Ethernet, 802.111 (WiFi), PPP 连接协议
physical: bits “on the wire” 物理层是傻子层,没有协议

ISO/OSI reference model

ISO = International Standards Office 组织名
OSI = Open Systems Interconnection ISO提出的网络七层结构
presentation: allow applications to interpret meaning of data, e.g., encryption, compression, machine specific conventions 解释层
session: synchronization, checkpointing, recovery of data exchange 会话层

headers

• Information separate from the data being sent that says things about that data.
Which computer is it being sent to?
Which program on that computer must receive it?
How long is this data?

two advantages of layering

Modularization eases maintenance and updates (change one part of the system leave others the same)
Helps with complexity: break a complex design task into several smaller ones
模块化简化了维护和更新(更改系统的一部分,让其他部分保持不变)
有助于解决复杂性:将一个复杂的设计任务分解成几个较小的任务

Devices for layers

Router 路由器

This is a layer 3 device – it reads a layer 3 address and works out which direction a packet should go
It is typically more complex and adaptive than a switch

Switch 交换机

This is a layer 2 device – it reads a layer 2 address and works out which nearby computer should get a message. Typically simpler than a router

Repeater 重组器

This is a layer 1 device – it strengthens or reconstructs a corrupted signal and carries on sending it. (修复消息)

The Transport layer

Application

Introduce

At the application layer the “network” is abstracted away and you access a stream of data that arrives at a “socket”.
在应用层,“网络”被抽象出来,您可以访问到达“套接字”的数据流。
Different applications have different formats:
HTTP (Hyptertext transfer protocol) world-wide web
FTP (File transfer protocol) moving data
SMTP (Send Mail transfer protocol) sending email
IMAP (Internet message access protocol) receiving email
网络层和运输层的区别:运输层主要负责进程通信,网络层负责设备之间的通信,运输层负责将报文发送给正确的进程

Sockets

sending process shoves message out door
sending process relies on transport infrastructure on other side of door to deliver message to socket at receiving process

发送过程依赖于门的另一边的传输基础设施,在接收过程中将消息传递到套接字

Addressing processes 标识过程

to receive messages, process must have identifier
要接收消息,进程必须具有标识符
host device has unique 32-bit IP address
主机设备具有唯一的32位IP地址
identifier includes both IP address and port numbers associated with process on host.
标识符包括与主机上的进程关联的IP地址和端口号。
端口号(port):程序的标识符
IP地址:本机和主机的标识符
Socket Address: IP地址和端口号的组合

4 different addresses in TCP/IP

Physical address Layer 2
Also known as the link address, is the address of a node as defined by its LAN or WAN
也称为链路地址,是由其局域网或广域网定义的节点的地址
Logical address Layer 3 (32-bit , IPv4 128-bit IPv6)
Logical (IP) addresses are for universal communications that are independent of underlying physical networks
逻辑(IP)地址是用于独立于底层物理网络的通用通信
Port address Layer 4 (16-bit)
Port addresses differentiate different processes
端口地址可区分出不同的进程
Application-specific address Layer 7
Some applications have user-friendly addresses that are designed for that specific application, such as email address, URL.
有些应用程序具有为该特定应用程序设计的用户友好的地址,如电子邮件地址、URL。

App-layer protocol defines

types of messages exchanged,
交换的消息类型,
message syntax
消息语法
message semantics
消息语义
open protocols
打开协议
proprietary protocols
专有协议

Session + Presentation layers

Theoretical only – not implemented in the Internet
Session Layer (layer 5):
• Takes care of a connection between two hosts for the lifetime of that connection
• Authentication + authorization (who is the user, what can they do)
• In working Internet this is at the application layer.

Transport

Transport services and protocols

provide logical communicationbetween app processes running on different hosts
传输协议在终端系统中运行
• send side: breaks app messages into segments, passes to network layer
发送端 将应用程序消息分成几段,传递到网络层
• rcv side: reassembles segments into messages, passes to app layer
接收端 将片段重新组装成消息,并传递到应用程序层
more than one transport protocol available to apps
• Internet: TCP and UDP

Transport vs. network layer

network layer: logical communication between hosts
transport layer: logical communication between processes

Internet transport-layer protocols

reliable, in-order delivery (TCP)
• congestion control
阻塞控制
• flow control
流量控制
• connection setup
推送和拉取:发送方无论接收方是否处理信息,产生数据就发送的方式叫做拉取。发送方只有在消耗对方请求后才发送这些数据叫做拉取

unreliable, unordered delivery: UDP

no-frills extension of “best-effort” IP
对“最大努力”IP的简单扩展

Multiplexing/demultiplexing 复用/分用

Multiplexing 复用
Combining several streams of data into a single stream.
Example – your phone is browsing the web, refreshing your email, connecting to wechat at the same time. All these connections are sent over the same link.
例如,您的手机正在浏览网页,刷新电子邮件,同时连接到微信。所有这些连接都是通过同一个链接发送的。
当一个实体接受来自多个源的输入时,称为复用
Demultiplexing 分用
当一个实体将数据交付到多个源时成为分用

How demultiplexing works

host receives IP datagrams 主机接收IP数据
host uses IP addresses & port numbers to direct segment to appropriate socket
主机使用IP地址和端口号将数据段引导到对应的套接字

Connectionless demultiplexing

recall: created socket has host-local port
召回:已创建的套接字具有主机本地端口
recall: when creating datagram to send into UDP socket, must specify
召回:当创建要发送到UDP套接字中的数据报时,必须指定
when host receives UDP segment
TCP socket identified by 4-tuple: 由4个元组标识的TCP套接字
• source IP address
• source port number
• dest IP address
• dest port number
demux: receiver uses all four values to direct segment to appropriate socket
接收器使用所有四个值将段引导到适当的套接字
server host may support many simultaneous TCP sockets
服务器主机可能支持许多同时使用的TCP套接字:
web servers have different sockets for each connecting client
Web服务器为每个连接的客户端都有不同的套接字

UDP

UDP是一种不可靠,无连接的运输协议它仅仅在主机的IP服务基础上增加了进程到进程的通信。因此成本较低,但是功能较弱

UDP head

图片上传不了

UDP checksum

sender:

treat segment contents, including header fields, as sequence of 16-bit integers

将段内容,包括头字段,视为16位整数的序列

checksum: addition (one’s complement sum) of segment contents

校验和:段内容的加法(补和)

sender puts checksum value into UDP checksum field

发送方将校验和值放入UDP校验和字段中

receiver compute checksum of received segment

接收方计算接收数据段的校验和

check if computed checksum equals checksum field value:

检查计算出的校验和是否等于校验和字段值:

• NO - error detected

• YES - no error detected.

UDP Encapsulation

在发送时,发送端进程将套接字地址,报文,数据长度
[外链图片转存失败

Principles of reliable data transfer

[外链图片转存失败

Reliable data transfer: getting started

incrementally develop sender, receiver sides of reliable data transfer protocol

逐步开发可靠的数据传输协议的发送方、接收方

consider only unidirectional data transfer

只考虑单向数据传输

use finite state machines (FSM) to specify sender, receiver

使用有限状态机(FSM)来指定发送方、接收方

rdt1.0: reliable transfer over a reliable channel

rdt1.0:通过可靠通道进行的可靠传输

underlying channel perfectly reliable 底层通道完全可靠

rdt2.0: channel with bit errors

We drop the assumption that the channel has no errors.

我们放弃了该通道没有错误的假设。

We need to be able to detect and recover from errors in transmission.

我们需要能够检测并从传输错误中检测和恢复。

acknowledgements (ACKs): receiver explicitly tells sender that pkt received OK

negative acknowledgements (NAKs): receiver explicitly tells sender that pkt had errors

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-R4syrwcv-1638778141709)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20211029190643090.png)]

sender sends one packet, then waits for receiver response

发送方发送一个数据包,然后等待接收方的响应

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-M0BdRqVv-1638778141710)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20211029191132020.png)]

rdt2.1: sender, handles corrupt ACK/NAKs

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-hsGTG480-1638778141710)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20211104180442094.png)]

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-3dwNoZA3-1638778141710)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20211029191408721.png)]

rdt2.2: a NAK-free protocol

same functionality as rdt2.1, using ACKs only

instead of NAK, receiver sends ACK for last pkt received OK

duplicate ACK at sender results in same action as

NAK: retransmit current pkt

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-8aCToVfh-1638778141711)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20211029191930882.png)]

rdt3.0: channels with errors and loss

sender waits “reasonable” amount of time for ACK

retransmits if no ACK received in this time

• A) Name the two types of error rdt3.0 can deal with?

• Packet is corrupted. Packet did not arrive at all.

• B) How many sequence numbers does rdt3.0 use?

• Two (0 and 1)

• C) How does rdt3.0 receiver indicate a packet is received but was corrupted?

• Does not use NACK. Uses ACK with the “wrong”

number – 0 if it was waiting for 1 and vice versa.

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-yz8OFbjR-1638778141711)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20211029193044109.png)]

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-7YrzLFsz-1638778141712)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20211029193339702.png)]

A-Summary

The transport layer multiplexes and demultiplexes traffic.

传输层是多路复用的流量和解多路复用的流量。

The transport layer exists on end machines to get traffic to and from a port connected to an application.

传输层存在于终端机器上,以便获取进出连接到应用程序的端口的流量。

UDP provides a simple connectionless service

UDP提供了一个简单的无连接的服务

It does not correct for loss or corrupted packets

它不纠正丢失或损坏的数据包

rdt (various protocols) can deliver reliable traffic over unreliable networks. uses ACKs and timeouts to provide a reliable service.

Rdt(各种协议)可以通过不可靠的网络提供可靠的流量。使用ack和超时来提供可靠的服务。

rdt 3.0 deals with timeouts and corruption.

rdt3.0处理超时和损坏。

questions

In Connectionless Demultiplexing, what are the two fields used to identify a socket?

IP address and port number(Dst IP, Dst Port)

What field in UDP header is used to detect errors?

checksum

What is the size of UDP header in bytes?

8

Consider a reliable data transfer (rdt) protocol over a channel with bit errors (packets are corrupted but not lost). Explain the procedure to detect and recover from errors.

(receive an ACK when message have no error,receive a NAK when a message has bit error,then wait for correct message ……)

Extract the checksum from the packet header. Calculate a new checksum from the packet and header data received. If these do not match there is an error. An error is reported with a NACK (or an ACK with the “wrong” number in rdt2.2, rdt3.0)

There are four types of addresses in TCP/IP Protocol Stack. Name the addresses associated with Transport, Network and Data Link Layers.

Transport:

Port number

Network:

Internet protocol address

Datalink:

MAC (Media Access Control) address

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-D1tWtdww-1638778141712)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20211031112356846.png)]

Link 1 100 Mb/s 3km

Trans = 12000/100000000 s = 0.12ms

Prop = 3000/2x108 s = 0.015ms

Link 2 1 Mb/s 5000km

Trans= 12ms

Prop= 25ms

Link 3 10 Mb/s 2km

Trans=1.2ms

Prop = 0.01ms

Answer the following questions related to User Datagram Protocol (UDP)

i) List and briefly describe each header field in UDP.

ii) Explain why where the reliability is not of primary importance, UDP would make a good transport protocol.

Source port: Port identifying the application socket sending the data

标识发送数据的应用程序套接字的端口

Dst port: Port identifying the application socket to receive the data

标识要接收数据的应用程序套接字的端口

Checksum: A sum over the header and data used to detect if the packet has corrupt.

用于检测数据包是否损坏的报头和数据的总和

Length: Length of packet including header at layer 4

第4层包括头的包长度

Simple to implement (no timers, acknowledgements etc)

实施简单(没有计时器、确认等)

Efficient (header is small as possible)Quick to send data (no need to set up connection)

效率较高(报头尽可能小)快速发送数据(不需要设置连接)

Can choose rate of sending

可以选择发送速率

Recap of rdt 1.0 2.0, 2.1, 2.2, 3.0

rdt 1.0 assumed no losses or errors

rdt 2.0 introduced ACK (ACK nowledgment) and NACK to say a packet had been received or an error occurred

rdt 2.1 introduced the concept of the SEQuence number to deal with errors in ACKs.

rdt2.1引入了序列号的概念来处理ack中的错误。

rdt 2.2 introduced the repeated ACK – ACK with repeated sequence number means same
as NACK.

rdt2.2引入重复序列号的ACK-ACK,均值与NACK相同。

rdt 3.0 introduced timeout in case packet lost completely not just corrupted.

rdt3.0引入了超时,以防数据包完全丢失,而不仅仅是损坏。

Pipelined protocols

Performance of rdt3.0

rdt3.0是正确的,但性能很差

停止-等待协议

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-Sfb57JYB-1638778141713)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20211031120607527.png)]

Pipelined protocols

pipelining: sender allows multiple, “in-flight” , yetto-be-acknowledged packets (packets with no ACK as yet)

two generic forms of pipelined protocols: go-Back-N, selective repeat

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-F8w8p7FQ-1638778141714)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20211031121754480.png)]

Pipelining: increased utilization

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-8iK42XnI-1638778141714)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20211031121848134.png)]

Go-Back-N

返回N协议(GO-Back -N GBN)的关键是发送方能够在收到确认之前发送多个分组,但接收方只能缓存一个分组.发送方为发送出去的分组保留副本,直到来自接收方确认达到.

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-TBFMVyO9-1638778141715)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20211031124029552.png)]

receiver individually acknowledges all correctly received packets

接收器分别确认所有正确接收到的数据包

sender only resends packets for which ACK not received

发送方只重新发送未收到ACK的数据包

sender window

Selective repeat

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-p60jDSjB-1638778141715)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20211031124952982.png)]

选择重传协议只重传真正丢失的分组.

窗口

选择重传协议的接收窗口和发送窗口一样大(2^m-1) 比返回N协议的窗口(2^m)小了一倍

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-uFpElsN6-1638778141716)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20211031125131256.png)]

选择重传的接收窗口与发送窗口一样大.选择重传协议允许与接受窗口一样多的分组失序到达,并保存这些失序到达的分组,直到连续的一组分组被交付给应用层.因为发送窗口与接收窗口是相同的,所以发送出来的所有分组都可以失序到达,而且会被保留知道交付为止.但是必须强调一点,在一个可靠的协议中,接收方永远不会把分组失序地交给应用层.在他们被交付给应用层之前,先要等待那些更早发出来的分组到达.

计时器

理论上选择重传协议要为每个分组使用一个计时器.当某个计时器超时后,只有相应的分组被重传.换而言之,返回N协议将所有的分组当做一个整体对待,而选择重传协议则分别对待每一个分组.但是大多数SR的运输层仅使用了一个计时器. 注意只使用一个计时器而做到跟踪所有发出去的分组的情况的做法是:标记发出分组,当ACK=Sf 时,将窗口滑过所有连续的已确认的分组,如果还有未确认的分组,则重发所有检测到的未被确认的分组并重启计时器,如果所有分组都被确认了则停止计时器.

确认

在GBN中确认值(ACK) 是累计的,它定义了下一个希望接收的分组序号,同时也证实了此前所有的分组都已经被完好的接收了.在SR中,确认号(ACK)之定义完好接收的那一个分组的序号,并不反馈任何其他分组的信息.

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-1ru6dOGz-1638778141717)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20211031125815553.png)]

TCP

TCP是一种面向交流的协议。在UDP中,进程把已预先预定好边界的报文发送给UDP以便交付。UDP对每个报文都添加自己的部首,然后通过IP传输。与此不同的是,TCP允许发送进程以字节流的形式传递数据,并且允许进程把数据作为字节流接受。这就是管道流。

TCP header

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-Xx1lf3Z2-1638778141717)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20211031130347002.png)]

TCP seq. numbers, ACKs

sequence numbers:

• byte stream “number” of first byte in segment’s data

序列号:段数据中第一个字节的字节流“数”

acknowledgements:

seq # of next byte expected from other side

TCP round trip time, timeout

how to set TCP timeout value?

longer than RTT but RTT varies

too short: early timeout, unnecessary retransmissions

too long: slow reaction to segment loss

how to estimate RTT

Sample RTT: measured time from segment transmission until ACK receipt

从段传输到ACK的测量时间

Sample RTT will vary, want estimated RTT “smoother”

SampleRTT会有所不同,希望估计的RTT“更流畅”

Estimated RTT_new = 0.875 · Estimated RTT + 0.125 · SampleRTT

TCP sender events

create segment with seq #

seq # is byte-stream number of first data byte in segment

start timer if not already running

timeout:

retransmit segment that caused timeout

导致超时的电子传输段

start timerack recieved:

if ack acknowledges previously unacked segments

如果ack发现以前未打包的数据段

仍有未打包的数据段,更新已知的辅助启动计时器

TCP fast retransmit

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-SyNEC97G-1638778141718)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20211031132712457.png)]

Test

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-OG3GgKvq-1638778141718)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20211031133342701.png)]

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-yYwNXZyc-1638778141719)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20211031133352986.png)]

TCP流量控制

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-klLgSEs5-1638778141719)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20211102152742752.png)]

接收器控制发送方,因此发送方不会通过发送过多、太快而溢出接收器缓冲区

接收器通过在接收器到发送器段的TCP头中包含rwnd值来“宣传”空闲缓冲空间

发送方将解打包(“飞行中”)数据的数量限制为接收方的rwnd值

TCP的拥塞控制主要原理依赖于一个拥塞窗口(cwnd)来控制,在之前我们还讨论过TCP还有一个对端通告的接收窗口(rwnd)用于流量控制。

窗口值的大小就代表能够发送出去的但还没有收到ACK的最大数据报文段,显然窗口越大那么数据发送的速度也就越快,但是也有越可能使得网络出现拥塞,如果窗口值为1,那么就简化为一个停等协议,每发送一个数据,都要等到对方的确认才能发送第二个数据包,显然数据传输效率低下。TCP的拥塞控制算法就是要在这两者之间权衡,选取最好的cwnd值,从而使得网络吞吐量最大化且不产生拥塞。

MSS&MTU

MSS (mentioned in Nagle algorithm) is a parameter specifying the largest amount of data in a single IP datagram that should be sent by a remote host.

MSS(在Nagle算法中提到)是一个参数,指定远程主机应该发送的单个IP数据报中最大的数量。

MTU is a parameter specifying the largest amount of data that a communication protocol or system can pass onwards. For example, standards (e.g. Ethernet) can fix the size of an MTU, or systems (such as point-to-point serial links) may set MTU at connect time.

MTU是一个指定通信协议或系统可以向前传递的最大数据量的参数。例如,标准(例如以太网)可以固定MTU的大小,或者系统(例如点点串行链路)可以在连接时设置MTU。

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-RTaSgJOQ-1638778141720)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20211102153923810.png)]

Nagle’s algorithm

当应用程序生成的数据非常慢时,可能会出现问题。考虑仅在用户类型时生成数据的ssh或telnet。如果发送缓冲区中还有剩余的空间,TCP将在到达发送缓冲区时发送数据。这意味着(对于ssh/telnet)每次用户按键时发送一个数据包。Overhead of this is huge (TCP header + IP header + frame header to send one byte).解决方案叫做Nagle’s algorithm。

1发送的TCP发送它接收到的第一段数据,无论大小。

2 发送了第一个报文后,发送TCP就在输出缓存中累计数据并等待,直到收到TCP发来的确认,或者已经累计了足够多的数据可以可以装成最大长度的报文字段。

3重复步骤2

有时,纳格尔的算法应该被关闭——例如,当快速交互至关重要时,并且您希望发送小的数据包很小时。

Silly Window Syndrome(傻窗口综合症)

当TCP发送的数据包很小时,傻窗口综合症就会出现。因为窗口的大小很傻。(比如有时候TCP只携带了了一个字节数据,但是实际上却是41个字节的数据在管道里跑来跑去,效率很低(20个IP首部+20个port number 和这个字节)

有两种发生的可能:

1.发送数据方发送的很慢

2.接收器处理数据的速度非常慢。

解决方案:nagle 算法

Connection Management

before exchanging data, sender/receiver “handshake”

agree to establish connection (each knowing the other willing to establish connection)

同意建立联系(彼此都知道对方愿意建立联系)

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-zIQ3tfM0-1638778141720)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20211102192011558.png)]

closing a connection

client, server each close their side of connection

respond to received FIN with ACK

simultaneous FIN exchanges can be handled

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-IWEX673S-1638778141721)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20211102193555709.png)]

Principles of congestion control

informally: “too many sources sending too much data too fast for network to handle”

how does this look?

• lost packets (buffer overflow at routers)

• long delays (queueing in router buffers)

Causes and costs of congestion

Too much traffic enters router – buffer fills up, this increases delay (and hence reduces throughput).

太多的流量进入路由器-缓冲区填满,这增加了延迟(以此降低吞吐量)

Much too much traffic enters router – buffer overfills and causes loss. Packet needs to be retransmitted.

太多的流量进入路由器-缓冲区过度填充,并导致损失。数据包需要重新传输。

If packet is lost after several “hops” then many resources are wasted.

如果数据包在几次“跳”后丢失,那么许多资源就会被浪费。

Useful concept: goodput – this is the rate at which data reaches the application layer.

这是数据到达应用程序层的速率

Different from throughput because of

• loss

• retransmission

• corrupted packets

additive increase multiplicative decrease

sender increases transmission rate (window size), probing for usable bandwidth, until loss occurs

发送方增加传输速率(窗口大小),探测可用带宽,直到发生丢失

details

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-4W6RzK8j-1638778141722)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20211102201053595.png)]

cwnd is dynamic, function of perceived network congestion

cwnd是动态的,感知网络拥塞的功能

roughly: send cwnd bytes, wait RTT for ACKS, then send more bytes

大致:发送cwnd字节,为ACKS等待RTT,然后发送更多字节

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-116sTD6Q-1638778141722)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20211102201459140.png)]

initial rate is slow but ramps up exponentially fast

初始速率缓慢,但呈指数级增长

detecting, reacting to loss

loss indicated by timeout:

cwnd set to 1 MSS

window then grows exponentially (as in slow start) to threshold, then grows linearly

然后,窗口以指数级增长(如缓慢开始)到阈值,然后呈线性增长

loss indicated by 3 duplicate ACKs: TCP RENO

dup ACKs indicate network capable of delivering some segments

dupack表示能够传递某些片段的网络

cwnd is cut in half window then grows linearly

Cwnd被切成半窗口,然后线性增长

TCP Tahoe always sets cwnd to 1 (timeout or 3 duplicate acks)

TCPTahoe总是将cwnd设置为1(超时或3个重复的数据包)

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-dQLRZfX9-1638778141722)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20211102202434831.png)]

TCP throughput

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-EAyyGDIs-1638778141723)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20211102202552752.png)]

fairness goal: if K TCP sessions share same bottleneck link of bandwidth R, each should have average rate of R/K

公平目标:如果K个TCP会话共享相同的带宽R的瓶颈链路,那么每个会话的平均速率应该为R/K

cwnd bytes, wait RTT for ACKS, then send more bytes

大致:发送cwnd字节,为ACKS等待RTT,然后发送更多字节

[外链图片转存中…(img-116sTD6Q-1638778141722)]

initial rate is slow but ramps up exponentially fast

初始速率缓慢,但呈指数级增长

detecting, reacting to loss

loss indicated by timeout:

cwnd set to 1 MSS

window then grows exponentially (as in slow start) to threshold, then grows linearly

然后,窗口以指数级增长(如缓慢开始)到阈值,然后呈线性增长

loss indicated by 3 duplicate ACKs: TCP RENO

dup ACKs indicate network capable of delivering some segments

dupack表示能够传递某些片段的网络

cwnd is cut in half window then grows linearly

Cwnd被切成半窗口,然后线性增长

TCP Tahoe always sets cwnd to 1 (timeout or 3 duplicate acks)

TCPTahoe总是将cwnd设置为1(超时或3个重复的数据包)

[外链图片转存中…(img-dQLRZfX9-1638778141722)]

TCP throughput

[外链图片转存中…(img-EAyyGDIs-1638778141723)]

fairness goal: if K TCP sessions share same bottleneck link of bandwidth R, each should have average rate of R/K

公平目标:如果K个TCP会话共享相同的带宽R的瓶颈链路,那么每个会话的平均速率应该为R/K

互联网协议 传输层及概述相关推荐

  1. 8月11日 网工学习 APR协议 传输层协议 TCP UDP 数据封装转发全过程

    目录 APR协议 传输层协议 TCP UDP 数据封装转发全过程 APR协议 作用:将IP地址解析为MAC地址 ARP的主要内容 在ARP高速缓存表中查找目的IP地址对应的MAC地址 广播发送ARP请 ...

  2. 【学习笔记】传输层:概述、UDP协议

    文章目录 一. 概述 1)传输层的寻址与接口 二. UDP协议 1)定义 2)首部格式 3)UDP检验 一. 概述 是主机才有的层次 两个协议:TCP & UDP TCP面向连接,UDP则不是 ...

  3. TCP/IP协议传输层详解

    目录 前言 一.端口号 1.概念 2.相关命令 二.UDP协议 1.UDP数据报格式 2.UDP的特点 3.UDP的缓冲区 三.TCP协议 1.TCP数据报格式 2.确认应答(ACK)机制 3.缓冲区 ...

  4. 应用层协议@传输层协议

    目录 1.自定制协议: 2.知名协议: HTTP协议实现 HTTP协议格式 3. UDP协议 3.1 UDP协议端格式:UDP协议报头只有8个字节 3.2 UDP特点 4. TCP协议 4.1 TCP ...

  5. java实现ip首部校验和算法,理解传输层中UDP协议首部校验和以及校验和计算方法的Java实现...

    UDP,全称User Datagram Protocol,用户数据报协议,是TCP/IP四层参考模型中传输层的一种面向报文的.无连接的.不能保证可靠的.无拥塞控制的协议.UDP协议因为传输效率高,常用 ...

  6. 计算机网络复习————概述,应用层,传输层

    计算机网络复习----概述,应用层,传输层 绪论 概述 交换技术 网络性能指标 协议栈 应用层 应用体系架构 Web和HTTP FTP和SMTP DNS p2p应用 传输层 传输层服务 UDP 可靠数 ...

  7. 【计算机网络】传输层 : 总结 ( TCP / UDP 协议 | 寻址与端口 | UDP 协议 | TCP 协议特点 | TCP 连接释放 | TCP 流量控制 | TCP 拥塞控制 ) ★★★

    文章目录 一.传输层 TCP / UDP 协议 ★ 二.寻址端口号 ★ 三.UDP 协议特点 四.UDP 协议首部格式 五.UDP 校验 六.TCP 协议 特点 ★ 七.TCP 报文段首部格式 八.T ...

  8. 网络协议分为哪几层---物理层,连接层,网络层,传输层,应用层详解

    原文地址点击此处 信号的传输总要符合一定的协议(protocol).比如说长城上放狼烟,是因为人们已经预先设定好狼烟这个物理信号代表了"敌人入侵"这一抽象信号.这样一个" ...

  9. TCP/IP 协议族 简介(应用层,传输层,网络层,链路层)

    互联网协议(Internet Protocol Suite [swi:t])是一个 网络通信模型,以及一整个网络传输协议家族,为互联网的基础通信架构.它常被通称为TCP/IP 协议族(TCP/IP P ...

最新文章

  1. 【 C 】转移表(理论与实践)(实现一个简单的计算器)
  2. POJ 1976 A Mini Locomotive【DP】
  3. 夺命雷公狗-----tp中遇到数据乘积的问题的遇见
  4. IIS7.5部署ASP.NET失败
  5. Asp.net 中 OnClientClick 与 OnClick 的执行顺序
  6. Page.LoadTemplate的使用
  7. Git学习笔记:如何删除GitHub上的项目
  8. readSerializableObj
  9. VS Code配置C/C++
  10. [WebApi] 捣鼓一个资源管理器--服务器端分割压缩图片
  11. mysql实验体会怎么写_数据库实验心得
  12. 测试用例设计方法详解
  13. html input文字缩进,使用HTML Tidy来缩进HTML代码?
  14. TP5整合阿里云OSS上传文件第二节,异步上传头像(下)
  15. Html5餐饮管理app,哗啦啦餐饮软件 餐饮管理系统
  16. c语言验证费马大定理,费马大定理,用电脑编程证明
  17. (黑龙江) --2011年度注册测绘师资格考试合格人员名单
  18. c语言c 哪个好学,C语言好学吗?
  19. 【AI每日播报】马云启动NASA计划 Intel150亿美元收购Mobileye
  20. 【Python】数据可视化基本套路总结

热门文章

  1. python 飞翔的小鸟
  2. MAVEN Plugins 插件官网下载
  3. 如何查看支付宝商户ID(支付宝pid)?
  4. boost 普通用户读取SYSTEM创建的共享内存
  5. 58.union (联合查询)
  6. win7识别到移动硬盘,但不显示盘符解决办法
  7. 三升序列20210314-20210413
  8. php 导出excel 进度条显示
  9. HTML中的单行注释标签是,html如何单行和多行注释呢 ?
  10. 用python绘制熊猫图案_python – 熊猫:如何在彼此之上绘制年度数据