Transport Layer: Understanding UDP and TCP Protocols, Slides of Computer Networks

An overview of the transport layer, focusing on connectionless udp and connection-oriented tcp. Topics include transport services, multiplexing and demultiplexing, reliable data transfer, flow control, connection management, and congestion control. Understand the differences between udp and tcp, their segment structures, and how they ensure reliable data transfer.

Typology: Slides

2011/2012

Uploaded on 07/03/2012

abhae
abhae 🇮🇳

4.4

(9)

43 documents

1 / 60

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Transport Services
Computer Networks Lect-10
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c

Partial preview of the text

Download Transport Layer: Understanding UDP and TCP Protocols and more Slides Computer Networks in PDF only on Docsity!

Transport Services

Computer Networks

Lect-

TRANSPORT LAYER

Transport Layer 3-

CHAPTER 3 OUTLINE

»3.1 Transport-layer services

»3.2 Multiplexing and

demultiplexing

»3.3 Connectionless

transport: UDP

»3.4 Principles of reliable

data transfer

»3.5 Connection-oriented

transport: TCP

» segment structure

» reliable data transfer

» flow control

» connection management

»3.6 Principles of congestion

control

»3.7 TCP congestion control

Transport Layer 3-

TRANSPORT SERVICES AND PROTOCOLS

»provide logical communication

between app processes running on

different hosts

»transport protocols run in end

systems

» send side: breaks app

messages into segments,

passes to network layer

» rcv side: reassembles

segments into messages,

passes to app layer

»more than one transport protocol

available to apps

» Internet: TCP and UDP

application

transport

network

data link

physical

application

transport

network

data link

physical

network

data link

physical

network

data link

physical

network

data link

physical

network

data link

physical network

data link

physical

Transport Layer 3-

INTERNET TRANSPORT-LAYER PROTOCOLS

»reliable, in-order delivery

(TCP)

» congestion control

» flow control

» connection setup

»unreliable, unordered

delivery: UDP

» no-frills extension of “best-

effort” IP

»services not available:

» delay guarantees

» bandwidth guarantees

application

transport

network

data link

physical

application

transport

network

data link

physical

network

data link

physical

network

data link

physical

network

data link

physical

network

data link

physical network

data link

physical

Transport Layer 3-

CHAPTER 3 OUTLINE

»3.1 Transport-layer services

»3.2 Multiplexing and

demultiplexing

»3.3 Connectionless

transport: UDP

»3.4 Principles of reliable

data transfer

»3.5 Connection-oriented

transport: TCP

» segment structure

» reliable data transfer

» flow control

» connection management

»3.6 Principles of congestion

control

»3.7 TCP congestion control

Transport Layer 3-

HOW DEMULTIPLEXING WORKS

»host receives IP datagrams

» each datagram has source IP

address, destination IP address

» each datagram carries 1 transport-

layer segment

» each segment has source,

destination port number

(recall: well-known port numbers

for specific applications)

»host uses IP addresses & port numbers to

direct segment to appropriate socket

source port # dest port #

32 bits

application

data

(message)

other header fields

TCP/UDP segment format

Transport Layer 3-

CONNECTIONLESS DEMULTIPLEXING

»Create sockets with port

numbers:

DatagramSocket mySocket1 = new

DatagramSocket(99111);

DatagramSocket mySocket2 = new

DatagramSocket(99222);

»UDP socket identified by two-

tuple:

(dest IP address, dest port number)

»When host receives UDP

segment:

» checks destination port

number in segment

» directs UDP segment to socket

with that port number

»IP datagrams with different

source IP addresses and/or

source port numbers directed

to same socket

Transport Layer 3-

CONNECTION-ORIENTED DEMUX

»TCP socket identified by 4-

tuple:

» source IP address

» source port number

» dest IP address

» dest port number

»recv host uses all four values

to direct segment to

appropriate socket

»Server host may support

many simultaneous TCP

sockets:

» each socket identified by its

own 4-tuple

»Web servers have different

sockets for each connecting

client

» non-persistent HTTP will have

different socket for each

request

Transport Layer 3-

CONNECTION-ORIENTED DEMUX (CONT)

Client

IP:B

P

client

IP: A

P

P

P

server

IP: C

SP: 9157

DP: 80

SP: 9157

DP: 80

P

P

P

D-IP:C

S-IP: A

D-IP:C

S-IP: B

SP: 5775

DP: 80

D-IP:C

S-IP: B

Transport Layer 3-

CHAPTER 3 OUTLINE

»3.1 Transport-layer services

»3.2 Multiplexing and

demultiplexing

»3.3 Connectionless

transport: UDP

»3.4 Principles of reliable

data transfer

»3.5 Connection-oriented

transport: TCP

» segment structure

» reliable data transfer

» flow control

» connection management

»3.6 Principles of congestion

control

»3.7 TCP congestion control

Transport Layer 3-

UDP: USER DATAGRAM PROTOCOL [RFC 768]

»“no frills,” “bare bones” Internet

transport protocol

»“best effort” service, UDP

segments may be:

» lost

» delivered out of order to

app

» connectionless:

» no handshaking between

UDP sender, receiver

» each UDP segment handled

independently of others

Why is there a UDP?

»no connection establishment

(which can add delay)

»simple: no connection state at

sender, receiver

»small segment header

»no congestion control: UDP can

blast away as fast as desired

Transport Layer 3-

UDP CHECKSUM

Sender:

»treat segment contents as

sequence of 16-bit integers

»checksum: addition (1’s

complement sum) of segment

contents

»sender puts checksum value

into UDP checksum field

Receiver:

»compute checksum of received

segment

»check if computed checksum equals

checksum field value:

» NO - error detected

» YES - no error detected. But

maybe errors nonetheless?

More later ….

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

segment

INTERNET CHECKSUM EXAMPLE

»Note

» When adding numbers, a carryout from the most significant bit

needs to be added to the result

»Example: add two 16-bit integers

wraparound

sum

checksum