Internet checksum: example example: add two 16-bit integers 1110011001100110 1101010101010101 wraparound(11011101110111011 sum 1011101110111100 checksum 0100010001000011 significant bit needs to be added to the resulost Note: when adding numbers a carryout from the me Transport Layer 3-22
Transport Layer 3-22 Internet checksum: example example: add two 16-bit integers 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 0 1 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1 wraparound sum checksum Note: when adding numbers, a carryout from the most significant bit needs to be added to the result
UDP检查和计算 口计算UDP检查和包括伪头、∪DP头和数据三个部分 口检査和的使用是可选的,若不计算检査和,该字段填入0 32-bit source iP address 32-bit destination ip address All Os 8-bit protocol (1 16-bit UDP total lengt Source port address Destination port address 16 bits 6 bits UDP total length Checksum 16 bits 16 bits Data (Padding must be added to make the data a multiple of 16 bits)
UDP检查和计算 计算UDP检查和包括伪头、UDP头和数据三个部分。 检查和的使用是可选的,若不计算检查和,该字段填入0
检查和计算举例 1001100100010010—153.18 0000100001101001 8.105 1010101100000010 171.2 0000111000001010 14.10 153.18.8.105 0000000000010001 0 and 17 71.2.14.10 0000000000001111 15 0000010000111111 1087 All Os 15 0000000000001101 0000000000001111 三三三 13 1087 13 0000000000000000 0(checksum) 15 All Os 0101010001000101 010100110101010 S and t T E T 0100100101001110 I and N All Os 0100011100000000 G and 0(padding) 1001011011101011 0110100100010100 Checksum 口计算检查和时, checksum字段填0 口接收方对UDP报文(包括检查和)及伪头求和,若结果为 OXFFFF,认为没有错误。 Transport layer 3-24
检查和计算举例 计算检查和时,checksum字段填0 接收方对UDP报文(包括检查和)及伪头求和,若结果为 0xFFFF,认为没有错误。 Transport Layer 3-24
为什么需要∪DP? why is there a UDP? UDP适合的应用: 冷应用可以尽可能快地 o容忍丢包但对延迟敏 发送报文: 感的应用:如流媒体 无建立连接的延迟 O以单次请求/响应为 不限制发送速率(不 主的应用:如DNs 进行拥塞控制和流量 控制) 若应用要求基于UDP 发送时间可控 进行可靠传输: ☆报头开销小 o由应用层实现可靠性 Transport layer
Transport Layer 为什么需要UDP? ❖ 应用可以尽可能快地 发送报文: ❖ 无建立连接的延迟 ❖ 不限制发送速率(不 进行拥塞控制和流量 控制) ❖ 发送时间可控 ❖ 报头开销小 why is there a UDP? UDP适合的应用: 容忍丢包但对延迟敏 感的应用:如流媒体 以单次请求/响应为 主的应用:如DNS 若应用要求基于UDP 进行可靠传输: 由应用层实现可靠性
Chapter 3 outline 口31 Transport-ayer 03. 5 Connection-oriented services transport: TCP 03.2 Multiplexing and o segment structure demultiplexing o reliable data transfer 03. 3 Connectionless flow control transport: UDP o connection management O 3.4 Principles of 口36 Principles of reliable data transfer congestion control 口3.7 TCP congestion control Transport layer 3-26
Transport Layer 3-26 Chapter 3 outline 3.1 Transport-layer services 3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4 Principles of reliable data transfer 3.5 Connection-oriented transport: TCP segment structure reliable data transfer flow control connection management 3.6 Principles of congestion control 3.7 TCP congestion control