5 sharing-app

1,308 views

Published on

Fifth week of the Computer Networking : Principles, Protocols and Practice class at UCL

Published in: Engineering
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,308
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
124
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • The value T is defined in the standard, but a detailed discussion of this value is outside the scope of this presentation.
  • 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.
  • UDP is defined in
    J. Postel, User Datagram Protocol. RFC768, August 1980
    It will be described in more details later
  • TCP is defined in
    J. Postel, Transmission Control Protocol, RFC793, September 1981
    It will be described in more details later
  • The RR MX were proposed in
    C. Partridge. Mail routing and the domain system. Request for Comments 974, Internet Engineering Task Force, January 1986.
    A complete list of DNS RR may be found at
    http://www.its.uq.edu.au/tn-0011
  • 5 sharing-app

    1. 1. Week 5 Sharing resources Internet applications
    2. 2. Agenda • Sharing resources • Medium Access Control • Congestion Control • Internet applications
    3. 3. ALOHA N=1; while ( N<= max) do send frame; wait for ack on return channel or timeout: if ack on return channel exit while; else /* timeout */ /* retransmission is needed */ wait for random time; N=N+1; end do /* too many attempts */
    4. 4. CSMA N=1; while ( N<= max) do wait until channel becomes free; send frame immediately; wait for ack or timeout: if ack received exit while; else /* timeout */ /* retransmission is needed */ N=N+1; end do /* too many attempts */
    5. 5. CSMA/CD • Basic solution N=1; while ( N<= max) do wait until channel becomes free; send frame and listen; wait until (end of frame) or (collision) if collision detected stop transmitting; /* after a special jam signal */ else /* no collision detected */ wait for interframe delay; exit while; N=N+1; end do /* too many attempts */
    6. 6. Example A B Start of frame 1 Frame is propagated on LAN (5 microsecond per kilometer) 2 Frame stops at left side and first bit reaches B 3 4 Frame leaves the LAN
    7. 7. Collisions A B Frame starts at A and B almost at the same time 1 2 Collision : at this point on the shared medium, it is impossible to decode the signal A detects the collision and stops transmitting its frame 3
    8. 8. Can we detect all collisions ? A B A and B send a small frame almost at the same time 1 The two frame collide in the middle of the medium 2 A did not notice any collision B did not notice any collision They both consider that their frames were received correctly 3
    9. 9. Worst case A B Start of 1 the frame sent by A 3 After t seconds, A’s frame reaches B A time t-e, B starts to transmit its own frame B notices the collision immediately and stops transmitting A detects collision at time t+t-e 2
    10. 10. How to detect all collisions ? • All nodes must always transmit during at least the two way delay (2∗τ) • If bandwidth is fixed => minimum frame size
    11. 11. How to react after collision ? • Exponential backoff • Wait random time after collision • Divide time in slots Backoff (slot = (2∗τ)) • 1st collision : wait 0 or 1 slot • 2nd collision :wait 0, 1,2 or 3 slots • ith collision : wait 0..2i-1 slots
    12. 12. CSMA/CD • Final solution N=1; while ( N<= max) do wait until channel becomes free; send frame and listen; wait until (end of frame) or (collision) if collision detected stop transmitting; /* after a special jam signal */ k = min (10, N); r = random(0, 2k – 1); wait for r time slots; else /* no collision detected */ wait for interframe delay; exit while; N=N+1; end do /* too many attempts */
    13. 13. CSMA/CA • A MAC for wireless networks • Cannot always detect collisions • Improvements to CSMA • Initial delay to transmit (EIFS) • Min. delay between frames (DIFS) • Delay between frame and ack (SIFS)
    14. 14. CSMA/CA : receiver While (true) { Wait for data frame; if not(duplicate) { deliver (frame) } wait during SIFS; send ack (frame) ; }
    15. 15. CSMA/CA : sender N=1; while ( N<= max) do if (previous frame corrupted) { wait until channel free during t>=EIFS; } else { wait until endofframe; wait until channel free during t>=DIFS; } send data frame ; wait for ack or timeout: if ack received exit while; else /* timeout retransmission is needed */ N=N+1; end do /* too many attempts */
    16. 16. Example A B C DIFS Data frame Busy SIFS ACK frame DIFS Data frame
    17. 17. Collisions A B C DIFS DIFS Data frame Busy Busy Data frame Timeout Timeout Data frame Busy Data frame
    18. 18. CSMA/CA : sender N=1; while ( N<= max) do if (previous frame corruped) { wait until channel free during t>=EIFS; } else { wait until endofframe; wait until channel free during t>=DIFS; } backoff_time = int(random[0,min(255,7*2N-1)])*T wait(channel free during backoff_time) send data frame ; wait for ack or timeout: if ack received exit while; else /* timeout retransmission is needed */ N=N+1; } end do
    19. 19. Backoff A B C DIFS DIFS Backoff[0,7] Backoff[0,7] Channel busy! Busy Data frame Data frame SIFS Ack frame Remaining backoff
    20. 20. HIdden station problem A B Hears A and C C Only hears B, not C Hears B, but not A
    21. 21. Hidden station • How to solve it ? • Sender reserves time slot • Receiver confirms the time reservation
    22. 22. RTS/CTS A B C DIFS+Backoff Busy[ 100microsec+ SIFS+ CTS+ SIFS+ ACK ] RTS [100 microsec] SIFS CTS[100microsec] Data [100 microsec] SIFS ACK frame SIFS
    23. 23. Agenda • Sharing resources • Medium Access Control • Congestion Control • Internet applications
    24. 24. Max-min fairness • Fairness definition for networks • a max-min allocation of bandwidth is an allocation of bandwidth which maximises the allocation of bandwidth to the sources receiving the smallest allocation • Property • 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
    25. 25. 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
    26. 26. Example R R D1 D3 D5 R R R 1000 Mbps 100 Mbps S1 S2 S3 S4 S5 S6 S7 S8 • Max-min fair bandwidth allocation D2 D4 D6 D7 D8 Link1 Link2 Link3 Link4
    27. 27. 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
    28. 28. Round robin Flow 1 Flow 2 Flow 3 Flow 4 Flow 5 Flow 1 Flow 2 Flow 3 Flow N Scheduler : F1 F2 FN F4 F3
    29. 29. Example F1 F2 F3 Flow1(L=1) Flow2 (L=2) Flow3 (L=1) F1 F3 F2 Flow1 and Flow3 send packets of size 1 Flow 2 sends packets of size 2
    30. 30. Adapting to different bandwidth
    31. 31. Self-clocking
    32. 32. The congestion problem
    33. 33. How to detect congestion ? • Packet losses • Routers add information to packets • Forward binary feedback • Backward binary feedback • Rate feedback
    34. 34. Congestion control • Additive Increase / Multiplicative Decrease # Additive Increase Multiplicative Decrease if congestion : rate=rate*betaC # MD, betaC<1 else rate=rate+alphaN # AI
    35. 35. Window-based Congestion control # Initialisation cwin = 1 # congestion window measured in segments # Ack arrival if newack : # new ack, no congestion # increase cwin by one every rtt cwin = cwin+ (1/cwin) else: # no increase Congestion detected: cwnd=cwin/2 # only once per rtt
    36. 36. Agenda • Sharing resources • Internet applications • DNS • Email • Web • Remote Procedure Calls
    37. 37. Internet Transport services • Service provided by UDP • Connectionless, unreliable • Service provided by TCP • Connection-oriented • reliable bytestream
    38. 38. Internet addresses • IPv4 • 32 bits, written as a.b.c.d, e.g. 130.104.1.1 • IPv6 • 128 bits, written in hexadecimal notation, e.g. 2001:6a8:3080:1::3
    39. 39. UDP service UDP service Applic. 2 Applic. 1 Identification IP address : 2001:4860:a005::68 Protocol : UDP Port : 53 Identification: IP address : 2001:6a8:3080:2:217:f2ff:fed6:65c0 Protocol : UDP Port : 1234 • Identification of an application • IP address + port number
    40. 40. TCP service TCP service • Identification of an application • IP address + TCP + port number Applic. 2 Applic. 1 Identification IP address: 2001:6a8:3080:1::3 Protocol : TCP Port : 80 Identification: IP address : 2a02:2788:2c4:16f:226:bbff:fe09:266e Protocol : TCP Port : 9876
    41. 41. Agenda • Sharing resources • Internet applications • DNS • Email • Web • Remote Procedure Calls
    42. 42. The Domain Name System • Hierarchy of domain names • Domain Name servers • DNS resolvers
    43. 43. DNS messages Each DNS request contains a number that will be returned in the response by the server to allow the client to match the request. 32 bits Identification Flags 12 bytes Number of questions Number of answers Number of authority Number of additional Questions (variable number of resource records) Answers (variable number of resource records) Authority (variable number of resource records) Additional information (variable number of resource records) lQuestion/Response lRecursive question or not lAuthoritative answer or not lPossible error
    44. 44. DNS Resource Records • A • IPv4 address • AAAA • IPv6 address • NS • Name server
    45. 45. Agenda • Sharing resources • Internet applications • DNS • Email • Web • Remote Procedure Calls
    46. 46. Simplified architecture Alice’s email server b.net ‘s email server Alice@a.net Bob@b.net Alice sends her email to local mail forwarder Alice’s server sends email to b.net’s MX Bob retrieves message from his server
    47. 47. Message format Exp: ABC S.A. Rue de Fer 10 5000 Namur DEF Corp. Steel street 9 WA78 AX London Grande Bretagne From: president@abc.be To: ceo@def.com Subject: Hello Date : 27 Sept. 1999 0901 Dear Sir, Bla Bla Bla... Header Message body
    48. 48. Header format • At least three lines that end with <CRLF> • From: sender@domain • To:recipient@domain • Date: <creation date of message> • Optional fields • Subject: , cc: ,Message-ID:, Received: In- Reply-To: , ... • Header ends with empty line (<CRLF>)
    49. 49. Email protocols SMTP SMTP Email a.net’s SMTP server b.net’s SMTP server retrieval Alice@a.net Bob@b.net
    50. 50. Agenda • Sharing resources • Internet applications • DNS • Email • Web • Remote Procedure Calls
    51. 51. Simplified architecture Client (browser) Server www.machin.be Server www.truc.fr Query Information
    52. 52. Key elements of the web • URL : An addressing scheme that allows to identify any document stored on a server • HTML : An hypertext language to easily write documents with hypertext links • HTTP : An efficient and lightweight protocol to exchange documents • Servers • Clients (browsers)
    53. 53. URL • syntax : <protocol>://<document> • http is the most common • document indicates the server and the location of the document • <user>:<password>@<server>:<port>/ <path>
    54. 54. HTML <HTML> <HEAD> <TITLE>HTML test page</TITLE> </HEAD> <BODY> <IMG SRC="http://www.images.be/logo.gif"> <H1>Web servers from UCL UCL<P></H1> <HR> <UL> <LI><A HREF="http://www.uclouvain.be">UCL</A> <LI><A HREF="http://www.info.ucl.ac.be">CSE Dept.</A> <LI><A HREF="http://www.math.ucl.ac.be">Math</A> </UL> </BODY> </HTML> Header Body Image on remote server First level title External hypertext link
    55. 55. HTTP Client Server Request Method Header CRLF MIME Document Method GET lPOST l... Header contains additional information about request sent by client Response Status line Header CRLF MIME Document Header contains information about server and optional parameters specific to response Success or failure HTTP is a stateless protocol, server does not maintain any state from one request to another
    56. 56. HTTP : Example Request Client Server GET /index.html HTTP/1.1 www.info.ucl.ac.be Host: www.info.ucl.ac.be CRLF Response HTTP/1.1 200 OK Date: Fri, 10 Sep 1999 14:29:19 GMT Server: Apache/1.3.0 (Unix) ApacheJServ/1.0b5 Last-Modified: Thu, 02 Sep 1999 11:50:50 GMT Content-Length: 1224 Content-Type: text/html CRLF <HTML> . . . </HTML>
    57. 57. Agenda • Sharing resources • Internet applications • DNS • Email • Web • Remote Procedure Calls

    ×