DOC PREVIEW
Berkeley ELENG 122 - Transport Protocols - UDP and TCP

This preview shows page 1-2-3-19-20-39-40-41 out of 41 pages.

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

Unformatted text preview:

EE 122: Transport Protocols: UDP and TCPToday’s LectureOutlineMotivationSlide 5Transport LayerCongestion vs. Flow ControlTransport Layer (cont’d)PortsHeadersSlide 11UDP: User (Unreliable) Data ProtocolUDP Service & HeaderSlide 14TCP: Transport Control ProtocolTCP ServiceOpen Connection: 3-Way Handshaking3-Way Handshaking (cont’d)Close Connection (Two-Army Problem)Close ConnectionReliable TransferStop & WaitSliding WindowGo-Back-n (GBN)GBN Example w/o ErrorsGBN Example with ErrorsSelective Repeat (SR)SR Example with ErrorsObservationsTCP Flow ControlSlide 31Retransmission TimeoutTiming IllustrationRetransmission Timeout (cont’d)RTT EstimationExponential Averaging ExampleProblemKarn/Partridge AlgorithmJacobson/Karels AlgorithmTCP HeaderSummaryKatz, Stoica F04EE 122: Transport Protocols: UDP and TCPComputer Science DivisionDepartment of Electrical Engineering and Computer ScienceUniversity of California, Berkeley,Berkeley, CA 94720-1776October 5, 20042Katz, Stoica F04Today’s LectureNetwork(IP)ApplicationTransportLinkPhysical3Katz, Stoica F04OutlineMotivationTransport layerTCPUDP4Katz, Stoica F04MotivationIP provides a weak, but efficient service model (best-effort)-Packets can be delayed, dropped, reordered, duplicated-Packets have limited size (why?)IP packets are addressed to a host-How to decide which application gets which packets?How should hosts send packets into the network?-Too fast may overwhelm the network-Too slow is not efficient5Katz, Stoica F04OutlineMotivationTransport layerTCPUDP6Katz, Stoica F04Transport LayerProvide a way to decide which packets go to which applications (multiplexing/demultiplexing)Can -Provide reliability, in order delivery, at most once delivery-Support messages of arbitrary length-Govern when hosts should send data  can implement congestion and flow control7Katz, Stoica F04Congestion vs. Flow ControlFlow Control – avoid overflowing the receiverCongestion Control – avoid congesting the networkWhat is network congestion?8Katz, Stoica F04Transport Layer (cont’d)IPTransportA B C[A | B | p1 | p2 | …]p1 p2 p1 p2 p3 p1 p2portsApplicationHTTPDNSRAUDP: Not reliableTCP: Ordered, reliable, well-paced9Katz, Stoica F04PortsNeed to decide which application gets which packetsSolution: map each socket to a portClient must know server’s portSeparate 16-bit port address space for UDP and TCP-(src_IP, src_port, dst_IP, dst_port) uniquely identifies TCP connection Well known ports (0-1023): everyone agrees which services run on these ports-e.g., ssh:22, http:80-On UNIX, must be root to gain access to these ports (why?)Ephemeral ports (most 1024-65535): given to clients-e.g. chat clients, p2p networks10Katz, Stoica F04HeadersIP header  used for IP routing, fragmentation, error detectionUDP header  used for multiplexing/demultiplexing, error detectionTCP header  used for multiplexing/demultiplexing, flow and congestion control IPTCP UDPdataTCP/UDPdataTCP/UDPIPApplicationSenderdataIPTCP UDPApplicationReceiverdataTCP/UDPdataTCP/UDPIPdata11Katz, Stoica F04OutlineMotivationTransport LayerUDPTCP12Katz, Stoica F04UDP: User (Unreliable) Data ProtocolMinimalist transport protocolSame best-effort service model as IPMessages up to 64KBProvides multiplexing/demultiplexing to IPDoes not provide flow and congestion controlApplication examples: video/audio streaming13Katz, Stoica F04UDP Service & HeaderService:-Send datagram from (IPa, Port1) to (IPb, Port2)-Service is unreliable, but error detection possibleHeader:Source portDestination port0 16 31UDP length UDP checksumPayload (variable)•UDP length is UDP packet length (including UDP header and payload, but not IP header)•Optional UDP checksum is over UDP packet14Katz, Stoica F04OutlineMotivationTransport LayerUDPTCP15Katz, Stoica F04TCP: Transport Control ProtocolReliable, in-order, and at most once deliveryStream oriented: messages can be of arbitrary lengthProvides multiplexing/demultiplexing to IPProvides congestion control and avoidanceApplication examples: file transfer, chat16Katz, Stoica F04TCP Service1) Open connection: 3-way handshaking2) Reliable byte stream transfer from (IPa, TCP_Port1) to (IPb, TCP_Port2)•Indication if connection fails: Reset3) Close (tear-down) connection17Katz, Stoica F04Open Connection: 3-Way HandshakingGoal: agree on a set of parameters: the start sequence number for each side-Starting sequence numbers are randomClient (initiator)ServerSYN, SeqNum = xSYN and ACK, SeqNum = y and Ack = x + 1ACK, Ack = y + 1ActiveOpenPassiveOpenconnect() listen()accept()allocatebuffer space18Katz, Stoica F043-Way Handshaking (cont’d) Three-way handshake adds 1 RTT delay Why?-Congestion control: SYN (40 byte) acts as cheap probe-Protects against delayed packets from other connection (would confuse receiver)19Katz, Stoica F04Close Connection (Two-Army Problem) Goal: both sides agree to close the connectionTwo-army problem: -“Two blue armies need to simultaneously attack the white army to win; otherwise they will be defeated. The blue army can communicate only across the area controlled by the white army which can intercept the messengers.” What is the solution?20Katz, Stoica F04Close Connection4-ways tear down connectionFINFIN ACKFINFIN ACKHost 1 Host 2timeout Avoid reincarnation Can retransmit FIN ACK if it is lostclosedcloseclose21Katz, Stoica F04Reliable TransferRetransmit missing packets-Numbering of packets and ACKsDo this efficiently-Keep transmitting whenever possible-Detect missing ACKs and retransmit quicklyTwo schemes-Stop & Wait-Sliding Window (Go-back-n and Selective Repeat)22Katz, Stoica F04Stop & Wait ACKDATATimeSenderReceiverRTTSend; wait for ackIf timeout, retransmit; else repeatInefficient ifTRANS << RTTInefficient ifTRANS << RTTTRANS23Katz, Stoica F04Sliding Windowwindow = set of adjacent sequence numbersThe size of the set is the window sizeAssume window size is nLet A be the last ack’d packet of sender without gap; then window of sender = {A+1, A+2, …, A+n}Sender can send packets in its windowLet B be the last received packet without gap by receiver, then window of receiver = {B+1,…, B+n}Receiver can accept out of sequence, if in window24Katz, Stoica F04Go-Back-n (GBN)Transmit up to n unacknowledged packetsIf timeout for ACK(k),


View Full Document

Berkeley ELENG 122 - Transport Protocols - UDP and TCP

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 Transport Protocols - UDP and TCP
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 Transport Protocols - UDP and TCP 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 Transport Protocols - UDP and TCP 2 2 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?