Presentation is loading. Please wait.

Presentation is loading. Please wait.

Transport Layer By Ossi Mokryn, Based also on slides from: the Computer Networking: A Top Down Approach Featuring the Internet by Kurose and Ross.

Similar presentations


Presentation on theme: "Transport Layer By Ossi Mokryn, Based also on slides from: the Computer Networking: A Top Down Approach Featuring the Internet by Kurose and Ross."— Presentation transcript:

1 Transport Layer By Ossi Mokryn, Based also on slides from: the Computer Networking: A Top Down Approach Featuring the Internet by Kurose and Ross

2 Transport Layer r Connectionless and connection oriented communication r Sockets programming r UDP r TCP m Reliable communication m Flow control m Congestion control m Timers 2 Transport Layer

3 Transport services and protocols r provide logical communication between app processes running on different hosts r transport protocols run in end systems m send side: breaks app messages into segments, passes to network layer m rcv side: reassembles segments into messages, passes to app layer r more than one transport protocol available to apps m Internet: TCP and UDP application transport network data link physical application transport network data link physical logical end-end transport Transport Layer 3

4 Internet transport-layer protocols r reliable, in-order delivery (TCP) m congestion control m flow control m connection setup r unreliable, unordered delivery: UDP m no-frills extension of “best-effort” IP r services not available: m delay guarantees m bandwidth guarantees application transport network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical application transport network data link physical logical end-end transport Transport Layer 4

5 Transport vs. network layer r network layer: logical communication between hosts r transport layer: logical communication between processes m relies on, enhances, network layer services Household analogy: 12 kids sending letters to 12 kids r processes = kids r app messages = letters in envelopes r hosts = houses r transport protocol = Ann and Bill r network-layer protocol = postal service Transport Layer 5

6 Multiplexing/demultiplexing application transport network link physical P1 application transport network link physical application transport network link physical P2 P3 P4 P1 host 1 host 2 host 3 = process= socket delivering received segments to correct socket Demultiplexing at rcv host: gathering data from multiple sockets, enveloping data with header (later used for demultiplexing) Multiplexing at send host: Transport Layer 6

7 How demultiplexing works r host receives IP datagrams m each datagram has source IP address, destination IP address m each datagram carries 1 transport-layer segment m each segment has source, destination port number r host uses IP addresses & port numbers to direct segment to appropriate socket source port #dest port # 32 bits application data (message) other header fields TCP/UDP segment format Transport Layer 7

8 Connectionless demultiplexing r Create sockets with port numbers: r UDP socket identified by two-tuple: ( dest IP address, dest port number) r When host receives UDP segment: m checks destination port number in segment m directs UDP segment to socket with that port number r IP datagrams with different source IP addresses and/or source port numbers directed to same socket Transport Layer 8

9 Connectionless demux (cont) DatagramSocket serverSocket = new DatagramSocket(6428); Client IP:B P2 client IP: A P1 P3 server IP: C SP: 6428 DP: 9157 SP: 9157 DP: 6428 SP: 6428 DP: 5775 SP: 5775 DP: 6428 SP provides “return address” Transport Layer 9

10 UDP: User Datagram Protocol [RFC 768] r Simplest Internet transport protocol r Each app. Output produces exactly one UDP segment r “best effort” service, UDP segments may be: m lost m delivered out of order to app r connectionless: m no handshaking between UDP sender, receiver m each UDP segment handled independently of others Why is there a UDP? r no connection establishment (which can add delay) r simple: no connection state at sender, receiver r small segment header r no congestion control: UDP can blast away as fast as desired Transport Layer 10

11 UDP: more r often used for streaming multimedia apps m loss tolerant m rate sensitive r other UDP uses m DNS m SNMP r reliable transfer over UDP: add reliability at application layer m application-specific error recovery! source port #dest port # 32 bits Application data (message) UDP segment format length checksum Length, in bytes of UDP segment, including header and data Minimum value is 8 Bytes Transport Layer 11

12 UDP checksum Sender: r treat segment contents as sequence of 16-bit integers r checksum: addition (1’s complement sum) of segment contents r sender puts checksum value into UDP checksum field Receiver: r compute checksum of received segment r check if computed checksum equals checksum field value: m NO - error detected m YES - no error detected. But maybe errors nonetheless? More later …. Goal: detect “errors” (e.g., flipped bits) in transmitted segment Transport Layer 12

13 Internet Checksum Example r Note m When adding numbers, a carryout from the most significant bit needs to be added to the result r Example: add two 16-bit integers wraparound sum checksum Transport Layer 13

14 Sockets Programming over UDP – use socket slides now.

15 Transmission Control Protocol  Principles of reliable communication  TCP basic notations, 3 way handshake  TCP flow control, congestion control

16 Principles of Reliable data transfer r important in app., transport, link layers r top-10 list of important networking topics! r characteristics of unreliable channel will determine complexity of reliable data transfer protocol (rdt) Transport Layer 16

17 Principles of Reliable data transfer r important in app., transport, link layers r top-10 list of important networking topics! r characteristics of unreliable channel will determine complexity of reliable data transfer protocol (rdt) Transport Layer 17

18 Principles of Reliable data transfer r important in app., transport, link layers r top-10 list of important networking topics! r characteristics of unreliable channel will determine complexity of reliable data transfer protocol (rdt) Transport Layer 18

19 Reliable Data Transfer: Stream stream jargon Application Layer 19 r A stream is a sequence of characters that flow into or out of a process. r An input stream is attached to some input source for the process, eg, keyboard or socket. r An output stream is attached to an output source, eg, monitor or socket.

20 Reliable Communication 20 Transport Layer state 1 state 2 event causing state transition actions taken on state transition event actions Terminology of a State Machine

21 Reliable communication First Model: sender sends, receiver receives. r Is this enough? r When will it work? r When will it not work? Transport Layer 21 Sender sends one packet, then waits for receiver response stop and wait

22 Reliable Communication 22 Transport Layer State 1 state 2 Send Data Data available Stop and Wait – Sender side Received Ack In State 1 Sender can send data In State 2 Sender can receive acknowledge packets Discussion: Why to send back an ack msg? What happens if data is available at state 2? Wait for data Wait for ack

23 channel with bit errors and losses r underlying channel may flip bits in packet m checksum to detect bit errors r underlying channel can also lose packets r the question: how to recover from errors: m acknowledgements (ACKs): receiver explicitly tells sender that pkt received OK m timeout: sender retransmits pkt if doesn’t receive ack within timeout r new mechanisms in: m error detection m receiver feedback: control msg (ACK) rcvr->sender m sender control: timer to understand if to send again. Transport Layer 23

24 Reliable Communication 24 Transport Layer State 1 state 2.a Send Data Data available Stop and Wait with errors/losses - sender Ack received In State 1 Receiver waits for data Wait for data Wait for ack packet or time out state 2.b timeout Send Data Discussion: What does the sender need to do for the retransmission? Process ack

25 This version has a fatal flaw! What happens if ACK corrupted/lost? r sender doesn’t know what happened at receiver! r can’t just retransmit: possible duplicate Handling duplicates: r sender retransmits current pkt if ACK garbled or didn’t arrive r sender adds sequence number to each pkt r receiver discards (doesn’t deliver up) duplicate pkt r receiver must specify seq # of pkt being ACKed Transport Layer 25

26 discussion Sender: r seq # added to pkt r two seq. #’s (0,1) will suffice. Why? r must check if received ACK corrupted r twice as many states m state must “remember” whether “current” pkt has 0 or 1 seq. # Receiver: r must check if received packet is duplicate m state indicates whether 0 or 1 is expected pkt seq # r receiver sends ACK for last pkt received OK m receiver must explicitly include seq # of pkt being ACKed r note: receiver can not know if its last ACK received OK at sender Transport Layer 26

27 Stop & wait in action Transport Layer 27

28 Stop & wait in action Transport Layer 28

29 Performance of stop & wait r Stop & wait works, but performance stinks r ex: 1 Gbps link, 15 ms prop. delay, 8000 bit packet: m U sender : utilization – fraction of time sender busy sending m 1KB pkt every 30 msec -> 33kB/sec thruput over 1 Gbps link m network protocol limits use of physical resources! Transport Layer 29

30 stop-and-wait operation first packet bit transmitted, t = 0 senderreceiver RTT last packet bit transmitted, t = L / R first packet bit arrives last packet bit arrives, send ACK ACK arrives, send next packet, t = RTT + L / R Transport Layer 30

31 Pipelined protocols Pipelining: sender allows multiple, “in-flight”, yet-to- be-acknowledged pkts m range of sequence numbers must be increased m buffering at sender and/or receiver r Two generic forms of pipelined protocols: go-Back-N, selective repeat Transport Layer 31

32 Pipelining: increased utilization first packet bit transmitted, t = 0 senderreceiver RTT last bit transmitted, t = L / R first packet bit arrives last packet bit arrives, send ACK ACK arrives, send next packet, t = RTT + L / R last bit of 2 nd packet arrives, send ACK last bit of 3 rd packet arrives, send ACK Increase utilization by a factor of 3! Transport Layer 32

33 Pipelining Protocol Transport Layer 33 Go-back-N: big picture: r Sender can have up to N unacked packets in pipeline r Rcvr only sends cumulative acks m Doesn’t ack packet if there’s a gap r Sender has timer for oldest unacked packet m If timer expires, retransmit all unacked packets

34 Transport Layer 3-34 Go-Back-N Sender: r k-bit seq # in pkt header r “window” of up to N, consecutive unack’ed pkts allowed r ACK(n): ACKs all pkts up to, including seq # n - “cumulative ACK” m may receive duplicate ACKs (see receiver) r timer for each in-flight pkt r timeout(n): retransmit pkt n and all higher seq # pkts in window

35 Go Back N Transport Layer 35  ACK-only: always send ACK for correctly-received pkt with highest in-order seq # m may generate duplicate ACKs  need only remember expectedseqnum r out-of-order pkt: m discard (don’t buffer) -> no receiver buffering! m Re-ACK pkt with highest in-order seq # Receiver:

36 Transport Layer 3-36 GBN in action

37 Transport Control Protocol Enhanced GBN protocol r Segment structure r reliable data transfer and data transfer issues r flow control r connection management r TCP congestion control Transport Layer 37

38 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r full duplex data: m bi-directional data flow in same connection m MSS: maximum segment size r connection-oriented: m handshaking (exchange of control msgs) init’s sender, receiver state before data exchange r flow controlled: m sender will not overwhelm receiver r point-to-point: m one sender, one receiver r reliable, in-order byte steam: m no “message boundaries” r pipelined: m TCP congestion and flow control set window size r send & receive buffers Transport Layer 38

39 TCP segment structure source port # dest port # 32 bits application data (variable length) sequence number acknowledgement number Receive window Urg data pnter checksum F SR PAU head len not used Options (variable length) URG: urgent data (generally not used) ACK: ACK # valid PSH: push data now (generally not used) RST, SYN, FIN: connection estab (setup, teardown commands) # bytes rcvr willing to accept counting by bytes of data (not segments!) Internet checksum (as in UDP) Transport Layer 39

40 TCP reliable data transfer r TCP creates reliable service on top of IP’s unreliable service r Pipelined segments r Cumulative acks r TCP uses single retransmission timer r The sequence number for a segment is the first byte-stream # of the first byte in the segment. Transport Layer 40

41 TCP sender events: data rcvd from app: r Create segment with seq # r start timer if not already running (think of timer as for oldest unacked segment)  expiration interval: TimeOutInterval timeout: r retransmit segment that caused timeout r restart timer Ack rcvd: r If acknowledges previously unacked segments m update what is known to be acked m start timer if there are outstanding segments Transport Layer 41

42 TCP seq. #’s and ACKs Seq. #’s: m byte stream “number” of first byte in segment’s data ACKs: m seq # of next byte expected from other side m cumulative ACK Q: how receiver handles out-of-order segments m A: TCP spec doesn’t say, - up to implementor Host A Host B Seq=42, ACK=79, data = ‘C’ Seq=79, ACK=43 User types ‘C’ host receives ACK host ACKs receipt of ‘C’ time Transport Layer 42

43 TCP: retransmission scenarios Host A Seq=100, 20 bytes data ACK=100 time premature timeout Host B Seq=92, 8 bytes data ACK=120 Seq=92, 8 bytes data Seq=92 timeout ACK=120 Host A Seq=92, 8 bytes data ACK=100 loss timeout lost ACK scenario Host B X Seq=92, 8 bytes data ACK=100 time Seq=92 timeout SendBase = 100 SendBase = 120 SendBase = 120 Sendbase = 100 Transport Layer 43

44 TCP retransmission scenarios (more) Host A Seq=92, 8 bytes data ACK=100 loss timeout Cumulative ACK scenario Host B X Seq=100, 20 bytes data ACK=120 time SendBase = 120 Transport Layer 44

45 Interactive data flow r Overhead for each packet: 40 bytes (20 TCP header + 20 IP header) to a total of 160 bytes for sending and receiving ‘C’. r If the receiver waits a while, it can piggyback the data packet r Delayed ack: Wait up to 500ms for next segment. If no next segment, send ACK. r Should sender use delayed acks too? [ Stevens figure 19.3] Host A Host B Seq=42, ACK=79, data = ‘C’ Seq=79, ACK=43 Seq=43, ACK=80 User types ‘C’ host ACKs receipt of echoed ‘C’ host ACKs receipt of ‘C’, time simple telnet scenario Transport Layer 45 Seq=79, ACK=43, data = ‘C’ Host echoes back ‘C’

46 Nagle Algorithm [RFC 896] r Quantifying overhead: how much control bytes per data bytes? with piggyback 2/120-> only 1.6% of the bits sent are data. r LANs usually not congested so it might be okay. r Small packets, termed tinygrams over congested WAN – bad news. r New data can’t be sent until outstanding data is acked. r Small amounts of data are collected and sent in a single segment when ack arrives. r Self clocking: the faster the ack comes back, the faster data is sent. Slow links cause fewer segments to be sent. r [Stevens 19.4] Transport Layer 46 Nagle’s alg:

47 TCP ACK generation [RFC 1122, RFC 2581] Event at Receiver Arrival of in-order segment with expected seq #. All data up to expected seq # already ACKed Arrival of in-order segment with expected seq #. One other segment has ACK pending Arrival of out-of-order segment higher-than-expect seq. #. Gap detected Arrival of segment that partially or completely fills gap TCP Receiver action Delayed ACK. Wait up to 500ms for next segment. If no next segment, send ACK Immediately send single cumulative ACK, ACKing both in-order segments Immediately send duplicate ACK, indicating seq. # of next expected byte Immediate send ACK, provided that segment starts at lower end of gap Transport Layer 47

48 Fast Retransmit r Time-out period often relatively long: m long delay before resending lost packet r Detect lost segments via duplicate ACKs. m Sender often sends many segments back-to- back m If segment is lost, there will likely be many duplicate ACKs. r If sender receives 3 ACKs for the same data, it supposes that segment after ACKed data was lost: m fast retransmit: resend segment before timer expires Transport Layer 48

49 Host A timeout Host B time X resend 2 nd segment Figure 3.37 Resending a segment after triple duplicate ACK Transport Layer 49

50 event: ACK received, with ACK field value of y if (y > SendBase) { SendBase = y if (there are currently not-yet-acknowledged segments) start timer } else { increment count of dup ACKs received for y if (count of dup ACKs received for y = 3) { resend segment with sequence number y } Fast retransmit algorithm: a duplicate ACK for already ACKed segment fast retransmit Transport Layer 50

51 TCP Round Trip Time and Timeout Q: how to set TCP timeout value? r longer than RTT m but RTT varies r too short: premature timeout m unnecessary retransmissions r too long: slow reaction to segment loss Q: how to estimate RTT?  SampleRTT : measured time from segment transmission until ACK receipt m ignore retransmissions  SampleRTT will vary, want estimated RTT “smoother”  average several recent measurements, not just current SampleRTT Transport Layer 51

52 TCP Round Trip Time and Timeout EstimatedRTT = (1-  )*EstimatedRTT +  *SampleRTT r Exponential weighted moving average r influence of past sample decreases exponentially fast  typical value:  = Transport Layer 52 [Retransmission example in Stevens 21.1]

53 Example RTT estimation: Transport Layer 53

54 TCP Round Trip Time and Timeout Setting the timeout  EstimtedRTT plus “safety margin”  large variation in EstimatedRTT -> larger safety margin r first estimate of how much SampleRTT deviates from EstimatedRTT: TimeoutInterval = EstimatedRTT + 4*DevRTT DevRTT = (1-  )*DevRTT +  *|SampleRTT-EstimatedRTT| (typically,  = 0.25) Then set timeout interval: Transport Layer 54

55 TCP Flow Control r receive side of TCP connection has a receive buffer: r speed-matching service: matching the send rate to the receiving app’s drain rate r app process may be slow at reading from buffer sender won’t overflow receiver’s buffer by transmitting too much, too fast flow control Transport Layer 55

56 TCP Flow control: how it works (Suppose TCP receiver discards out-of-order segments)  spare room in buffer = RcvWindow = RcvBuffer-[LastByteRcvd - LastByteRead]  Rcvr advertises spare room by including value of RcvWindow in segments  Sender limits unACKed data to RcvWindow m guarantees receive buffer doesn’t overflow r Discuss: [Stevens 20.1, 20.6] Transport Layer 56

57 TCP Connection Management Recall: TCP sender, receiver establish “connection” before exchanging data segments r initialize TCP variables: m seq. #s  buffers, flow control info (e.g. RcvWindow ) r client: connection initiator Socket clientSocket = new Socket("hostname","port number"); r server: contacted by client Socket connectionSocket = welcomeSocket.accept(); Three way handshake: Step 1: client host sends TCP SYN segment to server m specifies initial seq # m no data Step 2: server host receives SYN, replies with SYNACK segment m server allocates buffers m specifies server initial seq. # Step 3: client receives SYNACK, replies with ACK segment, which may contain data Transport Layer 57

58 Delayed Duplicates Problem r A user asks for a connection r Due to congestion the packet is caught in a traffic jam r The user asks again for the connection r Destination accepts 2 nd connection request r User sends info to dest. r Info gets caught in a traffic jam r User sends info again r Dest receives the info r Connection is closed by both parties r The original connection request and user info find their way to the destination. Transport Layer 58

59 TCP Connection Management (cont.) Closing a connection: client closes socket: clientSocket.close(); Step 1: client end system sends TCP FIN control segment to server Step 2: server receives FIN, replies with ACK. Closes connection, sends FIN. client FIN server ACK FIN close closed timed wait Transport Layer 59

60 TCP Connection Management (cont.) Step 3: client receives FIN, replies with ACK. m Enters “timed wait” - will respond with ACK to received FINs Step 4: server, receives ACK. Connection closed. Note: with small modification, can handle simultaneous FINs. client FIN server ACK FIN closing closed timed wait closed Transport Layer 60

61 TCP Connection Management (cont) TCP client lifecycle TCP server lifecycle Transport Layer 61 [Tanenbaum 6.33]

62 Principles of Congestion Control Congestion: r informally: “too many sources sending too much data too fast for network to handle” r different from flow control! r manifestations: m lost packets (buffer overflow at routers) m long delays (queueing in router buffers) r a top-10 problem! Transport Layer 62

63 Causes/costs of congestion: scenario 1 r two senders, two receivers r one router, infinite buffers r no retransmission r large delays when congested r maximum achievable throughput unlimited shared output link buffers Host A in : original data Host B out Transport Layer 63

64 Causes/costs of congestion: scenario 2 r one router, finite buffers r sender retransmission of lost packet finite shared output link buffers Host A in : original data Host B out ' in : original data, plus retransmitted data Transport Layer 64

65 Causes/costs of congestion: scenario 2 r always: (goodput) r “perfect” retransmission only when loss: r retransmission of delayed (not lost) packet makes larger (than perfect case) for same in out = in out > in out “costs” of congestion: r more work (retrans) for given “goodput” r unneeded retransmissions: link carries multiple copies of pkt R/2 in out b. R/2 in out a. R/2 in out c. R/4 R/3 Transport Layer 65

66 Causes/costs of congestion: scenario 3 r four senders r multihop paths r timeout/retransmit in Q: what happens as and increase ? in finite shared output link buffers Host A in : original data Host B out ' in : original data, plus retransmitted data Transport Layer 66

67 Causes/costs of congestion: scenario 3 Another “cost” of congestion: r when packet dropped, any “upstream transmission capacity used for that packet was wasted! HostAHostA HostBHostB o u t Transport Layer 67

68 TCP congestion control: additive increase, multiplicative decrease r Approach: increase transmission rate (window size), probing for usable bandwidth, until loss occurs m additive increase: increase CongWin by 1 MSS every RTT until loss detected m multiplicative decrease: cut CongWin in half after loss time congestion window size Saw tooth behavior: probing for bandwidth Transport Layer 68

69 TCP Congestion Control: details r sender limits transmission: LastByteSent-LastByteAcked  CongWin r Roughly,  CongWin is dynamic, function of perceived network congestion How does sender perceive congestion? r loss event = timeout or 3 duplicate acks  TCP sender reduces rate ( CongWin ) after loss event three mechanisms: m AIMD m slow start m conservative after timeout events rate = CongWin RTT Bytes/sec Transport Layer 69

70 TCP Slow Start  When connection begins, CongWin = 1 MSS m Example: MSS = 500 bytes & RTT = 200 msec m initial rate = 20 kbps r available bandwidth may be >> MSS/RTT m desirable to quickly ramp up to respectable rate r When connection begins, increase rate exponentially fast until first loss event Transport Layer 70

71 TCP Slow Start (more) r When connection begins, increase rate exponentially until first loss event:  double CongWin every RTT  done by incrementing CongWin for every ACK received r Summary: initial rate is slow but ramps up exponentially fast Host A one segment RTT Host B time two segments four segments Transport Layer 71

72 Refinement: inferring loss r After 3 dup ACKs:  CongWin is cut in half m window then grows linearly r But after timeout event:  CongWin instead set to 1 MSS; m window then grows exponentially m to a threshold, then grows linearly  3 dup ACKs indicates network capable of delivering some segments  timeout indicates a “more alarming” congestion scenario Philosophy: Transport Layer 72

73 Refinement Q: When should the exponential increase switch to linear? A: When CongWin gets to 1/2 of its value before timeout. Implementation: r Variable Threshold r At loss event, Threshold is set to 1/2 of CongWin just before loss event Transport Layer 73

74 Summary: TCP Congestion Control  When CongWin is below Threshold, sender in slow-start phase, window grows exponentially.  When CongWin is above Threshold, sender is in congestion-avoidance phase, window grows linearly.  When a triple duplicate ACK occurs, Threshold set to CongWin/2 and CongWin set to Threshold.  When timeout occurs, Threshold set to CongWin/2 and CongWin is set to 1 MSS. Transport Layer 74

75 TCP sender congestion control StateEventTCP Sender ActionCommentary Slow Start (SS) ACK receipt for previously unacked data CongWin = CongWin + MSS, If (CongWin > Threshold) set state to “Congestion Avoidance” Resulting in a doubling of CongWin every RTT Congestion Avoidance (CA) ACK receipt for previously unacked data CongWin = CongWin+MSS * (MSS/CongWin) Additive increase, resulting in increase of CongWin by 1 MSS every RTT SS or CALoss event detected by triple duplicate ACK Threshold = CongWin/2, CongWin = Threshold, Set state to “Congestion Avoidance” Fast recovery, implementing multiplicative decrease. CongWin will not drop below 1 MSS. SS or CATimeoutThreshold = CongWin/2, CongWin = 1 MSS, Set state to “Slow Start” Enter slow start SS or CADuplicate ACK Increment duplicate ACK count for segment being acked CongWin and Threshold not changed Transport Layer 75

76 TCP throughput r What’s the average throughout of TCP as a function of window size and RTT? m Ignore slow start r Let W be the window size when loss occurs. r When window is W, throughput is W/RTT r Just after loss, window drops to W/2, throughput to W/2RTT. r Average throughout:.75 W/RTT Transport Layer 76

77 TCP Futures: TCP over “long, fat pipes” r Example: 1500 byte segments, 100ms RTT, want 10 Gbps throughput r Requires window size W = 83,333 in-flight segments r Throughput in terms of loss rate:  ➜ L = 2· Wow r New versions of TCP for high-speed Transport Layer 77

78 Fairness goal: if K TCP sessions share same bottleneck link of bandwidth R, each should have average rate of R/K TCP connection 1 bottleneck router capacity R TCP connection 2 TCP Fairness Transport Layer 78

79 Why is TCP fair? Two competing sessions: r Additive increase gives slope of 1, as throughout increases r multiplicative decrease decreases throughput proportionally R R equal bandwidth share Connection 1 throughput Connection 2 throughput congestion avoidance: additive increase loss: decrease window by factor of 2 congestion avoidance: additive increase loss: decrease window by factor of 2 Transport Layer 79

80 Fairness (more) Fairness and UDP r Multimedia apps often do not use TCP m do not want rate throttled by congestion control r Instead use UDP: m pump audio/video at constant rate, tolerate packet loss r Research area: TCP friendly Fairness and parallel TCP connections r nothing prevents app from opening parallel connections between 2 hosts. r Web browsers do this r Example: link of rate R supporting 9 connections; m new app asks for 1 TCP, gets rate R/10 m new app asks for 11 TCPs, gets R/2 ! Transport Layer 80

81 Chapter 3: Summary r principles behind transport layer services: m multiplexing, demultiplexing m reliable data transfer m flow control m congestion control r instantiation and implementation in the Internet m UDP m TCP After that: r leaving the network “edge” (application, transport layers) r into the network “core” Transport Layer 81 Next: r Socket programming over TCP

82 Connection-oriented demux r TCP socket identified by 4-tuple: m source IP address m source port number m dest IP address m dest port number r recv host uses all four values to direct segment to appropriate socket r Server host may support many simultaneous TCP sockets: m each socket identified by its own 4-tuple r Web servers have different sockets for each connecting client m non-persistent HTTP will have different socket for each request Transport Layer 82

83 Connection-oriented demux (cont) Client IP:B P1 client IP: A P1P2P4 server IP: C SP: 9157 DP: 80 SP: 9157 DP: 80 P5P6P3 D-IP:C S-IP: A D-IP:C S-IP: B SP: 5775 DP: 80 D-IP:C S-IP: B Transport Layer 83

84 Connection-oriented demux: Threaded Web Server Client IP:B P1 client IP: A P1P2 server IP: C SP: 9157 DP: 80 SP: 9157 DP: 80 P4 P3 D-IP:C S-IP: A D-IP:C S-IP: B SP: 5775 DP: 80 D-IP:C S-IP: B Transport Layer 84


Download ppt "Transport Layer By Ossi Mokryn, Based also on slides from: the Computer Networking: A Top Down Approach Featuring the Internet by Kurose and Ross."

Similar presentations


Ads by Google