it 424 networks2

31
IT 424 Networks2 Ack.: Slides are adapted from the slides of the book: “Computer Networking” – J. Kurose, K. Ross Chapter 3: Transport Layer Chapter 3: Transport Layer Part 1: Services & Part 1: Services & UDP UDP

Upload: yvonne-quinn

Post on 30-Dec-2015

50 views

Category:

Documents


0 download

DESCRIPTION

IT 424 Networks2. Chapter 3: Transport Layer Part 1: Services & UDP. Ack.: Slides are adapted from the slides of the book: “Computer Networking” – J. Kurose, K. Ross. TCP/IP Suite – Transport Layer. Transport Layer Functionalities. Transport Layer Protocols. Overview. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: IT 424 Networks2

IT 424

Networks2IT 424

Networks2

Ack.: Slides are adapted from the slides of the book: “Computer Networking” – J. Kurose, K. Ross

Chapter 3: Transport Layer

Chapter 3: Transport Layer

Part 1: Services &

Part 1: Services &

UDPUDP

Page 2: IT 424 Networks2

TCP/IP

Sui

te –

Trans

port

Layer

Transport L

ayer Functi

onalitie

s

Transport Layer Protocols

User Datagram Protocol (UDP)Overview

2

Page 3: IT 424 Networks2

Learning Outcomes

1Differentiate between the transport layer and the network layer

2 Describe the role of the transport layer and its two main protocols

3Explain how multiplexing and demultiplexing work

4 Differentiate between TCP and UDP services

5 Calculate the check-sum in UDP packets

6Select the most proper transport protocol for any application3

Page 4: IT 424 Networks2

TCP/IP

Sui

te –

Trans

port

Layer

Transport L

ayer Functi

onalitie

s

Transport Layer Protocols

User Datagram Protocol (UDP)Overview

4

Page 5: IT 424 Networks2

TCP/IP Suite

TCP

TCP/IP Suite

5

Page 6: IT 424 Networks2

Why We Need A Transport Layer?

TCP/IP Suite

Since several processes may be running on each host machine, a layer is needed to be responsible for process-to-process delivery (also called end-to-end delivery)

Transport layer works as a liaison between application layer and lower layers (network layer, data link layer, and physical layer)

Application layer programs use the services of the transport layer to communicate without being aware of the lower layers (i.e., not dependent on the physical network

itself)

Transport layer uses the network layer services and implement its own internal functions to hide the imperfection and the heterogeneous nature of the physical

network

6

Page 7: IT 424 Networks2

End-to-End Communication

applicationtransportnetworkdata linkphysical

logical end-end transport

applicationtransportnetworkdata linkphysical

TCP/IP Suite –Transport Layer

7

Page 8: IT 424 Networks2

Transport layer provides logical communication between application processes running on different hosts

Transport protocols run in end systems send side: breaks app messages into

segments, passes to network layerreceive side: reassembles segments into messages, passes to application

layerMore than one transport protocol available

to applicationsInternet: TCP and UDP

Transport Services and Protocols

applicationtransportnetworkdata linkphysical

applicationtransportnetworkdata linkphysical

networkdata linkphysical

networkdata linkphysical

networkdata linkphysical

networkdata linkphysical

networkdata linkphysical

networkdata linkphysical

networkdata linkphysical

logical end-end transport

TCP/IP Suite –Transport Layer

8

Page 9: IT 424 Networks2

Transport vs. Network Layer

Network layer: logical communication between hosts

Transport layer: logical communication between processes

Relies on, enhances, network layer services

TCP/IP Suite –Transport Layer

9

Page 10: IT 424 Networks2

TCP/IP

Sui

te –

Trans

port

Layer

Transport L

ayer Functi

onalitie

s

Transport Layer Protocols

User Datagram Protocol (UDP)Overview

10

Page 11: IT 424 Networks2

Transport Layer Functionalities

Transport Layer Functionalities

Isolating the application layer from the technology, design, and imperfections of the network (hiding transmission details from applications)

Fragmentation of large messages into segments and reassembly of segments into messages (segmentation)

Addressing

Multiplexing / Demultiplexing

Reliable data transfer (provide a reliable service on top of an unreliable network)

QoS , security functions (cooperation with other layers)11

Page 12: IT 424 Networks2

Segmentation

The transport layer receives the message from the application process and divides it into smaller units then encapsulates each unit in a segment (also

called packet) by adding header information

Message

payloadTH …

Transport Layer

segment

To network layer

From app layer

Transport Layer Functionalities - Segmentation

12

Page 13: IT 424 Networks2

Addressing

For two application processes to communicate, they need to uniquely identify each other using socket address: IP address which uniquely distinguish a computer from all other computers

(responsibility of the network layer) A port number (local number) to uniquely identify a process on the

computer (i.e. uniquely identify a process at the transport layer) A request segment at the transport layer must carry

The destination port to specify remote process As well as the source port to specify the sender process

Transport Layer Functionalities - Addressing

13

Page 14: IT 424 Networks2

Addressing (Example)

Transport Layer Functionalities - Addressing

14

Page 15: IT 424 Networks2

Multiplexing and Demultiplexing

Multiplexing – at the sender, the transport layer protocol accepts messages from several processes identified by their port numbers then passes the packets to the network layer after adding the header

Demultiplexing – at the receiver, the transport layer delivers each message to appropriate process based on the port number contained in the header

many-to-one relationship

one-to-many relationship

Transport Layer Functionalities - Multiplexing

15

Page 16: IT 424 Networks2

Host receives IP datagrams Each datagram has source IP address,

destination IP address Each datagram carries one transport-

layer segment Each segment has source, destination

port number Host uses IP addresses & port numbers to direct segment to appropriate socket

How Demultiplexing Works

source port # dest port #

32 bits

applicationdata (payload)

other header fields

TCP/UDP segment format

Transport Layer Functionalities - Multiplexing

16

Page 17: IT 424 Networks2

Multiplexing/Demultiplexing

process

socket

use header info to deliverreceived segments to correct socket

demultiplexing at receiver:handle data from multiplesockets, add transport header (later used for demultiplexing)

multiplexing at sender:

transport

application

physical

link

network

P2P1

transport

application

physical

link

network

P4

transport

application

physical

link

network

P3

Transport Layer Functionalities - Multiplexing

17

Page 18: IT 424 Networks2

Demultiplexing Example

DatagramSocket serverSocket = new DatagramSocket

(6428);

transport

application

physical

link

network

P3transport

application

physical

link

network

P1

transport

application

physical

link

network

P4

DatagramSocket mySocket1 = new DatagramSocket (5775);

DatagramSocket mySocket2 = new DatagramSocket

(9157);

source port: 9157dest port: 6428

source port: 6428dest port: 9157

source port: ?dest port: ?

source port: ?dest port: ?

Transport Layer Functionalities - Multiplexing

18

Page 19: IT 424 Networks2

Reliable Data Transfer

Very important network topic (for transport, application, and link layers) Characteristics of unreliable channel will determine the complexity of

reliable data transfer protocol How to provide a reliable transmission over a non reliable channel or a

non reliable network layer? Reliable channel: No transferred data bits are corrupted or lost, and all are

delivered in the order in which they were sent

Transport Layer Functionalities - Reliable Data

19

Page 20: IT 424 Networks2

TCP/IP

Sui

te –

Trans

port

Layer

Transport L

ayer Functi

onalitie

s

Transport Layer Protocols

User Datagram Protocol (UDP)Overview

20

Page 21: IT 424 Networks2

Reliable, in-order delivery (TCP) Error control Congestion control Flow control Connection setup (connection-

oriented)

Unreliable, unordered delivery: UDP Connectionless Extension of “best-effort” IP

Services not available: Delay guarantees Bandwidth guarantees

Internet Transport-Layer Protocols

Transport Layer Protocols

applicationtransportnetworkdata linkphysical

applicationtransportnetworkdata linkphysical

networkdata linkphysical

networkdata linkphysical

networkdata linkphysical

networkdata linkphysical

networkdata linkphysical

networkdata linkphysical

networkdata linkphysical

logical end-end transport

21

Page 22: IT 424 Networks2

TCP Vs. UDP Functions

UDP: fragmentation and reassembly, Multiplexing/ Demultiplexing, error-detection using checksum

TCP: All UDP functionalities + reliable data transfer (connection management, error-control, flow control, congestion control)

Transport Layer Protocols

22

Page 23: IT 424 Networks2

TCP/IP

Sui

te –

Trans

port

Layer

Transport L

ayer Functi

onalitie

s

Transport Layer Protocols

User Datagram Protocol (UDP)Overview

23

Page 24: IT 424 Networks2

“No frills,” Internet transport protocol

“Best effort” service, UDP segments may be: Lost Delivered out-of-order to

application

Connectionless: No handshaking between UDP

sender, receiver Each UDP segment handled

independently of others

UDP use: Streaming multimedia

applications (loss tolerant, delay sensitive)

DNS SNMP

Reliable transfer over UDP: Add reliability at application layer Application-specific error

recovery!

User Datagram Protocol (UDP)

[RFC 768]

User Datagram Protocol (UDP)

24

Page 25: IT 424 Networks2

UDP: Segment Header

source port # dest port #

32 bits

applicationdata (payload)

UDP segment format

length checksum

length, in bytes of UDP segment, including

header

User Datagram Protocol (UDP) - Header

No connection establishment (which can add delay)

Simple: no connection state at sender, receiver

Small header size No congestion control: UDP can

blast away as fast as desired

Why is there a UDP?

25

Page 26: IT 424 Networks2

Sender:Treat segment contents, including header fields, as sequence of 16-bit integersChecksum: addition (one’s complement sum) of segment contentsSender puts checksum value into UDP checksum field

Receiver:Compute checksum of received segmentCheck if computed checksum equals checksum field value:

NO - error detected YES - no error detected. But maybe

errors nonetheless?

UDP Checksum

Goal: detect “errors” (e.g., flipped bits) in transmitted segment

User Datagram Protocol (UDP) - Checksum

26

Page 27: IT 424 Networks2

Internet Checksum: Example

Example: add two 16-bit integers

Note: when adding numbers, a carryout from the most significant bit needs to be added to the result

1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 01 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1

1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 01 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1

wraparound

sumchecksum

User Datagram Protocol (UDP) - Checksum

27

Page 28: IT 424 Networks2

Checksum Calculation of A Simple UDP Datagram

Figure above shows the checksum calculation for a very small user datagram with only 7 bytes of data.

Because the number of bytes of data is odd, padding is added for checksum calculation.

The pseudo-header as well as the padding will be dropped when the user datagram is delivered to IP.

User Datagram Protocol (UDP) - Checksum

28

Page 29: IT 424 Networks2

Uses of UDP

Used by a process that requires simple request-response communication with little concern for flow and error control.

Not used for processes that send a bulk of data such as FTP. Used by a process with internal flow and error control mechanisms, ex: Trivial

File Transfer Protocol (TFTP). Multicasting, multicasting capability is embedded in the UDP software but not

in the TCP software. Management processes, ex: SNMP. Route updating protocols, ex: RIP.

User Datagram Protocol (UDP) - Uses

29

Page 30: IT 424 Networks2

Conclusion

Conclusion

Principles behind transport layer services: Segmentation Addressing Multiplexing, demultiplexing Reliable data transfer

Instantiation, implementation in the Internet UDP TCP

UDP uses checksum to detect errors. It provides unreliable unordered data service

30

Page 31: IT 424 Networks2

References

References

Computer Networking: A Top-Down Approach Featuring the Internet by James Kurose and Keith Ross, Addison Wesley, 2012 (chapter 3 )

Internet Protocol (RFC791)

User Datagram Protocol (RFC768)

31