Presentation is loading. Please wait.

Presentation is loading. Please wait.

ICE 302 T RANSPORT LAYER 1 Thanks to A. B. Forouzan Md. Asif Hossain Term # 2 Lecture # 2.

Similar presentations

Presentation on theme: "ICE 302 T RANSPORT LAYER 1 Thanks to A. B. Forouzan Md. Asif Hossain Term # 2 Lecture # 2."— Presentation transcript:

1 ICE 302 T RANSPORT LAYER 1 Thanks to A. B. Forouzan Md. Asif Hossain Term # 2 Lecture # 2

2 This is the presentation slides of the Book You MUST go through this TEXT BOOK for your further learning and for the EXAMS. So, without reading the Book, you can not pass the exams. Read the topics that will be covered in the classes. You can take the helps from the other related Books. 2 3 rd Edition

3 T RANSMISSION C ONTROL P ROTOCOL Port numbers PortProtocolDescription 7Echo Echoes a received datagram back to the sender 9DiscardDiscards any datagram that is received 11UsersActive users 13DaytimeReturns the date and the time 17QuoteReturns a quote of the day 19ChargerReturns a string of characters 20FTP, DataFile Transfer Protocol (data connection) 21FTP, ControlFile Transfer Protocol (control connection) 23TELNETTerminal Network 25SMTPSimple Mail Transfer Protocol 53DNSDomain Name Server 67BOOTPBootstrap Protocol 79Finger 80HTTPHypertext Transfer Protocol 111RPCRemote Procedure Call 28/04/2015 3

4 T RANSMISSION C ONTROL P ROTOCOL Byte-stream connection-oriented & reliable transport protocol 28/04/2015 4

5 TCP - BUFFERS Sending & receiving buffers Processes do not consume data at the same speed Sending site: White section: empty locations to be filled by sending process Blue section: bytes sent but not yet acknowledged Red section: bytes to be sent by sending TCP Receiving site: White section: empty locations to be filled by bytes from the networks Red section: received bytes to be consumed by the receiving process 28/04/2015 5

6 TCP – BYTES & SEGMENTS TCP at the sending site gathers bytes into a packet called a segment TCP adds a header to each segment and delivers it to IP for transmission Segments can arrive out of order Size of the segment varies 28/04/2015 6

7 TCP – NUMBERING BYTES Numbering is used for flow & error control Segments are not numbered, only bytes Full-duplex connection – numbering is independent in each direction Numbers generated randomly from 0 to 2 32 -1 Sequence number The number of the first byte carried in the segment Acknowledgement number To confirm received bytes Defines the number of the next byte the party expects to receive Cumulative 28/04/2015 7

8 TCP NUMBERING – AN EXAMPLE Imagine a TCP connection is transferring a file of 6000 bytes. The first byte is numbered 10010. What are the sequence numbers for each segment if data are sent in five segments with the first four segments carrying 1000 bytes and the last segment carrying 2000 bytes? 28/04/2015 8 The following shows the sequence number for each segment: Segment 1 ==> sequence number: 10 010 (range: 10,010 to 11,009) Segment 2 ==> sequence number: 11 010 (range: 11,010 to 12,009) Segment 3 ==> sequence number: 12 010 (range: 12,010 to 13,009) Segment 4 ==> sequence number: 13 010 (range: 13,010 to 14,009) Segment 5 ==> sequence number: 14 010 (range: 14,010 to 16,009)

9 TCP SEGMENT FORMAT 28/04/2015 9

10 TCP - CONNECTIONS Connection establishment Three-way handshake Why is two-way handshake not enough? 28/04/2015 10 Connection termination –Four steps

11 Tran sport Laye r 3-11 TCP client lifecycle TCP server lifecycle TCP – A STATE TRANSITION DIAGRAM

12 F LOW CONTROL Remember? The amount of data a source can send before receiving an ACK from the destination Whether to send 1 byte of data and wait for ACK or send all bytes and wait for the ACK for the complete message? TCP gives a solution in between Sliding window protocol byte oriented 12

13 F LOW C ONTROL Avoids the problem of a host at one side of the connection overflowing the buffers in the host at the other side Ensures the integrity of the data

14 S ESSION M AINTENANCE AND T ERMINATION Congestion can occur during data transfer To terminate, the sending host sends a signal that indicates the end of the transmission, which is acknowledged by the receiver.

15 F LOW CONTROL ( CNT ’ D ) If no window, a sender can send all bytes without regarding the condition of the receiver if data are consumed too slowly then receiver buffer becomes full -> drop the packet (retransmit) the sender must adjust itself to the number of the free locations in the receiver buffer 28/04/2015 15 sender buffer Direction of transmission

16 F LOW CONTROL ( CNT ’ D ) Receiver window 28/04/2015 16 Sender window N M N-M = receiver window

17 F LOW CONTROL ( CNT ’ D ) sliding widow ACK is received for bytes 200-202 the sender can send bytes 205- 209 28/04/2015 17 expanding the sender widow shrinking the sender widow Direction of transmission Direction of window shift

18 3-18 P ERFORMANCE OF RDT 3.0 (R ELIABLE DATA TRANSFER OVER A LOSSY CHANNEL WITH BIT ERRORS ) rdt3.0 works, but performance stinks example: 1 Gbps link, 15 ms e-e prop. delay, 1KB packet: T transmit = 8kb/pkt 10^9 b/sec = 8 microsec m U sender : utilization – fraction of time sender busy sending m 1KB pkt every 30 msec -> 33kB/sec thruput over 1 Gbps link m network protocol limits use of physical resources! L (packet length in bits) R (transmission rate, bps) =


20 Transport Layer 3-20 P IPELINED PROTOCOLS Pipelining: sender allows multiple, “in-flight”, yet- to-be-acknowledged pkts range of sequence numbers must be increased buffering at sender and/or receiver Two generic forms of pipelined protocols: go-Back-N, selective repeat


22 Tran sport Laye r 3-22 T HE “ A ” F ACTOR a = (Round Trip Time) / (Transmission time) Transmission time (L) is usually represented in bits and Round Trip Time (RTT) is usually given in time units (say 50 ms). small a – implies low RTT or Large L; usually LANs with large packets. large a – implies high RTT or small L; usually WANs or LANS with small packets; or highly congested network.

23 Tran sport Laye r 3-23 S TOP AND W AIT L INK U TILIZATION ( CONT.) Tx time = RTT + L +TA TA – time to tx ack frame (small and ignored) Therefore, Tx time = RTT + L U = L/(Tx time)= L/(L+RTT)= 1/(1+a) For large a, U is small  For small a, U is high

24 G O -B ACK -N In a GBN protocol, the sender is allowed to transmit multiple packets without waiting for an acknowledgment, but is constrained to have no more than some maximum allowable number, N, of unacknowledged packets in the pipeline.

25 Tran sport Laye r 3-25 GBN IN ACTION

26 Transport Layer 3-26 S ELECTIVE R EPEAT receiver individually acknowledges all correctly received pkts buffers pkts, as needed, for eventual in-order delivery to upper layer sender only resends pkts for which ACK not received sender timer for each unACKed pkt sender window N consecutive seq #’s again limits seq #s of sent, unACKed pkts

27 Tran sport Laye r 3-27 S ELECTIVE REPEAT IN ACTION

28 E RROR CONTROL IN TCP Detect corrupted segments; lost segments; out- of-order segments & duplicated segments Three tools: 1. checksum 2. acknowledgment – no NACKs 3. time-out – one time-out counter for each segment sent 28/04/2015 28


30 E RROR CONTROL IN TCP - DUPLICATE & OUT - OF - ORDER SEGMENT - Duplicate segment the destination TCP simply discards the segment Out-of-order segment not acknowledged until it receives all the segments that precede it 28/04/2015 30

31 TCP TIMERS 28/04/2015 31 1.Retransmission Persistence Keep-alive Time-waited

Download ppt "ICE 302 T RANSPORT LAYER 1 Thanks to A. B. Forouzan Md. Asif Hossain Term # 2 Lecture # 2."

Similar presentations

Ads by Google