Example S0 urce addr=192.168.0.123=11000000101010000000000001111011 Dest addr=202.120.0.2=11001010011110000000000000000010 Zer0=00000000 Protocol =17=00010001 (ICMP:1,TCP:6,EGP:8,UDP:17,ISO TP4:29. UDP Length=9=0000000000001001 Source p0rt#=2345=0000100100101001 Dest port#=80=0000000001010000 Length =9=00000000 00001001(Length=UDP Length) Checksum=0000000000000000 Data=01000001 Pad=00000000 Transport Layer 3-21
Transport Layer 3-21 Example Source addr =192.168.0.123 = 11000000 10101000 00000000 01111011 Dest addr = 202.120.0.2 = 11001010 01111000 00000000 00000010 Zero = 00000000 Protocol = 17 = 00010001 (ICMP:1, TCP:6, EGP:8, UDP:17, ISO TP4:29. UDP Length = 9 = 00000000 00001001 Source port # = 2345 = 00001001 00101001 Dest port # = 80 = 00000000 01010000 Length = 9 = 00000000 00001001 (Length = UDP Length) Checksum = 00000000 00000000 Data = 01000001 Pad = 00000000
1100000010101000 +0000000000001001 1100000010101000 +0000000001111011 1001010100111010 N 0000000001111011 1100000100100011 +0000000000000000 1100101001111000 +1100101001111000 1001010100111010 W A (1)1000101110011011 +0100000100000000 0000000000000010 ->1000101110011100 1101011000111010 U 0000000000010001 +0000000000000010 O 0000000000001001 100010111001111 y 0000100100101001 +0000000000010001 00 0000000001010000 1000101110101111 o 0000000000001001 +0000000000001001 0010100111000101 0000000000000000 1000101110111000 0 0100000100000000 +0000100100101001 1001010011100001 +0000000001010000 1001010100110001 Transport Layer 3-22
Transport Layer 3-22 11000000 10101000 00000000 01111011 11001010 01111000 00000000 00000010 00000000 00010001 00000000 00001001 00001001 00101001 00000000 01010000 00000000 00001001 00000000 00000000 01000001 00000000 11000000 10101000 + 00000000 01111011 11000001 00100011 + 11001010 01111000 (1)10001011 10011011 -> 10001011 10011100 + 00000000 00000010 10001011 1001111 + 00000000 00010001 10001011 10101111 + 00000000 00001001 10001011 10111000 + 00001001 00101001 10010100 11100001 + 00000000 01010000 10010101 00110001 + 00000000 00001001 10010101 00111010 + 00000000 00000000 10010101 00111010 + 01000001 00000000 11010110 00111010 1 2 3 4 5 6 7 8 9 A B 00101001 11000101
.If the sum is S,the checksum will be -S. .If the PDU is intact,the result found by the receiver should be 0,or all 1s in one's complement representation. .Checksum detects all errors involving odd numbers of bits,as well as most errors involving even number of bits.Any time a bit inversion in a 16-bit word is balanced by an opposite bit inversion in the corresponding digit of another 16-bit word,the error is invisible. .Although UDP provides error checking,it does not do anything to recover an error. Transport Layer 3-23
Transport Layer 3-23 •If the sum is S, the checksum will be –S. •If the PDU is intact, the result found by the receiver should be 0, or all 1s in one’s complement representation. •Checksum detects all errors involving odd numbers of bits, as well as most errors involving even number of bits. Any time a bit inversion in a 16-bit word is balanced by an opposite bit inversion in the corresponding digit of another 16-bit word, the error is invisible. •Although UDP provides error checking, it does not do anything to recover an error
Internet Checksum Example r Note m When adding numbers,a carryout from the most significant bit needs to be added to the result r Example:add two 16-bit integers 1110011001100110 1101010101010101 wraparound 11011101110111011 sum 1011101110111100 checksum 0100010001000011 Transport Layer 3-24
Transport Layer 3-24 Internet Checksum Example r Note mWhen adding numbers, a carryout from the most significant bit needs to be added to the result r 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
Chapter 3 outline r 3.1 Transport-layer r 3.5 Connection-oriented services transport:TCP r 3.2 Multiplexing and m segment structure demultiplexing m reliable data transfer r 3.3 Connectionless m flow control transport:UDP m connection management r 3.4 Principles of r 3.6 Principles of reliable data transfer congestion control r 3.7 TCP congestion control Transport Layer 3-25
Transport Layer 3-25 Chapter 3 outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP r 3.4 Principles of reliable data transfer r 3.5 Connection-oriented transport: TCP m segment structure m reliable data transfer m flow control m connection management r 3.6 Principles of congestion control r 3.7 TCP congestion control