Computer Communication Networks Lecture 23 24 Transport Layer

  • Slides: 41
Download presentation
Computer Communication & Networks Lecture 23 & 24 Transport Layer: UDP and TCP http:

Computer Communication & Networks Lecture 23 & 24 Transport Layer: UDP and TCP http: //web. uettaxila. edu. pk/CMS/coe. CCNbs. Sp 09/index. asp Waleed Ejaz waleed. ejaz@uettaxila. edu. pk 1

Transport Layer 2

Transport Layer 2

Transport Layer Topics to Cover UDP, TCP 3

Transport Layer Topics to Cover UDP, TCP 3

Process-to-Process Delivery n The transport layer is responsible for process -to-process delivery—the delivery of

Process-to-Process Delivery n The transport layer is responsible for process -to-process delivery—the delivery of a packet, part of a message, from one process to another. Two processes communicate in a client/server relationship, as we will see later. 4

Types of Data Deliveries 5

Types of Data Deliveries 5

Port Numbers 6

Port Numbers 6

IP addresses versus port numbers 7

IP addresses versus port numbers 7

Internet Assigned Number Authority (IANA) Ranges 8

Internet Assigned Number Authority (IANA) Ranges 8

Socket address 9

Socket address 9

Multiplexing and demultiplexing 10

Multiplexing and demultiplexing 10

Error control 11

Error control 11

Position of UDP, TCP, and SCTP in TCP/IP suite 12

Position of UDP, TCP, and SCTP in TCP/IP suite 12

User Datagram Protocol (UDP) 13

User Datagram Protocol (UDP) 13

User Datagram Protocol (UDP) n The User Datagram Protocol (UDP) is called a connectionless,

User Datagram Protocol (UDP) n The User Datagram Protocol (UDP) is called a connectionless, unreliable transport protocol. It does not add anything to the services of IP except to provide process-toprocess communication instead of host-tohost communication. 14

Well-known ports used with UDP 15

Well-known ports used with UDP 15

User Datagram Format 16

User Datagram Format 16

UDP Operation n n Connectionless Services Flow and Error Control q q n No

UDP Operation n n Connectionless Services Flow and Error Control q q n No flow control No Error Control except Checksum Encapsulation & Decapsulation 17

Queues in UDP 18

Queues in UDP 18

TCP 19

TCP 19

TCP n TCP is a connection-oriented protocol; it creates a virtual connection between two

TCP n TCP is a connection-oriented protocol; it creates a virtual connection between two TCPs to send data. In addition, TCP uses flow and error control mechanisms at the transport level. 20

Well-known ports used by TCP 21

Well-known ports used by TCP 21

Stream delivery 22

Stream delivery 22

Sending and receiving buffers 23

Sending and receiving buffers 23

TCP segments 24

TCP segments 24

Example n The bytes of data being transferred in each connection are numbered by

Example n The bytes of data being transferred in each connection are numbered by TCP. The numbering starts with a randomly generated number. n The value in the sequence number field of a segment defines the number of the first data byte contained in that segment. The value of the acknowledgment field in a segment defines the number of the next byte a party expects to receive. The acknowledgment number is cumulative. n 25

TCP segment format 20 to 60 Byte header 26

TCP segment format 20 to 60 Byte header 26

Connection establishment using threeway handshaking n n n A SYN segment cannot carry data,

Connection establishment using threeway handshaking n n n A SYN segment cannot carry data, but it consumes one sequence number. A SYN + ACK segment cannot carry data, but does consume one sequence number. An ACK segment, if carrying no data, consumes no sequence number. 27

Data transfer 28

Data transfer 28

Connection termination using three-way handshaking n n The FIN segment consumes one sequence number

Connection termination using three-way handshaking n n The FIN segment consumes one sequence number if it does not carry data. The FIN + ACK segment consumes one sequence number if it does not carry data. 29

Half Close 30

Half Close 30

Sliding Window Protocol n n A sliding window is used to make transmission more

Sliding Window Protocol n n A sliding window is used to make transmission more efficient as well as to control the flow of data so that the destination does not become overwhelmed with data. TCP sliding windows are byte-oriented. 31

Example Figure on next slide shows an unrealistic example of a sliding window. The

Example Figure on next slide shows an unrealistic example of a sliding window. The sender has sent bytes up to 202. We assume that cwnd is 20 (in reality this value is thousands of bytes). The receiver has sent an acknowledgment number of 200 with an rwnd of 9 bytes (in reality this value is thousands of bytes). The size of the sender window is the minimum of rwnd and cwnd, or 9 bytes. Bytes 200 to 202 are sent, but not acknowledged. Bytes 203 to 208 can be sent without worrying about acknowledgment. Bytes 209 and above cannot be sent. 32

Example 33

Example 33

Note ACK segments do not consume sequence numbers and are not acknowledged. 34

Note ACK segments do not consume sequence numbers and are not acknowledged. 34

Note In modern implementations, a retransmission occurs if the retransmission timer expires or three

Note In modern implementations, a retransmission occurs if the retransmission timer expires or three duplicate ACK segments have arrived. 35

Note No retransmission timer is set for an ACK segment. 36

Note No retransmission timer is set for an ACK segment. 36

Note Data may arrive out of order and be temporarily stored by the receiving

Note Data may arrive out of order and be temporarily stored by the receiving TCP, but TCP guarantees that no out-of-order segment is delivered to the process. 37

Normal operation 38

Normal operation 38

Lost Segment 39

Lost Segment 39

Note The receiver TCP delivers only ordered data to the process. 40

Note The receiver TCP delivers only ordered data to the process. 40

Fast Retransmission 41

Fast Retransmission 41