networking n.
Skip this Video
Loading SlideShow in 5 Seconds..
Networking PowerPoint Presentation


259 Views Download Presentation
Download Presentation


- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. Networking Transport Layer

  2. Networking – Transport Layer • The Transport Layer is part of the Internet Protocol stack • The Transport Layer sits between the Application Layer and the Network Layer • The Transport Layer provides communication services to the application processes in a network

  3. Networking – Transport Layer • Main properties of Transport Layer • Provides logical (not physical) connection between processes • Implemented in end system (processes), not in e.g. routers • The data unit at the Transport Layer level is a segment, not a full message • Two common Transport layer protocls are TCP and UDP

  4. Networking – Transport Layer • Transport Layer vs. Network Layer • Transport Layer transports data between processes running of different hosts • Network Layer transports data between hosts • A Transport Layer protocol can offer services that the underlying Network Layer protocol does not offer

  5. Networking – Transport Layer • Multiplexing/demultiplexing Transport Layer Network Layer

  6. Networking – Transport Layer • Multiplexing/demultiplexing • How does it work in the letter analogy? Source person Jim Carpenter High Road 112 2209 Smallville Sue Miller School Street 207 8865 Silvertown A stamp… Source location Destinationperson Destinationlocation

  7. Networking – Transport Layer • Multiplexing/demultiplexing • Remember • A host is specified by its IP address • A process is specified by its port number Transport Layer segment

  8. Networking – Transport Layer • Client side process • ”I run on port 55” • ”I wish to talk to a server running on port 23” • Remember IP address of client host is also included in the segment (at IP level) 55 23

  9. Networking – Transport Layer • Server side process • ”I run on port 23” • ”I wish to reply to the client running on port 55” 23 55

  10. Networking – Transport Layer • What if two different clients – running on different hosts – use the same port number (for different processes)? • No problem, since the two hosts will have different IP addresses! • It is the combination of IP address and port number that must be unique (just as name and address for a plain letter…)

  11. Networking – Transport Layer • Specific Transport Layer protocols – UDP • UDP – User Datagram Protocol • In the context of the Internet Protocol Stack, it is built on top the IP Network Protocol • Adds just two ”services” to the IP protocol • Multiplexing/demultiplexing • Lightweight data validation

  12. Networking – Transport Layer

  13. Networking – Transport Layer • Multiplexing/demultiplexing is done using the source and destination port numbers, as explained previously • Length field specifies the length (in bytes) of the actual data • Checksum field is used for data validation

  14. Networking – Transport Layer • Data validation uses a so-called checksum calculation • Data is binary – consists of 0s and 1s (bits) • Binary numbers can be added together, just as decimal numbers

  15. Networking – Transport Layer • Adding two 16-bit binary numbers also produces a 16-bit binary number • All the 16-bit ”words” in the data fields are added together, producing a single 16-bit binary number • The 16-bit binary number in the checksum field is now chosen in a clever way…

  16. Networking – Transport Layer 0100101011011101 + (16-bit checksum) 1111111111111111

  17. Networking – Transport Layer • This is 1-complement checksum • If we add… • All the 16-words of the data field, plus • The 16-bit checksum • …we always get 1111111111111111

  18. Networking – Transport Layer • Server side • Given the data, calculate the corresponding checksum • Put the checksum in the checksum field • Send to client • Clientside • Receive from server • Add up all data and the chekcsum • If the result is not 1111111111111111, we have discovered an error!

  19. Networking – Transport Layer • How does UDP handle a data error…? • Some UDP implementations simply throw away damaged segments • Other deliver them to the application, with an indicating that the data is damaged • Higher-level error handling must be done by the receiving application!

  20. Networking – Transport Layer • Specific Transport Layer protocols – TCP • TCP – Transmission Control Protocol • In the context of the Internet Protocol Stack, it is built on top the IP Network Protocol • TCP adds significant non-trivial services to the IP protocol!

  21. Networking – Transport Layer • Main TCP features • Reliable data transfer – data is guaranteed to arrive without errors, and in the correct order • Flow control – match the transmission speed of sender and receiver • Congestion control – makes sure that no single connection is allowed to flood the network with data traffic (a benefit for the Internet as a whole, not so much for the individual connection…)

  22. Networking – Transport Layer • How can you implement ”reliable data transfer”? • A complex task! • Not only at the Transport Layer level, but also at the ”deeper” levels • We will explore the problem in general

  23. Networking – Transport Layer • Abstract look at data transfer: Application Layer Sender Reliable channel Receiver Reliable! Data Transport Layer

  24. Networking – Transport Layer • Data transfer seen from the Transport Layer: Transport Layer Sender Unreliable channel Receiver Reliable! Data Network Layer

  25. Networking – Transport Layer • Levels of unreliability • Level 0 - perfect reliability (no loss of data packets, no errors in data packets) • Level 1 - partial reliability (no loss of data packets, possible errors in data packets) • Level 2 – no reliability (possible loss of data packets, possible errors in data packets)

  26. Networking – Transport Layer • Level 0 – perfect reliability • Essentially trivial to implement • Data from the Application Layer is divided into segments, headers are added, and data is sent • Similarly, data is extracted on the server side, and handed to the Application Layer

  27. Networking – Transport Layer • Level 1 – Partial reliability • Packets are guaranteed to arrive at their destination… • …but the content of a packets may be damaged • We need a mechanism for retransmission of a damaged packet

  28. Networking – Transport Layer • Main steps involved • Checking whether or not (the data in) a packet is damaged • Informing the sender of the packet whether or not the received packet was intact • Known as an ARQ protocol (Automatic Repeat reQuest)

  29. Networking – Transport Layer • Error detection • We already saw an example (1-complement checksum) • More sophisticated techniques exist (error detection and correction) • Exact technique not important here • All techniques require sending extra data

  30. Networking – Transport Layer • Receiver feedback • Receiver must provide explicit feedback to the sender, about the successful/failed outcome of receiving a packet • Receiver sends a packet back to sender • ACK (acknowledge) packet – all went well • NAK (not acknowledge) packet - failure

  31. Networking – Transport Layer • Step 1: Send data packet n from Sender to Receiver Receiver Sender Data (n)

  32. Networking – Transport Layer • Step 2a: Receiver finds data to be OK Receiver Sender Data (n)

  33. Networking – Transport Layer • Step 3a: Receiver sends ACK packet to Sender Receiver Sender ACK

  34. Networking – Transport Layer • Step 4a: Receiver gets ACK packet Receiver Sender ACK

  35. Networking – Transport Layer • Step 1 (again): Send next piece of data from Sender to Receiver Receiver Sender Data (n+1)

  36. Networking – Transport Layer • Step 2b: Receiver finds data to be damaged Receiver Sender Data (n)

  37. Networking – Transport Layer • Step 3b: Receiver sends NAK packet to Sender Receiver Sender NAK

  38. Networking – Transport Layer • Step 4b: Receiver gets NAK packet Receiver Sender NAK

  39. Networking – Transport Layer • Step 1 (again): Send same piece of data from Sender to Receiver Receiver Sender Data (n)

  40. Networking – Transport Layer • Packets are sent in order • Next packet is not sent before the current packet has been correctly received (a stop-and-wait protocol) • Sender thus always knows which data a ACK/NAK packet refers to

  41. Networking – Transport Layer • Can anything go wrong…? • Data packet keeps getting damaged…at some point we must give up (timeout) • The ACK/NAK packets themselves could also become damaged!

  42. Networking – Transport Layer • Possible solutions • Introduce ”acknowledge to acknowledge” packets – hard to decide when to stop… • Better error correction – can only partially solve the problem • Assume the worst – only consider a correctly received ACK packet as meaning ”acknowledge”. Everything else is interpreted as NAK

  43. Networking – Transport Layer • Problematic scenario • Receiver receives data, and confirms it to be OK • Receiver sends ACK to Sender • Sender receives a damaged packet, and interprets this as a NAK (”assume the worst”) • Sender thus decides to to resend data • Receiver gets data. Data is OK, BUT is it • Resent data, or • New data?

  44. Networking – Transport Layer • To resolve the problem, we intro-duce a data packet sequence number • All data packets are marked with an incremental sequence number • Receiver keeps track of the sequence number of the last correctly received package

  45. Networking – Transport Layer • Step 1: Send data packet n from Sender to Receiver Receiver Sender Data (n)

  46. Networking – Transport Layer • Step 2: Receiver finds data to be OK Receiver Sender Data (n)

  47. Networking – Transport Layer • Step 3: Receiver sends ACK packet to Sender, and remembers sequence number n Receiver Sender ACK

  48. Networking – Transport Layer • Step 4: Receiver gets damaged ACK packet n Receiver Sender !C¤

  49. Networking – Transport Layer • Step 5: Resend data packet n from Sender to Receiver n Receiver Sender Data (n)

  50. Networking – Transport Layer • Step 6: Receiver looks at sequence number, and discovers that this is resent data n Receiver Sender Data (n)