Sunum yükleniyor. Lütfen bekleyiniz

Sunum yükleniyor. Lütfen bekleyiniz

TOBB ETÜ BİL 552 Internet Architecture Lecture Mehmet Özdem.

Benzer bir sunumlar


... konulu sunumlar: "TOBB ETÜ BİL 552 Internet Architecture Lecture Mehmet Özdem."— Sunum transkripti:

1 TOBB ETÜ BİL 552 Internet Architecture Lecture Mehmet Özdem

2 Transport Layer Protokolleri Chapter 2

3 TCP Due to network congestion, traffic load balancing, or other unpredictable network behavior, IP packets can be lost, duplicated, or delivered out of order. TCP detects these problems, requests retransmission of lost data, rearranges out-of-order data, and even helps minimize network congestion to reduce the occurrence of the other problems. Once the TCP receiver has reassembled the sequence of octets originally transmitted, it passes them to the application program. Thus, TCP abstracts the application's communication from the underlying networking detailslostdelivered out of order

4 TCP TCP is utilized extensively by many of the Internet's most popular applications, including the World Wide Web (WWW), E-mail, File Transfer Protocol, Secure Shell, peer-to-peer file sharing, and some streaming media applications.World Wide Web (WWW)E-mailFile Transfer ProtocolSecure Shellpeer-to-peerfile sharingstreaming media TCP is optimized for accurate delivery rather than timely delivery, and therefore, TCP sometimes incurs relatively long delays (in the order of seconds) while waiting for out-of-order messages or retransmissions of lost messages. It is not particularly suitable for real-time applications such as Voice over IP. For such applications, protocols like the Real-time Transport Protocol (RTP) running over the User Datagram Protocol (UDP) are usually recommended instead.Voice over IPReal-time Transport ProtocolUser Datagram Protocol

5 TCP & UDP There are a few key features that set TCP apart from User Datagram Protocol:User Datagram Protocol Ordered data transfer - the destination host rearranges according to sequence number Retransmission of lost packets - any cumulative stream not acknowledged is retransmitted Error-free data transfer Flow control - limits the rate a sender transfers data to guarantee reliable delivery. The receiver continually hints the sender on how much data can be received (controlled by the sliding window). When the receiving host's buffer fills, the next acknowledgment contains a 0 in the window size, to stop transfer and allow the data in the buffer to be processed. Congestion control

6 Evolution of TCP 19751980 1985 1990 1982 TCP & IP RFC 793 & 791 1974 TCP described by Vint Cerf and Bob Kahn In IEEE Trans Comm 1983 BSD Unix 4.2 supports TCP/IP 1984 Nagel’s algorithm to reduce overhead of small packets; predicts congestion collapse 1987 Karn’s algorithm to better estimate round-trip time 1986 Congestion collapse observed 1988 Van Jacobson’s algorithms congestion avoidance and congestion control (most implemented in 4.3BSD Tahoe) 1990 4.3BSD Reno fast retransmit delayed ACK’s 1975 Three-way handshake Raymond Tomlinson In SIGCOMM 75

7 IGMPRSVP

8 TCP IGMP UDP RTP RSVP

9 9 Bil456 adlı host aşağıdaki URL ye ulaşmak istediğinde http://tobb.etu.edu.tr/index.html. TCP/IP Örnek

10 10 HTTP Request and HTTP response Web browser,HTTP client program çalıştırır. Web server, HTTP server program çalıştırır. HTTP client HTTP servera doğru HTTP request yollar HTTP server buna HTTP response ile cevap döner

11 11 HTTP Request GET /index.html HTTP/1.1 Accept: image/gif, */* Accept-Language: en-us Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 Host: neon.tcpip-lab.edu Connection: Keep-Alive Check if /index.html is correct

12 12 HTTP Response HTTP/1.1 200 OK Date: Sat, 25 May 2002 21:10:32 GMT Server: Apache/1.3.19 (Unix) Last-Modified: Sat, 25 May 2002 20:51:33 GMT ETag: "56497-51-3ceff955" Accept-Ranges: bytes Content-Length: 81 Keep-Alive: timeout=15, max=100 Connection: Keep-Alive Content-Type: text/html Internet Lab Click here for the Internet Lab webpage. HTTP request Bil456’dan Tobb’a nasıl gidecek?

13 13 HTTP’den TCP’ye HTTP request gönderebilmek için HTTP client programı, Tobb HTTP server ile TCP bağlantısı kurar, Tobb HTTP serverında TCP server çalışmaktadır.

14 14 Hostname’lerin çözülme işlemi TCP; hostname ile birlikte çalışamaz bundan dolayı; “tobb.etu.edu.tr” nin IP adresi bilinmelidir. DNS kullanılmalıdır. Tobb HTTP server’ı 16 bitlik bir port numarası ile tanımlanmalıdır.

15 15 Port Numaraları HTTP Server port 80.porttur Bundan dolayı Bil456 client’ı sadece uzaktaki makinenin HTTP server port numarasını bilir. Well-Known Ports ftp21finger79 telnet23http80 smtp 25 nntp 119

16 16 TCP Connection Request bil456.etu.edu.tr’daki bulunan Bil456 HTTP client’ı 1.1.1.1 IP numaralı uzak makinenin 80.portu ile TCP bağlantısı kurmaya çalışır.

17 17 Bil456 TCP client HTTP server ile TCP kurmak için istek yollar.

18 18 HTTP server gelen Ethernet frame’i alır. Ethernet Frame soyularak IP header’una bakılır,IP datagramının payload kısmında TCP segmenti bulunur bu kısım artık TCP server’a çıkarılır. Note: Since the TCP segment is a connection request (SYN), the TCP protocol does not pass data to the HTTP program for this packet. Instead, the TCP protocol at tobb will respond with a SYN segment to bil456

19 19 TCP Connection-oriented protokol Güvenli iletişim sağlar.

20 20 Connection-Oriented Data göndermeden önce TCP bağlantısı kurulur.

21 21 Reliable Receiver segmentler için ACK gönderir TCP timer yapısı içerisinde belirli zaman aralığında eğer ACK gelmez ise segmenti tekrar gönderir (retransmit) Hata Tespiti: Tüm byte’lar sequence ID ile gönderilir TCP checksum vardır, invalid checksum lar discar edilir.

22 22 TCP Format

23 23 TCP Header Alanları Port Number

24 24 TCP Header Alanları Sequence Number (SeqNo): 32 bit uzunluğundadır. 0 <= SeqNo <= 2 32 -1  4.3 Gbyte Herbir SeqNo byte stream’deki bir byte’ı gösterir. Bağlantı kurulma aşamasında; Initial Sequence Number (ISN) ayarlanmalıdır. Each byte of data is assigned a sequence number. The first byte of data by a station in a particular TCP header will have its sequence number in this field, say 58000. If this packet has 700 bytes of data in it then the next packet sent by this station will have the sequence number of 58000 + 700 + 1 = 58701.

25 25 TCP Header Alanları Acknowledgement Number (AckNo): Hostlar ACK göndermek için AckNo alanını kullanırlar (If a host sends an AckNo in a segment it sets the “ACK flag”) AckNo alanı hostun bir sonraki almak istediği SeqNo yu içerir. Örnek: SeqNo=0-1500 için ACK =1501

26

27 27 TCP Header Alanları Acknowledge Number Göndericiden alıcıya olan akışı kontrol edebilmek adına TCP; sliding window flow protokolunu kullanır. TCP aşağıdaki iki çeşit sliding window mekanizmasını kullanır. no NACKs (Negative ACKnowledgement) only cumulative ACKs

28 28 TCP Header Alanları Header Length ( 4bits): 32-bit uzunluğundadır. TCP header değişen uzunluktadır ( minimum 20 bytes)

29 29 TCP Header Alanları Flag bits: RST: Reset the connection SYN: Synchronize sequence numbers Bağlantı kurulma aşamasında ilk pakette gönderilir FIN: Sender is finished with sending Bağlantının kapatılması için kullanılır, tüm taraflarca gönderilmesi gereklidir.

30 30 TCP Header Alanları Window Size: Bağlantının tüm tarafları windows size’ını anons ederler. Window size; alıcı tarafın kabul edeceği maximum byte sayısıdır. Maximum window size 2 16 -1= 65535 bytes

31 31 TCP Bağlantı Yönetimi TCP Connection Açılması TCP Connection Kapatılması Özel Seneryolar State Diagram

32 32 TCP Bağlantı Kurulması TCP bağlantı kurmak için three-way handshake kullanır. (1) ACTIVE OPEN: Client aşağıdakileri gönderir SYN bit set * port number of client initial sequence number (ISN) of client (2) PASSIVE OPEN: Server aşağıdaki bilgileri döner. SYN bit set * initial sequence number of server ACK for ISN of client (3) Client aşağıdaki göndererek ACK döner. ACK ISN of server (* counts as one byte)

33 33 Three-Way Handshake For animation http://netbook.cs.purdue.edu/

34 34 TCP Bağlantı Sonlandırılması Tarafların bir tanesinin FIN mesajı göndermesi artık data göndermeyeği anlamına gelir. (1) X ; Y’ye FIN gönderir(active close) (2) Y ACKs FIN, (bu sırada Y hala X’e data göndermeye devam edebilir.) (3) Y ; X’e FIN gönderir (passive close) (4) X ACKs FIN.

35 35 TCP Bağlantı Sonlandırılması

36 36 TCP States

37 37 TCP States in “Normal” Connection Lifetime

38 38 TCP State Transition Diagram Opening A Connection

39 39 TCP State Transition Diagram Closing A Connection


"TOBB ETÜ BİL 552 Internet Architecture Lecture Mehmet Özdem." indir ppt

Benzer bir sunumlar


Google Reklamları