networking transport layer
play

Networking: Transport Layer Summer 2013 Cornell University 1 - PowerPoint PPT Presentation

CS 4410 Operating Systems Networking: Transport Layer Summer 2013 Cornell University 1 Today What are the services that the Transport layer offers? Transport Layer Multiplexing-Demultiplexing UDP TCP Reliable


  1. CS 4410 Operating Systems Networking: Transport Layer Summer 2013 Cornell University 1

  2. Today ● What are the services that the Transport layer offers? ● Transport Layer ● Multiplexing-Demultiplexing ● UDP ● TCP ● Reliable transmission ● Congestion Control 2

  3. Protocol Stack Computer B Computer A Message Application Application M Transport Transport Ht M Segment Network Network Datagram Hn Ht M Link Link Frame Hl Hn Ht M Physical Physical 3

  4. Transport Layer ● It offers logical communication between processes. ● Networking processes think that they directly speak to each other. 4

  5. Transport Layer Mission: Transfer a segment from one process to another. ● Services: ● Multiplexing – Demultiplexing ● Error Detection ● Reliable data transfer ● – It takes care of packet loss and reordering. Examples: UDP, TCP ● UDP offers the first two services and TCP offers all the services. ● Transport Layer Protocols are implemented only at terminal nodes ● (computers). Routers and switches do not exam this layer. ● 5

  6. Multiplexing - Demultiplexing How does the Transport Layer know to which networking process it ● should forward the received data? How does the Transport Layer collect the data that the processes ● want to send and forward it to the network layer? Each process can create one or more sockets . ● Processes see sockets as the only gateway to the network . ● They can send or receive data only through them. In reality, they are structures of the OS that maintain valuable ● information for the connection. One field of the socket is its port number, a unique id in the ● system. Sockets are like file descriptors. When a process wants to send ● data, it invokes a system call, passing the socket and the pointer to data. 6

  7. Multiplexing - Demultiplexing From the “other side” of the socket there is the Transport layer, implemented in the ● OS. The Transport Layer: ● takes the data from the process, ● splits the data into frames, ● reads the fields of the corresponding socket, ● creates the header for each frame (being based on the fields) ● and forwards the frame to the Network layer. ● This process is called Multiplexing . ● When a frame is forwarded from the Network Layer to the Transport Layer, the latter ● checks the header, identifies the port number of the socket-destination and forwards the data there. This process is called Demultiplexing . ● 7

  8. Multiplexing - Demultiplexing ● The fields that are stored in the socket depend on which Transport protocol we use. ● UDP: port number of the source, port number of the destination. ● TCP: port number of the source, port number of the destination, IP address of the source, IP address of the destination. 8

  9. UDP ● User Datagram Protocol ● Services: Multiplexing-Demultiplexing, Error detection. ● It is so light that the process “roughly” talks directly to the Network layer. ● It is not reliable, but it is fast. ● Usage: DNS, media transfer. Source port number Destination port number Length Checksum Data 9

  10. TCP Transmission Control Protocol ● Connection-oriented ● The involved processes first establish a connection, through ● handshaking, and then they exchange data. TCP offers full-duplex service. ● Both processes can send data after the connection establishment. ● TCP offers point-to-point connection. ● Only two remote processes take part in one connection. ● TCP offers reliable communication and congestion control. ● 10

  11. TCP segment 11

  12. TCP Handshake SYN SYN, ACK of SYN ACK of SYN 12

  13. TCP ● Reliability → all the data reaches the destination ● The destination should acknowledge the received segments to the source. ● Every TCP segment has: Sequence number = number of the first byte in the segment. ● Acknowledgement number = number of the next byte that the host ● expects. 1 st segment 2 nd segment 0 1 ... 1000 .. ... 1999 499999 13 text

  14. TCP Seq=42, ACK=79, data='C' Seq=79, ACK=43, data='W' Seq=43, ACK=80 14

  15. TCP: Retransmission ● What happens when a segment is lost or broken? ● No acknowledgment. ● The source waits for a specific time period and then it retransmits the segment. ● How long does it have to wait? 15

  16. TCP Windows ● Instead of waiting for the acknowledgment of one frame before sending the next one, the source should send a window of frames. DATA, id=17 DATA, id=18 DATA, id=19 DATA, id=20 ACK 17 ACK 18 ACK 19 ACK 20 16

  17. TCP Congestion Control ● TCP Increases its window size as long as no packets are dropped (linearly). ● It halves the window size when a packet drop occurs. A packet drop is evident from the acknowledgements ● ● Therefore, it will slowly build up to the max bandwidth, and hover around the max. It doesn’t achieve the max possible though ● Instead, it shares the bandwidth well with other TCP connections ● ● This linear-increase , exponential backoff in the face of congestion is termed TCP-friendliness. 17

  18. TCP Congestion Control Max Bandwidth Bandwidth Time 18

  19. TCP Slow Start ● Linear increase takes a long time to build up a window size that matches the link bandwidth*delay. ● Most file transactions are not long enough. ● Consequently, TCP can spend a lot of time with small windows, never getting the chance to reach a sufficiently large window size. ● Fix: Allow TCP to build up to a large window size initially by doubling the window size until first loss . 19

  20. TCP Slow Start Max Bandwidth Bandwidth Time 20

  21. Today ● What are the services that the Transport layer offers? ● Transport Layer ● Multiplexing-Demultiplexing ● UDP ● TCP ● Reliable transmission ● Congestion Control 21

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend