Successfully reported this slideshow.

Part 4 : reliable transport and sharing resources

0

Share

Loading in …3
×
1 of 54
1 of 54

Part 4 : reliable transport and sharing resources

0

Share

Download to read offline

Slides supporting the "Computer Networking: Principles, Protocols and Practice" ebook. The slides can be freely reused to teach an undergraduate computer networking class using the open-source ebook.

Slides supporting the "Computer Networking: Principles, Protocols and Practice" ebook. The slides can be freely reused to teach an undergraduate computer networking class using the open-source ebook.

More Related Content

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all

Part 4 : reliable transport and sharing resources

  1. 1. Week 4 Reliable transport Sharing resources
  2. 2. Agenda • Reliable transport • Multiplexing • Connection establishment • Data transfer • Connection release • Sharing resources
  3. 3. Multiplexing Server Client Source port : 1234 Destination port: 5678 Request Response Source port : 5678 Destination port: 1234 Source Addr: Client Dest. Addr: Server Source Addr: Server Dest. Addr: Client
  4. 4. Connection table • A server interacts with many different clients and maintains a connection table • This table contains one entry per active connection with its state • Each connection is identified by 4 infos • Client address and port • Server address and port
  5. 5. Agenda • Reliable transport • Multiplexing • Connection establishment • Data transfer • Connection release • Sharing resources • Security principles
  6. 6. Coping with delayed segments • How to deal with delayed segments ? • Network level guarantee • No packet will survive more than MSL seconds inside the network • Transport entities use on a local clock to detect duplicated connection establishment requests
  7. 7. Three way handshake CR (seq=x) CA (seq=y, ack=x) CA (seq=x, ack=y) Sequence number x read from local transport clock Local state : Connection to B : - Wait for ack for CR (x) - Start retransmission timer Sequence number y read from local transport clock CA sent to ack CR Local state : Connection to A : - Wait for ack for CA(y) Received CA acknowledges CR Send CA to ack received CA Local state : Connection to B : - established - current_seq = x The sequence numbers used for the data segments will start from x The sequence numbers used for the data segments will start from y D(x) D(y) Local state : Connection to A : - established - current_seq=y Connection established Connection established Host A Host B
  8. 8. Client FSM Connect.req Send CR Timer expires Send CR Recvd REJECT Disconnect.ind Recvd(CA) Connect.conf / Send CA Recvd REJECT Disconnect.ind In any state, a Disconnect.ind (abrupt) -> Send REJECT and transition to red state
  9. 9. Server FSM Recvd (CR) Connect.ind Connect.resp Send CA Recvd REJECT Disconnect.ind Recvd REJECT Disconnect.ind Recvd CA In any state, a Disconnect.ind (abrupt) -> Send REJECT and transition to red state Recvd CR Recvd CR Send CA
  10. 10. Three way handshake (2) CA (seq=y, ack=z) CR (seq=z) REJECT (ack=y) Connection cancelled No connection is established Host A Host B Sequence number y read from local transport clock Acknowledges CR segment Local state : Connection to A : - Wait for ack for CA(y) Local state : No connection to B Send REJECT to cancel connection establishment
  11. 11. Three way handshake (3) CR (seq=z) Current state does not contain a CR with seq=x REJECT (ack=y) Connection established CR (seq=z) Retransmission timer expires CA (seq=w, ack=z) CA (seq=z, ack=w) CA (seq=y, ack=x) Sequence number z read from local transport clock Local state : Connection to B : - Wait for ack for CR (z) - Start retransmission timer Host A Host B Current state does not contain a segment with seq=y REJECT ignored Sequence number w read from local transport clock CA sent to ack CR Local state : Connection to A : - Wait for ack for CA(w) Received CA acknowledges CR Send CA to ack received CA Local state : Connection to B : - established - current_seq = z
  12. 12. Three way handshake (4) Invalid CA received from A Send REJECT CA (seq=w, ack=z) CR (seq=z) CA (seq=z, ack=y) REJECT (ack=w) REJECT (ack=z) Sequence number w read from local transport clock Acknowledges CR segment Local state : Connection to A : - Wait for ack for CA(w) Current state does not contain a CR with seq=z Host A Host B No connection is established
  13. 13. Agenda • Reliable transport • Multiplexing • Connection establishment • Data transfer • Connection release • Sharing resources • Security principles
  14. 14. Reliable data transfer • What are the main differences with the reliable protocols of the datalink layer ? • Segments can be reordered • Buffers can change dynamically • Bytestream service
  15. 15. Buffer management • A transport entity serves a variable number of applications with a limited buffer • The buffer/window allocated to a given connection may need to change dynamically as connections start and stop
  16. 16. Buffer management A B Data.req(a) Data.ind(a) D(0,a) C(OK,0, w=1) C(OK,0,w=3) Data.req(c) D(2,c) 2 new buffers become available Data.req(b) Data.ind(b) D(1,b) 0 1 2 3 0 1 2 3 0 1 2 3 C(OK,1,w=3) Rwin=1 0 1 2 3 Swin=3, rwin=1 0 1 2 3 Swin=3, rwin=1 0 1 2 3 Swin=3, rwin=1 0 1 2 3 Swin=3, rwin=1 Swin=3, rwin=3 0 1 2 3 Data.req(d) D(3,d) 0 1 2 3
  17. 17. Buffer management A B Data.req(b) Data.ind(a) Data.req(a) D(0,a) C(OK,0, w=0) 2 new buffers are available 0 1 2 3 Rwin=1 0 1 2 3 Swin=3, rwin=1 0 1 2 3 Swin=3, rwin=1 0 1 2 3 Receiver cannot handle segment immediately C(OK,0,w=3) Lost segment 0 1 2 3 Swin=3, rwin=0 Window blocked No transmission possible Waits for control segment Waits for data segment How to recover from deadlock ? Persistence timer on receiver, resend control segment after timer expiration
  18. 18. Delayed segments A B D(1,b) Timer expiration Retransmission D(1,b) D(3,d) C(OK,0) C(OK,0) C(OK,3) C(OK,0) C(OK,1) D(0,e) Data.ind(e) Data.ind(b) !!!!!!!!!!!! D(0,a) Data.req(a) Data.ind(a) Data.ind(b) Data.ind(e)
  19. 19. Delayed segments • How to deal with them ? • Packets cannot live more than MSL seconds inside the network • Only one segment carrying sequence number x can be transmitted during MSL seconds • upper bound on maximum throughput
  20. 20. Bidirectional transfer • How to efficiently carry data in both directions ?
  21. 21. Piggybacking A B Data.req(a) Data.ind(a) D(0,0,a) Data.req(b) D(1,0,b) Error Discarded Data.req(c) D(2,0,c) Segment -> buffer Retransmission Data.ind(b) D(1,5,b) Data.ind(c) Data.req(d) D(3,6,d) Data.ind(d) C(OK,2) C(OK,3) Data.req(x) D(5,0,w) Data.req(w) Data.ind(w) D(6,0,x) Data.ind(x) D(5,0,w) acks D(0,0,a)
  22. 22. Bytestream • How to provide a bytestream service ?
  23. 23. Byte stream service (2) A B Data.req(ijkl) Data.req(mnop) Data.req(abcdef) Data.ind(ab) D(0,ab) C(OK,1) C(OK,1) D(2,cd) Lost segment D(4,ef) Placed in buffer Data.ind(cdef) D(2,cd) Expiration timer Retransmission D(6,ijklmnop) Data.ind(ijklmnop) C(OK,5) C(OK,13)
  24. 24. Agenda • Reliable transport • Multiplexing • Connection establishment • Data transfer • Connection release • Sharing resources • Security principles
  25. 25. Connection release • Graceful release • Data transfer finished and connection must be terminated • Abrupt release • Something went wrong and the connection must be closed immediately • Data can be lost !
  26. 26. Graceful release D(‘a’,1233) DISCONNECT.req (A-B) DISCONNECT.ind(A-B) ACK,1234 DISCONNECT.conf(A-B) ACK,4567 DISCONNECT.conf(A-B) DISCONNECT.req(B-A) DISCONNECT.ind(B-A) DR(B-A,4567) Outgoing connection (A->B) closed Incoming connection (A->B) closed Incoming connection (B->A) closed Outgoing connection (B->A) closed DR(A-B,1234) DATA.ind(‘a’)
  27. 27. Graceful release (2) D(‘a’,1230) DISCONNECT.req (A-B) DISCONNECT.ind(A-B) ACK(1230) DISCONNECT.conf(A-B) Outgoing connection (A->B) closed Incoming connection (A->B) closed DR(A-B,1234) DATA.ind(‘a’) D(‘bcd’,1231) ACK(1230) DATA.ind(‘bcd’) ACK(1234)
  28. 28. Abrupt release CR (seq=z) CA (seq=w, ack=z) CA (seq=z, ack=w) D Data.req() Data.ind() Disc.req() D Data.req() DR Disc.req() Connection closed Connection closed This segment will not be delivered !
  29. 29. Agenda • Reliable transport • Sharing resources • Which resources need to be shared • Medium Access Control • Congestion Control
  30. 30. Network resources • What are the resources that are shared by multiple users inside a network ?
  31. 31. Sharing bandwidth • Several nodes on a single link
  32. 32. Sharing bandwidth • Congested network
  33. 33. Agenda • Reliable transport • Sharing resources • Which resources need to be shared • Medium Access Control • Congestion Control
  34. 34. How to share access to a link ? • Deterministic solutions • Probabilistic solutions
  35. 35. Time Division Multiplexing
  36. 36. ALOHA
  37. 37. Agenda • Reliable transport • Sharing resources • Which resources need to be shared • Medium Access Control • Congestion Control
  38. 38. Adapting to different bandwidth What is the round-trip-time in milliseconds this network if A sends 10,000 bits segments, all links are 1 m long and B returns 100 bits acks ? If A sends four 10,000 bits segments in a row, after how many msec will it receive the last
  39. 39. Self-clocking
  40. 40. The congestion problem • If R1 has a buffer of five 10,000 bits long packets, how many packets will be dropped if A and B send a burst of ten packets at line rate ?
  41. 41. Fairness • What is the final objective of congestion control ? • On a single link • Fair share • In a large network • Max-min fairness
  42. 42. Max-min fairness • a max-min allocation of bandwidth is an allocation of bandwidth which maximises the allocation of bandwidth to the sources receiving the smallest allocation • a max-min fair allocation is such that in order to increase the bandwidth allocated to one source, it is necessary to decrease the bandwidth allocated to another source which already receives a lower allocation
  43. 43. Max-min fairness • a max-min allocation maximises the allocation of bandwidth to the sources receiving the smallest allocation • Property • to increase the bandwidth allocated to one source, it is necessary to decrease the bandwidth allocated to another source which already receives a lower allocation
  44. 44. Example • Max-min fair bandwidth allocation R R R R R 1000 Mbps 100 Mbps S1 S2 S3 S4 S5 S6 S7 S8 D1 D3 D4 D2 D5 D6 D7 D8 Link1 Link2 Link3 Link4
  45. 45. How to achieve max-min fairness ? • Two possible approaches • Modify the routers to reach max-min fairness • Modify the endhosts to reach max-min fairness
  46. 46. How to detect congestion ? • Packet losses • Increased delay • Routers add information to packets • Forward binary feedback • Backward binary feedback • Rate feedback
  47. 47. Congestion control
  48. 48. Congestion control • Additive Increase / Multiplicative Decrease # Additive Increase Multiplicative Decrease if congestion : rate=rate*betaC # MD, betaC<1 else rate=rate+alphaN # AI
  49. 49. Simple Router output port Buffer Input links Output link Buffer acceptance accepts or rejects incoming packets
  50. 50. Router output port Q[1] Q[2] Q[3] Q[N] Flow identification Input links Output link Flow identification Identifies the TCP/UDP flow to which the arriving packet belongs Buffer acceptance accepts or rejects incoming packets Queuing strategy Logical organization of the router's buffers Scheduler Chooses the packet to be transmitted first on the output link
  51. 51. Round robin Flow 2 Flow 1 Flow 3 Flow 4 Flow 5 Flow 1 Flow 2 Flow 3 Flow N Scheduler : F1 F2 F3 F4 FN
  52. 52. Round robin • If the RR scheduler starts with queue1 and serves them in numerical order, what is the ordering of the packets on the output link ? A B D E F G Queue 1 Queue 2 Queue 3
  53. 53. Example F1 F2 F3 Flow2 (L=2) Flow1(L=1) Flow3 (L=1) F1 F2 F3 Flow1 and Flow3 send packets of size 1 Flow 2 sends packets of size 2
  54. 54. Round-Robin • Advantage • Can provide fairness independently of the characteristics of the flows • Drawback • Difficult to scale to a very large number of flows

Editor's Notes

  • In this example, the duplicate CR is likely to be a previous retransmission of the CR that was delayed in the network.
  • MSL means Maximum Segment Lifetime
  • How to determine a max-min fair bandwidth allocation for a given network ?

    Algorithm [Bertsekas & Gallager, Data Networks, 2nd edition, Prentice Hall 1992]

    First start with an allocation of 0 Mbps for each source
    Then equally increment the allocation to each source until one link becomes saturated. At this point, each source which uses the saturated link receives an allocation equal to the bandwidth of this saturated link divided by the number of sources using this bottleneck link.
    Next, the allocation of all the sources which do not use a saturated link is equally incremented until another link becomes saturated.
    The algorithm continues from step to step, always incrementing the allocation of the sources which do not use a saturated link, until all sources use at least one of the saturated links.
  • ×