1 / 39

TOBB ET Ü B İL 55 2 Internet Architecture Lecture

TOBB ET Ü B İL 55 2 Internet Architecture Lecture. Mehmet Özdem. Transport Layer Protokolleri. Chapter 2. TCP.

Télécharger la présentation

TOBB ET Ü B İL 55 2 Internet Architecture Lecture

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. TOBB ETÜ BİL 552Internet ArchitectureLecture 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 details

  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-peerfile sharing, and some streaming media applications. • 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.

  5. TCP & UDP • There are a few key features that set TCP apart from 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 1984 Nagel’s algorithm to reduce overhead of small packets; predicts congestion collapse 1975 Three-way handshake Raymond Tomlinson In SIGCOMM 75 1987 Karn’s algorithm to better estimate round-trip time 1990 4.3BSD Reno fast retransmit delayed ACK’s 1983 BSD Unix 4.2 supports TCP/IP 1988 Van Jacobson’s algorithms congestion avoidance and congestion control (most implemented in 4.3BSD Tahoe) 1986 Congestion collapse observed 1974 TCP described by Vint Cerf and Bob Kahn In IEEE Trans Comm 1982 TCP & IP RFC 793 & 791 1990 1975 1980 1985

  7. IGMP RSVP

  8. RTP TCP UDP IGMP RSVP

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

  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. HTTP Request Check if /index.html is correct 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

  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 <HTML> <BODY> <H1>Internet Lab</H1> Click <a href="http://www.tcpip-lab.net/index.html">here</a> for the Internet Lab webpage. </BODY> </HTML> • HTTP request Bil456’dan Tobb’a nasıl gidecek?

  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ındaTCP serverçalışmaktadır.

  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. Port Numaraları • HTTP Server port 80.porttur • Bundan dolayı Bil456 client’ı sadece uzaktaki makinenin HTTP server port numarasını bilir. • Well-KnownPorts ftp 21 finger 79 telnet 23 http 80 smtp 25 nntp 119

  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. Bil456 TCP client HTTP server ile TCP kurmak için istek yollar.

  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. TCP • Connection-oriented protokol • Güvenli iletişim sağlar.

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

  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. TCP Format

  23. TCP Header Alanları • Port Number

  24. TCP Header Alanları • Sequence Number (SeqNo): • 32 bit uzunluğundadır. • 0 <= SeqNo <= 232 -1  4.3 Gbyte • HerbirSeqNobytestream’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 willhave the sequence number of 58000 + 700 + 1 = 58701.

  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”) • AckNoalanı hostun bir sonraki almak istediği SeqNoyu içerir. • Örnek: SeqNo=0-1500 için ACK =1501

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

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

  28. 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.

  29. TCP Header Alanları • Window Size: • Bağlantının tüm tarafları windowssize’ını anons ederler. • Window size; alıcı tarafın kabul edeceği maximumbyte sayısıdır. • Maximum window size 216-1= 65535 bytes

  30. TCP Bağlantı Yönetimi • TCP Connection Açılması • TCP Connection Kapatılması • ÖzelSeneryolar • State Diagram

  31. TCP Bağlantı Kurulması • TCP bağlantı kurmak için three-way handshakekullanı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)

  32. Three-Way Handshake Foranimation http://netbook.cs.purdue.edu/

  33. 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.

  34. TCP Bağlantı Sonlandırılması

  35. TCP States

  36. TCP States in “Normal” Connection Lifetime

  37. TCP State Transition DiagramOpening A Connection

  38. TCP State Transition DiagramClosing A Connection

More Related