1 / 14

ELEN 602 Lecture 15

More on IP TCP. ELEN 602 Lecture 15. TCP Streams. Application. Application. byte stream. byte stream. segments. Transmitter. Receiver. Send buffer. Receive buffer. ACKs. TCP end-to-end Flow control. Transmitter. Receiver. Send Window. Receive Window. S last +W a -1.

idola-barry
Download Presentation

ELEN 602 Lecture 15

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. More on IP TCP ELEN 602 Lecture 15

  2. TCP Streams Application Application byte stream byte stream segments Transmitter Receiver Send buffer Receive buffer ACKs

  3. TCP end-to-end Flow control Transmitter Receiver Send Window Receive Window Slast+Wa-1 Rlast+WR+1 Rlast ... ... ... Rnext Rnew Octets transmitted and ACKed Slast Srecent Slast+Ws-1 Slast oldest unacknowledged octet Srecent highest-numbered transmitted octet Slast+Wa-1 highest-numbered octet that can be transmitted Slast+Ws-1 highest-numbered octet that can be accepted from the application Rlast highest-numbered octet not yet read by the application Rnext next expected octet Rnew highest numbered octet received correctly Rlast+WR-1 highest-numbered octet that can be accommodated in receive buffer

  4. TCP Segment 0 4 10 16 24 31 Source Port Destination Port Sequence Number Acknowledgement Number U A P R S F Header R C S S Y I Reserved Window Size Length G K H T N N Checksum Urgent Pointer Options Padding Data

  5. TCP Pseudoheader 0 8 16 31 Source IP Address Destination IP Address 0 0 0 0 0 0 0 0 Protocol = 6 TCP Segment Length

  6. 3-way Handshake for connection establishment Host A Host B SYN, Seq_no = x SYN, Seq_no = y, ACK, Ack_no = x+1 Seq_no = x+1, ACK, Ack_no = y+1

  7. Sequence numbers Host A Host B SYN, Seq_no = n SYN, Seq_no = n, ACK, Ack_no = n+1 Seq_no = n+1, ACK, Ack_no = n+1 Delayed segment with Seq_no = n+2 will be accepted

  8. TCP application example Host B (Server) Host A (Client) socket bind listen accept (blocks) socket connect (blocks) SYN, Seq_no = x SYN, Seq_no = y, ACK, Ack_no = x+1 connect returns Seq_no = x+1, ACK, Ack_no = y+1 write read (blocks) accept returns read (blocks) request message read returns write read (blocks) reply message read returns

  9. TCP Window control Host A Host B t0 Seq_no = 1, Ack_no = 2000, Win = 2048, No Data t1 Seq_no = 2000, Ack_no = 1, Win = 1024, Data = 2000-3023 t2 Seq_no = 3024, Ack_no = 1, Win = 1024, Data = 3024-4047 t3 Seq_no = 1, Ack_no = 4048, Win = 512, Data = 1-128 t4 Seq_no = 4048, Ack_no = 129, Win = 1024, Data = 4048-4559

  10. Data TCP Header overhead TCP Header 20 bytes of TCP header 20 bytes of IP header IP Header

  11. Connection Termination Host A Host B FIN, seq = 5086 ACK = 5087 Data, seq. = 303, ACK = 5087 Deliver 150 bytes ACK = 453 FIN, seq. =453, ACK = 5087 ACK = 454

  12. TCP State diagram CLOSED passive open, create TCB applic.close active open,create TCB send SYN LISTEN receive SYN, send SYN, ACK receive RST send SYN applic. close or timeout, delete TCB SYN_SENT SYN_RCVD receive SYN, send ACK receiveACK receive SYN, ACK, send ACK applic. close, send FIN ESTABLISHED receive FIN, send ACK applic. close, send FIN CLOSE_WAIT receive FIN send ACK applic. close send FIN CLOSING FIN_WAIT_1 receive ACK LAST_ACK receive ACK receive ACK receive FIN, ACK send ACK receive FIN send ACK 2MSL timeout delete TCB FIN_WAIT_2 TIME_WAIT

  13. Routing for mobile hosts Foreign network Home network Foreign agent Mobile host 2 Home agent Internet 3 1 Correspondent host

  14. IP to IP Encapsulation Outer IP Header IP Header IP Header IP Payload IP Payload

More Related