DOC PREVIEW
Berkeley ELENG 122 - Transport - UDP and TCP

This preview shows page 1-2-16-17-18-34-35 out of 35 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 35 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 35 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 35 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 35 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 35 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 35 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 35 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 35 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

EECS 122: Introduction to Computer Networks Transport: UDP and TCPOutlineMotivationSlide 4Transport LayerCongestion & Flow ControlTransport Layer (cont’d)PortsHeadersSlide 10UDPUDP Service & HeaderSlide 13TCPTCP ServiceTiming DiagramOpen Connection: 3-Way Handshaking3-Way Handshaking (cont’d)Close Connection (Two-Army Problem)Close ConnectionReliable TransferStop & WaitSliding WindowGo-Back-n (GBN)GBN ExampleGBN Example with ErrorsSelective Repeat (SR)SR Example with ErrorsObservationsSetting TimersTiming IllustrationAdaptive TimersTimer AlgorithmTCP HeaderSummaryKatz, Stoica F04EECS 122: Introduction to Computer Networks Transport: UDP and TCPComputer Science DivisionDepartment of Electrical Engineering and Computer SciencesUniversity of California, BerkeleyBerkeley, CA 94720-17762Katz, Stoica F04OutlineMotivationTransport layerTCPUDP3Katz, 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 into the network?-Too fast is bad; too slow is not efficient4Katz, Stoica F04OutlineMotivationTransport layerTCPUDP5Katz, Stoica F04Transport LayerCan provide more reliability, in order delivery, at most once deliverySupports messages of arbitrary lengthProvide a way to decide which packets go to which applications (multiplexing/demultiplexing)Govern when hosts should send data  can implement congestion and flow control6Katz, Stoica F04Congestion & Flow ControlFlow Control – avoid overflowing the receiverCongestion Control – avoid congesting the networkWhat is network congestion?7Katz, Stoica F04Transport Layer (cont’d)IPTransportA B C[A | B | p1 | p2 | …]p1 p2 p1 p2 p3 p1 p2portsApplicationHTTPDNSRAUDP: Not reliableTCP: Ordered, reliable, well-paced8Katz, 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 client gets one of these9Katz, Stoica F04HeadersIP header  used for IP routing, fragmentation, error detection… (we study that when we explore IP)UDP header  used for multiplexing/demultiplexing, error detectionTCP header  used for multiplexing/demultiplexing, flow and congestion control IPTCP UDPdataTCP/UDPdataTCP/UDPIPApplicationSenderdataIPTCP UDPApplicationReceiverdataTCP/UDPdataTCP/UDPIPdata10Katz, Stoica F04OutlineMotivationTransport LayerUDPTCP11Katz, Stoica F04UDPUser Datagram 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 streaming12Katz, Stoica F04UDP Service & HeaderService:-Send datagram from (IPa, Port 1) to (IPb, Port 2)-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 packet Why have UDP checksum in addition to IP checksum? Why not have just the UDP checksum? Why is the UDP checksum optional?13Katz, Stoica F04OutlineMotivationTransport LayerUDPTCP14Katz, Stoica F04TCPTransmission Control ProtocolReliable, in-order, and at most once deliveryMessages can be of arbitrary lengthProvides multiplexing/demultiplexing to IPProvides congestion control and avoidanceApplication examples: file transfer, chat15Katz, Stoica F04TCP Service1) Open connection2) Reliable byte stream transfer from (IPa, TCP Port1) to (IPb, TCP Port2)•Indication if connection fails: Reset3) Close connection16Katz, Stoica F04SYN kSYN n; ACK k+1DATA k+1; ACK n+1ACK k+n+1data exchangeFINFIN ACK½ closeFINFIN ACK½ closeTiming Diagram3-way handshakeOpenconnect.TransferCloseconnect.17Katz, Stoica F04Open Connection: 3-Way HandshakingGoal: agree on a set of parameters: the start sequence number for each side-Starting sequence numbers are random.Client (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


View Full Document

Berkeley ELENG 122 - Transport - 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 - 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 - 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 - 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?