CSC8021_computer network_The Transport Layer

Role of the transport layer

• The transport layer is responsible for providing a reliable end-to-end connection between two application processes in a network
• Abstracting away the physical subnet
• Does not involve intermediate nodes
• Takes a network address (IP) and transport address (port) to ensure packets are received by the desired service
·传输层负责在网络中的两个应用进程之间提供可靠的端到端连接
·抽象出物理子网
·不涉及中间节点
·获取网络地址(IP)和传输地址(端口),以确保数据包被所需的服务接收
在这里插入图片描述

Comparison with other OSI layers

• Much of the functionality of the Transport and Datalink layers are the same but with any complex network between hosts abstracted away
• The Network layer is run by communications providers while the Transport layer is run by communicating hosts
·传输层和数据链路层的大部分功能都是相同的,但主机之间的任何复杂网络都被抽象掉了。
·网络层由通信提供商运行,而传输层由通信主机运行

Well known ports

• Well known ports are (usually) assigned to a standard service that a
system offers.
• In combination with an IP, the port is used to move packets from the network to the desired application layer service. An example might be
127.0.0.1:22 for SSH
• This combination of IP + port is called a socket
·众所周知的端口(通常)被分配给标准服务,系统报价。
·与IP结合,端口用于将数据包从网络移动到所需的应用层服务。一个例子可能是127.0.0.1:22用于SSH
·这种IP +端口的组合称为套接字
在这里插入图片描述

Transport protocol data unit (TPDU)

在这里插入图片描述• Used to encapsulate transport layer data
• Passed to the Network layer, which is passed to the Datalink layer, which is passed to the Physical layer, sent across a network, then back up the stack and unwrapped
·用于封装传输层数据
·传递到网络层,然后传递到数据链路层,再传递到物理层,通过网络发送,然后备份堆栈并解包

Unicast vs Multicast vs Broadcast

• Unicast is a one-to-one transmission from one node in a network to another
• Multicast is a one-to-many transmission from one node in a network to many selected nodes
• Broadcast is a one-to-all transmission from one node to all other nodes on the network
·单播是从网络中的一个节点到另一个节点的一对一传输
·多播是从网络中的一个节点到许多选定节点的一对多传输
·广播是从网络上的一个节点到所有其他节点的一对多传输
在这里插入图片描述

Transport protocols

• There are two commonly supported transport layer protocols

  1. Transmission Control Protocol (TCP)
  2. User Datagram Protocol (UDP)
    • UDP is connectionless (also called fire and forget) and consequentially faster than TCP
    – Used for real-time services (DNS lookup, online gaming, video streaming)
    • TCP is connection oriented and while slower is more reliable
    – Used for transfers that cannot fail (email, webpages, file transfers)
    ·有两种通常支持的传输层协议
    1.传输控制协议(TCP)
    2.用户数据报协议(UDP)
    UDP是无连接的(也称为fire and forget),因此比TCP快。
  • 用于实时服务(DNS查找、在线游戏、视频流)
    · TCP是面向连接的,速度越慢越可靠
  • 用于不会失败的传输(电子邮件、网页、文件传输)

User Datagram Protocol (UDP)

• Designed for “one request, one response” applications where setting up a connection is too much work
• An unreliable transport protocol
• UDP is not very popular but has its use cases
• “IP with extra header”
• Many systems reject UDP on non-standard ports by default
·专为“一个请求,一个响应”的应用程序,其中设置连接是太多的工作
·不可靠的传输协议
UDP不是很流行,但有它的用例
·“IP with extra header”
·许多系统默认拒绝非标准端口上的UDP
在这里插入图片描述

Transmission control protocol (TCP)

• Designed to be robust under unreliable internet conditions
• Provides end-to-end connection
• Utilises a 3-way handshake for connection
• Utilises a sliding window protocol for flow control
·在不可靠的互联网条件下保持稳定
·提供端到端连接
·使用3次握手进行连接
·利用滑动窗口协议进行流控制
在这里插入图片描述

3-Way handshake

The TCP 3-Way Handshake prevents duplicate connections,and allows the nodes to reject spurious packets

  1. SYN (sync)
  2. SYN/ACK
    (sync/acknowledged)
  3. ACK (acknowledged)
    At this point x becomes the starting sequence number for the sender, and y becomes the starting sequence number for the receiver
    TCP 3-Way Handshake防止重复连接,并允许节点拒绝虚假数据包
  4. SYN(同步)
  5. SYN/ACK
    (sync/确认)
  6. ACK(已确认)
    此时,x成为发送方的起始序列号,y成为接收方的起始序列号
    在这里插入图片描述

Flow control

• TCP operates a sliding window mechanism where each acknowledge includes the amount of data the receiver is now willing to accept.
• A number of measures are commonly employed to ensure that the window size is roughly a multiple of the senders desired segment size.
• Different flow control schemes are one of the main differences between different versions of TCP used today (there are several).
TCP采用滑动窗口机制,其中每个确认包括接收方现在愿意接受的数据量。
·通常采用许多措施来确保窗口大小大致为所需分段大小的倍数。
不同的流量控制方案是当今使用的TCP不同版本之间的主要差异之一(有几个)。

Sliding window

• Sender sends 2048 bits to start
• Receiver’s buffer has capacity so it acks the send and sets the window
• Sender sends the same amount which fills receiver’s buffer
• Receiver acks the send and sets the window to 0 until the buffer is cleared
• Receivers buffer gets cleared 2048 bits so it acks the last send again and sends the new window
·UART发送2048位启动
·接收方的缓冲区有容量,因此它确认发送并设置窗口
·发送器发送与填充接收器的缓冲区相同的量
·接收方确认发送并将窗口设置为0,直到缓冲区被清除
·接收器缓冲区被清除2048位,因此它再次确认最后一次发送并发送新窗口

在这里插入图片描述

UDP vs TCP

UDP
• Connectionless
• Unicast, Multicast, or Broadcast communication
• No guarantees (packets may be lost, out of order,dropped)
• Faster due to “fire and forget” model

TCP
• Connection oriented
• Unicast communication
• Data delivery guarantees
– Packets arrive in order
– Duplicate packets are rejected
– Dropped packets are retransmitted
• Slower due to connection overhead
• Can deal with congestion
UDP
·无连接
·单播、多播或广播通信
·无保证(数据包可能丢失、乱序、丢失)
·更快,因为“火灾和遗忘”模式

TCP
·面向连接
·单播通信
·数据传输保证
- 数据包按顺序到达
- 拒绝重复的数据包
- 重传丢弃的数据包
·由于连接开销而变慢
·可以处理拥塞

TCP congestion control - slow start

In order to deal with packet congestion,TCP utilises an algorithm called slow start

  1. Window starts at 1 max segment(TDPU) size
  2. Doubles window each time an ack is received, exponential increase
  3. When a packet is lost (congestion), the window reverts to 1 max segment and the process starts from step 1 again
    为了处理数据包拥塞,TCP使用一种称为慢启动的算法
    1.窗口从1个最大段(TDPU)大小开始
    2.每次接收到ACK时将窗口加倍,指数增加
    3.当数据包丢失(拥塞)时,窗口恢复为最大1个段,过程再次从步骤1开始。
    在这里插入图片描述

TCP congestion control - threshold

Another way TCP deals with congestion is by utilising a threshold

  1. Window starts at 1 max segment(TDPU) size
  2. State some threshold (e.g. 32k) and double the window each time an ack is received until it is reached
  3. Once threshold is met, linearly increase window size
  4. When a packet is lost (congestion) reset threshold to ½ current window and the process starts from step 1 again
    TCP处理拥塞的另一种方法是利用阈值
    1.窗口从1个最大段(TDPU)大小开始
    2.规定某个阈值(例如32 k),并在每次收到确认时将窗口加倍,直到达到该阈值
    3.一旦达到阈值,则线性增加窗口大小
    4.当数据包丢失(拥塞)时,将阈值重置为当前窗口的1/2,并再次从步骤1开始处理
    在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/623044.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

UML-通信图和交互概览图(通信图和顺序图的区别与联系)

UML-通信图和交互概览图(通信图和顺序图的区别与联系) 一、通信图简介1.消息2.链接 二、通信图和[顺序图](https://blog.csdn.net/weixin_65032328/article/details/135587782)的联系与区别三、交互概览图四、顺序图转化为通信图练习 一、通信图简介 通…

2.2 物理层

2.2 物理层 2.2.1 物理层的基本概念 1、物理层主要解决在各种传输媒体上传输比特0和1的问题,进而给数据链路层提供透明传输比特流的服务 2、由于传输媒体的种类太多(例如同轴电缆、光纤、无线电波等),物理连接方式也有很多例如…

libcurl开源库的编译与使用全攻略

libcurl简介 libcurl 是一个广泛使用的、支持多种协议的、开源的客户端URL传输库,提供了许多用于数据传输的API,例如文件传输、FTP、HTTP、HTTPS、SMTP等。libcurl 的主要特点包括 支持多种协议:libcurl 支持多种协议,如 HTTP、F…

Spring集成

目录 概述1 声朋一个简单的集成流1.1 使用XML定义集成流1.2 使用Java配置集成流1.3 使用Spring lntegration 的 DSL 配置 2 Spring integration 功能概览2.1 消息通道2.2 过滤器2.3 转换器2.4 路由器2.5 切分器2.6 服务激活器2.7 网关2.8 通道适配器2.9 端点模块 概述 就像我们…

JDK8-JDK17版本升级

局部变量类型推断 switch表达式 文本块 Records 记录Records是添加到 Java 14 的一项新功能。它允许你创建用于存储数据的类。它类似于 POJO 类,但代码少得多;大多数开发人员使用 Lombok 生成 POJO 类,但是有了记录,你就不需要使…

逸学Docker【java工程师基础】3.1安装Jenkins

1.下载镜像 docker pull jenkins/jenkins:lts 2.运行容器 docker run -d -u root -p 8080:8080 -p 50000:50000 -v /var/jenkins_home:/var/jenkins_home -v /etc/localtime:/etc/localtime --name jenkins jenkins/jenkins:lts 3.要启动名为 jenkins 的 Docker 容器 docker st…

HarmonyOS-LocalStorage:页面级UI状态存储

管理应用拥有的状态概述 上一个章节中介绍的装饰器仅能在页面内,即一个组件树上共享状态变量。如果开发者要实现应用级的,或者多个页面的状态数据共享,就需要用到应用级别的状态管理的概念。ArkTS根据不同特性,提供了多种应用状态…

OpenGauss源码分析-SQL引擎

所讨论文件大多位于src\common\backend\parser文件夹下 总流程 start_xact_command():开始一个事务。pg_parse_query():对查询语句进行词法和语法分析,生成一个或者多个初始的语法分析树。进入foreach (parsetree_item, parsetree_list)循环…

LeetCode 每日一题 Day 37-43

终于考完试了,寒假期间将会每天持续更新! 447. 回旋镖的数量(Day 37) 给定平面上 n 对 互不相同 的点 points ,其中 points[i] [xi, yi] 。回旋镖 是由点 (i, j, k) 表示的元组 ,其中 i 和 j 之间的欧式距离和 i 和 k 之间的欧…

通过开源端点可见性改善网络安全响应

在当今复杂的数字环境中,企业内的许多不同端点(从数据中心的服务器到咖啡店的笔记本电脑)创建了巨大且多样化的攻击面。每个设备都存在网络安全威胁的机会,每个设备都有其独特的特征和复杂性。攻击者使用的多种攻击媒介不仅是一个…

正则表达式中的“回引用(回溯)”——别名引用与序号引用的差异及正则表达式中的“P”关键字

读到一段巧妙的正则表达式,勾起我对正则表达式欠缺知识点的探寻: P y t h o n Python Python正则表达式中的“回引用(回溯)”——分组别名引用与序号引用的差异及正则表达式中的“P”关键字详情。 (笔记模板由python脚本于2024年01月14日 07:49:35创建&a…

pytorch集智4-情绪分类器

1 目标 从中文文本中识别出句子里的情绪。和上一章节单车预测回归问题相比,这个问题是分类问题,不是回归问题 2 神经网络分类器 2.1 如何用神经网络分类 第二章节用torch.nn.Sequantial做的回归预测器,输出神经元只有一个。分类器和其区别…

QT——connect的第五个参数 Qt::ConnectionType (及qt和c++的多线程的区别)

一直对QT的多线程和c的多线程的区别有疑惑,直到看到文档中这一部分内容才豁然开朗 一.ConnectionType参数的类型和区别 首先是官方文档中对于该枚举值的区别介绍: 对于队列(queued )连接,参数必须是 Qt 元对象系统已知…

强化学习应用(四):基于Q-learning的物流配送路径规划研究(提供Python代码)

一、Q-learning算法简介 Q-learning是一种强化学习算法,用于解决基于马尔可夫决策过程(MDP)的问题。它通过学习一个值函数来指导智能体在环境中做出决策,以最大化累积奖励。 Q-learning算法的核心思想是使用一个Q值函数来估计每…

助力工业园区作业违规行为检测预警,基于YOLOv7【tiny/l/x】不同系列参数模型开发构建工业园区场景下作业人员违规行为检测识别系统

在很多工业园区生产作业场景下保障合规合法进行作业生产操作,对于保护工人生命安全降低安全隐患有着非常重要的作用,但是往往在实际的作业生产中,因为一个安全观念的淡薄或者是粗心大意,对于纪律约束等意思薄弱,导致在…

maven镜像源设置aliyun提升下载速度

一、打开pom.xml project下在添加 <repositories><repository><id>aliyunmaven</id><name>aliyun</name><url>https://maven.aliyun.com/repository/public</url></repository><repository><id>central2&l…

分布形态的度量_峰度系数的探讨

集中趋势和离散程度是数据分布的两个重要特征,但要全面了解数据分布的特点&#xff0c;还应掌握数据分布的形态。 描述数据分布形态的度量有偏度系数和峰度系数, 其中偏度系数描述数据的对称性,峰度系数描述与正态分布的偏离程度。 峰度系数反映分布峰的尖峭程度的重要指标. 当…

【ESP32接入语言大模型之智谱清言】

1. 智谱清言 讲解视频&#xff1a; 随着人工智能技术的不断发展&#xff0c;自然语言处理领域也得到了广泛的关注和应用。智谱清言作为千亿参数对话模型 基于ChatGLM2模型开发&#xff0c;支持多轮对话&#xff0c;具备内容创作、信息归纳总结等能力。可以快速注册体验中国版…

远程开发之vscode端口转发

远程开发之vscode端口转发 涉及的软件forwarded port 通过端口转发&#xff0c;实现在本地电脑上访问远程服务器上的内网的服务。 涉及的软件 vscode、ssh forwarded port 在ports界面中的port字段&#xff0c;填需要转发的IP:PORT&#xff0c;即可转发远程服务器中的内网端…

增强FAQ搜索引擎:发挥Elasticsearch中KNN的威力

英文原文地址&#xff1a;https://medium.com/nerd-for-tech/enhancing-faq-search-engines-harnessing-the-power-of-knn-in-elasticsearch-76076f670580 增强FAQ搜索引擎&#xff1a;发挥Elasticsearch中KNN的威力 2023 年 10 月 21 日 在一个快速准确的信息检索至关重要的…