last t ime transport 1 transport 2
play

Last t ime: Transport 1 Transport 2 t ransport layer services - PDF document

Last t ime: Transport 1 Transport 2 t ransport layer services connect ion-orient ed t ransport : TCP reliable t r ansf er mult iplexing/ demult iplexing f low cont r ol connect ionless t ransport : UDP connect ion


  1. Last t ime: Transport 1 Transport 2 ❒ t ransport layer services ❒ connect ion-orient ed t ransport : TCP ❍ reliable t r ansf er ❒ mult iplexing/ demult iplexing ❍ f low cont r ol ❒ connect ionless t ransport : UDP ❍ connect ion management ❒ principles of reliable dat a t ransf er ❒ principles of congest ion cont rol ❒ sliding window prot ocols ❒ TCP congest ion cont rol ❍ go-back-N ❍ selct ive r epeat 21 September 2001 Data Communications, Jonny Pettersson, UmU Transport 2 1 21 September 2001 Data Communications, Jonny Pettersson, UmU Transport 2 2 Transmission Cont rol Vad TCP måst e klara Prot ocol(TCP) ❒ Koppla ihop många olika maskiner ❒ Def inierar säker överf ör ing i TCP / I P I nt ernet genom at t bland annat def iniera ❍ Behov av explicit upp- och nedkoppling ❒ Hant er a var ierande RTT ❍ Formen på paket och ackar ❍ Behov av adapt iv t imeout f ör omsändning ❍ Funkt ioner som kan användas f ör at t se t ill at t dat a anländer korr ekt ❒ Hant er a långa f ör dröj ningar i nät et ❍ Hur TCP -mj ukvar an skilj er på f ler a mot t agare ❍ Behov av hant er ing av sent anländande paket inom en maskin ❍ TTL (nu r ekomenderas 120 sek) ❍ Hur kommunikat ionen init ier as och avslut as ❒ Hant er a olika kapacit et er hos mot t agar e ❒ VI KTI GT! ❍ Behov av at t kunna anpassa t ill olika noder s resurser ❍ TCP är et t prot okol, ej en mj ukvara ❒ Hant er a olika nät ver kskapacit et er ❍ Behov av at t hant er a t raf ikst ockningar på nät et 21 September 2001 Data Communications, Jonny Pettersson, UmU Transport 2 3 21 September 2001 Data Communications, Jonny Pettersson, UmU Transport 2 4 TCP - Överblick När skickas segment ? RFCs: 793, 1122, 1323, 2018, 2581 ❒ Kopplingsor ient er at ❒ Full duplex ❒ Tre sät t at t t rigga en sändning ❒ Byt e-st ream ❒ Flow cont rol: Så sändar en ❍ MSS (Maximum Segment Size), of t ast lika med int e dr änker mot t agar en ❍ app skr iver byt es MTU (Maximum Tr ansf er Unit ) f ör lokala ❒ Congest ion cont rol: Så ❍ TCP sänder segment nät ver ket sändar en int e dr änker ❍ app läser byt es ❍ P ush operat ion f rån applikat ionen nät ver ket ❍ Timeout Application process Application process Write Read … bytes … bytes TCP TCP Send buffer Receive buffer … Segment Segment Segment Transmit segments 21 September 2001 Data Communications, Jonny Pettersson, UmU Transport 2 5 21 September 2001 Data Communications, Jonny Pettersson, UmU Transport 2 6 1

  2. Port ar och kopplingar Välkända TCP port ar ❒ TCP använder port ar på et t mer ❒ 7 - Echo komplicerat sät t än UDP ❒ 9 - Discard ❒ Flera kopplingar per port ❒ 21 - FTP ❒ TCP ident if ierar kopplingar som par av ❒ 25 - SMTP kommunikat ionspunkt er ❒ 79 - Finger ❍ < SrcPort , SrcIPAddr , DesPort , DesIPAddr > 21 September 2001 Data Communications, Jonny Pettersson, UmU Transport 2 7 21 September 2001 Data Communications, Jonny Pettersson, UmU Transport 2 8 TCP segment st r uct ur e TCP seq. # ’s and ACKs 32 bit s Seq. # ’s: URG: ur gent dat a Host B Host A count ing source port # dest port # ❍ byt e st ream (gener ally not used) by byt es “number” of f ir st User sequence number Seq=42, ACK=79, data = ‘C’ of dat a ACK: ACK # byt e in segment ’s t ypes (not segment s!) acknowledgement number valid dat a ‘C’ host ACKs head not r cvr window size ACKs: U A P R S F PSH: push dat a now r eceipt of len used # byt es C ’ ‘ (gener ally not used) ❍ seq # of next byt e = ‘C’, echoes checksum a t a pt r ur gent dat a d 3 , = 4 r cvr willing K A C back ‘C’ expect ed f rom , 7 9 q = e t o accept S RST, SYN, FI N: Opt ions (variable lengt h) ot her side connect ion est ab ❍ cumulat ive ACK host ACKs (set up, t ear down r eceipt Q: how r eceiver handles Seq=43, ACK=80 commands) of echoed applicat ion out -of -order segment s ‘C’ dat a ❍ A: TCP spec doesn’t (var iable lengt h) say, - up t o I nt er net Checksum implement or t ime (TCP header + dat a + simple t elnet scenar io pseudo header ) 21 September 2001 Data Communications, Jonny Pettersson, UmU Transport 2 9 21 September 2001 Data Communications, Jonny Pettersson, UmU Transport 2 10 TCP Sliding Window TCP: r eliable dat a t r ansf er ❒ Garant erar t illf örlit lig leverans av dat a event: data received simplif ied sender , assuming from application above ❒ Garant erar ordning •one way dat a t r ansf er create, send segment •no f low, congest ion cont rol ❒ Flow Cont rol ❍ RcvWindow event: timer timeout for wait wait segment with seq # y f or f or event retransmit segment event event: ACK received, with ACK # y not pur e go-back-N ACK processing 21 September 2001 Data Communications, Jonny Pettersson, UmU Transport 2 11 21 September 2001 Data Communications, Jonny Pettersson, UmU Transport 2 12 2

  3. TCP: r et r ansmission scenar ios TCP ACK gener at ion [RFC 1122, RFC 2581] Host A Host B Host A Host B Event TCP Receiver action Seq=92, 8 bytes data Seq=92, 8 bytes data delayed ACK. Wait up to 500ms in-order segment arrival, S e Seq=92 t imeout q = 1 0 0 , 2 0 no gaps, for next segment. If no next segment, b y t e s d a ACK=100 Seq=100 t imeout t a t imeout everything else already ACKed send ACK ACK=100 X ACK=120 in-order segment arrival, immediately send single loss no gaps, cumulative ACK Seq=92, 8 bytes data Seq=92, 8 bytes data one delayed ACK pending send duplicate ACK, indicating seq. # out-of-order segment arrival ACK=120 higher-than-expect seq. # of next expected byte ACK=100 gap detected arrival of segment that immediate ACK if segment starts t ime t ime pr emat ur e t imeout , lost ACK scenar io partially or completely fills gap at lower end of gap cumulat ive ACKs 21 September 2001 Data Communications, Jonny Pettersson, UmU Transport 2 13 21 September 2001 Data Communications, Jonny Pettersson, UmU Transport 2 14 Tillf örlit lig och ordnad leverans TCP Flow Cont r ol f low cont r ol receiver : explicit ly inf orms sender of sender won’t overrun Sending application Receiving application (dynamically changing) receiver’s buf f ers by amount of f r ee buf f er t ransmit t ing t oo much, space t oo f ast TCP TCP ❍ RcvWindow f ield in LastByteWritten LastByteRead TCP segment RcvBuffer = size or TCP Receive Buf f er LastByteAcked LastByteSent NextByteExpected LastByteRcvd sender : keeps t he amount RcvWindow = amount of spare room in Buf f er of t r ansmit t ed, Sändaren Mot t agaren unACKed dat a less t han most recent ly received LastByteAcked ≤ ≤ ≤ ≤ LastByteSent LastByteRead < < < NextByteExpected < RcvWindow LastByteSent ≤ ≤ LastByteWritten ≤ ≤ NextByteExpected ≤ ≤ ≤ ≤ LastByteRcvd + 1 Buf f r ar mellan LastByteAcked och LastByteWritten Buf f r ar mellan LastByteRead och LastByteRcvd r eceiver buf f er ing 21 September 2001 Data Communications, Jonny Pettersson, UmU Transport 2 15 21 September 2001 Data Communications, Jonny Pettersson, UmU Transport 2 16 Flow Cont rol - Mot t agaren Flow Cont rol - Sändaren Sending application Receiving application Sending application Receiving application TCP TCP TCP TCP LastByteWritten LastByteRead LastByteWritten LastByteRead LastByteAcked LastByteSent NextByteExpected LastByteRcvd LastByteAcked LastByteSent NextByteExpected LastByteRcvd ❒ Hos mot t agaren ❒ Hos sändaren ❍ LastByteRcvd - LastByteRead ≤ ≤ RcvBuffer ≤ ≤ ❍ LastByteSent - LastByteAcked ≤ ≤ Rcv Window ≤ ≤ ❍ RcvWindow = RcvBuffer - ( LastByteRcvd - ❍ EffectiveWindow = Rcv Window - ( LastByteSent - LastByteAcked ) LastByteRead ) ❍ LastByteWritten - LastByteAcked ≤ ≤ MaxSendBuffer ≤ ≤ 21 September 2001 Data Communications, Jonny Pettersson, UmU Transport 2 17 21 September 2001 Data Communications, Jonny Pettersson, UmU Transport 2 18 3

Recommend


More recommend