DOC PREVIEW
Berkeley ELENG 122 - TCP - Reliable, In-Order Delivery

This preview shows page 1-2-22-23 out of 23 pages.

Save
View full document
Premium Document
Do you want full access? Go Premium and unlock all 23 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

TCP Reliable In Order Delivery EE 122 Intro to Communication Networks Fall 2006 MW 4 5 30 in Donner 155 Vern Paxson TAs Dilip Antony Joseph and Sukun Kim http inst eecs berkeley edu ee122 Materials with thanks to Jennifer Rexford Ion Stoica and colleagues at Princeton and UC Berkeley 1 Announcements Sukun is away this week Dilip will cover his section and office hours Dilip s office has moved to 751 Soda alcove His office hours remain Fri 11 12 Today is the deadline for requesting discussion possible regarding of midterm questions Send email to do so Project 3 out on Wednesday Can do individual or in a team of 2 people First phase due November 16 no slip days Exercise good better time management 2 1 Today s Lecture How does TCP achieve correct operation Reliability in the face of IP s meager best effort service 3 way handshake to establish connections 3 way or 4 way handshake to terminate conn Retransmission to recover from loss We ll only look at timeout based retransmission today State diagrams as a tool for understanding complex protocol operation 3 TCP Service Model Reliable in order byte stream delivery and with good performance Challenges the network can drop packets Even perhaps a large number delay packets deliver packets out of order Follows from possibility of arbitrary delay replicate packets Even perhaps for many seconds Weird but it does sometimes happen corrupt packets What s missing 4 2 TCP Support for Reliable Delivery Checksum Sequence numbers Used to detect corrupted data at the receiver leading the receiver to drop the packet Used to detect missing data and for putting the data back in order Retransmission Sender retransmits lost or corrupted data Timeout based on estimates of round trip time Fast retransmit algorithm for rapid retransmission 5 TCP Header Source port Destination port Sequence number Acknowledgment HdrLen 0 Flags Advertised window Checksum Urgent pointer Options variable Data 6 3 TCP Header Source port These should be familiar Destination port Sequence number Acknowledgment HdrLen 0 Flags Advertised window Checksum Urgent pointer Options variable Data 7 TCP Header Starting sequence number byte offset of data carried in this segment Source port Destination port Sequence number Acknowledgment HdrLen 0 Flags Advertised window Checksum Urgent pointer Options variable Data 8 4 TCP Header Source port Acknowledgment gives seq just beyond highest seq received in order Destination port Sequence number Acknowledgment HdrLen 0 Flags Advertised window Checksum If sender sends N in order bytes starting at seq S then ack for it will be S N Urgent pointer Options variable Data 9 TCP Header Source port Destination port Sequence number Number of 4 byte words in TCP header 5 no options Acknowledgment HdrLen 0 Flags Advertised window Checksum Urgent pointer Options variable Data 10 5 TCP Header Source port Destination port Sequence number Must Be Zero 6 bits reserved Acknowledgment HdrLen 0 Flags Advertised window Checksum Urgent pointer Options variable Data 11 TCP Header Source port Destination port Sequence number We will get to these shortly Acknowledgment HdrLen 0 Flags Advertised window Checksum Urgent pointer Options variable Data 12 6 TCP Header Source port Destination port Sequence number Buffer space available for receiving data Used for TCP s sliding window Acknowledgment HdrLen 0 Flags Advertised window Checksum Urgent pointer Options variable Interpreted as offset beyond Acknowledgment field s value Data 13 TCP Header Source port Destination port Sequence number Used with URG flag to indicate urgent data not discussed further Acknowledgment HdrLen 0 Flags Advertised window Checksum Urgent pointer Options variable Data 14 7 TCP Stream of Bytes Service Host A Byte 80 Byte 3 Byte 2 Byte 1 Byte 0 Host B Byte 80 Byte 3 Byte 2 Byte 1 Byte 0 15 Provided Using TCP Segments Host A Byte 80 Byte 3 Byte 2 Byte 1 Byte 0 Segment sent when TCP Data Host B 1 Segment full Max Segment Size 2 Not full but times out or 3 Pushed by application TCP Data Byte 80 Byte 3 Byte 2 Byte 1 Byte 0 16 8 TCP Segment IP Data TCP Data segment TCP Hdr IP Hdr IP packet No bigger than Maximum Transmission Unit MTU E g up to 1 500 bytes on an Ethernet TCP packet IP packet with a TCP header and data inside TCP header 20 bytes long TCP segment No more than Maximum Segment Size MSS bytes E g up to 1460 consecutive bytes from the stream 17 Sequence Numbers Host A ISN initial sequence number Sequence number 1st byte Host B TCP Data TCP HDR TCP Data ACK sequence number next expected byte TCP HDR 18 9 Initial Sequence Number ISN Sequence number for the very first byte E g Why not just use ISN 0 Practical issue IP addresses and port s uniquely identify a connection Eventually though these port s do get used again a chance an old packet is still in flight and might be associated with new connection TCP requires RFC793 changing ISN over time Set from 32 bit clock that ticks every 4 microseconds only wraps around once every 4 55 hours To establish a connection hosts exchange ISNs 19 Connection Establishment TCP s Three Way Handshake 20 10 Establishing a TCP Connection A B SYN CK SYN A Each host tells its ISN to the other host ACK Data Data Three way handshake to establish connection Host A sends a SYN open synchronize sequence numbers to host B Host B returns a SYN acknowledgment SYN ACK Host A sends an ACK to acknowledge the SYN ACK 21 TCP Header Source port Flags SYN ACK FIN RST PSH URG Destination port Sequence number Acknowledgment HdrLen 0 Flags Advertised window Checksum Urgent pointer Options variable Data See usr include netinet tcp h on Unix Systems 22 11 Step 1 A s Initial SYN Packet A s port B s port A s Initial Sequence Number Flags SYN ACK FIN RST PSH URG Irrelevant since ACK not set 5 20B 0 Flags Checksum Advertised window Urgent pointer Options variable A tells B it wants to open a connection 23 Step 2 B s SYN ACK Packet B s port A s port B s Initial Sequence Number Flags SYN ACK FIN RST PSH URG ACK A s ISN plus 1 20B 0 Flags Checksum Advertised window Urgent pointer Options variable B tells A it accepts and is ready to hear the next byte upon receiving this packet A can start sending data 24 12 Step 3 A s ACK of the SYN ACK A s port B s port A s Initial Sequence Number Flags SYN ACK FIN RST PSH URG B s ISN plus 1 20B Flags 0 Checksum Advertised window Urgent pointer Options variable A tells B it s likewise okay to start sending upon receiving this packet B can start sending data 25


View Full Document

Berkeley ELENG 122 - TCP - Reliable, In-Order Delivery

Documents in this Course
Lecture 6

Lecture 6

22 pages

Wireless

Wireless

16 pages

Links

Links

21 pages

Ethernet

Ethernet

10 pages

routing

routing

11 pages

Links

Links

7 pages

Switches

Switches

30 pages

Multicast

Multicast

36 pages

Switches

Switches

18 pages

Security

Security

16 pages

Switches

Switches

18 pages

Lecture 1

Lecture 1

56 pages

OPNET

OPNET

5 pages

Lecture 4

Lecture 4

16 pages

Ethernet

Ethernet

65 pages

Models

Models

30 pages

TCP

TCP

16 pages

Wireless

Wireless

48 pages

Load more
Download TCP - Reliable, In-Order Delivery
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view TCP - Reliable, In-Order Delivery and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view TCP - Reliable, In-Order Delivery and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?