CS 557 - Lecture 1 Review of Basic Protocols IP - RFC 791, 1981 TCP - - PowerPoint PPT Presentation

cs 557 lecture 1 review of basic protocols
SMART_READER_LITE
LIVE PREVIEW

CS 557 - Lecture 1 Review of Basic Protocols IP - RFC 791, 1981 TCP - - PowerPoint PPT Presentation

CS 557 - Lecture 1 Review of Basic Protocols IP - RFC 791, 1981 TCP - RFC 793, 1981 Spring 2013 These slides are a combination of two great sources: Kurose and Ross Textbook slides Steve Deering IETF Plenary Talk IP Datagram Format


slide-1
SLIDE 1

CS 557 - Lecture 1 Review of Basic Protocols

IP - RFC 791, 1981 TCP - RFC 793, 1981

Spring 2013

slide-2
SLIDE 2
  • These slides are a combination of two

great sources:

– Kurose and Ross Textbook slides – Steve Deering IETF Plenary Talk

slide-3
SLIDE 3

IP Datagram Format

ver length 32 bits

data (variable length, typically a TCP

  • r UDP segment)

16-bit identifier Internet checksum time to live 32 bit source IP address IP protocol version number header length (bytes) max number remaining hops (decremented at each router) for fragmentation/ reassembly total datagram length (bytes) upper layer protocol to deliver payload to head. len type of service “type” of data flgs fragment

  • ffset

upper layer 32 bit destination IP address Options (if any) E.g. timestamp, record route taken, specify list of routers to visit.

how much overhead with TCP?

  • 20 bytes of TCP
  • 20 bytes of IP
  • = 40 bytes + app

layer overhead

slide-4
SLIDE 4

IP Fragmentation

  • network links have MTU

(max.transfer size) - largest possible link-level frame. – different link types, different MTUs

  • large IP datagram divided

(“fragmented”) within net – one datagram becomes several datagrams – “reassembled” only at final destination – IP header bits used to identify, order related fragments

fragmentation: in: one large datagram

  • ut: 3 smaller datagrams

reassembly

slide-5
SLIDE 5

TCP

RFCs: 793, 1122, 1323, 2018, 2581

  • full duplex data:

– bi-directional data flow in same connection – MSS: maximum segment size

  • connection-oriented:

– handshaking (exchange

  • f control msgs) init’s

sender, receiver state before data exchange

  • flow controlled:

– sender will not overwhelm receiver

  • point-to-point:

– one sender, one receiver

  • reliable, in-order byte

steam:

– no “message boundaries”

  • pipelined:

– TCP congestion and flow control set window size

  • send & receive buffers

socket door TCP send buffer TCP receive buffer socket door

segment

application writes data application reads data

slide-6
SLIDE 6

TCP segment structure

source port # dest port #

32 bits

application data (variable length) sequence number acknowledgement number

Receive window Urg data pnter checksum

F S R P A U

head len not used

Options (variable length)

URG: urgent data (generally not used) ACK: ACK # valid PSH: push data now (generally not used) RST, SYN, FIN: connection estab (setup, teardown commands) # bytes rcvr willing to accept counting by bytes

  • f data

(not segments!) Internet checksum (as in UDP)

slide-7
SLIDE 7

TCP Connection Management Three-Way Handshake

TCP client lifecycle TCP server lifecycle

slide-8
SLIDE 8

TCP Flow control

(Suppose TCP receiver discards out-of-order segments)

  • spare room in buffer

= RcvWindow = RcvBuffer-[LastByteRcvd - LastByteRead]

  • Rcvr advertises

spare room by including value of RcvWindow in segments

  • Sender limits

unACKed data to RcvWindow

– guarantees receive buffer doesn’t

  • verflow
slide-9
SLIDE 9

TCP Congestion Control Review

  • When CongWin is below Threshold, sender in slow-

start phase, window grows exponentially.

  • When CongWin is above Threshold, sender is in

congestion-avoidance phase, window grows linearly.

  • When a triple duplicate ACK occurs, Threshold set to

CongWin/2 and CongWin set to Threshold.

  • When timeout occurs, Threshold set to CongWin/2

and CongWin is set to 1 MSS.

slide-10
SLIDE 10

TCP: retransmission scenarios

Host A

Seq=100, 20 bytes data

time premature timeout

Host B

Seq=92, 8 bytes data Seq=92, 8 bytes data Seq=92 timeout

Host A

Seq=92, 8 bytes data ACK=100

loss

timeout

lost ACK scenario

Host B

X

Seq=92, 8 bytes data A C K = 1

time

Seq=92 timeout

SendBase = 100 SendBase = 120 SendBase = 120 Sendbase = 100

slide-11
SLIDE 11

TCP Timeouts

Setting the timeout

  • EstimtedRTT plus “safety margin”

– large variation in EstimatedRTT -> larger safety margin

  • first estimate of how much SampleRTT deviates from EstimatedRTT:

TimeoutInterval = EstimatedRTT + 4*DevRTT DevRTT = (1-β)*DevRTT + β*|SampleRTT-EstimatedRTT| (typically, β = 0.25)

Then set timeout interval:

slide-12
SLIDE 12

Example RTT estimation:

RTT: RTT: gaia.c gaia.cs.u s.umass.edu mass.edu to to fantasia.e fantasia.eure urecom.fr com.fr

100 150 200 250 300 350 1 8 15 22 29 36 43 50 57 64 71 78 85 92 99 106 ti time me (s (sec econ

  • nnds

ds) RTT RTT (millis (millisec econ

  • nds

ds) SampleRTT Estimated RTT

slide-13
SLIDE 13

TCP Window Size Over Time

8 Kbytes 16 Kbytes 24 Kbytes time congestion window

Long-lived TCP connection

slide-14
SLIDE 14

Event State TCP Sender Action Commentary ACK receipt for previously unacked data Slow Start (SS) CongWin = CongWin + MSS, If (CongWin > Threshold) set state to “Congestion Avoidance” Resulting in a doubling of CongWin every RTT ACK receipt for previously unacked data Congestion Avoidance (CA) CongWin = CongWin+MSS * (MSS/CongWin) Additive increase, resulting in increase of CongWin by 1 MSS every RTT Loss event detected by triple duplicate ACK SS or CA Threshold = CongWin/2, CongWin = Threshold, Set state to “Congestion Avoidance” Fast recovery, implementing multiplicative decrease. CongWin will not drop below 1 MSS. Timeout SS or CA Threshold = CongWin/2, CongWin = 1 MSS, Set state to “Slow Start” Enter slow start Duplicate ACK SS or CA Increment duplicate ACK count for segment being acked CongWin and Threshold not changed

slide-15
SLIDE 15

Summary

slide-16
SLIDE 16
slide-17
SLIDE 17
slide-18
SLIDE 18
slide-19
SLIDE 19
slide-20
SLIDE 20
slide-21
SLIDE 21

IPv6

  • Initial motivation: 32-bit address space

soon to be completely allocated.

  • Additional motivation:

– header format helps speed processing/ forwarding – header changes to facilitate QoS IPv6 datagram format: – fixed-length 40 byte header – no fragmentation allowed

slide-22
SLIDE 22

IPv6 Header (Cont)

Priority: identify priority among datagrams in flow Flow Label: identify datagrams in same “flow.” (concept of“flow” not well defined). Next header: identify upper layer protocol for data

slide-23
SLIDE 23

Other Changes from IPv4

  • Checksum: removed entirely to reduce

processing time at each hop

  • Options: allowed, but outside of header,

indicated by “Next Header” field

  • ICMPv6: new version of ICMP

– additional message types, e.g. “Packet Too Big” – multicast group management functions

slide-24
SLIDE 24
slide-25
SLIDE 25
slide-26
SLIDE 26
slide-27
SLIDE 27
slide-28
SLIDE 28
slide-29
SLIDE 29
slide-30
SLIDE 30
slide-31
SLIDE 31
slide-32
SLIDE 32