CMPT 371 - Week 4 & 5 Part 1

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/21

encourage image

There's no tags or description

Looks like no tags are added yet.

22 Terms

1
New cards

Transport services

provide logcal communication between application processes running on different hosts

<p>provide logcal communication between application processes running on different hosts</p>
2
New cards

Transport protocols

2 transport protocols available to internet applications: TCP, UDP

transport protocols actions in end systems:

  • sender: breaks application messages into segments, passes to network layer

  • receiver: reassembles segments into messages, passes to application layer


3
New cards

Transport layer vs network layer

Transport layer: communication between processes

  • relies on, enhances, network layer services


Network layer: communication between hosts


4
New cards

Transport Layer Actions: Sender

Sender:

  • is passed an application-layer message

  • determines segment header fields values

  • creates segment

  • passes segment to IP


<p>Sender:</p><ul><li><p>is passed an application-layer message</p></li><li><p>determines segment header fields values</p></li><li><p>creates segment</p></li><li><p>passes segment to IP</p></li></ul><p></p>
5
New cards

Transport Layer Actions: Receiver

Receiver:

  • receives segment from IP

  • checks header values

  • extracts application-layer message

  • demultiplexes message up to application via socket


<p>Receiver:</p><ul><li><p>receives segment from IP</p></li><li><p>checks header values</p></li><li><p>extracts application-layer message</p></li><li><p><strong>demultiplexes</strong> message up to application via socket</p></li></ul><p></p>
6
New cards

TCP: Transmission Control Protocol

  • reliable, in-order delivery

  • congestion control

  • flow control

  • connection setup


not available: delay guarantees, bandwidth guarantees


7
New cards

UDP: User Datagram Protocol

  • unreliable, unordered delivery

  • no-frills extension of “best-effort” IP


services not available: delay guarantees, bandwidth guarantees


8
New cards

Multiplexing (as sender)

handle data from multiple sockets, add transport header (later used for demultiplexing)

<p>handle data from multiple sockets, add transport header (later used for demultiplexing)</p>
9
New cards

Demultiplexing (as receiver)

use header info to deliver received segments to correct socket

<p>use header info to deliver received segments to correct socket</p>
10
New cards

How demultiplexing works

  • 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


<ul><li><p>host receives IP datagrams</p><ul><li><p>each datagram has source IP address, destination IP address</p></li><li><p>each datagram carries one transport-layer segment</p></li><li><p>each segment has source, destination port number</p></li></ul></li><li><p>host uses <strong>IP addresses &amp; port numbers </strong>to direct segment to appropriate socket</p></li></ul><p></p>
11
New cards

Connectionless demultiplexing

Recall:

  • when creating socket, must specify host-local port #

  • when creating datagram to send into UDP socket, must specify:

    • destination IP address

    • destination port #


When receiving host receives UDP segment:

  • checks destination port # in segment, directs UDP segment to socket with that port #


IP/UDP datagrams with same dest. port #, but different source IP addresses and/or source port numbers, will be directed to the same socket at receiving host


<p>Recall: </p><ul><li><p>when creating socket, must specify host-local port #</p></li><li><p>when creating datagram to send into UDP socket, must specify:</p><ul><li><p>destination IP address</p></li><li><p>destination port #</p></li></ul></li></ul><p></p><p>When receiving host receives UDP segment:</p><ul><li><p>checks destination port # in segment, directs UDP segment to socket with that port #</p></li></ul><p></p><p>IP/UDP datagrams with same <strong>dest. port #</strong>, but different source IP addresses and/or source port numbers, will be directed to the <strong>same socket</strong> at receiving host</p><p></p>
12
New cards

UDP: User Datagram Protocol

“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


13
New cards

Why do we have UDP at all?

  • no connection establishment (which can add RTT - Round trip time delay)

  • simple: no connection state at sender, receiver

  • small header size

  • no congestion control

    • UDP can blast away as fast as desired!

    • can function in the face of congestion


14
New cards

UDP is used in:

  • streaming multimedia apps (loss tolerant, rate sensitive)

  • DNS

  • SNMP

  • HTTP/3


15
New cards

If reliability + reliable transfer needed over UDP, then you need to:

  • add needed reliability at application layer

  • add congestion control at application layer


Basically you need to add control at the application layer:

  • for example, Youtube, if it used TCP it would have head-blocking, in case the first packet was lost

  • however with UDP, if the first packet is lost and the others make it, Youtube can still load the other packets, while packet 1 is retransmitted

    • allows for smooth streaming


16
New cards

Transport Layer: UDP sender actions

  • is passed an application-layer message

  • determines UDP segment header fields values

  • creates UDP segment

  • passes segment to IP


<ul><li><p>is passed an application-layer message</p></li><li><p>determines UDP segment header fields values</p></li><li><p>creates UDP segment</p></li><li><p>passes segment to IP</p></li></ul><p></p>
17
New cards

Transport Layer: UDP receiver actions

  • receies segment from IP

  • checks UDP checksum header value

  • extracts application-layer message

  • demultiplexes message up to application via socket


<ul><li><p>receies segment from IP</p></li><li><p>checks UDP checksum header value</p></li><li><p>extracts application-layer message</p></li><li><p>demultiplexes message up to application via socket</p></li></ul><p></p>
18
New cards

UDP segment header

  • each field is 16-bits (source port #, dest port #, length, checksum, etc.)

  • Checksum: the first thing that is checked at the receiving end, bit flipping checks for errors in transmission

    • basically anything can cause a bitflip, eg. electromagnetic noise, congestion, physics, etc.

    • UDP doesn’t provide much but still has this for error-checking; not 100% reliable but it is something

  • length: allows reader to know how much to look for in a network stream


<ul><li><p>each field is 16-bits (source port #, dest port #, length, checksum, etc.)</p></li><li><p>Checksum: the first thing that is checked at the receiving end, bit flipping checks for errors in transmission</p><ul><li><p>basically anything can cause a bitflip, eg. electromagnetic noise, congestion, physics, etc.</p></li><li><p>UDP doesn’t provide much but still has this for error-checking; not 100% reliable but it is something</p></li></ul></li><li><p>length: allows reader to know how much to look for in a network stream</p></li></ul><p></p>
19
New cards

UDP checksum

added sum based on the bits in transmitted segment; goal is to detect errors (ie. flipped bits)

<p>added sum based on the bits in transmitted segment; goal is to detect errors (ie. flipped bits)</p>
20
New cards

How checksum works with sender and receiver?

sender:

  • treat contents of UDP segment (including UDP header fields and IP addresses) as sequence of 16-bit integers

  • checksum: addition (one’s complement sum) of segment content

  • check sum value put into UDP checksum field


receiver:

  • compute checksum of received segment

  • check if computed checksum equals checksum field value:

    • not equal - error detected

    • equal - no error detected (but actually, errors could have still occurred!)


21
New cards

Internet checksum: weak protection!

very slight chance of this happening

<p>very slight chance of this happening</p>
22
New cards