Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

TCP and UDP: Reliable and Unreliable Data Transfer Protocols, Study notes of Engineering

A comprehensive explanation of tcp and udp, two fundamental protocols used in computer networks. It delves into the principles of reliable data transfer, highlighting the differences between tcp's reliable, ordered byte stream and udp's connectionless, unreliable approach. Key concepts such as checksums, rdt protocols, flow control, congestion control, and the three-way handshake. It also examines tcp's delayed acknowledgment mechanism and retransmission scenarios, including fast retransmit. Valuable for students and professionals seeking a deeper understanding of network protocols and their practical applications.

Typology: Study notes

2023/2024

Available from 12/16/2024

mariam-ibrahim-7
mariam-ibrahim-7 🇨🇦

5 documents

1 / 14

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
UDP connection
less transport can havesegmentloss 5segmentsarrivingout
oforder
veryunreliable no connection very
lowdelay butnotreliable so it's good for zoomcalls
DNSneedasapsouses UDP streaming multimediaapps use it cuz theycan tolerate loss
UDPsegmentformat
size
of
entire
segment app no reliable transfer BUTucan
checkifthere's
anybit
errors inthedata
part ofUDP the
check
iscalledaUDP
checksum
checksum it's goal is to detecterrors flipped
bits in transmitted segment
sender takesentire segmentout including headerand laythe bits one row
mail.L.g.eayggggigsmasmmm.mn
lllll
rao
Iattitbach
flip thebits
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe

Partial preview of the text

Download TCP and UDP: Reliable and Unreliable Data Transfer Protocols and more Study notes Engineering in PDF only on Docsity!

UDP

connection

less

transport

can have

segmentloss

segments arriving

out

of

order

very

unreliable

no

connection

very

low

delay

but not

reliable

so

it's

good for

zoom

calls

DNS

need

asap

so

uses UDP streaming

multimedia

apps

use it

cuz

they

can

tolerate

loss

UDP

segment

format

size

of

entire

segment

app no

reliable transfer

BUT

ucan

check

if

there's

any

bit

errors

in

the

data

part

of

UDP

the

check

is

called

a

UDP

checksum

checksum

it's

goal

is to

detect

errors flippedbits

in

transmitted

segment

sender takes entire segmentout

including

header

and

lay

the

bits

one

row

mail.L.g.eayggggigsmasmmm.mn

l

l

l l

l

r a

o

I

attitbach

flip

the

bits

receiver

when

that segment

arrives at receiver

side

receiver

does

same

computation

and re

calculates

checksum

which is

then comparedto the

checksum

feild

in

packet

header

if YES

they're

equal

then

no

errors if NO

not

equal

then

error

detected

so

discards

it

btw

theres

some other

errors

checksum

can't

detect

if

checksums

aren't

the

same

UDP

doesn't

resend

it

it

just

discards

it so

packets are

lost

outoford

Principles

of reliabledata

transfer

important in

application transport

linklayers

processes

sitting

at

application

layer

it

demants reliable data

transfer

transport

layer

sending

site 8 recieving

side

eachwill

need

to

implement

extramechanism

to

ensure

reliable data

transfer

in

application

layer mags

aregenerated

andpassed

down

to

transport layer

those

mags

are now

called data application layer

calls

fin

rat

senses

to

pass

the

data

down

to

transport

layer

mags

willbe

processed

in to a

number

of

segments

packets

will

begenerated th

calls

fin

udt

send

pushes it to

network

layy

the

nl

calls

fin

ratrevl to

pass

it

up

Tone

P

p

that

mm

propdelay

4R

Proday

waste

of time low utilization

Pipelined

protocols

to

increase

the

utilization

we

send

multiple packets that

br

und in flight

packets not

yet

acked

stops wait pipelines rtt

Egg

EE

E Eir

two

forms

of

pipelined

protocols GoBack

N

and

selective

repeat

Go

Back

N

allows multiple

unacked packets in pipeline

receiversends

comulative ack's

in

orderback to

bae

doesn't

ack

packet

if

theres

a

gap

has a

timer for

the

oldest

unacked

packet when

timer expires

it

goes

back

in and

resents allll

unackled packets

sender has

a

window

of

up

to

N

consecutive

transmitted

but anack

ed packets

window

slides

after ack

maxy.ge

ptsthatcanbesentatareasametome

timeout

makes

all yellow

packets be

resent

retransmitted

men

iiii.it

35

EE Tug

atsmuar filamentgotartment

addthis.tn

mom

Connection

oriented transport

TCP

TCP

is

a

point

to

point

communication

one

sender

one

receiver

reliable

in

order

byte

stream

data

transmission

we

countdata

by

the

bytes

pipelined

based

rat

window

size is

also for

congestion flow

control flow

control

so

it

doesn't

overwhelm

the

receiver

handshaking to setup

the

initial

states before starting

dataexchange

fullduplexdata

data

is going

bi

directional MSS

max segmentpacketsize

comulative ack's

TOP

segment

structure

0 takes

32

bits

hekewursesintryhihiar.is

mansions

daters

sept

1st first.gg

nt

uket

sequence

numbers

byte

stream

ofthefirst

byte

in thedata

segment

Tig

bit

ftp.yf

i

eesaentes

acknowledgements

willbethe

of

thenext

expected

sequence

comulative

ack

I

example

bi

directional

here

btwiexpectputzanextneresiexpect.su

RDT

mechanism implemented in TCP

howdoes TCP

set the perfect

timeout value

be

the

timeout

is thereto

allow

us to

know

wheathe

a

packet islost or

just

delayed

if

timout istoo

short then

it

sends before delayed

ack

comes

doesn't

give

enough

time

for

delayed

ackto

come

if

too

long

then its a

waste

oftime

doesn't recover

on

time

timer

value

should

be settocoverlongerthan

most

average RTTthat

s8r use

to

give

is

enough

time

for

delay

how

dowe

estimate

RTT we use

a sampleRTT a

pair

of

data

goes

outandtheack

comes back

it

calculates

the

time

difbet revofackand

sending of

data

the

sample

will

vary

it'll average

severalrecent

measurements

not

just

the current sampleRTT

it

ignores

retransmissions

to

make

sure it

covers

only

RTT

the average isto

get

the

bes

smoothestestimation

ofRTT

smoothes

RATnext

smoothetRA

now

currentsample

exponential weighted moving average

ELMA

typical

value of 2 0.

offers

TCP

delayed

ack

Tsents

Lack

rm

TCP

retransmission scenarios

TCP fast

retransmit

TCP

flow

control

Whathappens

if

network

layer

delivers

data

faster

than

application

layer

removes datafrom

socketbuffers

when outgoing is

slow incoming is fastwe

need

flow

control

or

else

the

socket

spacewillbe

exhausted

8

data

willbe

dropped

flow

control receiver

controls sender

usually

to

slow

down

abitso that

sender

won't

overflowreceiver'sbuffer

by

transmitting

toomuch

or

too

fast

the

way

flow

control

works is

by

trackingtherund

in

OS

there's

the

Reubuffer which

is

the size

of

the receive

buffer

space initially

rund

Reubuffer whur TCP

sends

data

ihY

p

pi

Finger

therund is

going

tobe

subtracted

by

the

amount

of

bytesbeing

passed to

it and whur apple

takes in

data

out

ofthe

buffer

rundis

increased

by

these data bytes so

rund

is basically

tracking

thefree buffer

space

TCP

reur will

include rundvalue in

TCPheader and

sends

to

sender

to

know

it

needs

to limit

its

sending

windo

Connection

management

in

TCP

initially

done

before

exchangingdata

using

aprocesses called

a 3

way

handshake

whereafter

a

connection

is

established

a

new

socket

whichthen also

exchanges a

number

of

parameters ex

starting

seq

s sothat

the

server can

decide

weather to

extract data

and

send

up

to

apple

or no

only

tractates

TCP

congestion

control

congestion having

too

many

sources sending

too

much data too

fast

into

the

network

coreof

internet

occurring

in routers

router

buffer

Congestion

window

TCP

sender

limits

transmission

by

assuming rund isso

large

so thelimit

is

just

cund

curd

is

adjusted

in

response to

observed

network congestion

it

dec

if

lost

inc

if

good

TCPsending rate

TCP

initialization

slow

start

when

TCP

connection

is

just

starting

the

initial

cund 1 MSS

max

seg

size

AIMD

increases

the

cund

by

only

1 for

every

ACK

it

receives

soit's

technically doubling cundeach

RTT

is

Congestion

avoidance

the

sender

detects

a packetloss

by

two

ways

1 timout 2

doup ack

if

loss

is

detected

by

timout

curd

is

set

to

MSS

window

then

grows

exponentially

until

cund

slow

start

getsto the

threshold

value

ss

thresh

on

loss

event ss

thresh

is

cut

to

halfofprev

cund

if

loss

is

detected

by

douplicate

ack curdis

cutin half

moreaccuratelyhalf

suss

then

grows

linearly

soup

ack

detected

Orhalftsuss

cuttohalf

agoubling

IMSS

AIMD

Additive Increase

Multiplicative

Decrease

the

sender

will

increase the

sending

rate

gradually

as

long

as

no

loss

defected

but

as

soon

as

there's

packet

loss we

drop sending

rate