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

networking transport layer
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

1

CS 4410 Operating Systems

Networking: Transport Layer

Summer 2013 Cornell University

slide-2
SLIDE 2

2

Today

  • What are the services that the Transport layer
  • ffers?
  • Transport Layer
  • Multiplexing-Demultiplexing
  • UDP
  • TCP
  • Reliable transmission
  • Congestion Control
slide-3
SLIDE 3

3

Protocol Stack

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

slide-4
SLIDE 4

4

Transport Layer

  • It offers logical communication between processes.
  • Networking processes think that they directly speak to each
  • ther.
slide-5
SLIDE 5

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.
slide-6
SLIDE 6

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.

slide-7
SLIDE 7

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.
slide-8
SLIDE 8

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.

slide-9
SLIDE 9

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

slide-10
SLIDE 10

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.
slide-11
SLIDE 11

11

TCP segment

slide-12
SLIDE 12

12

TCP Handshake

SYN SYN, ACK of SYN ACK of SYN

slide-13
SLIDE 13

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 ... 1000 ... 1999 499999 1st segment 2nd segment text

slide-14
SLIDE 14

14

TCP

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

slide-15
SLIDE 15

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?
slide-16
SLIDE 16

16

TCP Windows

  • Instead of waiting for the acknowledgment of
  • ne 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

slide-17
SLIDE 17

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
  • f congestion is termed TCP-friendliness.
slide-18
SLIDE 18

18

TCP Congestion Control

Time Bandwidth Max Bandwidth

slide-19
SLIDE 19

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.

slide-20
SLIDE 20

20

TCP Slow Start

Time Bandwidth Max Bandwidth

slide-21
SLIDE 21

21

Today

  • What are the services that the Transport layer
  • ffers?
  • Transport Layer
  • Multiplexing-Demultiplexing
  • UDP
  • TCP
  • Reliable transmission
  • Congestion Control